-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple functionalities added to stx_science_data_lightcurve #132
Conversation
…iles concatenation and sub-interval extraction
This looks great one question I have is how would this work if the pixel/detector/energy masks change between the the supplied fits files, maybe this is handled in the ospex part of the code? |
Yes, this is handled in the OSPEX part of the code. What we do here is to extract the fluxes (in cnts/s/keV/cm^2) from the OSPEX object separately for each FITS file and then concatenate these flux arrays (as well as times and other stuff). Maybe not the best solution from the computational cost and efficiency point of view, but it seems to work fine. |
I've applied a few small corrections taking into account Shane's comments: - doc string of ´fits_path´ updated - doc string of ´time_range´ updated
Hi. In testing I found an issue that it wasn't removing many overlapping time bins - I think this is due to the way it determines the exact start time from the FITS header and the fact these might not exactly align so when keeplist = where(this_diff ne 0) is called in line 217 there are many time intervals where the difference is very small but not 0 and these are not removed. |
Great, thanks a lot for spotting this Ewan! Ok, then if I have understood well your plot (and issue) we could replace Would this change be a solution of the issue? Or do we need to be a little conservative and set it a bit lower, such as |
Yes I think that would solve the issue. I would think we should err on the side of being a bit conservative in case of numerical issues. I am not sure if at some point we might try a minimum time of 0.4 or 0.3 but we can easily update in future if that becomes an issue. |
Thanks to Ewan's review, line 217 has been modified to solve the issue when removing overlapping time bins.
Hi @grazwegian
I've added two functionalities to stx_science_data_lightcurve (see issue #113):
FITS files concatenation: the user can now pass multiple FITS files under
fits_path
, as array of string, and the output will be the concatenation of all FITS files given as an input. This is particularly useful if we want to avoid digital steps in the time profiles that we can see in the spectrogram data. Since the cpd are requested in multiple FITS files, now we can get a single time profile out of multiple cpd FITS files.Sub-interval extraction: this goes in the opposite direction as point 1. The keyword
time_range
has been added, so that we can get a lightcurve for a sub-interval only. This is useful if we just need a relatively short time profile out of a long spectrogram FITS file.