-
Notifications
You must be signed in to change notification settings - Fork 169
Add AstroSat-LAXPC specific codes #929
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
Add AstroSat-LAXPC specific codes #929
Conversation
There is a quick fix being implemented at the moment. LAXPC's current software results in a column heading called "LAXPC_No." The current implementation of stingray converts this to an attribute named laxpc_no., which leads to an error in the compilation. For testing purposes, the original event file was modified to have a different name for the column but this needs to be changed in the stingray software.
Changes in the events.py Removed the functions specific to LAXPC and modified a filtering function to work on detector_id attribute instead. Changes in missions.py If the mission is AstroSat then the detector ID columns maps to LAXPC_No. Changes in io.py If the code detected a "." in the attribute name, it is replace with an underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @yashbhargava1992!
A few change requests, but it's overall good.
Don't forget the changelog entry!
Changes to events.py Now the filtering also accepts a list of detector ids. Changes to testio.py The code should ideally catch the warning due to lack of GTI extension in the event file. Added Changelog entry.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #929 +/- ##
===========================================
- Coverage 96.03% 79.66% -16.38%
===========================================
Files 48 48
Lines 9770 9787 +17
===========================================
- Hits 9383 7797 -1586
- Misses 387 1990 +1603 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@yashbhargava1992 strange that it looks for the PI column. I'll take a look tomorrow |
Changes to test_io.py Added a check to see is the instrument is LAXPC3 Changes to test_events.py Added a test to read the LAXPC file. This also catches warnings present while reading the LAXPC files. Changes to missions.py Manual assignment of the Energy/PI column and Instrument keyword from the header of the event file.
@yashbhargava1992 the missing coverage is from the two new methods in EventList, that I don't know if you want to keep. If so, they need to be tested ;) |
… and verify the length. The event file is also updated as it was an incorrect file.
Co-authored-by: Matteo Bachetti <[email protected]>
PR: Inclusion of AstroSat/LAXPC in stingray IO
This PR is to include relevant codes that will allow testing and usage of LAXPC event files for analysis using Stingray.
Overview of the implemented solution and modifications.
Due to particular naming conventions implemented in LAXPC event files, certain functions and attributes have been modified.
LAXPC observations typically have 3 detector units and a particular use may want to select data from only 1 of them. Therefore the column which includes the information of the detector units (i.e. "LAXPC_No.") is mapped to
detector_id
attribute.Additional functions to filter based on
detector_id
are also included. Current implementation allows for filtering on a singledetector_id
.A sample event file is included in the
stingray/tests/data
directory and a test function is also included to check if file is loaded correctly.Future directions
The filtering based on multiple detectors can be included. This can allow for selection of events from a range of detectors from NICER or two detectors from LAXPC, for example.
Current implementation assumes that event file from AstroSat mission pertains to LAXPC (there are multiple mission onboard AstroSat) and is generated from a particular software (
LAXPCsoftware
). These are not checked by the code and may result in file reading errors.