Skip to content

Conversation

Sudarshan-21
Copy link

Fixes issue #129

Description:
This enhancement ensures that, if user inputs a Lightcurve, it will first identify, it is a lightcurve, and will notify the user about it, further, it will ask the user, whether or not to proceed, as shown in the attached image. Depending on the chosen option, the file reading or aborting the process will be done.

Current Behavior

At the moment, HENreadevents reads a FITS light curve with just a mild warning. It should realize if it is a light curve, and give a stronger warning or just fail.

Enhanced Behavior
Screenshot from 2025-04-16 23-49-22

PS: The previous PR is closed, since I was having some conflicts with that forked repo.

if len(hdulist) < 2:
return False

data_hdu = hdulist[1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check every extension (not just hdulist[1]).

colnames = [col.name.upper() for col in data_hdu.columns]

time_col = "TIME" in colnames
lc_like_col = any(x in colnames for x in ["FLUX", "RATE", "COUNTS", "SAP_FLUX", "PDCSAP_FLUX"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for name in [
"ERROR",
"FRACEXP"
])

You may include this also .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accept columns common in NICER data like "ERROR", "FRACEXP" as part of the light curve signature.

@kashish2210
Copy link
Member

@Sudarshan-21 thanks for your PR this looks good to me but we have take care of NICER datas handling that is going to handle by stingray (I have lefted some comments ). And also include some checks and tests as per the contributing guidelines.
@matteobachetti your review required

@Sudarshan-21
Copy link
Author

@kashish2210, thank you for the suggestions!! I will review them and try to make the necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants