#include "OutputFormat/segy.h"#include "Basic/Utilities.hpp"#include "Basic/File.hpp"#include "Db/Db.hpp"#include "Db/DbGrid.hpp"#include "geoslib_old_f.h"#include <stdio.h>#include <string.h>#include <math.h>Classes | |
| struct | RefPt |
| struct | RefStats |
Macros | |
| #define | MAT(i, j) (mat[2 * (i) + (j)]) |
| #define | SWAP_INT16(x) (x) = ((0x00ff & ((x))>>8) | (0xff00 & ((x))<<8)) |
| #define | SWAP_INT32(x) |
Functions | |
| static int | st_to_f (int x) |
| static short int | st_to_s (short int x) |
| static unsigned short int | st_to_u (unsigned short int a) |
| static int | st_to_i (int a) |
| static float | st_ibm2ieee (const float ibm) |
| static double | st_scaling (int coor, int scale) |
| static void | st_print_traceHead (traceHead *Theader, int numTrace) |
| static void | st_print_BFileHead (binaryFileHeader *Bheader) |
| static binaryFileHeader | st_binaryFileHeader_init () |
| static int | st_readFileHeader (FILE *file, int verbOption, int *NPerTrace, double *delta) |
| static int | st_read_trace (FILE *file, int codefmt, int numtrace, int nPerTrace, double delta, int verbOption, VectorDouble &values, VectorDouble &cotes) |
| static int | st_surface_identify (int verbOption, Db *surfaces, const String &name_bot, bool flag_bot, int *iatt_bot, const String &name_top, bool flag_top, int *iatt_top, const String &aux_top, int *iaux_top, const String &aux_bot, int *iaux_bot) |
| static int | st_get_cuts (Db *surfaces, int rank, int iatt_top, int iatt_bot, double, double, double thickmin, double *cztop, double *czbot) |
| static void | st_verify_refpt (RefPt refpt[3], RefStats &refstats, int nbrefpt, double x0, double y0, double dx, double dy, double sint, double cost) |
| static void | st_grid_from_3refpt (RefPt refpt[3], RefStats &refstats, double dz, Grid &def_grid) |
| static void | st_grid_from_2refpt (RefPt refpt[3], RefStats &refstats, double dz, Grid &def_grid) |
| static int | st_store_refpt (int nbrefpt, RefPt refpt[3], int iline, int xline, double xtrace, double ytrace) |
| static void | st_print_grid (const Grid &def_grid) |
| static int | st_complete_squeeze_and_stretch (int ntab, VectorDouble &tab) |
| static bool | st_within_layer (double z0, double delta, double cztop, double czbot, double cote, int option, int nz, int *iz1_ret, int *iz2_ret, double *cote_ret) |
| static double | st_get_average (int nz, const VectorDouble &writes) |
| static int | st_identify_trace_rank (DbGrid *surfaces, double xtrace, double ytrace) |
| static void | st_auxiliary (Db *surfaces, int rank, int nz, int option, double z0, double delta, double czbot, double cztop, int iaux_bot, int iaux_top, RefStats &refstats) |
| static int | st_load_trace (int nPerTrace, int nz, int option, double z0, double delta, double czbot, double cztop, const VectorDouble &cotes, const VectorDouble &values, VectorDouble &writes, int *nbvalues, RefStats &refstats) |
| static void | st_print_results (int nPerTrace, bool flag_surf, double delta, RefStats &refstats) |
| void | st_get_trace_params (traceHead *Theader, int *iline, int *xline, double *delta, double *xtrace, double *ytrace) |
| static int | st_reject_trace (int iline, int xline, int iline_min, int iline_max, int xline_min, int xline_max) |
| static void | st_refstats_update (int iline, int xline, double xtrace, double ytrace, RefStats &refstats) |
| static void | st_refstats_init (RefStats &refstats, double modif_high, double modif_low, double modif_scale) |
| static traceHead | st_traceHead_init () |
| SegYArg | segy_array (const char *filesegy, DbGrid *surf2D, const String &top_name, const String &bot_name, const String &top_aux, const String &bot_aux, double thickmin, int option, int nz_ss, int verbOption, int iline_min, int iline_max, int xline_min, int xline_max, double modif_high, double modif_low, double modif_scale, int codefmt) |
| Grid | segy_summary (const char *filesegy, DbGrid *surf2D, const String &name_top, const String &name_bot, double thickmin, int option, int nz_ss, int verbOption, int iline_min, int iline_max, int xline_min, int xline_max, double modif_high, double modif_low, double modif_scale, int codefmt) |
| int | db_segy (const char *filesegy, DbGrid *grid3D, DbGrid *surf2D, const String &name_top, const String &name_bot, double thickmin, int option, int nz_ss, int verbOption, int iline_min, int iline_max, int xline_min, int xline_max, double modif_high, double modif_low, double modif_scale, int codefmt, const NamingConvention &namconv) |
| #define MAT | ( | i, | |
| j | |||
| ) | (mat[2 * (i) + (j)]) |
| #define SWAP_INT32 | ( | x | ) |
| int db_segy | ( | const char * | filesegy, |
| DbGrid * | grid3D, | ||
| DbGrid * | surf2D, | ||
| const String & | name_top, | ||
| const String & | name_bot, | ||
| double | thickmin, | ||
| int | option, | ||
| int | nz_ss, | ||
| int | verbOption, | ||
| int | iline_min, | ||
| int | iline_max, | ||
| int | xline_min, | ||
| int | xline_max, | ||
| double | modif_high, | ||
| double | modif_low, | ||
| double | modif_scale, | ||
| int | codefmt, | ||
| const NamingConvention & | namconv | ||
| ) |
Read the contents of a SEGY file
| [in] | filesegy | Name of the SEGY file |
| [in] | grid3D | Db containing the resulting 3-D grid |
| [in] | surf2D | Db containing the top, Bottom and Reference surfaces This file is optional |
| [in] | name_top | Rank of variable containing the Top Surface (or 0) |
| [in] | name_bot | Rank of variable containing the Bottom Surface (or 0) |
| [in] | thickmin | Minimum thickness (or 0) |
| [in] | option | Flattening option: 0 no flattening; 1 flattening from top; -1 flattening from bottom -2 squeeze and stretch option 2 averaging from 3-D to 2-D |
| [in] | nz_ss | Deprecated argument |
| [in] | verbOption | Verbose option |
| [in] | iline_min | Minimum Inline number included (if defined) |
| [in] | iline_max | Maximum Inline number included (if defined) |
| [in] | xline_min | Minimum Xline number included (if defined) |
| [in] | xline_max | Maximum Xline number included (if defined) |
| [in] | modif_high | Upper truncation (when defined) |
| [in] | modif_low | Lower truncation (when defined) |
| [in] | modif_scale | Scaling value (when defined) |
| [in] | codefmt | Reading format |
| [in] | namconv | Naming convention |
: In the case of Squeeze and Stretch (S&S), the number of layers
: is meaningless. It is fixed by the user, unless defined
: by the output grid (if flag_store == 1)
| SegYArg segy_array | ( | const char * | filesegy, |
| DbGrid * | surf2D, | ||
| const String & | top_name, | ||
| const String & | bot_name, | ||
| const String & | top_aux, | ||
| const String & | bot_aux, | ||
| double | thickmin, | ||
| int | option, | ||
| int | nz_ss, | ||
| int | verbOption, | ||
| int | iline_min, | ||
| int | iline_max, | ||
| int | xline_min, | ||
| int | xline_max, | ||
| double | modif_high, | ||
| double | modif_low, | ||
| double | modif_scale, | ||
| int | codefmt | ||
| ) |
Read the contents of a SEGY file
| [in] | filesegy | Name of the SEGY file |
| [in] | surf2D | Db containing the top, Bottom and Reference surfaces This file is optional |
| [in] | top_name | Name of variable containing the Top Surface (or "") |
| [in] | bot_name | Name of variable containing the Bottom Surface (or "") |
| [in] | top_aux | Name of auxiliary variable containing a Top (or "") |
| [in] | bot_aux | Name of auxiliary variable containing a Top (or "") |
| [in] | thickmin | Minimum thickness (or 0) |
| [in] | option | Flattening option: 0 no flattening; 1 flattening from top; -1 flattening from bottom -2 squeeze and stretch option 2 averaging from 3-D to 2-D |
| [in] | nz_ss | Number of layers for different options (see details) |
| [in] | verbOption | Verbose option |
| [in] | iline_min | Minimum Inline number included (if defined) |
| [in] | iline_max | Maximum Inline number included (if defined) |
| [in] | xline_min | Minimum Xline number included (if defined) |
| [in] | xline_max | Maximum Xline number included (if defined) |
| [in] | modif_high | Upper truncation (when defined) |
| [in] | modif_low | Lower truncation (when defined) |
| [in] | modif_scale | Scaling value (when defined) |
| [in] | codefmt | Reading format |
In the case of Squeeze and Stretch (S&S), the number of layers
is meaningless. It is fixed by the user.
| Grid segy_summary | ( | const char * | filesegy, |
| DbGrid * | surf2D, | ||
| const String & | name_top, | ||
| const String & | name_bot, | ||
| double | thickmin, | ||
| int | option, | ||
| int | nz_ss, | ||
| int | verbOption, | ||
| int | iline_min, | ||
| int | iline_max, | ||
| int | xline_min, | ||
| int | xline_max, | ||
| double | modif_high, | ||
| double | modif_low, | ||
| double | modif_scale, | ||
| int | codefmt | ||
| ) |
Read the contents of a SEGY file and returns the structure SegyRead which captures the main characteristics of the SEGY grid
| [in] | filesegy | Name of the SEGY file |
| [in] | surf2D | Db containing the top, Bottom and Reference surfaces This file is optional |
| [in] | name_top | Rank of variable containing the Top Surface (or 0) |
| [in] | name_bot | Rank of variable containing the Bottom Surface (or 0) |
| [in] | thickmin | Minimum thickness (or 0) |
| [in] | option | Flattening option: 0 no flattening; 1 flattening from top; -1 flattening from bottom -2 squeeze and stretch option 2 averaging from 3-D to 2-D |
| [in] | nz_ss | Number of layers for different options (see details) |
| [in] | verbOption | Verbose option |
| [in] | iline_min | Minimum Inline number included (if defined) |
| [in] | iline_max | Maximum Inline number included (if defined) |
| [in] | xline_min | Minimum Xline number included (if defined) |
| [in] | xline_max | Maximum Xline number included (if defined) |
| [in] | modif_high | Upper truncation (when defined) |
| [in] | modif_low | Lower truncation (when defined) |
| [in] | modif_scale | Scaling value (when defined) |
| [in] | codefmt | Reading format |
: In the case of Squeeze and Stretch (S&S), the number of layers
: is meaningless. It is fixed by the user, unless defined
: by the output grid (if flag_store == 1)
|
static |
Project the auxiliary surfaces on the system defined by the unit and store the result in the structure 'refstats'
| surfaces | Pointer to the Db containing the surfaces |
| rank | Rank of the trace within 'db' |
| nz | Number of meshes in the layer |
| option | Stretching option |
| z0 | Elevation origin |
| delta | Vertical mesh |
| czbot | Bottom bound |
| cztop | Top bound |
| iaux_bot | Attribute index of the Auxiliary Bottom variable (or -1) |
| iaux_top | Attribute index of the Auxiliary Top variable (or -1) |
| refstats | RefStats structure |
|
static |
|
static |
Complete the information in the Squeeze and Stretch feature
| [in] | ntab | Dimension of the vector |
| [in,out] | tab | Vector |
|
static |
Calculate the average
|
static |
Define the cutoffs along a vertical for a given trace
| [in] | surfaces | Db containing the top, Bottom and Reference surfaces This file is optional |
| [in] | rank | Rank of the trace within 'surfaces' |
| [in] | iatt_top | Rank of attribute containing the Top Surface (or 0) |
| [in] | iatt_bot | Arnk of the attribute containing the Bottom Surface (or 0) |
| [in] | thickmin | Minimum thickness (if defined) |
| [out] | cztop | Coordinate for the Top along Z (or TEST) |
| [out] | czbot | Coordinate for the Bottom along Z (or TEST) |
| void st_get_trace_params | ( | traceHead * | Theader, |
| int * | iline, | ||
| int * | xline, | ||
| double * | delta, | ||
| double * | xtrace, | ||
| double * | ytrace | ||
| ) |
Get Trace characteristics
|
static |
|
static |
|
static |
Processing a Trace
|
static |
Internal function for printing the Binary File Header
| [in] | Bheader | Pointer to the Binary File header |
|
static |
Print the characteristics of the resulting grid
| [in] | def_grid | Pointer to the Grid structure |
|
static |
Printout
|
static |
Internal function for printing the Trace Header
| [in] | Theader | Pointer to the Trace Header contents |
| [in] | numTrace | Rank of the trace |
|
static |
|
static |
Internal function for reading the File header
| [in] | file | Pointer to the File stream |
| [in] | verbOption | Verbose option |
| [out] | NPerTrace | Number of samples per trace |
| [out] | delta | Distance between two consecutive vertical samples |
|
static |
Initialize statistics
|
static |
Update statistics
|
static |
Reject trace due to trace boundary specifications
|
static |
Internal function to scale the coordinate by the scaling factor
| [in] | coor | Integer value containing the input coordinate |
| [in] | scale | Integer value giving the scale factor |
|
static |
Store an additional reference point
|
static |
Identify Bottom and Top surfaces (if present)
| [in] | verbOption | Verbose Option |
| [in] | surfaces | Db containing the top, Bottom and Reference surfaces This file is optional |
| [in] | name_bot | Name of variable containing the Bottom Surface (or empty) |
| [in] | flag_bot | Flag for defining a Bottom surface |
| [in] | name_top | Name of variable containing the Top Surface (or empty) |
| [in] | flag_top | Flag for defining a Top surface |
| [in] | aux_top | Name of the Auxiliary Top variable (optional) |
| [in] | aux_bot | Name of the Auxiliary Bottom variable (optional) |
| [out] | iatt_top | Attribute index for the Top surface (or -1) |
| [out] | iatt_bot | Attribute index for the Bottom surface (or -1) |
| [out] | iaux_top | Attribute index for the Top Auxiliary variable (or -1) |
| [out] | iaux_bot | Attribute index for the Bottom Auxiliary variable (or -1) |
|
static |
Routines for reading / decoding information stored in SEGY file
|
static |
|
static |
|
static |
|
static |
|
static |
Check that calculations are correct
| [in] | refpt | Array of RefPt structure pointers |
| [in] | refstats | Structure for Statistics |
| [in] | nbrefpt | Number of reference points |
| [in] | x0 | Origin of the grid along X |
| [in] | y0 | Origin of the grid along Y |
| [in] | dx | Mesh of the grid along X |
| [in] | dy | Mesh of the grid along Y |
| [in] | sint | Sine of the rotation angle |
| [in] | cost | Cosine of the rotation angle |
|
static |
Get the vertical limits in indices Check if the target elevation 'cote' belongs to the layer If True, returns the starting and ending index
| z0 | Origin of the Elevations |
| delta | Elevation increment |
| cztop | Top bound |
| czbot | Bottom bound |
| cote | Target elevation |
| option | Stretching option |
| nz | Number of meshes of the layer |
| iz1_ret | Returned starting index |
| iz2_ret | Returned ending index |
| cote_ret | Returelevation (expressed in the layer system (possibly stretched) |