gwsumm.archive module¶
This module handles HDF archiving of data.
In production for LIGO, the LIGO Summary Pages (LSP) Service runs at regular intervals (about every 10 minutes), so an HDF5 file is used to archive the data read and produced from one instance so that the next instance doesn’t have to re-read and re-produce the same data.
All data products are stored just using the ‘standard’ gwpy .write() method for that object.
- gwsumm.archive.archive_table(table, key, parent)[source]¶
Add a table to the given HDF5 group
Warning
If the input
table
is empty, it will not be archived- Parameters:
- table~astropy.table.Table
the data to archive
- keystr
the path (relative to
parent
) at which to store the table- parenth5py.Group
the h5py group in which to add this dataset
- gwsumm.archive.find_daily_archives(start, end, ifo, tag, basedir='.')[source]¶
Find the daily archives spanning the given GPS [start, end) interval
- Parameters:
- startfloat, ~datetime.datetime, ~astropy.time.Time, str
start time of the archive file to find, any object that can be converted into a LIGOTimeGPS, ~astropy.time.Time, or ~datetime.datetime is acceptable
- endfloat, ~datetime.datetime, ~astropy.time.Time, str
end time of the archive file to find, any object that can be converted into a LIGOTimeGPS, ~astropy.time.Time, or ~datetime.datetime is acceptable
- ifostr
interferometer string, ex. ‘H1’
- tagstr
tag string for the archive file
- basedirpath-like, optional
base path to archive files, default: ‘.’
- Returns:
- archiveslist
list of matching archive files
Notes
This will only search the day directories with the format YYYYMMDD
- gwsumm.archive.load_table(dataset)[source]¶
Read table from the given HDF5 group
The EventTable is read, stored in the memory archive, then returned
- Parameters:
- dataseth5py.Dataset
n-dimensional table to load from hdf5
- Returns:
- table~gwpy.table.EventTable
the table of events loaded from hdf5
- gwsumm.archive.read_data_archive(sourcefile, rm_source_on_fail=True)[source]¶
Read archived data from an HDF5 archive source
This method reads all found data into the data containers defined by the gwsumm.globalv module, then returns nothing.
- Parameters:
- sourcefilestr
path to source HDF5 file
- rm_source_on_failbool, optional
remove the source HDF5 file if there was an OSError when opening the file
- gwsumm.archive.segments_from_array(array)[source]¶
Convert a 2-dimensional numpy.ndarray to a SegmentList
- Parameters:
- arrayfloat numpy.ndarray
input numpy array to convert into a segment list
- Returns:
- out~gwpy.segments.SegmentList
output segment list
- gwsumm.archive.segments_to_array(segmentlist)[source]¶
Convert a SegmentList to a 2-dimensional numpy.ndarray
- Parameters:
- segmentlist~gwpy.segments.SegmentList
input segment list to convert
- Returns:
- outfloat numpy.ndarray
output segment list as a numpy array
- gwsumm.archive.write_data_archive(outfile, channels=True, timeseries=True, spectrogram=True, segments=True, triggers=True)[source]¶
Build and save an HDF archive of data processed in this job.
- Parameters:
- outfilestr
path to target HDF5 file
- timeseriesbool, optional
include TimeSeries data in archive
- spectrogrambool, optional
include Spectrogram data in archive
- segmentsbool, optional
include DataQualityFlag data in archive
- triggersbool, optional
include EventTable data in archive