DfsIO
|
DFS file routines, C API. More...
#include <windows.h>
#include "mztypes.h"
#include "ufs.h"
#include "ufscommon.h"
#include "m0dll.h"
Go to the source code of this file.
Typedefs | |
typedef ufsErrors | FioErrors |
typedef ufsSimpleType | SimpleType |
typedef LONG(m0CABA * | FErrorHandlerT) (void *headptr, void *fileptr, void *vectorptr, FioErrors ioError, LPCTSTR src_file, int line) |
Enumerations | |
enum | FileType { F_UNDEFINED_FILE_TYPE = 0 , F_EQTIME_FIXEDSPACE_ALLITEMS = 0x1 , F_EQTIME_TVARSPACE_ALLITEMS = 0x2 , F_NEQTIME_FIXEDSPACE_ALLITEMS = 0x4 , F_NEQTIME_FIXEDSPACE_VARITEMS = 0x8 , F_NEQTIME_TVARSPACE_VARITEMS = 0x10 } |
enum | StatType { F_UNDEFINED_STAT_TYPE = 0 , F_NO_STAT , F_REGULAR_STAT , F_LARGEVAL_STAT } |
Statistical values types. | |
enum | DataValueType { F_INSTANTANEOUS = 0 , F_ACCUMULATED , F_STEP_ACCUMULATED , F_MEAN_STEP_ACCUMULATED , F_REV_MEAN_STEP_ACCUMULATED } |
Type of data value to specify how each value is to be interpreted between two time step values.. More... | |
enum | TimeAxisType { F_UNDEFINED_TAXIS = 0 , F_TM_EQ_AXIS , F_TM_NEQ_AXIS , F_CAL_EQ_AXIS , F_CAL_NEQ_AXIS } |
Defines the regularity of the time axis used for the time series data. When the data is uniformly distributed in time, the axis is equidistant, otherwise non-equidistant. It also considers whether the time axis is related to a calendar reference, or an absolute zero reference. More... | |
enum | SpaceAxisType { F_UNDEFINED_SAXIS = 0 , F_EQ_AXIS_D0 , F_EQ_AXIS_D1 , F_NEQ_AXIS_D1 , F_TVAR_AXIS_D1 , F_EQ_AXIS_D2 , F_NEQ_AXIS_D2 , F_TVAR_AXIS_D2 , F_EQ_AXIS_D3 , F_NEQ_AXIS_D3 , F_TVAR_AXIS_D3 , F_EQ_AXIS_D4 , F_CURVE_LINEAR_AXIS_D2 , F_CURVE_LINEAR_AXIS_D3 } |
Defines the regularity of the space axis used for the time series data. When the data is uniformly distributed in space, the axis is equidistant, otherwise non-equidistant. This applies to either 1-2-3 or 4 dimensional time series data. More... | |
enum | GeoInfoType { F_UNDEFINED_GEOINFO = 0 , F_UTM_PROJECTION } |
Defines whether the geographical projection is defined as a UTM projection type, or in other case, as undefined projection. More... | |
Functions | |
m0LINK void m0IMEX | dfsDebugOn (BOOL On) |
Switches on/off the possibility for online debugging. More... | |
m0LINK void m0IMEX | dfsInitSystem () |
Initializes the entire dfs system. More... | |
m0LINK void m0IMEX | dfsAddErrorHandler (FioErrors ioError, FErrorHandlerT dfsErrorHandler) |
Adds an error handler for specific types of errors. More... | |
m0LINK void m0IMEX | dfsAddCommonErrorHandler (FErrorHandlerT dfsErrorHandler) |
Adds a common error handler for all types of errors. More... | |
m0LINK LONG m0IMEX | dfsHeaderCreate (FileType file_type, LPCTSTR title, LPCTSTR apptitle, LONG appverno, LONG no_of_items, StatType stat_type, LPHEAD *pdfs_rtn) |
Creates the appropriate data structures for the header associated with a file. More... | |
m0LINK LONG m0IMEX | dfsHeaderDestroy (LPHEAD *pdfs_rtn) |
Frees the appropriate data structures for the header associated with a file. More... | |
m0LINK LONG m0IMEX | dfsSetEncodeKey (LPHEAD pdfs, int *xkey, int *ykey, int *zkey, int nRecordSize) |
Sets the encoding key for compressing the dfs file. More... | |
m0LINK LONG m0IMEX | dfsGetEncodeKey (LPHEAD pdfs, int *xkey, int *ykey, int *zkey) |
Gets the compression encoding key. More... | |
m0LINK LONG m0IMEX | dfsGetEncodeKeySize (LPHEAD pdfs) |
Gets the compression encoding key size. More... | |
m0LINK LONG m0IMEX | dfsIsFileCompressed (LPHEAD pdfs) |
Returns flag indicating if file is compressed. More... | |
m0LINK LONG m0IMEX | dfsFileRead (LPCTSTR pathname, LPHEAD *pdfs_rtn, LPFILE *fp_rtn) |
Opens the file specified by pathname for reading, automatically reads the static header information and then returns a pointer to the header information pdfs_rtn and a pointer to the file fp_rtn. More... | |
m0LINK LONG m0IMEX | dfsStreamRead (unsigned char *buffer, size_t bufferSize, FillBufferCallback callback, LPHEAD *pdfs_rtn, LPFILE *fp_rtn) |
Use buffer for reading data, and when read to end-of-buffer, the callback is used to fill the buffer with new data. More... | |
m0LINK LONG m0IMEX | dfsFileCreate (LPCTSTR pathname, LPHEAD pdfs, LPFILE *fp_rtn) |
Creates a file specified by pathname for writing, automatically writes the static header information pointed to by pdfs and then returns a pointer to the file fp_rtn. More... | |
m0LINK LONG m0IMEX | dfsFileCreateEx (LPCTSTR pathname, LPHEAD pdfs, LPFILE *fp_rtn, BOOL canRead) |
Creates a file specified by pathname for writing, automatically writes the static header information pointed to by pdfs and then returns a pointer to the file fp_rtn. More... | |
m0LINK LONG m0IMEX | dfsStreamCreate (unsigned char *buffer, size_t bufferSize, WriteBufferCallback callback, LPHEAD pdfs, LPFILE *fp_rtn) |
Creates a file and writes it to stream. More... | |
m0LINK LONG m0IMEX | dfsFileAppend (LPCTSTR pathname, LPHEAD *pdfs_rtn, LPFILE *fp_rtn) |
Opens the file specified by pathname for appending, automatically reads the static header information and then returns a pointer to the file fp_rtn and a pointer to the header information pdfs_rtn. More... | |
m0LINK LONG m0IMEX | dfsFileEdit (LPCTSTR pathname, LPHEAD *pdfs_rtn, LPFILE *fp_rtn) |
Opens the file specified by pathname for editing, automatically reads the static header information and then returns a pointer to the file fp_rtn and a pointer to the header information pdfs_rtn. More... | |
m0LINK LONG m0IMEX | dfsFileFlush (LPHEAD pdfs, LPFILE fp) |
Flushes the file specified by fp and updates the header information pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsFileFlushTimeStep (LPHEAD pdfs, LPFILE fp) |
Flushes the file specified by fp and updates the time step information in the header information pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsFileClose (LPHEAD pdfs, LPFILE *fp_rtn) |
Closes the file specified by fp_rtn and updates the header specified by pdfs. More... | |
m0LINK LONG m0IMEX | dfsFileDelete (LPCTSTR pathname) |
Deletes the file, if it exists. More... | |
m0LINK LONG m0IMEX | dfsEnablePlugin (const LPHEAD pdfs, const LPFILE fp) |
Enables the load of a plugin-dll and initializes it, if it's available. More... | |
m0LINK LONG m0IMEX | dfsUnloadPlugin (LPHEAD pdfs) |
Unloads a DFS plugin. More... | |
m0LINK LONG m0IMEX | dfsParamModifyTimes (LPHEAD pdfs, BOOL doModify) |
Sets the parameter deciding whether times stored in the dfs should be modified. Default is true. More... | |
m0LINK LONG m0IMEX | dfsWriteStartBlockDynamic (LPHEAD pdfs, LPFILE fp) |
Writes a "start-of-dynamic-block" tag to the file, effectively ending the header part and the static part of the dfs file. More... | |
m0LINK LPCTSTR m0IMEX | dfsGetAppTitle (LPHEAD pdfs) |
Retrieves the application title string of the data from the header structure. More... | |
m0LINK LONG m0IMEX | dfsSetAppTitle (LPHEAD pdfs, LPCTSTR apptitle) |
Copies the string from the apptitle-text string to a corresponding field in the header structure pointed to by pdfs. dfsSetAppTitle automatically allocates sufficiently memory for storing strings of any length. More... | |
m0LINK LONG m0IMEX | dfsGetAppVersionNo (LPHEAD pdfs) |
Retrieves the version number of the application from the header structure. More... | |
m0LINK LONG m0IMEX | dfsSetAppVersionNo (LPHEAD pdfs, LONG appverno) |
Copies the application version number from the appverno to a corresponding field in the header structure pointed to by pdfs. More... | |
m0LINK LPCTSTR m0IMEX | dfsGetFileTitle (LPHEAD pdfs) |
Retrieves the title string of the data from the header structure. More... | |
m0LINK LONG m0IMEX | dfsSetFileTitle (LPHEAD pdfs, LPCTSTR title) |
Copies the string from the title-text string to a corresponding field in the header structure pointed to by pdfs. dfsSetFileTitle automatically allocates sufficiently memory for storing strings of any length. More... | |
m0LINK FileType m0IMEX | dfsGetFileType (LPHEAD pdfs) |
Retrieves the file type of the file pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetVersionCurrent () |
Retrieves the version number of the ufs-library that is currently being used. More... | |
m0LINK LONG m0IMEX | dfsGetDataType (LPHEAD pdfs) |
Retrieves the tag-variable defining the type of data. More... | |
m0LINK LONG m0IMEX | dfsSetDataType (LPHEAD pdfs, LONG data_type) |
Sets the tag-variable defining the type of data pointed to by pdfs.. More... | |
m0LINK char m0IMEX | dfsGetDeleteValByte (LPHEAD pdfs) |
Retrieves the char-type delete value from the header structure pointed to by pdfs. More... | |
m0LINK double m0IMEX | dfsGetDeleteValDouble (LPHEAD pdfs) |
Retrieves the double-type delete value from the header structure pointed to by pdfs. More... | |
m0LINK float m0IMEX | dfsGetDeleteValFloat (LPHEAD pdfs) |
Retrieves the float-type delete value from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetDeleteValInt (LPHEAD pdfs) |
Retrieves the int-type delete value from the header structure pointed to by pdfs. More... | |
m0LINK ULONG m0IMEX | dfsGetDeleteValUnsignedInt (LPHEAD pdfs) |
Retrieves the ULONG (unsigned int)-type delete value from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetDeleteValByte (LPHEAD pdfs, char cdel) |
Copies the char-delete value from cdel to a corresponding field in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetDeleteValDouble (LPHEAD pdfs, double ddel) |
Copies the double-delete value from ddel to a corresponding field in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetDeleteValFloat (LPHEAD pdfs, float fdel) |
Copies the float-delete value from fdel to a corresponding field in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetDeleteValInt (LPHEAD pdfs, LONG idel) |
Copies the LONG-delete value from idel to a corresponding field in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetDeleteValUnsignedInt (LPHEAD pdfs, ULONG udel) |
Copies the ULONG-delete value from udel to a corresponding field in the header structure pointed to by pdfs. More... | |
m0LINK GeoInfoType m0IMEX | dfsGetGeoInfoType (LPHEAD pdfs) |
Retrieves the type of geographical information from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetGeoInfoUTMProj (LPHEAD pdfs, LPCTSTR *projection_id_rtn, double *lon0_rtn, double *lat0_rtn, double *orientation_rtn) |
Retrieves the geographical information for an UTM-projection. The longitude, latitude and orientation are all given in decimal degrees. More... | |
m0LINK LONG m0IMEX | dfsSetGeoInfoUTMProj (LPHEAD pdfs, LPCTSTR projection_id, double lon0, double lat0, double orientation) |
Sets the type of projection to be UTM-projection, sets the zone and sets the longitude, latitude and orientation of the reference coordinate system. More... | |
m0LINK LONG m0IMEX | dfsUpdateGeoInfoUTMProj (LPHEAD pdfs, LPCTSTR projection_id, double lon0, double lat0, double orientation) |
Updates the GeoInfo projection, sets the zone and sets the longitude, latitude and orientation of the reference coordinate system for an existing file. The existing file must have a projection. More... | |
m0LINK LONG m0IMEX | dfsSetGeoInfoUndefined (LPHEAD pdfs) |
Sets the type of projection to be undefined. If no geographical information is available or the projection type is unknown, this call should be used. More... | |
m0LINK TimeAxisType m0IMEX | dfsGetTimeAxisType (LPHEAD pdfs) |
Retrieves the time axis type of the data set from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetNumberOfTimeSteps (LPHEAD pdfs, LONG n_number_of_time_steps) |
Sets explicitly the number of time steps in the header. More... | |
m0LINK LONG m0IMEX | dfsSetTimeStartEnd (LPHEAD pdfs, double startTimeOffset, double timeSpan) |
Sets explicitly the time of the first data set and the time span of the data set in the header. More... | |
m0LINK LONG m0IMEX | dfsGetEqTimeAxis (LPHEAD pdfs, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, double *tstart_rtn, double *tstep_rtn, LONG *tnum_rtn, LONG *tindex_rtn) |
Retrieves the description of an equidistant time axis from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetNeqTimeAxis (LPHEAD pdfs, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, double *tstart_rtn, double *tspan_rtn, LONG *tnum_rtn, LONG *tindex_rtn) |
Retrieves the description of a non equidistant time axis from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetEqTimeAxis (LPHEAD pdfs, LONG n_eum_unit, double tstart, double tstep, LONG tindex) |
Copies the description of an equidistant time axis to the corresponding fields in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetNeqTimeAxis (LPHEAD pdfs, LONG n_eum_unit, double tstart, LONG tindex) |
Copies the description of a non equidistant time axis to the corresponding fields in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetEqCalendarAxis (LPHEAD pdfs, LPCTSTR *start_date_rtn, LPCTSTR *start_time_rtn, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, double *tstart_rtn, double *tstep_rtn, LONG *tnum_rtn, LONG *tindex_rtn) |
Retrieves the description of an equidistant calendar axis from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetNeqCalendarAxis (LPHEAD pdfs, LPCTSTR *start_date_rtn, LPCTSTR *start_time_rtn, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, double *tstart_rtn, double *tspan_rtn, LONG *tnum_rtn, LONG *tindex_rtn) |
Retrieves the description of a non equidistant time axis from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetEqCalendarAxis (LPHEAD pdfs, LPCTSTR start_date, LPCTSTR start_time, LONG n_eum_unit, double tstart, double tstep, LONG tindex) |
Copies the description of an equidistant calendar axis to the corresponding fields in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsSetNeqCalendarAxis (LPHEAD pdfs, LPCTSTR start_date, LPCTSTR start_time, LONG n_eum_unit, double tstart, LONG tindex) |
Copies the description of a non equidistant calendar axis to the corresponding fields in the header structure pointed to by pdfs. More... | |
m0LINK LPITEM m0IMEX | dfsItemD (LPHEAD pdfs, LONG item_no) |
Maps the item number item_no for the header structure pointed to by pdfs to a direct reference to the geometrical description of a dynamic item. More... | |
m0LINK LPITEM m0IMEX | dfsItemS (LPVECTOR pvec) |
Maps a static vector to a direct reference to the geometrical description of the item (static and dynamic items have common germetrical description). More... | |
m0LINK LONG m0IMEX | dfsGetNoOfItems (LPHEAD pdfs) |
Returns the number of dynamic items defined in the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsGetItemInfo_ (LPITEM item, LONG *item_type_rtn, LPCTSTR *name_rtn, LPCTSTR *unit_rtn, SimpleType *data_type_rtn) |
m0LINK LONG m0IMEX | dfsSetItemInfo_ (LPHEAD pdfs, LPITEM item, LONG item_type, LPCTSTR name, LPCTSTR unit, SimpleType data_type) |
m0LINK LONG m0IMEX | dfsSetItemUnitConversion (LPITEM item, UnitConvType nConvType, LONG nUnit) |
Sets the unit conversion for a specific item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisUnitConversion (LPITEM item, UnitConvType nConvType, LONG nUnit) |
Sets the unit conversion for the axis of a specific item. More... | |
m0LINK LONG m0IMEX | dfsGetItemUnitConversion (LPITEM item, UnitConvType *nConvType_rtn, LONG *nUnit_rtn) |
Gets the unit conversion for a specific item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisUnitConversion (LPITEM item, UnitConvType *nConvType_rtn, LONG *nUnit_rtn) |
Gets the unit conversion for the axis of a specific item. More... | |
m0LINK LONG m0IMEX | dfsGetItemValueType (LPITEM item, DataValueType *value_type) |
Gets the Data value type of the specified item. More... | |
m0LINK LONG m0IMEX | dfsSetItemValueType (LPITEM item, DataValueType value_type) |
Sets the data value type for the specified item. More... | |
m0LINK LONG m0IMEX | dfsGetItemInfo (LPITEM item, LONG *n_eum_item_type_rtn, LPCTSTR *t_eum_item_type_rtn, LPCTSTR *name_rtn, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, SimpleType *data_type_rtn) |
Retrieves the item information that are common for all items both dynamic and static and 0- to 3-dimensional as well as static and curvelinear items pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemInfo (LPHEAD pdfs, LPITEM item, LONG n_eum_item_type, LPCTSTR name, LONG n_eum_unit, SimpleType data_type) |
Copies the common item information to the item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsUpdateItemInfo (LPHEAD pdfs, LPITEM item, LONG n_eum_item_type, LPCTSTR name, LONG n_eum_unit) |
Updates the common item information of an item of an existing file. Item is pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsRqItemUnit_ (LPITEM item, LONG unit) |
m0LINK LONG m0IMEX | dfsGetAssocStatic (LPHEAD pdfs, LONG item_no, LONG staSeqNo, LONG *staItNo_rtn) |
Retrieves the index number of a static item associated with the dynamic item specified by item_no. More... | |
m0LINK LONG m0IMEX | dfsSetAssocStatic (LPHEAD pdfs, LONG item_no, LONG staItNo) |
Associates a static item specified by staItNo with a dynamic item specified by item_no (establishes a link between the items). More... | |
m0LINK ULONG m0IMEX | dfsGetNoAssocStatic (LPHEAD pdfs, LONG item_no) |
Retrieves the number of static items associated with the dynamic item specified by item_no. More... | |
m0LINK ULONG m0IMEX | dfsGetItemElements (LPITEM item) |
Retrieves the number of elements for an item pointed to by It. More... | |
m0LINK ULONG m0IMEX | dfsGetUsedItemElements (LPITEM item) |
Retrieves the number of actually used elements for an item pointed to by Item. More... | |
m0LINK ULONG m0IMEX | dfsGetItemXYZSize (LPITEM item) |
Retrieves the number of actually used elements for an item pointed to by Item, in rectangular grids of 0, 1, 2, 3, and 4 dimensions. More... | |
m0LINK ULONG m0IMEX | dfsGetItemXYSize (LPITEM item) |
Retrieves the number of horisontal elements, ie. in the plane X-Y for an item pointed to by Item, in rectangular grids of 0, 1, 2, 3, and 4 dimensions. More... | |
m0LINK ULONG m0IMEX | dfsGetItemXSize (LPITEM item) |
Retrieves the number of elements in the X axis, for an item pointed to by Item, in rectangular grids of 0, 1, 2, 3, and 4 dimensions. More... | |
m0LINK ULONG m0IMEX | dfsGetItemBytes (LPITEM item) |
Retrieves the number of bytes for an item pointed to by It. More... | |
m0LINK ULONG m0IMEX | dfsGetUsedItemBytes (LPITEM item) |
Retrieves the number of packed bytes for an item pointed to by It. More... | |
m0LINK LONG m0IMEX | dfsGetItemRefCoords (LPITEM item, float *x_rtn, float *y_rtn, float *z_rtn) |
Retrieves the origin of the reference coordinate system of a n-dimensional item pointed to by Item, static as well as dynamic, where 0 <= n <= 3. More... | |
m0LINK LONG m0IMEX | dfsSetItemRefCoords (LPITEM item, float x, float y, float z) |
Sets the origin of the reference coordinate system of a n-dimensional item pointed to by Item, either static or dynamic, where 0 <= n <= 3. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisOrientation (LPITEM item, float *alpha_rtn, float *phi_rtn, float *theta_rtn) |
Retrieves the orientation of the reference coordinate system of a n-dimensional item pointed to by Item, static as well as dynamic, where 0 <= n <= 3. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisOrientation (LPITEM item, float alpha, float phi, float theta) |
Sets the orientation of the reference coordinate system of a n-dimensional item pointed to by Item, static as well as dynamic, where 0 <= n <= 3. More... | |
m0LINK LONG m0IMEX | dfsGetItemStatsGlobal (LPITEM item, double *min_rtn, double *max_rtn, LONG *no_of_del_values_rtn) |
Retrieves the global statistical values of an individually selected item pointed to by Item. More... | |
m0LINK SpaceAxisType m0IMEX | dfsGetItemAxisType (LPITEM item) |
Retrieves the spatial axis type of an individually selected item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemDim (LPITEM item) |
Retrieves the dimension of the spatial axis of an individually selected item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemGeometryType (LPITEM item) |
Retrieves the type of geometry type, according to the dimension of the spatial axis of an individually selected item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemGeometryUnit (LPITEM item) |
Retrieves the unit type of the spatial dimension of an individually selected item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisEqD0 (LPITEM item, LONG n_eum_unit) |
Sets the relative axis description of an individually selected 0-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisEqD0 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn) |
Retrieves the relative axis description of an individually selected 0-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisEqD1 (LPITEM item, LONG n_eum_unit, LONG j, float x0, float dx) |
Sets the relative axis description of an individually selected 1-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisEqD1 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, float *x0_rtn, float *dx_rtn) |
Retrieves the relative axis description of an individually selected 1-dimensional equidistant item pointed to by item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisEqD2 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, float x0, float y0, float dx, float dy) |
Sets the relative axis description of an individually selected 2-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisEqD2 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, float *x0_rtn, float *y0_rtn, float *dx_rtn, float *dy_rtn) |
Retrieves the relative axis description of an individually selected 2-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisEqD3 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, LONG l, float x0, float y0, float z0, float dx, float dy, float dz) |
Sets the relative axis description of an individually selected 3-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisEqD3 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, LONG *l_rtn, float *x0_rtn, float *y0_rtn, float *z0_rtn, float *dx_rtn, float *dy_rtn, float *dz_rtn) |
Retrieves the relative axis description of an individually selected 3-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisEqD4 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, LONG l, LONG m, float x0, float y0, float z0, float f0, float dx, float dy, float dz, float df) |
Sets the relative axis description of an individually selected 4-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisEqD4 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, LONG *l_rtn, LONG *m_rtn, float *x0_rtn, float *y0_rtn, float *z0_rtn, float *f0_rtn, float *dx_rtn, float *dy_rtn, float *dz_rtn, float *df_rtn) |
Retrieves the relative axis description of an individually selected 4-dimensional equidistant item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisNeqD1 (LPITEM item, LONG n_eum_unit, LONG j, Coords *coords, BOOL coords_copy) |
Sets the relative axis description of an individually selected 1-dimensional curvelinear item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisNeqD1 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, Coords **coords_rtn) |
Retrieves the relative axis description of an individually selected 1-dimensional curvelinear item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisNeqD2 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, double *xcoords, double *ycoords, BOOL coords_copy) |
Sets the relative axis description of an individually selected 2-dimensional non equidistant but orthogonal item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisNeqD2 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, double **xcoords_rtn, double **ycoords_rtn) |
Retrieves the relative axis description of an individually selected 2-dimensional non equidistant but orthogonal item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisNeqD3 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, LONG l, double *xcoords, double *ycoords, double *zcoords, BOOL coords_copy) |
Sets the relative axis description of an individually selected 3-dimensional non equidistant but orthogonal item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisNeqD3 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, LONG *l_rtn, double **xcoords_rtn, double **ycoords_rtn, double **zcoords_rtn) |
Retrieves the relative axis description of an individually selected 3-dimensional non equidistant but orthogonal item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisCurveLinearD2 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, double *xcoords, double *ycoords, BOOL coords_copy) |
Sets the relative axis description of an individually selected 2-dimensional curvelinear item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisCurveLinearD2 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, double **xcoords_rtn, double **ycoords_rtn) |
Retrieves the relative axis description of an individually selected 2-dimensional curvelinear item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsSetItemAxisCurveLinearD3 (LPITEM item, LONG n_eum_unit, LONG j, LONG k, LONG l, double *xcoords, double *ycoords, double *zcoords, BOOL coords_copy) |
Sets the relative axis description of an individually selected 3-dimensional curvelinear item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsGetItemAxisCurveLinearD3 (LPITEM item, LONG *n_eum_unit_rtn, LPCTSTR *t_eum_unit_rtn, LONG *j_rtn, LONG *k_rtn, LONG *l_rtn, double **xcoords_rtn, double **ycoords_rtn, double **zcoords_rtn) |
Retrieves the relative axis description of an individually selected 3-dimensional curvelinear item pointed to by Item. More... | |
m0LINK LONG m0IMEX | dfsIsItemCompressed (LPITEM item, LONG *n_rec_size_rtn) |
Determines whether the selected item is compressed in a MIKE 3 or a MIKE 21 compressed file. Item. More... | |
m0LINK void m0IMEX | dfsItemEnableCompression (LPHEAD pdfs) |
Flags the header information structure of a file to enable compression of the file. More... | |
m0LINK StatType m0IMEX | dfsGetItemStatsType (LPHEAD pdfs) |
retrieves the type of statistical values stored in the header part of the file pointed to by pdfs More... | |
m0LINK LONG m0IMEX | dfsGetItemStats (LPHEAD pdfs, LONG item_no, LONG cOff, double *min_rtn, double *max_rtn, double *mean_rtn, double *st_dev_rtn, double *auto_corr_rtn, LONG *no_of_values_rtn, LONG *no_of_del_values_rtn, LONG *no_of_pairs_rtn) |
Retrieves the statistical description of an individually selected gridpoint of an individually selected n-dimensional item specified by item_no from the header structure pointed to by pdfs. More... | |
m0LINK LONG m0IMEX | dfsAddCustomBlock (LPHEAD pdfs, SimpleType data_type, LPCTSTR name, LONG n_elements, void *data_ptr) |
adds a custom defined block of data to the file in form of an array. More... | |
m0LINK LONG m0IMEX | dfsGetCustomBlockRef (LPHEAD pdfs, LPBLOCK *pBlock_rtn) |
retrieves a reference to the first custom defined block in a file if any blocks are found. More... | |
m0LINK LONG m0IMEX | dfsGetCustomBlock (LPBLOCK pblock, SimpleType *data_type_rtn, LPCTSTR *name_rtn, LONG *n_elements_rtn, void **data_ptr_rtn, LPBLOCK *pNextBlock_rtn) |
retrieves the data of a custom defined block when a reference pblock is given. More... | |
m0LINK LPVECTOR m0IMEX | dfsStaticRead (LPFILE fp, LONG *fioError) |
Reads a static vector from the file pointed to by fp. dfsStaticRead allocates the memory necessary to contain a complete description of a static vector. More... | |
m0LINK LONG m0IMEX | dfsStaticSetHeader (LPHEAD pdfs, LPITEM item) |
Connects the header to the static item. This is required if the static item needs to be updated. More... | |
m0LINK LONG m0IMEX | dfsStaticWrite (LPVECTOR pvec, LPFILE fp, void *data) |
Writes the static vector pointed to by pvec to the file pointed to by fp. More... | |
m0LINK LONG m0IMEX | dfsStaticCreate (LPVECTOR *pvec_rtn) |
Creates the appropriate data structures for a new static vector. More... | |
m0LINK LONG m0IMEX | dfsStaticDestroy (LPVECTOR *pvec_rtn) |
Frees the appropriate data structures for the static vector specified by pvec_rtn. The function is complementary to dfsStaticCreate. More... | |
m0LINK LONG m0IMEX | dfsStaticGetData (LPVECTOR pvec, void *data) |
Retrieves the actual data from the static vector pointed to by pvec and copies them to the array specified by data. More... | |
m0LINK LONG m0IMEX | dfsStaticSkip (LPFILE fp) |
Skips a static item and jumps to the next one. More... | |
m0LINK LONG m0IMEX | dfsFindBlockStatic (LPHEAD pdfs, LPFILE fp) |
Sets the position of the file pointer fp to the beginning of the static vector (topography) block. More... | |
m0LINK LONG m0IMEX | dfsFindBlockDynamic (LPHEAD pdfs, LPFILE fp) |
Sets the position of the file pointer fp to the beginning of the dynamic block, that is at the beginning of the first timestep. The function can be called any time when reading, writing or editing the file, provided that the static block is written completely. More... | |
m0LINK LONG m0IMEX | dfsSkipItem (LPHEAD pdfs, LPFILE fp) |
Skips the time step of the next item in the file. More... | |
m0LINK LONG m0IMEX | dfsSkipTimeStep (LPHEAD pdfs, LPFILE fp) |
Skips the entire time step containing all items stored consecutively in the time step. More... | |
m0LINK LONG m0IMEX | dfsReadItemTimeStep (LPHEAD pdfs, LPFILE fp, double *time_rtn, void *dataptr_rtn) |
Reads the time step of the next item in the file. More... | |
m0LINK LONG m0IMEX | dfsWriteItemTimeStep (LPHEAD pdfs, LPFILE fp, double time, void *dataptr) |
Writes the time step of the next item in the file. More... | |
m0LINK LONG m0IMEX | dfsTruncateItemTimeStep (LPHEAD pdfs, LONG item_no, LONG ndigit, void *dataptr) |
Truncate the item data of a dfs file to a given number of digits. More... | |
m0LINK LONG m0IMEX | dfsFindItemDynamic (LPHEAD pdfs, LPFILE fp, LONG tstep_no, LONG item_no) |
Positions the file pointer at the location in the file where the specified item at the specified time step starts. More... | |
m0LINK LONG m0IMEX | dfsFindTimeStep (LPHEAD pdfs, LPFILE fp, LONG tstep_no) |
Positions the file pointer at the location in the file where the the specified time step starts. More... | |
m0LINK LONG m0IMEX | dfsFindItemStatic (LPHEAD pdfs, LPFILE fp, LONG item_no) |
Positions the file pointer at the location in the file where the specified static item starts. More... | |
m0LINK LONG m0IMEX | _dfsGetTimeAxisSpan (LPHEAD pdfs, LPFILE fp, double *tspan_rtn) |
DFS file routines, C API.
:
The DFS (Data File System) is used extensively within the MIKE Powered by DHI software. It is a binary data file format and it provides a general file format for handling spatially distributed and time dependent data. For details on the DFS file system, see http://docs.mikepoweredbydhi.com/core_libraries/dfs/dfs-file-system/
The API in this library allow the user to Open, create and edit all dfs type files: dfs0, dfs1, dfs2, dfs3, dfsu files. It allows creation and modification of static and dynamic items, temporal and spatial axes, their discretizations and corresponding units.
The API is a exported such that it is accessible from C/C++, Pascal/Delphi, Python and any other technology that can consume a C API.
Definition in file dfsio.h.
FErrorHandlerT |
Callback function definition for a error handler callback, used in dfsAddCommonErrorHandler
headptr | DFS header |
fileptr | UFS file |
vectorptr | static vector |
ioError | Error code to handle |
src_file | Source file name |
line | Source line no |
DFS error enum values:
Enumerator | value | description |
---|---|---|
F_NO_ERROR | 0 | No error, |
F_END_OF_FILE | 1 | End of file was reached, |
F_FAIL_DATA | 1000 | Failed reading/writing data from/to the file. File is corrupt, not a DFS file or handled incorrectly, or data is invalid |
F_FAIL_ILLEGEAL_TSTEP | 1001 | The time step number is out of range |
F_FAIL_ILLEGEAL_ITEM | 1002 | The item number is out of range |
F_ERR_MALLOC | 2000 | Error allocating memory |
F_ERR_READ | 2001 | Error reading file. Common reasons: File has zero size, file is open in write-only mode, disc is corrupt |
F_ERR_WRITE | 2002 | Error writing data to disc. Common reasons: Disc is full, filename is invalid, not enough available memory (for write buffers) |
F_ERR_OPEN | 2003 | Error opening file. Filename is invalid, or header could not be read (corrupt, or not a DFS file) |
F_ERR_CLOSE | 2004 | Error closing file |
F_ERR_FLUSH | 2005 | Error flushing data to disc. Disc/quota may be full |
F_ERR_SEEK | 2006 | Error seeking in file. File has been truncated or disc is corrupt |
F_ERR_ITEMNO | 2007 | An item number is out of range |
F_ERR_INDEX | 2008 | An index number is out of range |
F_ERR_DTYPE | 2009 | A data type does not match (internal error). File is most likely corrupt |
F_ERR_DATA | 2010 | Error in file data, file is most likely corrupt |
F_ERR_DATE_FORMAT | 2011 | Date format is invalid. Must be YYYY-MM-dd |
F_ERR_TIME_FORMAT | 2012 | Time format is invalid. Must be hh:mm:ss |
F_ERR_SIZE | 2013 | A size does not match (internal error). File is most likely corrupt |
F_ERR_TAG | 2014 | Error reading DHI DFS tag (DHI_). Most likely file is not a DFS file |
F_ERR_READONLY | 2015 | Trying to write to a file in read-only mode |
F_ERR_SKIP | 2016 | Error skipping a logical block (internal error). Most likely file is corrupt |
F_ERR_APPTAG | 2017 | Error reading DHI DFS API tag (DFS_). Most likely file is not a DFS file |
F_ERR_AXIS | 2018 | Wrong axis type number (internal error). Most likely the file is corrupt |
F_ERR_CTYPE | 2019 | Error reading logical block type (internal error). Most likely the file is corrupt |
F_ERR_EUM | 2010 | EUM unit and type does not match |
F_ERR_NOT_DTX | 2021 | File is not a dtx file, though loaded as such |
F_ERR_PLUGIN | 2022 | Plugin extension error |
DFS SimpleType enum values:
Enumerator | value | description |
---|---|---|
UFS_FLOAT | 1 | Single precision float (4 byte) |
UFS_DOUBLE | 2 | Double precision float (8 byte) |
UFS_CHAR | 3 | Char/Byte (1 byte) |
UFS_INT | 4 | Signed integer (4 bytes) |
UFS_UNSIGNED | 5 | Unsigned integer (4 bytes) |
UFS_SHORT | 6 | Signed short integer (2 bytes) |
UFS_USHORT | 7 | Unsigned short integer (2 bytes) |
enum DataValueType |
Type of data value to specify how each value is to be interpreted between two time step values..
enum FileType |
Type of file also specifies the type of data in the file
enum GeoInfoType |
Defines whether the geographical projection is defined as a UTM projection type, or in other case, as undefined projection.
enum SpaceAxisType |
Defines the regularity of the space axis used for the time series data. When the data is uniformly distributed in space, the axis is equidistant, otherwise non-equidistant. This applies to either 1-2-3 or 4 dimensional time series data.
enum TimeAxisType |
Defines the regularity of the time axis used for the time series data. When the data is uniformly distributed in time, the axis is equidistant, otherwise non-equidistant. It also considers whether the time axis is related to a calendar reference, or an absolute zero reference.
Enumerator | |
---|---|
F_TM_EQ_AXIS | Equidistant time axis. |
F_TM_NEQ_AXIS | Non-equidistant time axis. |
F_CAL_EQ_AXIS | Equidistant calendar axis. |
F_CAL_NEQ_AXIS | Non-equidistant calendar axis. |
m0LINK void m0IMEX dfsAddCommonErrorHandler | ( | FErrorHandlerT | dfsErrorHandler | ) |
Adds a common error handler for all types of errors.
It adds the FioErrors - specified errors. dfsErrorHandler is called whenever one of these errors occurs.
[in] | dfsErrorHandler | Specifies a reference to the error handler, that is the user-defined function that should be called when the specified error occurs. |
m0LINK LONG m0IMEX dfsAddCustomBlock | ( | LPHEAD | pdfs, |
SimpleType | data_type, | ||
LPCTSTR | name, | ||
LONG | n_elements, | ||
void * | data_ptr | ||
) |
adds a custom defined block of data to the file in form of an array.
dfsAddCustomBlock accepts arrays of floats, doubles, chars, integers and unsigned integers of any size. dfsAddCustomBlock can be called freely any number of times.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | data_type | Specifies the simple data type of the data block. Accepted values are
|
[in] | name | Specifies a pointer to the text string containing the label of the data. |
[in] | n_elements | Specifies the number of elements in the array. |
[in] | data_ptr | Specifies a pointer to the array containing the elements. |
m0LINK void m0IMEX dfsAddErrorHandler | ( | FioErrors | ioError, |
FErrorHandlerT | dfsErrorHandler | ||
) |
Adds an error handler for specific types of errors.
It adds the specified errors. dfsErrorHandler is a user-defined function that is called whenever errors of the specified type occurs.
[in] | ioError | Specifies the type of error Valid values are the FioErrors - specified errors, that is: |
F_FAIL_DATA, F_ERR_MALLOC, F_ERR_READ, F_ERR_WRITE, F_ERR_OPEN, F_ERR_CLOSE, F_ERR_FLUSH, F_ERR_SEEK, F_ERR_ITEMNO, F_ERR_INDEX, F_ERR_DTYPE, F_ERR_DATA, F_ERR_DATE_FORMAT, F_ERR_TIME_FORMAT, F_ERR_SIZE, F_ERR_TAG, F_ERR_READONLY, F_ERR_SKIP, F_ERR_APPTAG, F_ERR_AXIS, F_ERR_CTYPE,
[in] | dfsErrorHandler | Specifies a reference to the error handler, that is the user-defined function that should be called when the specified error occurs. |
m0LINK void m0IMEX dfsDebugOn | ( | BOOL | On | ) |
Switches on/off the possibility for online debugging.
When the debug is switched on, the debugging is done using prints to stdout and stderr.
[in] | On | Specifies whether the application should be running in debug mode, with respect to the dfs-library routines. |
m0LINK LONG m0IMEX dfsEnablePlugin | ( | const LPHEAD | pdfs, |
const LPFILE | fp | ||
) |
Enables the load of a plugin-dll and initializes it, if it's available.
The plugin then becomes a part of the DFS header. The plugin computes derived items, if it makes sense. Enabling the plugin can always be done. It will only effect the items in special cases.
[in] | pdfs | Specifies a pointer to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsFileAppend | ( | LPCTSTR | pathname, |
LPHEAD * | pdfs_rtn, | ||
LPFILE * | fp_rtn | ||
) |
Opens the file specified by pathname for appending, automatically reads the static header information and then returns a pointer to the file fp_rtn and a pointer to the header information pdfs_rtn.
The file pointer is left at the end of the file. dfsFileAppend allocates the memory necessary to contain the complete header description found in the file.
[in] | pathname | Specifies a pointer to the filename. |
[out] | pdfs_rtn | Returns a reference to the header upon successful execution. If a NULL-pointer is specified the parameter is ignored. |
[out] | fp_rtn | Returns a reference to the file upon successful execution. If a NULL-pointer param is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsFileClose | ( | LPHEAD | pdfs, |
LPFILE * | fp_rtn | ||
) |
Closes the file specified by fp_rtn and updates the header specified by pdfs.
[in] | pdfs | Specifies a pointer to the header information structure. |
[out] | fp_rtn | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsFileCreate | ( | LPCTSTR | pathname, |
LPHEAD | pdfs, | ||
LPFILE * | fp_rtn | ||
) |
Creates a file specified by pathname for writing, automatically writes the static header information pointed to by pdfs and then returns a pointer to the file fp_rtn.
The file pointer is left at the position following the header part of the file which corresponds to the end of the file.
[in] | pathname | Specifies a pointer to the filename. |
[in] | pdfs | Specifies a pointer to the header structure. |
[out] | fp_rtn | Returns a reference to the file upon successful execution of dfsFileCreate. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsFileCreateEx | ( | LPCTSTR | pathname, |
LPHEAD | pdfs, | ||
LPFILE * | fp_rtn, | ||
BOOL | canRead | ||
) |
Creates a file specified by pathname for writing, automatically writes the static header information pointed to by pdfs and then returns a pointer to the file fp_rtn.
The file pointer is left at the position following the header part of the file which corresponds to the end of the file. The dfsFileCreateEx differs from the dfsFileCreate by a canRead flag that must be set when reading/modifying operations on the file is required. Performance measurements have shown that in some cases use of the canRead flag can slow down write performance.
[in] | pathname | Specifies a pointer to the filename. |
[in] | pdfs | Specifies a pointer to the header structure. |
[out] | fp_rtn | Returns a reference to the file upon successful execution of dfsFileCreate. If a NULL-pointer is specified the parameter is ignored. |
[in] | canRead | flag specifying whether read/modify operations are allowed |
m0LINK LONG m0IMEX dfsFileDelete | ( | LPCTSTR | pathname | ) |
Deletes the file, if it exists.
[in] | pathname | Specifies a pointer to the filename. |
m0LINK LONG m0IMEX dfsFileEdit | ( | LPCTSTR | pathname, |
LPHEAD * | pdfs_rtn, | ||
LPFILE * | fp_rtn | ||
) |
Opens the file specified by pathname for editing, automatically reads the static header information and then returns a pointer to the file fp_rtn and a pointer to the header information pdfs_rtn.
The file pointer is left at the position following the header part of the file. dfsFileEdit allocates the memory necessary to contain the complete header description found in the file.
[in] | pathname | Specifies a pointer to the filename. |
[out] | pdfs_rtn | Returns a reference to the header upon successful execution of dfsFileEdit. If a NULL-pointer is specified the parameter is ignored. |
[out] | fp_rtn | Returns a reference to the file upon successful execution of dfsFileEdit. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsFileFlush | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Flushes the file specified by fp and updates the header information pointed to by pdfs.
[in] | pdfs | Specifies a pointer to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsFileFlushTimeStep | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Flushes the file specified by fp and updates the time step information in the header information pointed to by pdfs.
Compared to dfsFileFlush, this method only updates the time step information in the header, and not the statistics and other information
[in] | pdfs | Specifies a pointer to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsFileRead | ( | LPCTSTR | pathname, |
LPHEAD * | pdfs_rtn, | ||
LPFILE * | fp_rtn | ||
) |
Opens the file specified by pathname for reading, automatically reads the static header information and then returns a pointer to the header information pdfs_rtn and a pointer to the file fp_rtn.
The file pointer is left at the position following the header part of the file. dfsFileRead allocates the memory necessary to contain the complete header description found in the file.
[in] | pathname | Specifies a pointer to the filename. |
[out] | pdfs_rtn | Returns a reference to the header upon successful execution of dfsFileRead. If a NULL-pointer is specified the parameter is ignored. |
[out] | fp_rtn | Returns a reference to the file upon successful execution of dfsFileRead. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsFindBlockDynamic | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Sets the position of the file pointer fp to the beginning of the dynamic block, that is at the beginning of the first timestep. The function can be called any time when reading, writing or editing the file, provided that the static block is written completely.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsFindBlockStatic | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Sets the position of the file pointer fp to the beginning of the static vector (topography) block.
The function can be called any time when reading, writing or editing the file.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsFindItemDynamic | ( | LPHEAD | pdfs, |
LPFILE | fp, | ||
LONG | tstep_no, | ||
LONG | item_no | ||
) |
Positions the file pointer at the location in the file where the specified item at the specified time step starts.
The function call only succeeds if the storage type of the file is F_EQTIME_FIXEDSPACE_ALLITEMS, F_EQTIME_TVARSPACE_ALLITEMS or F_NEQTIME_FIXEDSPACE_ALLITEMS that is a file where each time step includes all items defined in the file.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a reference to the file. |
[in] | tstep_no | Specifies the number of the selected time step. |
[in] | item_no | Specifies the number of the selected dynamic item. |
m0LINK LONG m0IMEX dfsFindItemStatic | ( | LPHEAD | pdfs, |
LPFILE | fp, | ||
LONG | item_no | ||
) |
Positions the file pointer at the location in the file where the specified static item starts.
The function call succeeds if the specified static item exists.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a reference to the file. |
[in] | item_no | Specifies the number of the selected static item. |
m0LINK LONG m0IMEX dfsFindTimeStep | ( | LPHEAD | pdfs, |
LPFILE | fp, | ||
LONG | tstep_no | ||
) |
Positions the file pointer at the location in the file where the the specified time step starts.
The function call only succeeds if the storage type of the file is F_EQTIME_FIXEDSPACE_ALLITEMS, F_EQTIME_TVARSPACE_ALLITEMS or F_NEQTIME_FIXEDSPACE_ALLITEMS that is a file where each time step includes all items defined in the file.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a reference to the file. |
[in] | tstep_no | Specifies the number of the selected time step. |
m0LINK LPCTSTR m0IMEX dfsGetAppTitle | ( | LPHEAD | pdfs | ) |
Retrieves the application title string of the data from the header structure.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsGetAppVersionNo | ( | LPHEAD | pdfs | ) |
Retrieves the version number of the application from the header structure.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsGetAssocStatic | ( | LPHEAD | pdfs, |
LONG | item_no, | ||
LONG | staSeqNo, | ||
LONG * | staItNo_rtn | ||
) |
Retrieves the index number of a static item associated with the dynamic item specified by item_no.
Since more static items can be associated with a specific dynamic item, a sequence number specifying the exact number of static item has to be given too.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item_no | Specifies the number of the dynamic item. |
[in] | staSeqNo | Specifies the sequence number of the static item associated with the dynamic item. |
[out] | staItNo_rtn | Returns the number of the static item. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetCustomBlock | ( | LPBLOCK | pblock, |
SimpleType * | data_type_rtn, | ||
LPCTSTR * | name_rtn, | ||
LONG * | n_elements_rtn, | ||
void ** | data_ptr_rtn, | ||
LPBLOCK * | pNextBlock_rtn | ||
) |
retrieves the data of a custom defined block when a reference pblock is given.
dfsGetCustomBlock also returns a reference to the next custom defined block if any is found.
[in] | pblock | Specifies a reference to the header information structure. |
[out] | data_type_rtn | Returns the simple data type of the custom block. Possible return values are
|
If a NULL-pointer is specified the parameter is ignored.
[out] | name_rtn | Returns a pointer to the text string containing the label of the data. If a NULL-pointer is specified the parameter is ignored. |
[out] | n_elements_rtn | Returns the number of elements in the array. If a NULL-pointer is specified the parameter is ignored. |
[out] | data_ptr_rtn | Returns a pointer to the array containing the elements. If a NULL-pointer is specified the parameter is ignored. |
[out] | pNextBlock_rtn | Returns a pointer to the next custom defined block in the file. If no custom defined block is found NULL is returned. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetCustomBlockRef | ( | LPHEAD | pdfs, |
LPBLOCK * | pBlock_rtn | ||
) |
retrieves a reference to the first custom defined block in a file if any blocks are found.
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | pBlock_rtn | Returns a pointer to the first custom defined block in the file. If no custom defined block is found NULL is returned. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetDataType | ( | LPHEAD | pdfs | ) |
Retrieves the tag-variable defining the type of data.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK char m0IMEX dfsGetDeleteValByte | ( | LPHEAD | pdfs | ) |
Retrieves the char-type delete value from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK double m0IMEX dfsGetDeleteValDouble | ( | LPHEAD | pdfs | ) |
Retrieves the double-type delete value from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK float m0IMEX dfsGetDeleteValFloat | ( | LPHEAD | pdfs | ) |
Retrieves the float-type delete value from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsGetDeleteValInt | ( | LPHEAD | pdfs | ) |
Retrieves the int-type delete value from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK ULONG m0IMEX dfsGetDeleteValUnsignedInt | ( | LPHEAD | pdfs | ) |
Retrieves the ULONG (unsigned int)-type delete value from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsGetEncodeKey | ( | LPHEAD | pdfs, |
int * | xkey, | ||
int * | ykey, | ||
int * | zkey | ||
) |
Gets the compression encoding key.
When a file is compressed, all dynamic items are compressed with the same encoding key, and hence also all dynamic items have the same spatial axis.
When a file is compressed, the encoding key defines for each value stored in the file the indices [xi, yi, zy] in the data matrix where the value belongs. Hence, the i'th data value belongs in the data matrix on
or using linear indexing:
For a 2D axis all zKey values are zero. For a 1D axis all yKey and zKey values are zero.
When reading data from or writing data to dynamic items, data is automatically compressed/uncompressed, hence the encoding keys are only for information. Some files also compresses static items, and compresses these also, however using a dummy axis of the size of the encoding key, and manual decoding needs to take place,
Data outside the encoding key gets the delete value. For a file with 2D data all zi's are zero, and for a 1D file, zi's and yi's are zero.
It is only valid to call this function if dfsIsFileCompressed returns true.
Compression is only supported when all dynamic items are of type float.
[in] | pdfs | Specifies a pointer to the header structure. |
[in,out] | xkey | x-index of encoding key. Array must be pre-allocated, size matching dfsGetEncodeKeySize |
[in,out] | ykey | y-index of encoding key. Array must be pre-allocated, size matching dfsGetEncodeKeySize |
[in,out] | zkey | z-index of encoding key. Array must be pre-allocated, size matching dfsGetEncodeKeySize |
m0LINK LONG m0IMEX dfsGetEncodeKeySize | ( | LPHEAD | pdfs | ) |
Gets the compression encoding key size.
See dfsGetEncodeKey for the definition of the encode key values
[in] | pdfs | Specifies a pointer to the header structure. |
m0LINK LONG m0IMEX dfsGetEqCalendarAxis | ( | LPHEAD | pdfs, |
LPCTSTR * | start_date_rtn, | ||
LPCTSTR * | start_time_rtn, | ||
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
double * | tstart_rtn, | ||
double * | tstep_rtn, | ||
LONG * | tnum_rtn, | ||
LONG * | tindex_rtn | ||
) |
Retrieves the description of an equidistant calendar axis from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | start_date_rtn | Returns the date for the first time step. The string is 10 characters long in the following format YYYY-MM-DD. If a NULL-pointer is specified the parameter is ignored. |
[out] | start_time_rtn | Returns the time for the first time step. The string is 8 characters long in the following format HH:MM:SS. If a NULL-pointer is specified the parameter is ignored. |
[out] | n_eum_unit_rtn | Returns the eum-tag representing the time unit, e.g eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the time unit, e.g "second" corresponds to eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | tstart_rtn | Returns the starting time of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tstep_rtn | Returns the time step of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tnum_rtn | Returns the number of time steps of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tindex_rtn | Returns the index (record number) of the first time step. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetEqTimeAxis | ( | LPHEAD | pdfs, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
double * | tstart_rtn, | ||
double * | tstep_rtn, | ||
LONG * | tnum_rtn, | ||
LONG * | tindex_rtn | ||
) |
Retrieves the description of an equidistant time axis from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | n_eum_unit_rtn | Returns the eum-tag representing the time unit, e.g eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the time unit, e.g "second" corresponds to eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | tstart_rtn | Returns the starting time of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tstep_rtn | Returns the time step of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tnum_rtn | Returns the number of time steps of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tindex_rtn | Returns the index (record number) of the first time step. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LPCTSTR m0IMEX dfsGetFileTitle | ( | LPHEAD | pdfs | ) |
Retrieves the title string of the data from the header structure.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK FileType m0IMEX dfsGetFileType | ( | LPHEAD | pdfs | ) |
Retrieves the file type of the file pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK GeoInfoType m0IMEX dfsGetGeoInfoType | ( | LPHEAD | pdfs | ) |
Retrieves the type of geographical information from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsGetGeoInfoUTMProj | ( | LPHEAD | pdfs, |
LPCTSTR * | projection_id_rtn, | ||
double * | lon0_rtn, | ||
double * | lat0_rtn, | ||
double * | orientation_rtn | ||
) |
Retrieves the geographical information for an UTM-projection. The longitude, latitude and orientation are all given in decimal degrees.
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | projection_id_rtn | Returns the id-string of the projection which refers to the UTM zone (standard or specialized) that was used originally to create the data-set. Examples of this value are "UTM-32" and "BTM" for a special Bangladesh custom made UTM-zone. If a NULL-pointer is specified the parameter is ignored. |
[out] | lon0_rtn | Returns the longitude of the origin in the reference coordinate system in decimal degrees. If a NULL-pointer is specified the parameter is ignored. |
[out] | lat0_rtn | Returns the latitude of the origin in the reference coordinate system in decimal degrees. If a NULL-pointer is specified the parameter is ignored. |
[out] | orientation_rtn | Returns the orientation of the reference coordinate system in decimal degrees. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisCurveLinearD2 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
double ** | xcoords_rtn, | ||
double ** | ycoords_rtn | ||
) |
Retrieves the relative axis description of an individually selected 2-dimensional curvelinear item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | xcoords_rtn | Returns the array containing (j + 1)*(k + 1) x-coordinates for the gridpoints. If a NULL-pointer is specified the parameter is ignored. |
[out] | ycoords_rtn | Returns the array containing (j + 1)*(k + 1) y-coordinates for the gridpoints. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisCurveLinearD3 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
LONG * | l_rtn, | ||
double ** | xcoords_rtn, | ||
double ** | ycoords_rtn, | ||
double ** | zcoords_rtn | ||
) |
Retrieves the relative axis description of an individually selected 3-dimensional curvelinear item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | l_rtn | Returns the number of gridpoints in the z-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | xcoords_rtn | Returns the array containing (j + 1)*(k + 1)*(l + 1) x-coordinates for the gridpoints. If a NULL-pointer is specified the parameter is ignored. |
[out] | ycoords_rtn | Returns the array containing (j + 1)*(k + 1)*(l + 1) y-coordinates for the gridpoints. If a NULL-pointer is specified the parameter is ignored. |
[out] | zcoords_rtn | Returns the array containing (j + 1)*(k + 1)*(l + 1) z-coordinates for the gridpoints. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisEqD0 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn | ||
) |
Retrieves the relative axis description of an individually selected 0-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisEqD1 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
float * | x0_rtn, | ||
float * | dx_rtn | ||
) |
Retrieves the relative axis description of an individually selected 1-dimensional equidistant item pointed to by item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | x0_rtn | Returns the relative offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | dx_rtn | Returns the spacing between each set of neighboring gridpoints. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisEqD2 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
float * | x0_rtn, | ||
float * | y0_rtn, | ||
float * | dx_rtn, | ||
float * | dy_rtn | ||
) |
Retrieves the relative axis description of an individually selected 2-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | x0_rtn | Returns the relative x-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | y0_rtn | Returns the relative y-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | dx_rtn | Returns the spacing between each set of neighboring gridpoints in the x-direction. If a NULL-pointer is specified the parameter is ignored. |
[out] | dy_rtn | Returns the spacing between each set of neighboring gridpoints in the y-direction. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisEqD3 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
LONG * | l_rtn, | ||
float * | x0_rtn, | ||
float * | y0_rtn, | ||
float * | z0_rtn, | ||
float * | dx_rtn, | ||
float * | dy_rtn, | ||
float * | dz_rtn | ||
) |
Retrieves the relative axis description of an individually selected 3-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | l_rtn | Returns the number of gridpoints in the z-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | x0_rtn | Returns the relative x-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | y0_rtn | Returns the relative y-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | z0_rtn | Returns the relative z-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | dx_rtn | Returns the spacing between each set of neighboring gridpoints in the x-direction. If a NULL-pointer is specified the parameter is ignored. |
[out] | dy_rtn | Returns the spacing between each set of neighboring gridpoints in the y-direction. If a NULL-pointer is specified the parameter is ignored. |
[out] | dz_rtn | Returns the spacing between each set of neighboring gridpoints in the z-direction. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisEqD4 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
LONG * | l_rtn, | ||
LONG * | m_rtn, | ||
float * | x0_rtn, | ||
float * | y0_rtn, | ||
float * | z0_rtn, | ||
float * | f0_rtn, | ||
float * | dx_rtn, | ||
float * | dy_rtn, | ||
float * | dz_rtn, | ||
float * | df_rtn | ||
) |
Retrieves the relative axis description of an individually selected 4-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | l_rtn | Returns the number of gridpoints in the z-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | m_rtn | Returns the number of gridpoints in the f-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | x0_rtn | Returns the relative x-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | y0_rtn | Returns the relative y-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | z0_rtn | Returns the relative z-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | f0_rtn | Returns the relative f-offset to the origin. If a NULL-pointer is specified the parameter is ignored. |
[out] | dx_rtn | Returns the spacing between each set of neighboring gridpoints in the x-direction. If a NULL-pointer is specified the parameter is ignored. |
[out] | dy_rtn | Returns the spacing between each set of neighboring gridpoints in the y-direction. If a NULL-pointer is specified the parameter is ignored. |
[out] | dz_rtn | Returns the spacing between each set of neighboring gridpoints in the z-direction. If a NULL-pointer is specified the parameter is ignored. |
[out] | df_rtn | Returns the spacing between each set of neighboring gridpoints in the f-direction. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisNeqD1 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
Coords ** | coords_rtn | ||
) |
Retrieves the relative axis description of an individually selected 1-dimensional curvelinear item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | coords_rtn | Returns the array containing the coordinates (x, y, z) for each gridpoint. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisNeqD2 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
double ** | xcoords_rtn, | ||
double ** | ycoords_rtn | ||
) |
Retrieves the relative axis description of an individually selected 2-dimensional non equidistant but orthogonal item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | xcoords_rtn | Returns the array containing (j + 1) x-coordinates for the gridpoints along the x-axis. If a NULL-pointer is specified the parameter is ignored. |
[out] | ycoords_rtn | Returns the array containing (k + 1) y-coordinates for the gridpoints along the y-axis. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisNeqD3 | ( | LPITEM | item, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
LONG * | j_rtn, | ||
LONG * | k_rtn, | ||
LONG * | l_rtn, | ||
double ** | xcoords_rtn, | ||
double ** | ycoords_rtn, | ||
double ** | zcoords_rtn | ||
) |
Retrieves the relative axis description of an individually selected 3-dimensional non equidistant but orthogonal item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_unit_rtn | Returns the eum tag variable for the spatial axis unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the axis unit, e.g. the corresponding text for eumUmeter is "meter". If a NULL-pointer is specified the parameter is ignored. |
[out] | j_rtn | Returns the number of gridpoints in the x-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | k_rtn | Returns the number of gridpoints in the y-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | l_rtn | Returns the number of gridpoints in the z-direction for the item. If a NULL-pointer is specified the parameter is ignored. |
[out] | xcoords_rtn | Returns the array containing (j + 1) x-coordinates for the gridpoints along the x-axis. If a NULL-pointer is specified the parameter is ignored. |
[out] | ycoords_rtn | Returns the array containing (k + 1) y-coordinates for the gridpoints along the y-axis. If a NULL-pointer is specified the parameter is ignored. |
[out] | zcoords_rtn | Returns the array containing (l + 1) z-coordinates for the gridpoints along the z-axis. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemAxisOrientation | ( | LPITEM | item, |
float * | alpha_rtn, | ||
float * | phi_rtn, | ||
float * | theta_rtn | ||
) |
Retrieves the orientation of the reference coordinate system of a n-dimensional item pointed to by Item, static as well as dynamic, where 0 <= n <= 3.
[in] | item | Specifies a reference to the item geometry. |
[out] | alpha_rtn | Returns the horizontal rotation of the item relative to the geographical reference coordinate system. If a NULL-pointer is specified the parameter is ignored. |
[out] | phi_rtn | Returns the vertical rotation of the item relative to the geographical reference coordinate system. If a NULL-pointer is specified the parameter is ignored. |
[out] | theta_rtn | Returns the tilted rotation of the item relative to the geographical reference coordinate system. If a NULL-pointer is specified the parameter is ignored. |
m0LINK SpaceAxisType m0IMEX dfsGetItemAxisType | ( | LPITEM | item | ) |
Retrieves the spatial axis type of an individually selected item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetItemAxisUnitConversion | ( | LPITEM | item, |
UnitConvType * | nConvType_rtn, | ||
LONG * | nUnit_rtn | ||
) |
Gets the unit conversion for the axis of a specific item.
[in] | item | Specifies a reference to the item geometry. |
[out] | nConvType_rtn | Unit conversion type specifications for the given item |
[out] | nUnit_rtn | pointer to the eum unit code of the given item |
m0LINK ULONG m0IMEX dfsGetItemBytes | ( | LPITEM | item | ) |
Retrieves the number of bytes for an item pointed to by It.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetItemDim | ( | LPITEM | item | ) |
Retrieves the dimension of the spatial axis of an individually selected item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
m0LINK ULONG m0IMEX dfsGetItemElements | ( | LPITEM | item | ) |
Retrieves the number of elements for an item pointed to by It.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetItemGeometryType | ( | LPITEM | item | ) |
Retrieves the type of geometry type, according to the dimension of the spatial axis of an individually selected item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetItemGeometryUnit | ( | LPITEM | item | ) |
Retrieves the unit type of the spatial dimension of an individually selected item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetItemInfo | ( | LPITEM | item, |
LONG * | n_eum_item_type_rtn, | ||
LPCTSTR * | t_eum_item_type_rtn, | ||
LPCTSTR * | name_rtn, | ||
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
SimpleType * | data_type_rtn | ||
) |
Retrieves the item information that are common for all items both dynamic and static and 0- to 3-dimensional as well as static and curvelinear items pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_eum_item_type_rtn | Returns the eum item-tag, e.g. eumIWaterLevel. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_item_type_rtn | Returns the corresponding textual description of the eum-item, e.g "Water level" corresponds to eumIWaterLevel. If a NULL-pointer is specified the parameter is ignored. |
[out] | name_rtn | Returns a pointer to the text string containing the name of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | n_eum_unit_rtn | Returns the eum-tag representing the item unit, e.g. eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the item unit, e.g "meter" corresponds to eumUmeter. If a NULL-pointer is specified the parameter is ignored. |
[out] | data_type_rtn | Returns the simple data type of the item. Possible return values are UFS_FLOAT - indicating that the data of the item is stored in float format, UFS_DOUBLE - indicating that the data of the item is stored in double format, UFS_CHAR - indicating that the data of the item is stored in char format, UFS_INT - indicating that the data of the item is stored in int format, UFS_UNSIGNED
|
m0LINK LONG m0IMEX dfsGetItemRefCoords | ( | LPITEM | item, |
float * | x_rtn, | ||
float * | y_rtn, | ||
float * | z_rtn | ||
) |
Retrieves the origin of the reference coordinate system of a n-dimensional item pointed to by Item, static as well as dynamic, where 0 <= n <= 3.
[in] | item | Specifies a reference to the item geometry. |
[out] | x_rtn | Returns the x-coordinate in the geographical reference coordinate system. If a NULL-pointer is specified the parameter is ignored. |
[out] | y_rtn | Returns the y-coordinate in the geographical reference coordinate system. If a NULL-pointer is specified the parameter is ignored. |
[out] | z_rtn | Returns the z-coordinate in the geographical reference coordinate system. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemStats | ( | LPHEAD | pdfs, |
LONG | item_no, | ||
LONG | cOff, | ||
double * | min_rtn, | ||
double * | max_rtn, | ||
double * | mean_rtn, | ||
double * | st_dev_rtn, | ||
double * | auto_corr_rtn, | ||
LONG * | no_of_values_rtn, | ||
LONG * | no_of_del_values_rtn, | ||
LONG * | no_of_pairs_rtn | ||
) |
Retrieves the statistical description of an individually selected gridpoint of an individually selected n-dimensional item specified by item_no from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item_no | Specifies the number of the selected dynamic item. |
[in] | cOff | Specifies the 1-dimensional index of the selected gridpoint. For a 0-dimensional item, cOff must be 0. For a 1-dimensional item the limits are 0 <= cOff < j, for a 2-dimensional item the limits are 0 <= cOff < j*k and for a 3-dimensional item the limits are 0 <= cOff < j*k*l. |
[out] | min_rtn | Returns the minimum value of the selected gridpoint of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | max_rtn | Returns the maximum value of the selected gridpoint of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | mean_rtn | Returns the mean value of the selected gridpoint of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | st_dev_rtn | Returns the standard deviation of the selected gridpoint of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | auto_corr_rtn | Returns the auto correlation of the selected gridpoint of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | no_of_values_rtn | Returns the accumulated number of non delete values. If a NULL-pointer is specified the parameter is ignored. |
[out] | no_of_del_values_rtn | Returns the accumulated number of delete values. If a NULL-pointer is specified the parameter is ignored. |
[out] | no_of_pairs_rtn | Returns the accumulated number of pairs of non delete values, that is two adjacent non delete values. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetItemStatsGlobal | ( | LPITEM | item, |
double * | min_rtn, | ||
double * | max_rtn, | ||
LONG * | no_of_del_values_rtn | ||
) |
Retrieves the global statistical values of an individually selected item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | min_rtn | Returns the global minimum value of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | max_rtn | Returns the global maximum value of the selected item. If a NULL-pointer is specified the parameter is ignored. |
[out] | no_of_del_values_rtn | Returns the accumulated number of delete values. If a NULL-pointer is specified the parameter is ignored. |
m0LINK StatType m0IMEX dfsGetItemStatsType | ( | LPHEAD | pdfs | ) |
retrieves the type of statistical values stored in the header part of the file pointed to by pdfs
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsGetItemUnitConversion | ( | LPITEM | item, |
UnitConvType * | nConvType_rtn, | ||
LONG * | nUnit_rtn | ||
) |
Gets the unit conversion for a specific item.
[in] | item | Specifies a reference to the item geometry. |
[out] | nConvType_rtn | Unit conversion type specifications for the given item |
[out] | nUnit_rtn | pointer to the eum unit code of the given item |
m0LINK LONG m0IMEX dfsGetItemValueType | ( | LPITEM | item, |
DataValueType * | value_type | ||
) |
Gets the Data value type of the specified item.
[in] | item | Specifies a reference to the item geometry. |
[out] | value_type | pointer to the time series value type of the referred item. |
m0LINK ULONG m0IMEX dfsGetItemXSize | ( | LPITEM | item | ) |
Retrieves the number of elements in the X axis, for an item pointed to by Item, in rectangular grids of 0, 1, 2, 3, and 4 dimensions.
The idea is that the function retrieves the number of stored grid points e.g. wetpoints in the X axis only.
[in] | item | Specifies a reference to the item geometry. |
m0LINK ULONG m0IMEX dfsGetItemXYSize | ( | LPITEM | item | ) |
Retrieves the number of horisontal elements, ie. in the plane X-Y for an item pointed to by Item, in rectangular grids of 0, 1, 2, 3, and 4 dimensions.
The idea is that the function retrieves the number of stored grid points e.g. wetpoints in the horisontal plane.
[in] | item | Specifies a reference to the item geometry. |
m0LINK ULONG m0IMEX dfsGetItemXYZSize | ( | LPITEM | item | ) |
Retrieves the number of actually used elements for an item pointed to by Item, in rectangular grids of 0, 1, 2, 3, and 4 dimensions.
The idea is that the function retrieves the number of stored grid points e.g. wetpoints.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetNeqCalendarAxis | ( | LPHEAD | pdfs, |
LPCTSTR * | start_date_rtn, | ||
LPCTSTR * | start_time_rtn, | ||
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
double * | tstart_rtn, | ||
double * | tspan_rtn, | ||
LONG * | tnum_rtn, | ||
LONG * | tindex_rtn | ||
) |
Retrieves the description of a non equidistant time axis from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | start_date_rtn | Returns the date for the first time step. The string is 10 characters long in the following format YYYY-MM-DD. If a NULL-pointer is specified the parameter is ignored. |
[out] | start_time_rtn | Returns the time for the first time step. The string is 8 characters long in the following format HH:MM:SS. If a NULL-pointer is specified the parameter is ignored. |
[out] | n_eum_unit_rtn | Returns the eum-tag representing the time unit, e.g eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the time unit, e.g "second" corresponds to eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | tstart_rtn | Returns the starting time of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tspan_rtn | Returns the time span (tend - tstart) of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tnum_rtn | Returns the number of time steps of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tindex_rtn | Returns the index (record number) of the first time step. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsGetNeqTimeAxis | ( | LPHEAD | pdfs, |
LONG * | n_eum_unit_rtn, | ||
LPCTSTR * | t_eum_unit_rtn, | ||
double * | tstart_rtn, | ||
double * | tspan_rtn, | ||
LONG * | tnum_rtn, | ||
LONG * | tindex_rtn | ||
) |
Retrieves the description of a non equidistant time axis from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | n_eum_unit_rtn | Returns the eum-tag representing the time unit, e.g eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | t_eum_unit_rtn | Returns the corresponding textual description of the time unit, e.g "second" corresponds to eumUsec. If a NULL-pointer is specified the parameter is ignored. |
[out] | tstart_rtn | Returns the starting time of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tspan_rtn | Returns the time span (tend - tstart) of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tnum_rtn | Returns the number of time steps of the data set. If a NULL-pointer is specified the parameter is ignored. |
[out] | tindex_rtn | Returns the index (record number) of the first time step. If a NULL-pointer is specified the parameter is ignored. |
m0LINK ULONG m0IMEX dfsGetNoAssocStatic | ( | LPHEAD | pdfs, |
LONG | item_no | ||
) |
Retrieves the number of static items associated with the dynamic item specified by item_no.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item_no | Specifies the dynamic item number |
m0LINK LONG m0IMEX dfsGetNoOfItems | ( | LPHEAD | pdfs | ) |
Returns the number of dynamic items defined in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK TimeAxisType m0IMEX dfsGetTimeAxisType | ( | LPHEAD | pdfs | ) |
Retrieves the time axis type of the data set from the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK ULONG m0IMEX dfsGetUsedItemBytes | ( | LPITEM | item | ) |
Retrieves the number of packed bytes for an item pointed to by It.
[in] | item | Specifies a reference to the item geometry. |
m0LINK ULONG m0IMEX dfsGetUsedItemElements | ( | LPITEM | item | ) |
Retrieves the number of actually used elements for an item pointed to by Item.
The idea is that the function retrieves the number of stored grid points e.g. wetpoints.
[in] | item | Specifies a reference to the item geometry. |
m0LINK LONG m0IMEX dfsGetVersionCurrent | ( | ) |
Retrieves the version number of the ufs-library that is currently being used.
Retrieves the corresponding version number of the ufs-library that was used to originally create the a file.
m0LINK LONG m0IMEX dfsHeaderCreate | ( | FileType | file_type, |
LPCTSTR | title, | ||
LPCTSTR | apptitle, | ||
LONG | appverno, | ||
LONG | no_of_items, | ||
StatType | stat_type, | ||
LPHEAD * | pdfs_rtn | ||
) |
Creates the appropriate data structures for the header associated with a file.
This includes dynamic allocation of the memory needed for storing the text strings and the specified number of items.
[in] | file_type | Specifies the storage type for the axis, when the file is saved. file_type can only be set calling dfsHeaderCreate. The valid values are:
|
[in] | title | Specifies a pointer to the title text string. |
[in] | apptitle | Specifies a pointer to the application title text string. |
[in] | appverno | Specifies the version number of the application. The version number is a signed integer. |
[in] | no_of_items | Specifies the number of items. |
[in] | stat_type | Specifies the type af statistical value description used in the system. One of |
[in] | pdfs_rtn | Returns a reference LPHEAD to the header information of the file. If an error occurs during execution of the function a NULL-reference is returned. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsHeaderDestroy | ( | LPHEAD * | pdfs_rtn | ) |
Frees the appropriate data structures for the header associated with a file.
The function is complementary to IdfsHeaderCreate.
[in,out] | pdfs_rtn | Specifies a pointer to the reference to the header structure. After freeing the pointer is set to NULL. |
m0LINK void m0IMEX dfsInitSystem | ( | ) |
Initializes the entire dfs system.
It should in general be called before any other dfs-function is called.
m0LINK LONG m0IMEX dfsIsFileCompressed | ( | LPHEAD | pdfs | ) |
Returns flag indicating if file is compressed.
See dfsGetEncodeKey for the definition of compression and the encode key values
[in] | pdfs | Specifies a pointer to the header structure. |
m0LINK LONG m0IMEX dfsIsItemCompressed | ( | LPITEM | item, |
LONG * | n_rec_size_rtn | ||
) |
Determines whether the selected item is compressed in a MIKE 3 or a MIKE 21 compressed file. Item.
[in] | item | Specifies a reference to the item geometry. |
[out] | n_rec_size_rtn | pointer to the LONG value specifying the type of compression of the item. |
m0LINK LPITEM m0IMEX dfsItemD | ( | LPHEAD | pdfs, |
LONG | item_no | ||
) |
Maps the item number item_no for the header structure pointed to by pdfs to a direct reference to the geometrical description of a dynamic item.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item_no | Specifies the item number. Note that item_no = 1 for the first item. |
m0LINK void m0IMEX dfsItemEnableCompression | ( | LPHEAD | pdfs | ) |
Flags the header information structure of a file to enable compression of the file.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LPITEM m0IMEX dfsItemS | ( | LPVECTOR | pvec | ) |
Maps a static vector to a direct reference to the geometrical description of the item (static and dynamic items have common germetrical description).
[in] | pvec | Specifies a reference to the structure of a static vector. |
m0LINK LONG m0IMEX dfsParamModifyTimes | ( | LPHEAD | pdfs, |
BOOL | doModify | ||
) |
Sets the parameter deciding whether times stored in the dfs should be modified. Default is true.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | doModify | flag telling whether to modify or not. |
m0LINK LONG m0IMEX dfsReadItemTimeStep | ( | LPHEAD | pdfs, |
LPFILE | fp, | ||
double * | time_rtn, | ||
void * | dataptr_rtn | ||
) |
Reads the time step of the next item in the file.
If the time axis is non equidistant, the actual time label is read as well and returned in time_rtn, otherwise the time step number is returned. The function call only succeeds if the storage type of the file is F_EQTIME_FIXEDSPACE_ALLITEMS or F_NEQTIME_FIXEDSPACE_ALLITEMS.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a reference to the file. |
[out] | time_rtn | Returns the actual time label of the time step if the file is stored with non equidistant time axis,otherwise the time step number is returned. If a NULL-pointer is specified the parameter is ignored. |
[in,out] | dataptr_rtn | Array containing the time step values of the item. Must be pre-allocated. |
m0LINK LONG m0IMEX dfsSetAppTitle | ( | LPHEAD | pdfs, |
LPCTSTR | apptitle | ||
) |
Copies the string from the apptitle-text string to a corresponding field in the header structure pointed to by pdfs. dfsSetAppTitle automatically allocates sufficiently memory for storing strings of any length.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | apptitle | string that specifies the title of the application |
m0LINK LONG m0IMEX dfsSetAppVersionNo | ( | LPHEAD | pdfs, |
LONG | appverno | ||
) |
Copies the application version number from the appverno to a corresponding field in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | appverno | Specifies the application version number. |
m0LINK LONG m0IMEX dfsSetAssocStatic | ( | LPHEAD | pdfs, |
LONG | item_no, | ||
LONG | staItNo | ||
) |
Associates a static item specified by staItNo with a dynamic item specified by item_no (establishes a link between the items).
It is only possible to set associated static items to a new file. For an existing file it is invalid to call this method.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item_no | Specifies the number of the dynamic item. |
[in] | staItNo | Specifies the number of the static item. |
m0LINK LONG m0IMEX dfsSetDataType | ( | LPHEAD | pdfs, |
LONG | data_type | ||
) |
Sets the tag-variable defining the type of data pointed to by pdfs..
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | data_type | Specifies the tag-variable defining the type of data. |
m0LINK LONG m0IMEX dfsSetDeleteValByte | ( | LPHEAD | pdfs, |
char | cdel | ||
) |
Copies the char-delete value from cdel to a corresponding field in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | cdel | Specifies the char-delete value. |
m0LINK LONG m0IMEX dfsSetDeleteValDouble | ( | LPHEAD | pdfs, |
double | ddel | ||
) |
Copies the double-delete value from ddel to a corresponding field in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | ddel | Specifies the double-delete value. |
m0LINK LONG m0IMEX dfsSetDeleteValFloat | ( | LPHEAD | pdfs, |
float | fdel | ||
) |
Copies the float-delete value from fdel to a corresponding field in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fdel | Specifies the float-delete value. |
m0LINK LONG m0IMEX dfsSetDeleteValInt | ( | LPHEAD | pdfs, |
LONG | idel | ||
) |
Copies the LONG-delete value from idel to a corresponding field in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | idel | Specifies the LONG-delete value. |
m0LINK LONG m0IMEX dfsSetDeleteValUnsignedInt | ( | LPHEAD | pdfs, |
ULONG | udel | ||
) |
Copies the ULONG-delete value from udel to a corresponding field in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | udel | Specifies the ULONG-delete value. |
m0LINK LONG m0IMEX dfsSetEncodeKey | ( | LPHEAD | pdfs, |
int * | xkey, | ||
int * | ykey, | ||
int * | zkey, | ||
int | nRecordSize | ||
) |
Sets the encoding key for compressing the dfs file.
See dfsGetEncodeKey for the definition of the encode key values
Compression is only supported when all dynamic items are of type float.
All dynamic items must have a size that is compatible with the encode key values, i.e.,
[in] | pdfs | Specifies a pointer to the header structure. |
[in] | xkey | x-index of encoding key |
[in] | ykey | y-index of encoding key |
[in] | zkey | z-index of encoding key |
m0LINK LONG m0IMEX dfsSetEqCalendarAxis | ( | LPHEAD | pdfs, |
LPCTSTR | start_date, | ||
LPCTSTR | start_time, | ||
LONG | n_eum_unit, | ||
double | tstart, | ||
double | tstep, | ||
LONG | tindex | ||
) |
Copies the description of an equidistant calendar axis to the corresponding fields in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | start_date | Specifies the date for the first time step. The string must be 10 characters long in the following format YYYY-MM-DD |
[in] | start_time | Specifies the time for the first time step. The string must be 8 characters long in the following format HH:MM:SS |
[in] | n_eum_unit | Specifies the eum-tag representing a time unit, e.g eumUhour. |
[in] | tstart | Specifies the starting time of the data set. |
[in] | tstep | Specifies the time step of the data set. |
[in] | tindex | Specifies the index (record number) of the first time step. |
m0LINK LONG m0IMEX dfsSetEqTimeAxis | ( | LPHEAD | pdfs, |
LONG | n_eum_unit, | ||
double | tstart, | ||
double | tstep, | ||
LONG | tindex | ||
) |
Copies the description of an equidistant time axis to the corresponding fields in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | n_eum_unit | Specifies the eum-tag representing a time unit, e.g eumUhour. |
[in] | tstart | Specifies the starting time of the data set. |
[in] | tstep | Specifies the time step of the data set. |
[in] | tindex | Specifies the index (record number) of the first time step. |
m0LINK LONG m0IMEX dfsSetFileTitle | ( | LPHEAD | pdfs, |
LPCTSTR | title | ||
) |
Copies the string from the title-text string to a corresponding field in the header structure pointed to by pdfs. dfsSetFileTitle automatically allocates sufficiently memory for storing strings of any length.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | title | string that specifies title of the application |
m0LINK LONG m0IMEX dfsSetGeoInfoUndefined | ( | LPHEAD | pdfs | ) |
Sets the type of projection to be undefined. If no geographical information is available or the projection type is unknown, this call should be used.
[in] | pdfs | Specifies a reference to the header information structure. |
m0LINK LONG m0IMEX dfsSetGeoInfoUTMProj | ( | LPHEAD | pdfs, |
LPCTSTR | projection_id, | ||
double | lon0, | ||
double | lat0, | ||
double | orientation | ||
) |
Sets the type of projection to be UTM-projection, sets the zone and sets the longitude, latitude and orientation of the reference coordinate system.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | projection_id | Specifies the id-string of the projection which refers to the UTM zone (standard or specialized) that was used originally to create the data-set. Examples of this value are "UTM-32" and "BTM" for a special Bangladesh custom made UTM-zone. |
[in] | lon0 | Specifies the longitude of the origin in the reference coordinate system in decimal degrees. |
[in] | lat0 | Specifies the latitude of the origin in the reference coordinate system in decimal degrees. |
[in] | orientation | Specifies the orientation of the reference coordinate system in decimal degrees. |
m0LINK LONG m0IMEX dfsSetItemAxisCurveLinearD2 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
double * | xcoords, | ||
double * | ycoords, | ||
BOOL | coords_copy | ||
) |
Sets the relative axis description of an individually selected 2-dimensional curvelinear item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | xcoords | Specifies the array containing (j + 1)*(k + 1) x-coordinates for the gridpoints. |
[in] | ycoords | Specifies the array containing (j + 1)*(k + 1) y-coordinates for the gridpoints. |
[in] | coords_copy | Specifies whether the xcoords-array and the ycoords-array should be copied to system allocated arrays or used directly by just copying the pointer. If coords_copy is FALSE (0) only the pointer will be copied, otherwise (TRUE) the entire xcoords-array and ycoords-array will be copied to system allocated arrays. |
m0LINK LONG m0IMEX dfsSetItemAxisCurveLinearD3 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
LONG | l, | ||
double * | xcoords, | ||
double * | ycoords, | ||
double * | zcoords, | ||
BOOL | coords_copy | ||
) |
Sets the relative axis description of an individually selected 3-dimensional curvelinear item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | l | Specifies the number of gridpoints in the z-direction for the item. |
[in] | xcoords | Specifies the array containing (j + 1)*(k + 1)*(l + 1) x-coordinates for the gridpoints. |
[in] | ycoords | Specifies the array containing (j + 1)*(k + 1)*(l + 1) y-coordinates for the gridpoints. |
[in] | zcoords | Specifies the array containing (j + 1)*(k + 1)*(l + 1) z-coordinates for the gridpoints. |
[in] | coords_copy | Specifies whether the xcoords-array, the ycoords-array and the the zcoords-array should be copied to system allocated arrays or used directly by just copying the pointer. If coords_copy is FALSE (0) only the pointer will be copied, otherwise (TRUE) the entire xcoords-array, ycoords-array and zcoords-array will be copied to system allocated arrays. |
m0LINK LONG m0IMEX dfsSetItemAxisEqD0 | ( | LPITEM | item, |
LONG | n_eum_unit | ||
) |
Sets the relative axis description of an individually selected 0-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
m0LINK LONG m0IMEX dfsSetItemAxisEqD1 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
float | x0, | ||
float | dx | ||
) |
Sets the relative axis description of an individually selected 1-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints for the item. |
[in] | x0 | Specifies the relative offset to the origin. |
[in] | dx | Specifies the spacing between each set of neighboring gridpoints. |
m0LINK LONG m0IMEX dfsSetItemAxisEqD2 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
float | x0, | ||
float | y0, | ||
float | dx, | ||
float | dy | ||
) |
Sets the relative axis description of an individually selected 2-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | x0 | Specifies the relative x-offset to the origin. |
[in] | y0 | Specifies the relative y-offset to the origin. |
[in] | dx | Specifies the spacing between each set of neighboring gridpoints in the x-direction. |
[in] | dy | Specifies the spacing between each set of neighboring gridpoints in the y-direction. |
m0LINK LONG m0IMEX dfsSetItemAxisEqD3 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
LONG | l, | ||
float | x0, | ||
float | y0, | ||
float | z0, | ||
float | dx, | ||
float | dy, | ||
float | dz | ||
) |
Sets the relative axis description of an individually selected 3-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | l | Specifies the number of gridpoints in the z-direction for the item. |
[in] | x0 | Specifies the relative x-offset to the origin. |
[in] | y0 | Specifies the relative y-offset to the origin. |
[in] | z0 | Specifies the relative z-offset to the origin. |
[in] | dx | Specifies the spacing between each set of neighboring gridpoints in the x-direction. |
[in] | dy | Specifies the spacing between each set of neighboring gridpoints in the y-direction. |
[in] | dz | Specifies the spacing between each set of neighboring gridpoints in the z-direction. |
m0LINK LONG m0IMEX dfsSetItemAxisEqD4 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
LONG | l, | ||
LONG | m, | ||
float | x0, | ||
float | y0, | ||
float | z0, | ||
float | f0, | ||
float | dx, | ||
float | dy, | ||
float | dz, | ||
float | df | ||
) |
Sets the relative axis description of an individually selected 4-dimensional equidistant item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | l | Specifies the number of gridpoints in the z-direction for the item. |
[in] | m | Specifies the number of gridpoints in the f-direction for the item. |
[in] | x0 | Specifies the relative x-offset to the origin. |
[in] | y0 | Specifies the relative y-offset to the origin. |
[in] | z0 | Specifies the relative z-offset to the origin. |
[in] | f0 | Specifies the relative f-offset to the origin. |
[in] | dx | Specifies the spacing between each set of neighboring gridpoints in the x-direction. |
[in] | dy | Specifies the spacing between each set of neighboring gridpoints in the y-direction. |
[in] | dz | Specifies the spacing between each set of neighboring gridpoints in the z-direction. |
[in] | df | Specifies the spacing between each set of neighboring gridpoints in the f-direction. |
m0LINK LONG m0IMEX dfsSetItemAxisNeqD1 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
Coords * | coords, | ||
BOOL | coords_copy | ||
) |
Sets the relative axis description of an individually selected 1-dimensional curvelinear item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints for the item. |
[in] | coords | Specifies the array containing the coordinates (x, y, z) for each gridpoint. |
[in] | coords_copy | Specifies whether the coords-array should be copied to a system allocated array or used directly by just copying the pointer. If coords_copy is FALSE (0) only the pointer will be copied, otherwise (TRUE) the entire coords-array will be copied to a system allocated array. |
m0LINK LONG m0IMEX dfsSetItemAxisNeqD2 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
double * | xcoords, | ||
double * | ycoords, | ||
BOOL | coords_copy | ||
) |
Sets the relative axis description of an individually selected 2-dimensional non equidistant but orthogonal item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | xcoords | Specifies the array containing (j + 1) x-coordinates for the gridpoints along the x-axis. |
[in] | ycoords | Specifies the array containing (k + 1) y-coordinates for the gridpoints along the y-axis. |
[in] | coords_copy | Specifies whether the xcoords-array and the ycoords-array should be copied to system allocated arrays or used directly by just copying the pointer. If coords_copy is FALSE (0) only the pointer will be copied, otherwise (TRUE) the entire xcoords-array and ycoords-array will be copied to system allocated arrays. |
m0LINK LONG m0IMEX dfsSetItemAxisNeqD3 | ( | LPITEM | item, |
LONG | n_eum_unit, | ||
LONG | j, | ||
LONG | k, | ||
LONG | l, | ||
double * | xcoords, | ||
double * | ycoords, | ||
double * | zcoords, | ||
BOOL | coords_copy | ||
) |
Sets the relative axis description of an individually selected 3-dimensional non equidistant but orthogonal item pointed to by Item.
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_unit | Specifies the eum tag variable for the spatial axis unit, e.g. eumUmeter. |
[in] | j | Specifies the number of gridpoints in the x-direction for the item. |
[in] | k | Specifies the number of gridpoints in the y-direction for the item. |
[in] | l | Specifies the number of gridpoints in the z-direction for the item. |
[in] | xcoords | Specifies the array containing (j + 1) x-coordinates for the gridpoints along the x-axis. |
[in] | ycoords | Specifies the array containing (k + 1) y-coordinates for the gridpoints along the y-axis. |
[in] | zcoords | Specifies the array containing (l + 1) z-coordinates for the gridpoints along the z-axis. |
[in] | coords_copy | Specifies whether the xcoords-array, the ycoords-array and the the zcoords-array should be copied to system allocated arrays or used directly by just copying the pointer. If coords_copy is FALSE (0) only the pointer will be copied, otherwise (TRUE) the entire xcoords-array, ycoords-array and zcoords-array will be copied to system allocated arrays. |
m0LINK LONG m0IMEX dfsSetItemAxisOrientation | ( | LPITEM | item, |
float | alpha, | ||
float | phi, | ||
float | theta | ||
) |
Sets the orientation of the reference coordinate system of a n-dimensional item pointed to by Item, static as well as dynamic, where 0 <= n <= 3.
[in] | item | Specifies a reference to the item geometry. |
[in] | alpha | Specifies the horizontal rotation of the item relative to the geographical reference coordinate system. |
[in] | phi | Specifies the vertical rotation of the item relative to the geographical reference coordinate system. |
[in] | theta | Specifies the tilted rotation of the item relative to the geographical reference coordinate system. |
m0LINK LONG m0IMEX dfsSetItemAxisUnitConversion | ( | LPITEM | item, |
UnitConvType | nConvType, | ||
LONG | nUnit | ||
) |
Sets the unit conversion for the axis of a specific item.
The default option for an item is that no conversion is performed. If it's set to anything else automatic conversion is performed.
[in] | item | Specifies a reference to the item geometry. |
[in] | nConvType | Unit conversion type specifications for the given item |
[in] | nUnit | eum unit code of the given item |
m0LINK LONG m0IMEX dfsSetItemInfo | ( | LPHEAD | pdfs, |
LPITEM | item, | ||
LONG | n_eum_item_type, | ||
LPCTSTR | name, | ||
LONG | n_eum_unit, | ||
SimpleType | data_type | ||
) |
Copies the common item information to the item pointed to by Item.
This must be called as the first method when configuring a new item in a new file, i.e. before setting spatial axis. To update the information of an item in an existing file, see dfsUpdateItemInfo
[in] | pdfs | Specifies a reference to the header information structure. |
[out] | item | Specifies a reference to the item geometry. |
[out] | n_eum_item_type | Specifies the eum tag variable defining the type of item, e.g. eumIWaterLevel. |
[out] | name | Specifies a pointer to the text string containing the name of the selected item. |
[out] | n_eum_unit | Specifies the eum-tag representing the item unit, e.g. for eumIWaterLevel it could be eumUmeter. |
[out] | data_type | Specifies the simple data type of the item. Accepted values are UFS_FLOAT - indicating that the data of the item is stored in float format, UFS_DOUBLE - indicating that the data of the item is stored in double format, UFS_CHAR - indicating that the data of the item is stored in char format, UFS_INT - indicating that the data of the item is stored in int format, UFS_UNSIGNED
|
m0LINK LONG m0IMEX dfsSetItemRefCoords | ( | LPITEM | item, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Sets the origin of the reference coordinate system of a n-dimensional item pointed to by Item, either static or dynamic, where 0 <= n <= 3.
[in] | item | Specifies a reference to the item geometry. |
[in] | x | Specifies the x-coordinate in the geographical reference coordinate system. |
[in] | y | Specifies the y-coordinate in the geographical reference coordinate system. |
[in] | z | Specifies the z-coordinate in the geographical reference coordinate system. |
m0LINK LONG m0IMEX dfsSetItemUnitConversion | ( | LPITEM | item, |
UnitConvType | nConvType, | ||
LONG | nUnit | ||
) |
Sets the unit conversion for a specific item.
The default option for an item is that no conversion is performed. If it's set to anything else automatic conversion is performed.
[in] | item | Specifies a reference to the item geometry. |
[in] | nConvType | Unit conversion type specifications for the given item |
[in] | nUnit | eum unit code of the given item |
m0LINK LONG m0IMEX dfsSetItemValueType | ( | LPITEM | item, |
DataValueType | value_type | ||
) |
Sets the data value type for the specified item.
[in] | item | Specifies a reference to the item geometry. |
[in] | value_type | pointer to the time series value type of the referred item. |
m0LINK LONG m0IMEX dfsSetNeqCalendarAxis | ( | LPHEAD | pdfs, |
LPCTSTR | start_date, | ||
LPCTSTR | start_time, | ||
LONG | n_eum_unit, | ||
double | tstart, | ||
LONG | tindex | ||
) |
Copies the description of a non equidistant calendar axis to the corresponding fields in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | start_date | Specifies the date for the first time step. The string must be 10 characters long in the following format YYYY-MM-DD |
[in] | start_time | Specifies the time for the first time step. The string must be 8 characters long in the following format HH:MM:SS |
[in] | n_eum_unit | Specifies the eum-tag representing a time unit, e.g eumUhour. |
[in] | tstart | Specifies the starting time of the data set. Currently ignored. |
[in] | tindex | Specifies the index (record number) of the first time step. |
m0LINK LONG m0IMEX dfsSetNeqTimeAxis | ( | LPHEAD | pdfs, |
LONG | n_eum_unit, | ||
double | tstart, | ||
LONG | tindex | ||
) |
Copies the description of a non equidistant time axis to the corresponding fields in the header structure pointed to by pdfs.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | n_eum_unit | Specifies the eum-tag representing a time unit, e.g eumUhour. |
[in] | tstart | Specifies the starting time of the data set. Currently ignored |
[in] | tindex | Specifies the index (record number) of the first time step. |
m0LINK LONG m0IMEX dfsSetNumberOfTimeSteps | ( | LPHEAD | pdfs, |
LONG | n_number_of_time_steps | ||
) |
Sets explicitly the number of time steps in the header.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | n_number_of_time_steps | Specifies the number of time steps |
m0LINK LONG m0IMEX dfsSetTimeStartEnd | ( | LPHEAD | pdfs, |
double | startTimeOffset, | ||
double | timeSpan | ||
) |
Sets explicitly the time of the first data set and the time span of the data set in the header.
[in] | pdfs | Specifies a pointer to the header structure |
[in] | startTimeOffset | Specifies the time of the first data set in the file. This is usually zero. |
[in] | timeSpan | Specifies the timespan of data in the file |
m0LINK LONG m0IMEX dfsSkipItem | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Skips the time step of the next item in the file.
If the time axis is non equidistant, the actual time label is skipped as well. If the file contains timevarying curvelinear items, the time label, the axis definition and the actual data for the item is skipped. The file pointer fp is placed at the beginning of the next item time step in the file by directly jumping in the file without reading the data. The function call succeeds for any type of file.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsSkipTimeStep | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Skips the entire time step containing all items stored consecutively in the time step.
If the time axis is non equidistant, the actual time label is skipped as well. The file pointer fp is placed at the beginning of the first item in the next time step in the file by directly jumping in the file without reading the data. The function call only succeeds if the storage type of the file is F_EQTIME_FIXEDSPACE_ALLITEMS, F_EQTIME_TVARSPACE_ALLITEMS or F_NEQTIME_FIXEDSPACE_ALLITEMS that is a file where each time step includes all items defined in the file.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsStaticCreate | ( | LPVECTOR * | pvec_rtn | ) |
Creates the appropriate data structures for a new static vector.
This includes dynamic allocation of the memory needed for storing the text strings and the specified axis data.
[out] | pvec_rtn | Returns a pointer to the vector structure. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsStaticDestroy | ( | LPVECTOR * | pvec_rtn | ) |
Frees the appropriate data structures for the static vector specified by pvec_rtn. The function is complementary to dfsStaticCreate.
[out] | pvec_rtn | Specifies a pointer to the vector structure and returns a NULL-pointer. |
m0LINK LONG m0IMEX dfsStaticGetData | ( | LPVECTOR | pvec, |
void * | data | ||
) |
Retrieves the actual data from the static vector pointed to by pvec and copies them to the array specified by data.
[in] | pvec | Specifies a pointer to the vector structure. |
[in,out] | data | Specifies a preallocated data array, that the data is copied to. Note that the array must have a size corresponding to the axis description and the type used for storing the data. |
m0LINK LPVECTOR m0IMEX dfsStaticRead | ( | LPFILE | fp, |
LONG * | fioError | ||
) |
Reads a static vector from the file pointed to by fp. dfsStaticRead allocates the memory necessary to contain a complete description of a static vector.
This includes both geometry and the data itself. If other data (dynamic data) has been read from the file, it is required to reposition the file pointer to the start of the static data by calling dfsFindBlockStatic before calling this.
[in] | fp | Specifies a pointer to the file. |
[out] | fioError | Returns a LONG that indicates possible errors that occurred during the execution of the call. Possible return values are F_NO_ERROR ( = 0), indicating successful execution or a nonzero value ( != 0) of type FioErrors specifying the exact type of error. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsStaticSetHeader | ( | LPHEAD | pdfs, |
LPITEM | item | ||
) |
Connects the header to the static item. This is required if the static item needs to be updated.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item | Specifies a reference to the item. |
m0LINK LONG m0IMEX dfsStaticSkip | ( | LPFILE | fp | ) |
Skips a static item and jumps to the next one.
[in] | fp | Specifies a pointer to the file. |
m0LINK LONG m0IMEX dfsStaticWrite | ( | LPVECTOR | pvec, |
LPFILE | fp, | ||
void * | data | ||
) |
Writes the static vector pointed to by pvec to the file pointed to by fp.
[in] | pvec | Specifies a pointer to the vector structure. |
[in] | fp | Specifies a pointer to the file. |
[in] | data | Specifies a pointer to the array containing the actual data. Make sure that the dimension of the array matches the axis description given using e.g. the call dfsSetItemAxisEqD1 or a related call. |
m0LINK LONG m0IMEX dfsStreamCreate | ( | unsigned char * | buffer, |
size_t | bufferSize, | ||
WriteBufferCallback | callback, | ||
LPHEAD | pdfs, | ||
LPFILE * | fp_rtn | ||
) |
Creates a file and writes it to stream.
It automatically writes the static header information pointed to by pdfs and then returns a pointer to the file fp_rtn. The file pointer is left at the position following the header part of the file which corresponds to the end of the file.
[in] | buffer | Pointer to buffer of a given size. |
[in] | bufferSize | Size of buffer, in bytes |
[in] | callback | Callback to write content of buffer to stream. Callback must return number of bytes written. If number of bytes written is less than expected, there is some error with the stream. |
[in] | pdfs | Specifies a pointer to the header structure. |
[out] | fp_rtn | Returns a reference to the file upon successful execution of dfsFileCreate. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsStreamRead | ( | unsigned char * | buffer, |
size_t | bufferSize, | ||
FillBufferCallback | callback, | ||
LPHEAD * | pdfs_rtn, | ||
LPFILE * | fp_rtn | ||
) |
Use buffer for reading data, and when read to end-of-buffer, the callback is used to fill the buffer with new data.
Using this buffer and callback it automatically reads the static header information and then returns a pointer to the header information pdfs_rtn and a pointer to the file fp_rtn. The file pointer is left at the position following the header part of the file. dfsStreamRead allocates the memory necessary to contain the complete header description found in the file. It is not possible to jump backwards in a stream, only forward reading is supported
[in] | buffer | Pointer to buffer of a given size. |
[in] | bufferSize | Size of buffer, in bytes |
[in] | callback | Callback to fill up buffer. Callback must return number of bytes read and copied to the buffer. If number of bytes read is less than buffer-size, end-of-stream has been found. |
[out] | pdfs_rtn | Returns a reference to the header upon successful execution of dfsFileRead. If a NULL-pointer is specified the parameter is ignored. |
[out] | fp_rtn | Returns a reference to the file upon successful execution of dfsFileRead. If a NULL-pointer is specified the parameter is ignored. |
m0LINK LONG m0IMEX dfsTruncateItemTimeStep | ( | LPHEAD | pdfs, |
LONG | item_no, | ||
LONG | ndigit, | ||
void * | dataptr | ||
) |
Truncate the item data of a dfs file to a given number of digits.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item_no | Specifies the number of the selected item. |
[in] | ndigit | Number of digit to include in the item, after applying the truncation. |
[in,out] | dataptr | array of data to be truncated. |
m0LINK LONG m0IMEX dfsUnloadPlugin | ( | LPHEAD | pdfs | ) |
Unloads a DFS plugin.
[in] | pdfs | Specifies a pointer to the header information structure. |
m0LINK LONG m0IMEX dfsUpdateGeoInfoUTMProj | ( | LPHEAD | pdfs, |
LPCTSTR | projection_id, | ||
double | lon0, | ||
double | lat0, | ||
double | orientation | ||
) |
Updates the GeoInfo projection, sets the zone and sets the longitude, latitude and orientation of the reference coordinate system for an existing file. The existing file must have a projection.
If the new projection_id string is longer than the existing one, the update will fail. If the projection_id string is shorter, the projection string in the file will be padded with spaces.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | projection_id | Specifies the id-string as a WKT string of the projection which was used originally to create the data-set. Examples of this value are "UTM-32" and "BTM" for a special Bangladesh custom made UTM-zone. |
[in] | lon0 | Specifies the longitude of the origin in the reference coordinate system in decimal degrees. |
[in] | lat0 | Specifies the latitude of the origin in the reference coordinate system in decimal degrees. |
[in] | orientation | Specifies the orientation of the reference coordinate system in decimal degrees. |
m0LINK LONG m0IMEX dfsUpdateItemInfo | ( | LPHEAD | pdfs, |
LPITEM | item, | ||
LONG | n_eum_item_type, | ||
LPCTSTR | name, | ||
LONG | n_eum_unit | ||
) |
Updates the common item information of an item of an existing file. Item is pointed to by Item.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | item | Specifies a reference to the item geometry. |
[in] | n_eum_item_type | Specifies the eum tag variable defining the type of item, e.g. eumIWaterLevel. |
[in] | name | Specifies a pointer to the text string containing the name of the selected item. The text string stored in the item will have the same length as the original string i.e., the input string is either truncated or padded with zeros. |
[in] | n_eum_unit | Specifies the eum-tag representing the item unit, e.g. for eumIWaterLevel it could be eumUmeter |
m0LINK LONG m0IMEX dfsWriteItemTimeStep | ( | LPHEAD | pdfs, |
LPFILE | fp, | ||
double | time, | ||
void * | dataptr | ||
) |
Writes the time step of the next item in the file.
If the time axis is non equidistant, the actual time label time is written as well, otherwise ignored. The function call only succeeds if the storage type of the file is F_EQTIME_FIXEDSPACE_ALLITEMS or F_NEQTIME_FIXEDSPACE_ALLITEMS.
[in] | pdfs | Specifies a reference to the header information structure. |
[in] | fp | Specifies a reference to the file. |
[in] | time | Specifies the actual time label of the time step if the file is stored with non equidistant time axis, otherwise ignored. |
[in] | dataptr | Specifies the array containing the time step values of the item. |
m0LINK LONG m0IMEX dfsWriteStartBlockDynamic | ( | LPHEAD | pdfs, |
LPFILE | fp | ||
) |
Writes a "start-of-dynamic-block" tag to the file, effectively ending the header part and the static part of the dfs file.
The method can be called only when creating new files, and only after the header has been created and (optionally) static items has been written to the file. Calling it at any other point is invalid and can corrupt the file. The "start-of-dynamic-block" tag is also written by dfsWriteItemTimeStep first time it is called for a newly created file, in case this method has not explicitly been called beforehand. In such cases this method is redundant. This method is required in order to support closing a file that has no dynamic data written to it (yet). It is recommended that this is called explicitly after creation of the header and writing of the static data and before any dfsWriteItemTimeStep call, in order to support closing down a file gracefully in case of an error between the creation of the file and the first call to dfsWriteItemTimeStep.
[in] | pdfs | Specifies a pointer to the header information structure. |
[in] | fp | Specifies a pointer to the file. |