Provides function to read in a file containing a possibly unequally sampled noise amplitude spectrum ( \(\textrm{strain}/\sqrt(\textrm{Hz})\)) and return as a frequency series.
Prototypes | |
void | LALReadNoiseSpectrum (LALStatus *stat, REAL4FrequencySeries *spectrum, CHAR *fname) |
Function to read in noise spectrum from a formatted ascii file and return the amplitude noise spectrum in \(\textrm{strain}/\sqrt{\textrm{Hz}}\). More... | |
Error Codes | |
#define | LALREADNOISESPECTRUMH_ENULL 1 |
Null pointer. More... | |
#define | LALREADNOISESPECTRUMH_ENNUL 2 |
Non-null pointer. More... | |
#define | LALREADNOISESPECTRUMH_EALOC 3 |
Memory allocation error. More... | |
#define | LALREADNOISESPECTRUMH_EOPEN 4 |
Error opening file. More... | |
#define | LALREADNOISESPECTRUMH_EFCLO 5 |
Error closing file. More... | |
#define | LALREADNOISESPECTRUMH_EPARS 8 |
Error parsing spectrum file. More... | |
void LALReadNoiseSpectrum | ( | LALStatus * | stat, |
REAL4FrequencySeries * | spectrum, | ||
CHAR * | fname | ||
) |
Function to read in noise spectrum from a formatted ascii file and return the amplitude noise spectrum in \(\textrm{strain}/\sqrt{\textrm{Hz}}\).
LALReadNoiseSpectrum()
fills the contents of the REAL4FrequencySeries spectrum
from data read from formatted ascii file with name fname
. The ascii file should have a header (greater than or equal to one line) which is indicated by a \(\#\) at the start of the line. The first line of the file must contain the number of points at which the spectrum is sampled. If the spectrum is sampled at 500 different points, then the first line would be
Replace 500 by the number of sample points in your particular data.
The REAL4FrequencySeries spectrum
should be allocated before calling the routine which uses the length
and metadata information to determine the evenly sampled output that is reqruired. The function does nearest neighbor interpolation to get the points in the outpu frequency series.
Definition at line 88 of file ReadNoiseSpectrum.c.
#define LALREADNOISESPECTRUMH_ENULL 1 |
Null pointer.
Definition at line 60 of file ReadNoiseSpectrum.h.
#define LALREADNOISESPECTRUMH_ENNUL 2 |
Non-null pointer.
Definition at line 61 of file ReadNoiseSpectrum.h.
#define LALREADNOISESPECTRUMH_EALOC 3 |
Memory allocation error.
Definition at line 62 of file ReadNoiseSpectrum.h.
#define LALREADNOISESPECTRUMH_EOPEN 4 |
Error opening file.
Definition at line 63 of file ReadNoiseSpectrum.h.
#define LALREADNOISESPECTRUMH_EFCLO 5 |
Error closing file.
Definition at line 64 of file ReadNoiseSpectrum.h.
#define LALREADNOISESPECTRUMH_EPARS 8 |
Error parsing spectrum file.
Definition at line 65 of file ReadNoiseSpectrum.h.