Skip to content

Commit 174bf9f

Browse files
author
David Turner
committed
Still debugging byteswap
1 parent 9ee0403 commit 174bf9f

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

xga/generate/esass/phot.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2-
# Last modified by David J Turner (turne540@msu.edu) 03/07/2024, 08:35. Copyright (c) The Contributors
2+
# Last modified by David J Turner (turne540@msu.edu) 10/04/2025, 16:45. Copyright (c) The Contributors
33

44
import os
55
from random import randint
@@ -25,9 +25,11 @@ def _img_params_from_evtlist(evt_list: EventList):
2525
Internal function to work out the XGA image size and centre position for eROSITA observations. This is done using
2626
the minimum and maximum of the ra and dec, with a 1% buffer, as the corners of the image.
2727
28-
:param Eventlist evt_list: An EventList product object.
28+
:param EventList evt_list: An EventList product object.
2929
"""
3030

31+
print(evt_list.src_name, evt_list.obs_id, evt_list.instrument)
32+
3133
# returns a dataframe of only the RA and DEC columns
3234
rel_df = evt_list.get_columns_from_data(['RA', 'DEC'])
3335

@@ -45,11 +47,11 @@ def _img_params_from_evtlist(evt_list: EventList):
4547

4648
# If rasep is really tiny, then what has happened is that ramin = 0.00001 and ramax = 359.9999
4749
# and this means that our events go around the 0 deg. RA in the sky, so using ramin won't work
48-
# I could do this more thoroughly by sorting in some way, but this is the fastest way I think
50+
# I could do this more thoroughly by sorting in some way, but this is the fastest way I think
4951
if rasep < 0.001:
5052
# This is the RA on the 0 - 20 deg side
5153
ra1 = rel_df[(rel_df['RA'] < 20) & (rel_df['RA'] > 0)]['RA'].max()
52-
# This is the RA on the 340 - 360
54+
# This is the RA on the 340 - 360
5355
ra2 = rel_df[(rel_df['RA'] > 340) & (rel_df['RA'] < 360)]['RA'].min()
5456
rasep = abs(ra1 - ra2 + 360)
5557

xga/products/misc.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2-
# Last modified by David J Turner (turne540@msu.edu) 10/04/2025, 15:18. Copyright (c) The Contributors
2+
# Last modified by David J Turner (turne540@msu.edu) 10/04/2025, 16:45. Copyright (c) The Contributors
33

44
from typing import List
55

@@ -185,10 +185,9 @@ def get_columns_from_data(self, col_names: List[str]) -> pd.DataFrame:
185185
# nicer to have a dataframe than a recarray
186186
return pd.DataFrame.from_records(arr)
187187

188-
except ValueError:
189-
print(self.src_name, self.obs_id, self.instrument)
188+
except ValueError as err:
190189
# The error message generated by fitsio is informative enough
191-
# raise
190+
raise err
192191

193192
except OSError:
194193
raise FileNotFoundError("FITSIO read method cannot open {f}, possibly because there is a problem with "

0 commit comments

Comments
 (0)