`InterferometerData` proposal
@paul-lasky @colm.talbot @moritz.huebner
In the spirit of working next week on cleaning up our open data handling and also detectors.py to see where the bugs live I have a suggestion I'd like to run past you all (I was just thinking about it over coffee and wanted to get it on paper before I forgot - we can discuss it in person next week).
Could we add a InterferomerStrainData
class with something like the following attributes:
- frequency_domain_strain
- time_domain_strain
- frequencies
- times
- epoch (may be better named - segment_start_time)
- duration (or segment_duration)
- detector name
And something like the following methods
- set_from_psd
- set_from_frame_file
The basic idea is take what is currently done in Interferometer.set_data
and make it a class.
At the same time, it would be good to rename Interferometer.data
to Interferometer.strain_data
, which would be an instance of the above class. This would (a) make it clear that data
is the strain_data
and (b) mean that references to the frequencies
etc would be Interferometer.strain_data.frequencies
which identifies them as the 'frequencies of the strain data' and not, say, of the PSD or anything else. Similarly, it should simplify cases when you have time-series and frequency series as you can just call which ever you want and InterferometerStrainData
will have both.
A second reason to do this is that one could imagine (in the future) having InterferometerAuxillaryData
also be fed into the likelihood (or just for some other use).
Here are what I think are the basic steps to do this
-
Write the class and methods - move logic from
set_data
to the new class - Rewrite set_data to just pass the information into InterferometerStrainData
-
Turn the 'real data processing' steps into methods ofInterferometerStrainData
(e.g.download_open_data(), filter_data()
, etc -
Rewrite the likelihood to not call
interferometer.data
, butinterferometer.strain_data
- Move plotting tools to a method of this new class and remove duplicated plotting code
-
Check through the
get_interferometer_with...
functions to move logic which belongs in the new class into the new class.
This would then supersede #20 (closed) as it would do that and more.
What do people think? Ideas/suggestions welcome.