Page 1 of 1

Evtool failing when using GTI files produced by flaregti

Posted: Wed Jul 26, 2023 11:29 am
by jessicapilling
Hello,

I'm encountering an issue with evtool where it is failing when I try and filter events with a gti file that has been produced by the flaregti task.

I made the gti file with the command:

flaregti $evt gtifile=flaregti.fits (where $evt is just the path to the raw data)

This ran without trouble and the file flaregti.fits was created.
Then I ran evtool:

evtool eventfiles="$evt" gti=flaregti.fits outfile="evt_filtered.fits"

And this produced the following error:
evtool: eSASS4EDR Apr 06 16:05:20 2023
evtool/read_tBinTable: **ERROR2** illegal HDU number- extension STDGTI
evtool/sanityCheck_tGTI: **STOP** External GTI: You must first allocate both columns.
evtool: FAILED

Any suggestions on how to apply the gti file from flaregti correctly?

Thanks a lot for the help!
Best,
Jessica

Re: Evtool failing when using GTI files produced by flaregti

Posted: Fri Jul 28, 2023 9:51 am
by IanStewart
Hi Jessica, I have in mind some workarounds to suggest, but I'd like to understand the problem a bit better first. FYI I am the present maintainer of evtool, and I kind of know what is going on with it, but I am much less familiar with flaregti and what to expect from it. Can I confirm that you used the EDR versions of both evtool and flaregti?

Cheers Ian

Re: Evtool failing when using GTI files produced by flaregti

Posted: Mon Jul 31, 2023 1:00 pm
by jessicapilling
Hi Ian,

I have been using the eSASS4EDR installed from the public website. In the file: eSASS4EDR/erosita/TASKS it says that I have got evtool v2.10.1, and flaregti flaregti v1.20.

Thanks for the help!
Let me know if you need anymore info from me.

Best,
Jessica

Re: Evtool failing when using GTI files produced by flaregti

Posted: Thu Aug 03, 2023 8:39 am
by IanStewart
Hi Jessica, sorry for the delay in getting back to you. I need to configure my profile in this forum so it sends me a mail when a new post appears... Anyway, I checked the doco for these old versions of flaregti and evtool. (BTW the numbers in TASKS are misleading - sorry about that!) It seems that flaregti of that vintage could output to a separate file (which I had not realized), apparently writing extensions STDGTIn, where n is 1 to 7, one for each of the cameras. evtool on the other hand can accept external GTI files, but alas requires a single extension (which it applies to all cameras) of name STDGTI. I was going to suggest you hack the output file of flaregti to be acceptable by evtool, but filtering all events with the flare from a single camera is probably not what you want to do.

A better idea seems to me to re-run flaregti, but leave its parameter 'gtifile' unset. According to the flaregti documentation, this should cause the task to write its output to extensions FLAREGTIn inside the event list itself. If you then apply evtool to the modified event list with its parameter 'gti' set to 'FLAREGTI', then evtool should do the correct thing.

Re: Evtool failing when using GTI files produced by flaregti

Posted: Thu Aug 03, 2023 9:07 am
by IanStewart
Hmm, seems TASKS is accurate after all.