21 #include <lal/LALDatatypes.h>
22 #include <lal/LALCache.h>
23 #include <lal/LALFrameIO.h>
25 #ifndef _LALFRSTREAM_H
26 #define _LALFRSTREAM_H
70 typedef enum tagLALFrStreamState {
80 typedef enum tagLALFrStreamMode {
95 typedef struct tagLALFrStream {
110 typedef struct tagLALFrStreamPos {
223 stream,
const char *chname,
const LIGOTimeGPS * epoch);
225 stream,
const char *chname,
const LIGOTimeGPS * epoch);
227 stream,
const char *chname,
const LIGOTimeGPS * epoch);
229 * stream,
const char *chname,
const LIGOTimeGPS * epoch);
239 stream,
const char *chname,
const LIGOTimeGPS * epoch);
250 #define FRAMESTREAMH_ENULL 00001
251 #define FRAMESTREAMH_ENNUL 00002
252 #define FRAMESTREAMH_EALOC 00004
253 #define FRAMESTREAMH_EFILE 00010
254 #define FRAMESTREAMH_EOPEN 00020
255 #define FRAMESTREAMH_EREAD 00040
256 #define FRAMESTREAMH_ETIME 00100
257 #define FRAMESTREAMH_ESIZE 00200
258 #define FRAMESTREAMH_ECHAN 00400
259 #define FRAMESTREAMH_ETYPE 01000
260 #define FRAMESTREAMH_ERROR 02000
261 #define FRAMESTREAMH_EDONE 04000
262 #define FRAMESTREAMH_ETREQ 010000
263 #define FRAMESTREAMH_EDGAP 020000
264 #define FRAMESTREAMH_MSGENULL "Null pointer"
265 #define FRAMESTREAMH_MSGENNUL "Non-null pointer"
266 #define FRAMESTREAMH_MSGEALOC "Memory allocation error"
267 #define FRAMESTREAMH_MSGEFILE "Frame data files not found"
268 #define FRAMESTREAMH_MSGEOPEN "Frame file open error"
269 #define FRAMESTREAMH_MSGEREAD "Frame file read error"
270 #define FRAMESTREAMH_MSGETIME "Invalid ADC offset time"
271 #define FRAMESTREAMH_MSGESIZE "Invalid vector length"
272 #define FRAMESTREAMH_MSGECHAN "Could not find ADC channel"
273 #define FRAMESTREAMH_MSGETYPE "Invalid ADC type"
274 #define FRAMESTREAMH_MSGERROR "Frame stream error"
275 #define FRAMESTREAMH_MSGEDONE "End of frame data"
276 #define FRAMESTREAMH_MSGETREQ "No data at time requested"
277 #define FRAMESTREAMH_MSGEDGAP "Gap in the data"
280 typedef enum tagFrChanType {
291 #define ChannelType FrChanType
292 #define ProcDataChannel LAL_PROC_CHAN
293 #define ADCDataChannel LAL_ADC_CHAN
294 #define SimDataChannel LAL_SIM_CHAN
298 SWIGLAL(IMMUTABLE_MEMBERS(tagFrChanIn, name));
304 typedef struct tagFrChanIn {
310 SWIGLAL(IMMUTABLE_MEMBERS(tagFrOutPar, source, description));
318 typedef struct tagFrOutPar {
335 const CHAR * pattern);
void LALFrWriteREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *series, FrOutPar *params)
void LALFrGetCOMPLEX8TimeSeriesMetadata(LALStatus *status, COMPLEX8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrWriteINT4TimeSeries(LALStatus *status, INT4TimeSeries *series, FrOutPar *params)
void LALFrGetINT2TimeSeries(LALStatus *status, INT2TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetCOMPLEX8TimeSeries(LALStatus *status, COMPLEX8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetINT4TimeSeriesMetadata(LALStatus *status, INT4TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetINT8TimeSeries(LALStatus *status, INT8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetREAL8TimeSeriesMetadata(LALStatus *status, REAL8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetCOMPLEX8FrequencySeries(LALStatus *status, COMPLEX8FrequencySeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetINT4TimeSeries(LALStatus *status, INT4TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetREAL4TimeSeriesMetadata(LALStatus *status, REAL4TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrSeek(LALStatus *status, const LIGOTimeGPS *epoch, LALFrStream *stream)
void LALFrOpen(LALStatus *status, LALFrStream **stream, const CHAR *dirname, const CHAR *pattern)
void LALFrGetINT8TimeSeriesMetadata(LALStatus *status, INT8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetREAL8TimeSeries(LALStatus *status, REAL8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrGetINT2TimeSeriesMetadata(LALStatus *status, INT2TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrCacheOpen(LALStatus *status, LALFrStream **output, LALCache *cache)
void LALFrGetREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrClose(LALStatus *status, LALFrStream **stream)
int XLALFrStreamSeek(LALFrStream *stream, const LIGOTimeGPS *epoch)
Seeks a LALFrStream stream to data at a given time.
int XLALFrStreamSeekO(LALFrStream *stream, double dt, int whence)
Seeks a LALFrStream stream by a time offset.
LALFrStreamMode
Enum listing different stream modes.
LALFrStreamState
Enum listing different stream states.
int XLALFrStreamState(LALFrStream *stream)
Gets the current state of a LALFrStream.
int XLALFrStreamTell(LIGOTimeGPS *epoch, LALFrStream *stream)
Tells the current time of the current position of a LALFrStream stream.
int XLALFrStreamClose(LALFrStream *stream)
Closes a LALFrStream.
LALFrStream * XLALFrStreamCacheOpen(LALCache *cache)
Opens a LALFrStream associated with a LALCache.
int XLALFrStreamGetMode(LALFrStream *stream)
Returns the current operating mode of a LALFrStream.
int XLALFrStreamEnd(LALFrStream *stream)
Checks to see if a LALFrStream is at the end of the stream.
int XLALFrStreamRewind(LALFrStream *stream)
Rewinds a LALFrStream stream.
int XLALFrStreamGetpos(LALFrStreamPos *position, LALFrStream *stream)
Gets the current position of a LALFrStream stream.
int XLALFrStreamNext(LALFrStream *stream)
Advance a LALFrStream stream to the beginning of the next frame.
int XLALFrStreamSetMode(LALFrStream *stream, int mode)
Change the operating mode of a LALFrStream.
LALFrStream * XLALFrStreamOpen(const char *dirname, const char *pattern)
Opens a LALFrStream for specified frame files.
int XLALFrStreamSetpos(LALFrStream *stream, const LALFrStreamPos *position)
Sets the current position of a LALFrStream stream.
int XLALFrStreamClearErr(LALFrStream *stream)
Resets the state of a LALFrStream.
int XLALFrStreamError(LALFrStream *stream)
Checks to see if a LALFrStream has encountered an error.
@ LAL_FR_STREAM_CHECKSUM_MODE
ensure that file checksums are OK
@ LAL_FR_STREAM_DEFAULT_MODE
ignore time/gaps but report warnings & info
@ LAL_FR_STREAM_IGNOREGAP_MODE
ignore gaps in data
@ LAL_FR_STREAM_TIMEWARN_MODE
display warning for invalid time requests
@ LAL_FR_STREAM_IGNORETIME_MODE
ignore invalid times requested
@ LAL_FR_STREAM_SILENT_MODE
silent mode
@ LAL_FR_STREAM_GAPINFO_MODE
display info for gaps in data
@ LAL_FR_STREAM_VERBOSE_MODE
display warnings and info
@ LAL_FR_STREAM_GAP
gap in frame stream
@ LAL_FR_STREAM_OK
nominal
@ LAL_FR_STREAM_URL
error opening frame URL
@ LAL_FR_STREAM_ERR
error in frame stream
@ LAL_FR_STREAM_TOC
error reading frame TOC
@ LAL_FR_STREAM_END
end of frame stream
UINT4TimeSeries * XLALFrStreamReadUINT4TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
int XLALFrStreamGetUINT8TimeSeriesMetadata(UINT8TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetUINT4TimeSeries(UINT4TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
COMPLEX8TimeSeries * XLALFrStreamReadCOMPLEX8TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
int XLALFrStreamGetINT2TimeSeriesMetadata(INT2TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetUINT2TimeSeries(UINT2TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
int XLALFrStreamGetREAL8TimeSeriesMetadata(REAL8TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetREAL4FrequencySeries(REAL4FrequencySeries *series, LALFrStream *stream)
Reads frequency series data from the current frame in a LALFrStream stream.
REAL8FrequencySeries * XLALFrStreamInputREAL8FrequencySeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *epoch)
Reads a time series channel from a LALFrStream stream with a specified epoch, and performs any needed...
REAL8FrequencySeries * XLALFrStreamReadREAL8FrequencySeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *epoch)
Reads a time series channel from a LALFrStream stream with a specified epoch.
int XLALFrStreamGetREAL4TimeSeriesMetadata(REAL4TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetCOMPLEX8TimeSeriesMetadata(COMPLEX8TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
LALTYPECODE XLALFrStreamGetTimeSeriesType(const char *chname, LALFrStream *stream)
Returns the type code for the data type of channel chname in the current frame in frame stream stream...
int XLALFrStreamGetINT4TimeSeries(INT4TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
REAL8TimeSeries * XLALFrStreamInputREAL8TimeSeries(LALFrStream *stream, const char *channel, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration,...
int XLALFrStreamGetCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series, LALFrStream *stream)
Reads frequency series data from the current frame in a LALFrStream stream.
int XLALFrStreamGetCOMPLEX8TimeSeries(COMPLEX8TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
int XLALFrStreamGetREAL4TimeSeries(REAL4TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
COMPLEX16TimeSeries * XLALFrStreamInputCOMPLEX16TimeSeries(LALFrStream *stream, const char *channel, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration,...
int XLALFrStreamGetREAL8FrequencySeries(REAL8FrequencySeries *series, LALFrStream *stream)
Reads frequency series data from the current frame in a LALFrStream stream.
INT8TimeSeries * XLALFrStreamReadINT8TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
COMPLEX16FrequencySeries * XLALFrStreamReadCOMPLEX16FrequencySeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *epoch)
Reads a time series channel from a LALFrStream stream with a specified epoch.
int XLALFrStreamGetREAL8TimeSeries(REAL8TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
int XLALFrStreamGetUINT8TimeSeries(UINT8TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
int XLALFrStreamGetVectorLength(const char *chname, LALFrStream *stream)
Returns the number of data points in channel chname in the current frame in frame stream stream.
int XLALFrStreamGetINT2TimeSeries(INT2TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
int XLALFrStreamGetINT4TimeSeriesMetadata(INT4TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
int XLALFrStreamGetCOMPLEX16TimeSeriesMetadata(COMPLEX16TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetCOMPLEX8FrequencySeries(COMPLEX8FrequencySeries *series, LALFrStream *stream)
Reads frequency series data from the current frame in a LALFrStream stream.
COMPLEX16FrequencySeries * XLALFrStreamInputCOMPLEX16FrequencySeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *epoch)
Reads a time series channel from a LALFrStream stream with a specified epoch, and performs any needed...
COMPLEX16TimeSeries * XLALFrStreamReadCOMPLEX16TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
COMPLEX8FrequencySeries * XLALFrStreamReadCOMPLEX8FrequencySeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *epoch)
Reads a time series channel from a LALFrStream stream with a specified epoch.
INT4TimeSeries * XLALFrStreamReadINT4TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
int XLALFrStreamGetUINT2TimeSeriesMetadata(UINT2TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
INT2TimeSeries * XLALFrStreamReadINT2TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
REAL4FrequencySeries * XLALFrStreamReadREAL4FrequencySeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *epoch)
Reads a time series channel from a LALFrStream stream with a specified epoch.
UINT2TimeSeries * XLALFrStreamReadUINT2TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
int XLALFrStreamGetINT8TimeSeriesMetadata(INT8TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
int XLALFrStreamGetINT8TimeSeries(INT8TimeSeries *series, LALFrStream *stream)
Reads time series data from the current position in a LALFrStream stream.
REAL8TimeSeries * XLALFrStreamReadREAL8TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
REAL4TimeSeries * XLALFrStreamReadREAL4TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
int XLALFrStreamGetUINT4TimeSeriesMetadata(UINT4TimeSeries *series, LALFrStream *stream)
Reads time series metadata from the current position in a LALFrStream stream.
UINT8TimeSeries * XLALFrStreamReadUINT8TimeSeries(LALFrStream *stream, const char *chname, const LIGOTimeGPS *start, REAL8 duration, size_t lengthlimit)
Reads a time series channel from a LALFrStream stream with a specified start time and duration.
struct tagLALFrFile LALFrFile
Incomplete type for a frame file structure.
ChannelType type
the channel type
const CHAR * name
the name of the channel
ChannelType type
the type of channel to create in the output frames
UINT4 frame
the number the first frame of output
UINT4 nframes
the number of frames to output in the frame file
UINT4 run
the number this data run
const CHAR * source
the source identifier to attach to the output frame file name
const CHAR * description
the description identifier to attach to the output frame file name
This structure details the state of the frame stream.
This structure contains a record of the state of a frame stream; this record can be used to restore t...
UINT4 fnum
the file number of a list of frame files that was open when the record was made
LIGOTimeGPS epoch
the GPS time of the open frame when the record was made
INT4 pos
the position within the frame file that was open when the record was made