EventList.read does not read additional columns or allow for the selection of a time column
Description of the Bug
The Stingray API docs suggest that EventList.read can take keyword arguments that will be passed to "load_events_and_gtis" but in practice this does not appear to be happening, or at least in my case seems to have no effect. The EventList object has no place to store additional data that might be specified with the "additional_columns" kwarg and seems to exclusively read the "TIME" column for time values.
Steps/Code to Replicate the Bug
Starting with an OGIP event list I create a new barycentered, event list with the HEASOFT command "barycorr", i also produce a 3rd event list which contains both the telescope time arrival times and the barycentered times with "barytime=yes". I can confirm that all 3 event lists have the data I want.
Next I load each event list into Stingray using EventList.read, the first two are simply EventList.read('file_name', 'hea') and the 3rd is read in using: EventList.read('file_name', 'hea', column='BARYTIME', additional_columns=['TIME'])
Expected Results
I would expect to have 3 EventLists. 1: an EventList with the telescope time event arrival times in the "EventList.time" attribute 2: an EventList with the barycetnered event arrival times in the "EventList.time" attribute 3: an EventList with the barycetnered event arrival times in the "EventList.time" attribute and an "additional_columns" attribute which contained the telescope time arrival times
As an additional check I also ran EventList.read('file_name', 'hea', additional_columns=['BARYTIME']) wich i would expect to produce an EventList with the telescope time event arrival times in the "EventList.time" attribute and an "additional_columns" attribute with the barycetnered times
Actual Results
I can confirm that the times stored in the first two event lists are different, as one would expect. The 3rd event list, however, is identical to the first. That is, the event list with "column='BARYTIME'" and the telescope time event list are the same. The EventList still read the "TIME" column from my event file instead of the requested "BARYTIME". Moreover, there is no attribute in the EventList class that stores the "additional_columns" attribute so it seems that either the additional columns are never read in or they are inaccessible to the user.
@gabrielb09 thanks for the issue. Does the event list have a barytime attribute?
@matteobachetti thank you for the reply! the event list does not have a barytime attribute, it doesn't seem to have any attributes beyond what I would expect from a default event list.
@gabrielb09 I don't know what might be happening, here is a test I just ran:
In [5]: ev = EventList.read("file_bary.evt", fmt="ogip", additional_columns=["S_TIME"])
In [6]: ev.s_time
Out[6]:
array([70374954.140625, 70374950.84375 , 70374952.359375, ...,
70394482.984375, 70394481.234375, 70394482.5 ], dtype='>f8')
See? What I passed as additional columns get transformed into an array attribute.
In your first example, it makes sense: you are saying that the time column is barytime, but then giving time as an additional column, that will probably overwrite the barytime or be overwritten depending on the order they get loaded (I don't remember).
In the second, though, I expect the barytime attribute to exist! Can you provide an example dataset to run some test?