You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing I noted in the recent PR #19 was there's some ambiguity in the metadata requested and how it's used.
Specifically, the arrival times are to be given in seconds, but seconds since what reference epoch? Is that what the times_bin0 is used for? What time format is times_bin0 assumed to be in? Is the arrival_time relative to times_bin0 or some other reference epoch? Internally we know it's relative to times_bin0 since we create a times array from 0 to num_times * res_time seconds, but best to broadcast that.
e.g., "a floating-point scalar indicating the value of time bin at index 0, in seconds" is ambiguous - we should be very explicit: is it Unix time, MJD, JD, etc.?
The text was updated successfully, but these errors were encountered:
this is a very good point @bwmeyers, one i somewhat realized recently but the ambiguity wasn't bugging me just yet. nonetheless, i agree we should settle this now.
i think one way to do this is that we require the values of time_bin0 and arrival_time to be in MJD; we then load these values in astropy.time.TIme() objects so that we can obtain datetime representations and then take the difference, which gives a datetime.timedelta() object. finally, we can use the datetime.timedelta().total_seconds() method to obtain the total number of seconds relative to the reference time (time_bin0). this allows use to use both variables and still ensure that the units under the hood are in seconds. the following is an example in rough code:
fromastropy.timeimportTime# initialize timestamps.time_bin0=59295.64141165053t0=Time(time_bin0, format="mjd")
t1=TIme(time_bin0+9.259259259259259e-07, format="mjd") # 80 s after time_bin0# now compute difference.dt=t1.datetime-t0.datetimearrival_time=dt.total_seconds()
Having time_bin0 be in MJD makes a lot of sense. I guess it then follows that arrival_time should also be an MJD. Although if the data is dispersed still, then that arrival time would necessarily be the arrival time at the reference frequency.
One thing I noted in the recent PR #19 was there's some ambiguity in the metadata requested and how it's used.
Specifically, the arrival times are to be given in seconds, but seconds since what reference epoch? Is that what the
times_bin0
is used for? What time format istimes_bin0
assumed to be in? Is thearrival_time
relative totimes_bin0
or some other reference epoch? Internally we know it's relative totimes_bin0
since we create a times array from 0 tonum_times * res_time
seconds, but best to broadcast that.e.g., "a floating-point scalar indicating the value of time bin at index 0, in seconds" is ambiguous - we should be very explicit: is it Unix time, MJD, JD, etc.?
The text was updated successfully, but these errors were encountered: