Skip to content

Commit 2f34094

Browse files
committed
Added conversions to degrees to make ra and dec json serializable.
1 parent 927a8d2 commit 2f34094

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: banzai/lco.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ def get_output_directory(self, runtime_context) -> str:
2626
@property
2727
def ra(self):
2828
try:
29-
coord = Angle(self.meta.get('CRVAl1'), unit='degree')
29+
coord = Angle(self.meta.get('CRVAl1'), unit='degree').deg
3030
except (ValueError, TypeError):
3131
# Fallback to RA and DEC
3232
try:
33-
coord = Angle(self.meta.get('RA'), unit='hourangle')
33+
coord = Angle(self.meta.get('RA'), unit='hourangle').deg
3434
except (ValueError, TypeError):
3535
# Fallback to Cat-RA and CAT-DEC
3636
try:
37-
coord = Angle(self.meta.get('CAT-RA'), unit='hourangle')
37+
coord = Angle(self.meta.get('CAT-RA'), unit='hourangle').deg
3838
except (ValueError, TypeError) as e:
3939
coord = np.nan
4040
return coord
@@ -55,15 +55,15 @@ def ra(self, value):
5555
@property
5656
def dec(self):
5757
try:
58-
coord = Angle(self.meta.get('CRVAl2'), unit='degree')
58+
coord = Angle(self.meta.get('CRVAl2'), unit='degree').deg
5959
except (ValueError, TypeError):
6060
# Fallback to RA and DEC
6161
try:
62-
coord = Angle(self.meta.get('DEC'), unit='degree')
62+
coord = Angle(self.meta.get('DEC'), unit='degree').deg
6363
except (ValueError, TypeError):
6464
# Fallback to Cat-RA and CAT-DEC
6565
try:
66-
coord = Angle(self.meta.get('CAT-DEC'), unit='degree')
66+
coord = Angle(self.meta.get('CAT-DEC'), unit='degree').deg
6767
except (ValueError, TypeError) as e:
6868
coord = np.nan
6969
return coord

0 commit comments

Comments
 (0)