1.3.2
CCC
 
CalcMigrate.hpp File Reference
#include "gstlearn_export.hpp"
#include "ACalcDbToDb.hpp"
#include "geoslib_define.h"

Classes

class  CalcMigrate
 

Functions

GSTLEARN_EXPORT int migrate (Db *dbin, Db *dbout, const String &name, int dist_type=1, const VectorDouble &dmax=VectorDouble(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate", false))
 
GSTLEARN_EXPORT int migrateMulti (Db *dbin, Db *dbout, const VectorString &names, int dist_type=1, const VectorDouble &dmax=VectorDouble(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate"))
 
GSTLEARN_EXPORT int migrateByAttribute (Db *dbin, Db *dbout, const VectorInt &iatts=VectorInt(), int dist_type=1, const VectorDouble &dmax=VectorDouble(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate"))
 
GSTLEARN_EXPORT int migrateByLocator (Db *dbin, Db *dbout, const ELoc &locatorType, int dist_type=1, const VectorDouble &dmax=VectorDouble(), bool flag_fill=false, bool flag_inter=false, bool flag_ball=false, const NamingConvention &namconv=NamingConvention("Migrate"))
 
GSTLEARN_EXPORT int manageExternalInformation (int mode, const ELoc &locatorType, Db *dbin, Db *dbout, bool *flag_created)
 
GSTLEARN_EXPORT int interpolateVariableToPoint (DbGrid *db_grid, int iatt, int np, double *xp, double *yp, double *zp, double *tab)
 
GSTLEARN_EXPORT double * dbgridLineSampling (DbGrid *dbgrid, double *x1, double *x2, int ndisc, int ncut, double *cuts, int *nval_ret)
 
GSTLEARN_EXPORT int expandPointToGrid (Db *db_point, DbGrid *db_grid, int iatt, int iatt_time, int iatt_angle, int iatt_scaleu, int iatt_scalev, int iatt_scalew, int flag_index, int distType, const VectorDouble &dmax, VectorDouble &tab)
 
GSTLEARN_EXPORT int pointToBlock (Db *dbpoint, DbGrid *dbgrid, int option, int flag_size, int iatt_time, int iatt_size, int iatt_angle, int iatt_scaleu, int iatt_scalev, int iatt_scalew)
 
GSTLEARN_EXPORT int migrateGridToCoor (const DbGrid *db_grid, int iatt, const VectorVectorDouble &coords, VectorDouble &tab)
 
GSTLEARN_EXPORT int expandPointToCoor (const Db *db1, int iatt, const VectorVectorDouble &coords, VectorDouble &tab)
 

Function Documentation

◆ dbgridLineSampling()

GSTLEARN_EXPORT double* dbgridLineSampling ( DbGrid dbgrid,
double *  x1,
double *  x2,
int  ndisc,
int  ncut,
double *  cuts,
int *  nval_ret 
)

Sampling vertices within a Grid between two points

Returns
Array of sampled vertices
Parameters
[in]dbgridreference Grid
[in]x1Array giving the coordinates of the first point
[in]x2Array giving the coordinates of the second point
[in]ndiscNumber of discretized points in the segment
[in]ncutNumber of cutoffs
[in]cutsArray of cutoffs
[out]nval_retNumber of samples in the output array
Remarks
This function considers the segment [x1,x2] and subdivises it
into 'ndisc' intervals. The endpoints of each interval correspond
to two points in the space
At each endpoint, the target variable is interpolated from the grid
If the target variable values cross a cutoff, the coordinates of
the intersection are calculated.
The program returns the list of all these intersection coordinates

◆ expandPointToCoor()

GSTLEARN_EXPORT int expandPointToCoor ( const Db db1,
int  iatt,
const VectorVectorDouble coords,
VectorDouble tab 
)

Expands a variable from one point Db into a variable at points defined by coordinate vectors (maximum 3D)

Returns
Error return code
Parameters
[in]db1descriptor of the input parameters
[in]iattrank of the input attribute
[in]coordsArray of coordinates
[out]tabOutput array (Dimension: number of discretized points)

◆ expandPointToGrid()

GSTLEARN_EXPORT int expandPointToGrid ( Db db_point,
DbGrid db_grid,
int  iatt,
int  iatt_time,
int  iatt_angle,
int  iatt_scaleu,
int  iatt_scalev,
int  iatt_scalew,
int  flag_index,
int  distType,
const VectorDouble dmax,
VectorDouble tab 
)

Expands a variable from the point structure into a variable in the grid structure

Returns
Error return code
Parameters
[in]db_pointDescriptor of the point parameters
[in]db_gridDescriptor of the grid parameters
[in]iattRank of the point attribute
[in]iatt_timeOptional variable for Time shift
[in]iatt_angleOptional variable for anisotropy angle (around Z)
[in]iatt_scaleuOptional variable for anisotropy scale factor (U)
[in]iatt_scalevOptional variable for anisotropy scale factor (V)
[in]iatt_scalewOptional variable for anisotropy scale factor (W)
[in]flag_index1 if the Index must be assigned to grid node 0 the 'iatt' attribute is assigned instead
[in]distTypeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[out]tabOutput array
Remarks
When a Time Shift is present, this corresponds to Johnson-Mehl
The Time Shift is an optional variable which increases the
distance (the time-to-distance conversion is assumed to be 1)
Only positive Time Shifts are considered

◆ interpolateVariableToPoint()

GSTLEARN_EXPORT int interpolateVariableToPoint ( DbGrid db_grid,
int  iatt,
int  np,
double *  xp,
double *  yp,
double *  zp,
double *  tab 
)

Interpolate a variable from a grid Db on discretization points

Parameters
[in]db_gridDescriptor of the grid parameters
[in]iattRank of the attribute in db_grid
[in]npNumber of discretized points
[in]xpArray of first coordinates
[in]ypArray of second coordinates
[in]zpArray of third coordinates
[out]tabOutput array
Remarks
The arguments 'xp', 'yp' and 'zp' must be defined in accordance
with the space dimension in argument 'db_grid'
A point which does not lie between two valuated grid nodes
(in all space dimensions) is always set to FFFF

◆ manageExternalInformation()

GSTLEARN_EXPORT int manageExternalInformation ( int  mode,
const ELoc &  locatorType,
Db dbin,
Db dbout,
bool *  flag_created 
)

Derive the external information(s) from the Output db (if Grid) to the Input Db

Returns
Error return code
Parameters
[in]mode1 for allocation; -1 for deallocation
[in]locatorTypeType of the pointer (ELoc)
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[out]flag_createdTrue if variables have been created
Remarks
This function only functions when the Output Db is a grid
However, in case of a Point output Db, this function should not
be used: the external drift functions should already be present
in the output Db.
If this is not the case, an error is issued.

◆ migrate()

GSTLEARN_EXPORT int migrate ( Db dbin,
Db dbout,
const String name,
int  dist_type,
const VectorDouble dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates a variable from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]nameName of the attribute to be migrated
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming convention

◆ migrateByAttribute()

GSTLEARN_EXPORT int migrateByAttribute ( Db dbin,
Db dbout,
const VectorInt atts,
int  dist_type,
const VectorDouble dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates a variable from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]attsArray of attributes to be migrated
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming Convention

◆ migrateByLocator()

GSTLEARN_EXPORT int migrateByLocator ( Db dbin,
Db dbout,
const ELoc &  locatorType,
int  dist_type,
const VectorDouble dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates all z-locator variables from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]locatorTypeLocator Type
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming convention
Remarks
The output variable receive the same locator as the input variables

◆ migrateGridToCoor()

GSTLEARN_EXPORT int migrateGridToCoor ( const DbGrid db_grid,
int  iatt,
const VectorVectorDouble coords,
VectorDouble tab 
)

Migrates a variable from the grid structure into a variable at points defined by coordinate vectors

Returns
Error return code
Parameters
[in]db_griddescriptor of the grid parameters
[in]iattrank of the grid attribute
[in]coordsArray of coordinates (dimension: ndim, np)
[out]tabOutput array (Dimension: number of discretized points)

◆ migrateMulti()

GSTLEARN_EXPORT int migrateMulti ( Db dbin,
Db dbout,
const VectorString names,
int  dist_type,
const VectorDouble dmax,
bool  flag_fill,
bool  flag_inter,
bool  flag_ball,
const NamingConvention namconv 
)

Migrates a set of variables from one Db to another one

Returns
Error return code
Parameters
[in]dbinDescriptor of the input Db
[in]dboutDescriptor of the output Db
[in]namesName of the attribute to be migrated
[in]dist_typeType of distance for calculating maximum distance 1 for L1 and 2 for L2 distance
[in]dmaxArray of maximum distances (optional)
[in]flag_fillFilling option
[in]flag_interInterpolation
[in]flag_ballUse BallTree sorting algorithm when available
[in]namconvNaming convention

◆ pointToBlock()

GSTLEARN_EXPORT int pointToBlock ( Db dbpoint,
DbGrid dbgrid,
int  option,
int  flag_size,
int  iatt_time,
int  iatt_size,
int  iatt_angle,
int  iatt_scaleu,
int  iatt_scalev,
int  iatt_scalew 
)

Plunge a set of isolated points within a discretization grid in order to compute the voronoi of the points and derive:

  • the statistics on the volume and perimeter of the cells
  • the edge between cells
Returns
Error return code
Parameters
[in]dbpointDescriptor of the point parameters
[in]dbgridDescriptor of the grid parameters
[in]optionConnectivity option (0 for cross and 1 for block)
[in]flag_sizeWhen 1, the border pixels report the border thickness When 0, the border pixels are painted in 1
[in]iatt_timeAttribute of 'dbpoint'for Time shift (optional)
[in]iatt_sizeAttribute of 'dbpoint' giving size (optional)
[in]iatt_angleOptional variable for anisotropy angle (around Z)
[in]iatt_scaleuOptional variable for anisotropy scale factor (U)
[in]iatt_scalevOptional variable for anisotropy scale factor (V)
[in]iatt_scalewOptional variable for anisotropy scale factor (W)
Remarks
The value of 'flag_index' can be turned on for assigning
the sample index to the grid cell (instead of the 'iatt' value)
using: set_keypair("PTB_flag_index")