Prototypes | |
| LALFILE * | XLALSimReadDataFileOpen (const char *fname) |
| Opens a specified data file, searching default path if necessary. More... | |
| size_t | XLALSimReadDataFile2Col (double **xdat, double **ydat, LALFILE *fp) |
| Read a two-column data file. More... | |
| size_t | XLALSimReadDataFileNCol (double **data, size_t *ncol, LALFILE *fp) |
| Read a multi-column data file. More... | |
Go to the source code of this file.
| LALFILE * XLALSimReadDataFileOpen | ( | const char * | fname | ) |
Opens a specified data file, searching default path if necessary.
Opens a data file for input with a specified path name. If the path name is an absolute path then this specific file is opened; otherwise, search for the file in paths given in the environment variable LAL_DATA_PATH, and finally search in the installed PKG_DATA_DIR path.
| [in] | fname | The path of the file to open. |
Definition at line 59 of file LALSimReadData.c.
| size_t XLALSimReadDataFile2Col | ( | double ** | xdat, |
| double ** | ydat, | ||
| LALFILE * | fp | ||
| ) |
Read a two-column data file.
Read a data file containing two whitespace separated columns of data and create two arrays containing the data in each column. If any line begins with the character '#' then it is ignored.
| [out] | xdat | The x-data stored in the first column. |
| [out] | ydat | The y-data stored in the second column. |
| fp | Pointer to a LALFILE structure opened for input. |
Definition at line 84 of file LALSimReadData.c.
| size_t XLALSimReadDataFileNCol | ( | double ** | data, |
| size_t * | ncol, | ||
| LALFILE * | fp | ||
| ) |
Read a multi-column data file.
Read a data file containing multiple whitespace separated columns of data and create an array containing the data. If any line begins with the character '#' then it is ignored. The data is stored in the array in row-major format so that the data sample on row i (beginning with zero) and column j (beginning with zero) is found as the element [i * ncol + j] where ncol is the number of columns.
| [out] | data | The data stored in row-major order. |
| [out] | ncol | The number of columns in the data file. |
| fp | Pointer to a LALFILE structure opened for input. |
Definition at line 133 of file LALSimReadData.c.