DfsExtensions Methods |
The DfsExtensions type exposes the following members.
Name | Description | |
---|---|---|
AxisEquals |
Check whether two spatial axis equals.
| |
Clone |
Make a clone/copy of a spatial axis. Array data are copied (deep clone)
| |
CreateAllCoordinates |
Create coordinates for all data points, based on the spatial axis.
It calculates node coordinates for all nodes in the axis, i.e. the number of Coords returned may not equal the number of data values in the item. And the coordinates may be offset by half a grid cell compared to the center coordinate for the data values. | |
CreateEmptyItemData(IDfsSimpleDynamicItemInfo) |
Create an IDfsItemDataT of the correct type for the
item.
The result can be used by ReadItemTimeStep(IDfsItemData, Int32) | |
CreateEmptyItemData(IDfsFile, Int32) |
Create an IDfsItemDataT of the correct type for the
item with the given itemNumber.
The result can be used by ReadItemTimeStep(IDfsItemData, Int32) | |
CreateEmptyItemDataT(IDfsSimpleDynamicItemInfo) |
Create an IDfsItemDataT of the correct type for the
item.
The result can be used by ReadItemTimeStep(IDfsItemData, Int32) If not the item is of type {T}, an exception will be thrown. | |
CreateEmptyItemDataT(IDfsFile, Int32) |
Create an IDfsItemDataT of the correct type for the
item with the given itemNumber.
The result can be used by ReadItemTimeStep(IDfsItemData, Int32) If not the item is of type {T}, an exception will be thrown. | |
CreateEmptyItemDatas(IDfsFile) |
Create an IDfsItemDataT of the correct type for each of the
dynamic items in the file.
The result can be used by ReadItemTimeStep(IDfsItemData, Int32) | |
CreateEmptyItemDatasT(IDfsFile) |
Create an IDfsItemDataT of the provided type for each of the
dynamic items in the file.
The result can be used by ReadItemTimeStep(IDfsItemData, Int32) If not all items are of type {T}, an exception will be thrown. | |
dfsDecodeT |
Decompress the compressed array using the encoding keys
See GetEncodeKey(Int32, Int32, Int32) for details on the encoding key definition | |
dfsEncodeT |
Compress the uncompressed array using the encoding keys.
See GetEncodeKey(Int32, Int32, Int32) for details on the encoding key definition. Data outside the encoding key definitions are discarded (set to delete value). | |
EndDateTime(IDfsEqCalendarAxis) |
Get the end date time for an equidistant calendar axis.
| |
EndDateTime(IDfsNonEqCalendarAxis) |
Get the end date time for a non-equidistant calendar axis.
| |
GeometryItemType |
Get the item type of the spatial axis geometry.
| |
GetDateTimes(IDfsEqCalendarAxis) |
Return an array of DateTimes which are the times for each timestep
| |
GetDateTimes(IDfsTemporalAxis) |
Return an array of DateTimes which are the times for each timestep.
For non-equidistant axis, only the first and the last time are populated correctly. The rest are populated with MinValue. For time type axis, first time is StartTimeOffsetInSeconds(IDfsTemporalAxis) after MinValue. | |
GetRelativeSeconds |
Return an array of doubles which are the the number of seconds since the start time
for each timestep.
For non-equidistant axis, only the first and the last time are populated correctly. The rest are populated with -1 For time type axis, first time is StartTimeOffsetInSeconds(IDfsTemporalAxis) | |
IsCalendar |
Returns true if the temporal axis is a calendar axis
| |
IsEditable |
Returns true if the filemode corresponds to a file that is editable.
| |
IsEquidistant |
Returns true if the temporal axis is equidistant.
| |
MonthFraction |
Gets the fractional month value of the DateTime.
The value returned for a specific day in the month way will differ for each month, depending on the number of days in each month | |
ReShapeT(T, Int32, Int32) |
Reshape a 1D array to a 2D array of size
[xCount , yCount]
The length of the arr must match (xCount X yCount) | |
ReShapeT(T, Int32, Int32, Int32) |
Reshape a 1D array to a 3D array of size
[xCount , yCount, zCount]
The length of the arr must match (xCount X yCount X , zCount) | |
Search(IDfsFile, DateTime) |
Searches the dfs file for the time step index of a time,
and returns the zero-based time step index. The time axis of the file
must be a calendar type time axis
NOTE: For the non-equidistant time axes, the metod will read the first item in the file for a number of timesteps in random order, performing a binary search in the file data on disc. This will be slow if used many times on the same file. For the equidistant time axis, the method will calculate the time step index directly without reading data from the file. | |
Search(IDfsFile, Double) |
Searches the dfs file for the time step index of a time,
and returns the zero-based time step index.
NOTE: For the non-equidistant time axes, the metod will read the first item in the file for a number of timesteps in random order, performing a binary search in the file data on disc. This will be slow if used many times on the same file. For the equidistant time axis, the method will calculate the time step index directly without reading data from the file. | |
StartTimeOffsetInSeconds |
Return the start time offset in seconds
| |
TimeAsDateTime |
Convert the Time to a DateTime.
If the time axis is not a calender type time axis, an exception is thrown. | |
TimeInSeconds |
Convert the Time to seconds.
| |
TimeSpan |
Time span of all data in file, in unit described by TimeUnit.
The StartTimeOffset is not included in the span. The span starts at the time of the StartTimeOffset Convenience method that returns/calculates the time span consistently for all types of time axes, | |
TimeSpanAsTimeSpan |
Calculate the time span as a System.TimeSpan
| |
TimeSpanInSeconds |
Calculate the time span in seconds
| |
TimeStepInSeconds(IDfsEqCalendarAxis) |
Calculate the time step in seconds for an equidistant calendar axis
If the time axis unit can not be converted to seconds, an exception is thrown | |
TimeStepInSeconds(IDfsEqTimeAxis) |
Calculate the time step in seconds for an equidistant time axis
If the time axis unit can not be converted to seconds, an exception is thrown | |
TimeStepInSeconds(IDfsTemporalAxis) |
Calculate the time step in seconds for an equidistant temporal axis.
If the time axis is not equidistant, zero is returned. If the time axis unit can not be converted to seconds, an exception is thrown | |
ToDateTime |
Returns the relativeTime as a DateTime.
The time axis must be a calendar type axis.
| |
ToDoubleArray(Single) |
Copies the float array into a double array.
| |
ToDoubleArray(Single, Double) |
Copies the float array into a double array.
| |
ToFloatArray(Double) |
Copies the double array into a float array.
The double values are truncated and the higher precision of a double number is lost. | |
ToFloatArray(Double, Single) |
Copies the double array into a float array.
The double values are truncated and the higher precision of a double number is lost. | |
ToRelativeSeconds |
Returns the dateTime in relative seconds from the
start time of the time axis, in the unit used by the file.
The time axis must be a calendar type axis.
Note that for the equidistant axes, the first time step may be offset (see StartTimeOffset), however the time returned here is relative to the start time and not the first time step. This is matching the time returned by the read methods (Time). | |
ToRelativeTime(IDfsTemporalAxis, DateTime) |
Returns the dateTime in relative time from the
start time of the time axis, in the unit used by the file.
The time axis must be a calendar type
axis.
Note that for the equidistant axes, the first time step may be offset (see StartTimeOffset), however the time returned here is relative to the start time and not the first time step. This is matching the time returned by the read methods (Time). | |
ToRelativeTime(IDfsTemporalAxis, Double) |
Converts a time value in seconds to a time value in the unit
of the temporal axis.
| |
ToSeconds |
Converts a time value in the unit of the temporal axis
(TimeUnit) to
a time value in seconds.
| |
ToSecondsFactor(eumUnit) |
Returns a factor for converting from a time value in the
specified time unit to a time value in seconds.
For month and year time units, the factor not uniquely defined, and may not return the value you want to use. | |
ToSecondsFactor(IDfsTemporalAxis) |
Returns a factor for converting from a time value in the
specified time unit to a time value in seconds.
For month and year time units, the factor is not uniquely defined, and may not return the value you want to use. | |
TotalYear |
Gets the value of the DateTime as whole and fractional
years.
The fractional value returned for a specific day in the year way will differ for years being leap-years and years not being leap-years. | |
Update |
Updates the destination axis with the properties from the source axis.
Only the editable properties are edited.
| |
XCoordinatesTo2D |
Copy the x coordinates of an IDfsAxisCurveLinearD2
to a 2D array.
| |
YCoordinatesTo2D |
Copy the y coordinates of an IDfsAxisCurveLinearD2
to a 2D array.
|