Sherpa function to facilitate loading HETG responses associated with a PHA2 file#1031
Sherpa function to facilitate loading HETG responses associated with a PHA2 file#1031dprincipe2 wants to merge 2 commits intocxcsds:mainfrom
Conversation
…d with a PHA2 file.
…th only a PHA2 file as input. Added the ability to choose a sherpa dataset ID to start loading from so users can load multiple PHA2 datasets into the same session. Also added documentation.
|
I suggest moving the two local routines - Looking at the code, I see there's a number of cases where you have something like for i in range(len(some_array)):
... do something with some_array[i] ...This can often be written as for val in some_array:
... do something with val ...which I personally find easier to read (this is not always the case; it depends on whether you need the index for anything other than grabbing the value from a container like I tried this with a HETG dataset I grabbed from TGCat but it raised an error, so I'm either using it wrong or it doesn't handle the TGCat case" |
|
Sure, I can do those things. I tend to loop over ranges because many times I need the index but I can change that for this code for readability. I haven't tested this for tgcat- or tgextract-generated pha2 files but those can probably be added easy enough. Currently it's for chandra repro and the standard archive files. |
If users generated or obtained an HETG PHA2 file through relatively standard means (e.g., Chandra archive or running chandra_repro) then this function will load their PHA2 file into sherpa and find/assign the associated ARFs and RMFs.