32 #include <lal/SFTfileIO.h>
53 #define MIN_SFT_VERSION 2
54 #define MAX_SFT_VERSION 3
67 #ifndef SFTFILEIO_REALLOC_BLOCKSIZE
68 #define SFTFILEIO_REALLOC_BLOCKSIZE 100
74 #define UNUSED __attribute__ ((unused))
79 #define GPS2REAL8(gps) (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )
80 #define GPSEQUAL(gps1,gps2) (((gps1).gpsSeconds == (gps2).gpsSeconds) && ((gps1).gpsNanoSeconds == (gps2).gpsNanoSeconds))
81 #define GPSZERO(gps) (((gps).gpsSeconds == 0) && ((gps).gpsNanoSeconds == 0))
126 unsigned long long crc64(
const unsigned char *
data,
unsigned int length,
unsigned long long crc );
static const REAL8 fudge_up
unsigned long long crc64(const unsigned char *data, unsigned int length, unsigned long long crc)
static const REAL8 fudge_down
int parse_sft_windowspec(const UINT2 windowspec, const char **window_type, REAL8 *window_param)
Parse an SFT 2-byte 'windowspec' into a window name 'window_type' and possible parameter 'window_para...
UINT4 read_sft_bins_from_fp(SFTtype *ret, UINT4 *firstBinRead, UINT4 firstBin2read, UINT4 lastBin2read, FILE *fp)
REAL8 TSFTfromDFreq(REAL8 dFreq)
void endian_swap(CHAR *pdata, size_t dsize, size_t nelements)
int build_sft_windowspec(UINT2 *windowspec, CHAR(*windowspec_str)[9], const char *window_type, REAL8 window_param)
Build an SFT 2-byte 'windowspec' or filename field 'windowspec_str' for the window given by 'window_t...
int read_sft_header_from_fp(FILE *fp, SFTtype *header, UINT4 *version, UINT8 *crc64, UINT2 *SFTwindowspec, BOOLEAN *swapEndian, CHAR **SFTcomment, UINT4 *numBins)
FILE * fopen_SFTLocator(const struct tagSFTLocator *locator)
Open an "SFT" defined by the SFT-locator, return a FILE-pointer to the beginning of this SFT.
int compareSFTloc(const void *ptr1, const void *ptr2)
int compareDetNameCatalogs(const void *ptr1, const void *ptr2)
int parse_sft_windowspec_str(const CHAR *windowspec_str, CHAR(*window_type)[32], REAL8 *window_param)
Parse an SFT filename field 'windowspec_str' into a window name 'window_type' and possible parameter ...
BOOLEAN has_valid_crc64(FILE *fp)
Check the SFT-block starting at fp for valid crc64 checksum.
int compareSFTdesc(const void *ptr1, const void *ptr2)
int compareSFTepoch(const void *ptr1, const void *ptr2)
int read_SFTversion_from_fp(UINT4 *version, BOOLEAN *need_swap, FILE *fp)
Read valid SFT version-number at position fp, and determine if we need to endian-swap the data.