#include "grid.h"
#include "offsets.h"
#include "parser.h"
#include "iwave_fopen.h"
Go to the source code of this file.
Defines | |
#define | IWAVE_USE_FMGR |
Functions | |
int | fseeko (FILE *stream, off_t offset, int whence) |
off_t | ftello (FILE *stream) |
int | read_grid (grid *g, const char *fname, FILE *fp) |
read grid from SEP77/RSF header file | |
int | par_grid (grid *g, PARARRAY par, FILE *fp) |
initialize grid from PARARRAY object | |
int | extend_array (ireal *a, const IPNT rags, const IPNT ran, const IPNT gs, const IPNT n, int dim, int ax) |
extend by constant along axis ax an array of dimension dim defined by (rags,ran), assuming that its subarray defined by defined by (gs,n) has been initialized to correct values. | |
int | adj_extend_array (ireal *a, const IPNT rags, const IPNT ran, const IPNT gs, const IPNT n, int dim, int ax) |
adjoint-extend by constant along axis ax an array of dimension dim defined by (rags,ran) - replaces boundary elements of array by sum over extended axis, elements outside array by zero. | |
int | rsfread (ireal *a, const IPNT gs, const IPNT n, const char *fname, float scale, FILE *fp, int panelindex) |
read data from SEP77/RSF data cube, scale, add to target data cube | |
int | rsfwrite_proto (ireal *a, const IPNT rags, const IPNT ran, const char *fname, const char *dname, const char *type, float scale, const char *protohdr, const char *protodata, const grid *protog, int extend, FILE *fp, int panelindex) |
write array to RSF file structure | |
int | rsfwrite (ireal *a, const IPNT gs, const IPNT n, const char *fname, float scale, FILE *fp, int panelindex) |
int fseeko | ( | FILE * | stream, | |
off_t | offset, | |||
int | whence | |||
) |
off_t ftello | ( | FILE * | stream | ) |
int read_grid | ( | grid * | g, | |
const char * | fname, | |||
FILE * | fp | |||
) |
read grid from SEP77/RSF header file
[out] | g | (grid *) - grid to be initialized |
[in] | fname | (char *) - name of RSF header file |
[in] | fp | (FILE *) - verbose output strea |
initialize grid from PARARRAY object
[out] | g | (grid *) - grid to be initialized |
[in] | par | (PARARRAY) - param array from which to read grid data |
[in] | fp | (FILE *) - verbose output stream |
int extend_array | ( | ireal * | a, | |
const IPNT | rags, | |||
const IPNT | ran, | |||
const IPNT | gs, | |||
const IPNT | n, | |||
int | dim, | |||
int | ax | |||
) |
extend by constant along axis ax an array of dimension dim defined by (rags,ran), assuming that its subarray defined by defined by (gs,n) has been initialized to correct values.
If the subarray is void (i.e. if (rags,ran) does not overlap (gs,n)) or if subarray is the entire array defined by (rags,ran), than this function is a no-op.
Written dimensionally, to avoid offset computations. All axis lengths assumed to be correctly representable as ints. No particular attention paid to efficiency - it is assumed that this routine will be account for an infinitesimal part of the flops of an application.
[out] | a | (ireal *) - array to be extended |
[in] | rags | (IPNT) - global start indices |
[in] | ran | (IPNT) - global axis lengths |
[in] | gs | (IPNT) - start indices of already initialized subarray |
[in] | n | (IPNT) - axis lengths of already initialized subarray |
[in] | dim | (int) - dimension of grid |
[in] | ax | (int) - axis along which to extend by const |
int adj_extend_array | ( | ireal * | a, | |
const IPNT | rags, | |||
const IPNT | ran, | |||
const IPNT | gs, | |||
const IPNT | n, | |||
int | dim, | |||
int | ax | |||
) |
adjoint-extend by constant along axis ax an array of dimension dim defined by (rags,ran) - replaces boundary elements of array by sum over extended axis, elements outside array by zero.
If the subarray is void (i.e. if (rags,ran) does not overlap (gs,n)) or if subarray is the entire array defined by (rags,ran), than this function is a no-op.
Written dimensionally, to avoid offset computations. All axis lengths assumed to be correctly representable as ints. No particular attention paid to efficiency - it is assumed that this routine will be account for an infinitesimal part of the flops of an application.
[out] | a | (ireal *) - array to be extended |
[in] | rags | (IPNT) - global start indices |
[in] | ran | (IPNT) - global axis lengths |
[in] | gs | (IPNT) - start indices of already initialized subarray |
[in] | n | (IPNT) - axis lengths of already initialized subarray |
[in] | dim | (int) - dimension of grid |
[in] | ax | (int) - axis along which to extend by const |
int rsfread | ( | ireal * | a, | |
const IPNT | gs, | |||
const IPNT | n, | |||
const char * | fname, | |||
float | scale, | |||
FILE * | fp, | |||
int | panelindex | |||
) |
read data from SEP77/RSF data cube, scale, add to target data cube
[out] | a | - target cube data array |
[in] | gs | - global indices of target cube axis starts |
[in] | n | - global axis lengths of target cube |
[in] | fname | - name of RSF header file |
in[ | scale - scale input data by this factor before adding | |
[in] | fp | - verbose output unit |
[in] | panelindex | - panel index of extended model (extrenal axes - 0 for models without external exteded axes) |
int rsfwrite_proto | ( | ireal * | a, | |
const IPNT | rags, | |||
const IPNT | ran, | |||
const char * | fname, | |||
const char * | dname, | |||
const char * | type, | |||
float | scale, | |||
const char * | protohdr, | |||
const char * | protodata, | |||
const grid * | protog, | |||
int | extend, | |||
FILE * | fp, | |||
int | panelindex | |||
) |
write array to RSF file structure
Preconditions:
[in] | a | (ireal *) - array to be written |
[in] | gs | (IPNT) - global indices of axis starts |
[in] | n | (IPNT) - global axis lengths |
[in] | fname | (char *) - file to which to write data |
[in] | extend | (int) - extension flag - adjoint-extend along all axes in increasing axis order if set |
[in] | fp | (FILE *) - verbose output parameter |
[in] | panelindex | (int) - panel index of extended model (always be 0 for non-extended model) |
int rsfwrite | ( | ireal * | a, | |
const IPNT | gs, | |||
const IPNT | n, | |||
const char * | fname, | |||
float | scale, | |||
FILE * | fp, | |||
int | panelindex | |||
) |