libsacio
1.0.2
Seismic Analysis Code I/O Library
|
Compatability routines for fortran style sacio. More...
Functions | |
void | sac_iris::rsac1 (char *kname, float yarray[], int *nlen, float *beg, float *del, int *max_, int *nerr, int kname_s) |
Read an evenly spaced sac file. More... | |
void | sac_iris::rsac2 (char *kname, float *yarray, int *nlen, float *xarray, int *max_, int *nerr, int kname_s) |
Read an unevenly spaced sac file. More... | |
void | sac_iris::newhdr () |
Create a new sac header to store in memory. More... | |
void | sac_iris::rsach (char *kname, int *nerr, int kname_s) |
Read a sac file header. More... | |
void | sac_iris::wsac0 (char *kname, float *xarray, float *yarray, int *nerr, int kname_s) |
Write a sac file. More... | |
void | sac_iris::wsac3 (char *kname, float *xarray, float *yarray, int *nerr, int kname_s) |
Write a sac file. More... | |
void | sac_iris::wsac1 (char *kname, float *yarray, int *nlen, float *beg, float *del, int *nerr, int kname_s) |
Write an evenly spaced sac file. More... | |
void | sac_iris::wsac2 (char *kname, float *yarray, int *nlen, float *xarray, int *nerr, int kname_s) |
Write an unevenly spaced sac file. More... | |
void | sac_iris::getrhv (char *kname, double *fvalue, int *nerr, int kname_s) |
Get a floating point header value. More... | |
void | sac_iris::getfhv (char *kname, float *fvalue, int *nerr, int kname_s) |
Get a floating point header value. More... | |
void | sac_iris::getihv (char *kname, char *kvalue, int *nerr, int kname_s, int kvalue_s) |
Get a enumerated header value. More... | |
void | sac_iris::getkhv (char *kname, char *kvalue, int *nerr, int kname_s, int kvalue_s) |
Get a character string header value. More... | |
void | sac_iris::getnhv (char *kname, int *nvalue, int *nerr, int kname_s) |
Get a integer header value. More... | |
void | sac_iris::getlhv (char *kname, int *nvalue, int *nerr, int kname_s) |
Get a logical/bool header value. More... | |
void | sac_iris::setrhv (char *kname, double *fvalue, int *nerr, int kname_s) |
Set a floating point header value. More... | |
void | sac_iris::setfhv (char *kname, float *fvalue, int *nerr, int kname_s) |
Set a floating point header value. More... | |
void | sac_iris::setnhv (char *kname, int *nvalue, int *nerr, int kname_s) |
Set a integer header value. More... | |
void | sac_iris::setlhv (char *kname, int *nvalue, int *nerr, int kname_s) |
Set a logical/bool header value. More... | |
void | sac_iris::setkhv (char *kname, char *kvalue, int *nerr, int kname_s, int kvalue_s) |
Set a character string header value. More... | |
void | sac_iris::setihv (char *kname, char *kvalue, int *nerr, int kname_s, int kvalue_s) |
Set a enumerated header value. More... | |
Compatability routines for fortran style sacio.
void getfhv | ( | char * | kname, |
float * | fvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Get a floating point header value.
Get a floating point header value from the sac header
kname | Name of header value |
fvalue | Output header value |
nerr | Status, 0 on success, non-zero on failure |
kname_s | Length of kname |
void getihv | ( | char * | kname, |
char * | kvalue, | ||
int * | nerr, | ||
int | kname_s, | ||
int | kvalue_s | ||
) |
Get a enumerated header value.
Get a enumerated header value from the sac header
kname | Name of header value |
kvalue | Output enumerated value as a string |
nerr | Status, 0 on success, non-zero on failure |
kname_s | Length of kname |
kvalue_s | Length of kvalue |
void getkhv | ( | char * | kname, |
char * | kvalue, | ||
int * | nerr, | ||
int | kname_s, | ||
int | kvalue_s | ||
) |
Get a character string header value.
Get a character string header value from the sac header
kname | Name of header value |
kvalue | Output header character string |
nerr | Status, 0 in success, non-zero on failure |
kname_s | Length of kname |
kvalue_s | Length of kvalue |
void getlhv | ( | char * | kname, |
int * | nvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Get a logical/bool header value.
Get a logical/bool header value from the sac header
kname | Name of header value |
nvalue | Output header value |
nerr | Status, 0 on success, non-zero on failure |
kname_s | Length of kname |
void getnhv | ( | char * | kname, |
int * | nvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Get a integer header value.
Get a integer header value from the sac header
kname | Name of header value |
nvalue | Output header value |
nerr | Status, 0 on success, non-zero on failure |
kname_s | Length of kname |
void getrhv | ( | char * | kname, |
double * | fvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Get a floating point header value.
Get a floating point header value from the sac header
kname | Name of header value |
fvalue | Output header value |
nerr | Status, 0 on success, non-zero on failure |
kname_s | Length of kname |
void newhdr | ( | ) |
Create a new sac header to store in memory.
Creates a new, empy sac header in memory
void rsac1 | ( | char * | kname, |
float | yarray[], | ||
int * | nlen, | ||
float * | beg, | ||
float * | del, | ||
int * | max_, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Read an evenly spaced sac file.
Read an evenly spaced sac file
kname | Name of sac file to read |
yarray | Output dependent variable |
nlen | Output length of yarray . If the data length is greater than the space specificed by max_ , nlen is set to max_ , nerr is set to -803, and only the first max_ points are returned |
beg | Output begin value |
del | Output sampling for the independent variable |
max_ | Length of yarray |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
An error occurs, -803, if the input arrays are not big enough but the data for the first portion of the file is available
If the file does not exist, nerr = 801
If the file does not exist, nerr = 108
void rsac2 | ( | char * | kname, |
float * | yarray, | ||
int * | nlen, | ||
float * | xarray, | ||
int * | max_, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Read an unevenly spaced sac file.
Read an unevenly spaced sac file
kname | Name of sac file to read |
yarray | Output dependent variable |
nlen | Output length of yarray and xarray |
xarray | Output independent variable |
max_ | Length of yarray |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
An error occurs, -803, if the input arrays are not big enough but the data for the first portion of the file is available
If the file read is not unevenly spaced, nerr = 802
If the file does not exist, nerr = 108
void rsach | ( | char * | kname, |
int * | nerr, | ||
int | kname_s | ||
) |
Read a sac file header.
Read a sac file header
kname | Name of sac file header to read |
nerr | Status code, 0 on succes, non-zero on failure |
kname_s | Length of kname |
void setfhv | ( | char * | kname, |
float * | fvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Set a floating point header value.
Set a floating point header value in the active sac header
kname | Name of header value to set |
fvalue | Input value to set |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
void setihv | ( | char * | kname, |
char * | kvalue, | ||
int * | nerr, | ||
int | kname_s, | ||
int | kvalue_s | ||
) |
Set a enumerated header value.
Set a enumerated header value in the active sac header
kname | Name of header value to set |
kvalue | Input value to set as a character string |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
kvalue_s | Length of kvalue |
void setkhv | ( | char * | kname, |
char * | kvalue, | ||
int * | nerr, | ||
int | kname_s, | ||
int | kvalue_s | ||
) |
Set a character string header value.
Set a character string header value in the active sac header
kname | Name of header value to set |
kvalue | Input value to set |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
kvalue_s | Length of kvalue |
void setlhv | ( | char * | kname, |
int * | nvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Set a logical/bool header value.
Set a logical/bool header value in the active sac header
kname | Name of header value to set |
nvalue | Input value to set |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
void setnhv | ( | char * | kname, |
int * | nvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Set a integer header value.
Set a integer header value in the active sac header
kname | Name of header value to set |
nvalue | Input value to set |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
void setrhv | ( | char * | kname, |
double * | fvalue, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Set a floating point header value.
Set a floating point header value in the active sac header
kname | Name of header value to set |
fvalue | Input value to set |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
void wsac0 | ( | char * | kname, |
float * | xarray, | ||
float * | yarray, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Write a sac file.
Write a sac file using the existing header in memory
kname | Name of sac file to write |
yarray | Input independent varaible, e.g. x, time, real, amp |
xarray | Input dependedent variable, e.g. amplitude, imag, phase |
nerr | Status code, 0 on success, non-zero on failue |
kname_s | Length of kname |
Example of writing a time series file from scratch. It is probably better to use wsac1()
Example of writing a spectral file from scratch. It is probably better to use wsac2() This is an 3 point impulse, otherwise known as a triangle; y = (0, 1, 0)
void wsac1 | ( | char * | kname, |
float * | yarray, | ||
int * | nlen, | ||
float * | beg, | ||
float * | del, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Write an evenly spaced sac file.
Write an evenly spaced sac file using the header in memory
kname | Name of sac file to write |
yarray | Input dependent variable, e.g. amplitude |
nlen | Length of yarray |
beg | Begin value |
del | dependent variable sampling |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
void wsac2 | ( | char * | kname, |
float * | yarray, | ||
int * | nlen, | ||
float * | xarray, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Write an unevenly spaced sac file.
Write an unevenly spaced sac file using the header in memory
kname | Name of sac file to write |
yarray | Input dependent variable |
nlen | Length of yarray and xarray |
xarray | Input independent variable |
nerr | Status code, 0 on success, non-zero on failure |
kname_s | Length of kname |
void wsac3 | ( | char * | kname, |
float * | xarray, | ||
float * | yarray, | ||
int * | nerr, | ||
int | kname_s | ||
) |
Write a sac file.
Write a sac file using the existing header in memory
kname | Name of sac file to write |
yarray | Input independent varaible, e.g. x, time, real, amp |
xarray | Input dependedent variable, e.g. amplitude, imag, phase |
nerr | Status code, 0 on success, non-zero on failue |
kname_s | Length of kname |