pycbc.frame package¶
Submodules¶
pycbc.frame.frame module¶
This modules contains functions for reading in data from frame files or caches
-
pycbc.frame.frame.
read_frame
(location, channels, start_time=None, end_time=None, duration=None, check_integrity=False, sieve=None)[source]¶ Read time series from frame data.
Using the location, which can either be a frame file “.gwf” or a frame cache “.gwf”, read in the data for the given channel(s) and output as a TimeSeries or list of TimeSeries.
Parameters: - location (string) – A source of gravitational wave frames. Either a frame filename (can include pattern), a list of frame files, or frame cache file.
- channels (string or list of strings) – Either a string that contains the channel name or a list of channel name strings.
- start_time ({None, LIGOTimeGPS}, optional) – The gps start time of the time series. Defaults to reading from the beginning of the available frame(s).
- end_time ({None, LIGOTimeGPS}, optional) – The gps end time of the time series. Defaults to the end of the frame. Note, this argument is incompatible with duration.
- duration ({None, float}, optional) – The amount of data to read in seconds. Note, this argument is incompatible with end.
- check_integrity ({True, bool}, optional) – Test the frame files for internal integrity.
- sieve (string, optional) – Selects only frames where the frame URL matches the regular expression sieve
Returns: Frame Data – A TimeSeries or a list of TimeSeries, corresponding to the data from the frame file/cache for a given channel or channels.
Return type: TimeSeries or list of TimeSeries
-
pycbc.frame.frame.
frame_paths
(frame_type, start_time, end_time, server=None, url_type='file')[source]¶ Return the paths to a span of frame files
Parameters: - frame_type (string) – The string representation of the frame type (ex. ‘H1_ER_C00_L1’)
- start_time (int) – The start time that we need the frames to span.
- end_time (int) – The end time that we need the frames to span.
- server ({None, SERVER:PORT string}, optional) – Optional string to specify the datafind server to use. By default an attempt is made to use a local datafind server.
- url_type (string) – Returns only frame URLs with a particular scheme or head such as “file” or “gsiftp”. Default is “file”, which queries locally stored frames. Option can be disabled if set to None.
Returns: paths – The list of paths to the frame files.
Return type: list of paths
Examples
>>> paths = frame_paths('H1_LDAS_C02_L2', 968995968, 968995968+2048)
-
pycbc.frame.frame.
datafind_connection
(server=None)[source]¶ Return a connection to the datafind server
Parameters: server ({SERVER:PORT, string}, optional) – A string representation of the server and port. The port may be ommitted. Returns: The open connection to the datafind server. Return type: connection
-
pycbc.frame.frame.
query_and_read_frame
(frame_type, channels, start_time, end_time, sieve=None, check_integrity=False)[source]¶ Read time series from frame data.
Query for the locatin of physical frames matching the frame type. Return a time series containing the channel between the given start and end times.
Parameters: - frame_type (string) – The type of frame file that we are looking for.
- channels (string or list of strings) – Either a string that contains the channel name or a list of channel name strings.
- start_time (LIGOTimeGPS or int) – The gps start time of the time series. Defaults to reading from the beginning of the available frame(s).
- end_time (LIGOTimeGPS or int) – The gps end time of the time series. Defaults to the end of the frame.
- sieve (string, optional) – Selects only frames where the frame URL matches the regular expression sieve
- check_integrity (boolean) – Do an expensive checksum of the file before returning.
Returns: Frame Data – A TimeSeries or a list of TimeSeries, corresponding to the data from the frame file/cache for a given channel or channels.
Return type: TimeSeries or list of TimeSeries
Examples
>>> ts = query_and_read_frame('H1_LDAS_C02_L2', 'H1:LDAS-STRAIN', >>> 968995968, 968995968+2048)
pycbc.frame.losc module¶
This modules contains functions for getting data from the LOSC
-
pycbc.frame.losc.
losc_frame_json
(ifo, start_time, end_time)[source]¶ Get the information about the public data files in a duration of time
Parameters: Returns: info – A dictionary containing information about the files that span the requested times.
Return type:
-
pycbc.frame.losc.
losc_frame_urls
(ifo, start_time, end_time)[source]¶ Get a list of urls to losc frame files
Parameters: Returns: frame_files – A dictionary containing information about the files that span the requested times.
Return type:
-
pycbc.frame.losc.
read_frame_losc
(channels, start_time, end_time)[source]¶ Read channels from losc data
Parameters: Returns: ts – Returns a timeseries or list of timeseries with the requested data.
Return type:
pycbc.frame.store module¶
This modules contains functions for reading in data from hdf stores