net.simplace.sim.components.util.ArrayResampler

Resamples array values from one resolution to another resolution

The resolutions of original dataset and resampled datasets are determined by the arrays iOriginalDepths ($D_o$) and iResampledDepths ($D_r$) which contains the depths of the layers' bottom. The values have to be unique and sorted ascending. ($D_o(i_1) < D_o(i_2) \text{ when } i_1 < i_2$)

The array of values iOriginalValues ($V_o$) must have same length as the iOriginalDepths array. Values are resampled to the new resolution and output to the array ResampledValues ($V_r$) which has same length as iResampledDepths array.

When we denote the overlap of layer $i$ of original dataset and layer $j$ of resampled dataset by $o(i,j)$ and the thickness of layers is by $t_o(i)$ resp. $t_r(j)$, then:

\[ \begin{eqnarray} t_o(i) & = & D_o[i] - D_o[i-1] \\ t_r(j) & = & D_r[j] - D_r[j-1] \\ o(i,j) & = & max(0, \quad min(D_o[i], D_r[j]) - max(D_o[i-1], D_r[j-i]) \end{eqnarray} \]

If cIsProportional is false (the default), the values from those layers $i$, that overlap with the new layer $j$ are summed up, weighted by the proportion of the overlap to the original layer thickness:

\[ \begin{eqnarray} V_r(j) &=& \sum_{i} V_o(i) \frac{o(i,j)}{t_o(i)} \end{eqnarray} \]

If cIsProportional is true, then the values from those layers $i$, that overlap with the new layer $j$ are converted to absolute values by multiplying with the overlap $o(i,j)$, summed up and then divided by the resampled layer thickness $t_r(j)$ to get relative values:

\[ \begin{eqnarray} V_r(j) &=& \frac{\sum_{i} V_o(i) o(i,j)}{t_r(j)} \end{eqnarray} \]

Component Variables

Content TypeNameDescriptionData TypeUnitMin ValueMax ValueDefault Value
constantcIsProportionalValueWhether values are relative (proportions) or absolute (amounts) values.BOOLEAN--false
inputiOriginalDepthsBottom depth of each layer of the original dataset. Values must be unique and sorted ascending.DOUBLEARRAY---
inputiOriginalValuesValues of original layersDOUBLEARRAY---
inputiResampledDepthsBottom depth of each layer of the resampled dataset. Values must be unique and sorted ascending.DOUBLEARRAY---
outResampledValuesResampled valuesDOUBLEARRAY---


See also: net.simplace.sim.components.util.helper.ArrayHelper




public class ArrayResampler extends net.simplace.sim.model.FWSimComponent {
// Public Constructors
public ArrayResampler();


// Public Instance Methods
public HashMap createVariables(); // Defines
net.simplace.sim.model.FWSimComponent


Create the FWSimVariables as interface for this SimComponent

// Protected Instance Methods
protected void init(); // Defines net.simplace.sim.model.FWSimComponent

Initializes the fields by getting input and output FWSimVariables from VarMap
protected void process(); // Defines net.simplace.sim.model.FWSimComponent

Process the algorithm and write the results back to VarMap
protected void resampleArrays();

protected FWSimComponent clone(FWSimVarMap aVarMap);
// Defines net.simplace.sim.model.FWSimComponent


creates a clone from this SimComponent for use in other threads


}



Hierarchy: java.lang.Object - net.simplace.sim.model.FWSimComponent (net.simplace.sim.util.FWSimFieldContainer) - ArrayResampler