Class SoilLayerTransformerLegacy
- All Implemented Interfaces:
net.simplace.sim.util.FWSimFieldContainer
Takes data with n depth depended layers and creates m layers with the same information
Description
Soil data is mostly delivered with the layer specific information. The layers have different depth and are varying in their count. This Transformer takes the data with these n different depth layers and creates layercount layers data with uniform thickness.
Either the layercount or the layerthickness can be defined to specify the output data resolution. The depthfield signifies the source field id with the depth information. Default is depth.
Output will be written as follows: Scalar field types like CHAR,DOUBLE,INT,... are kept as they are Array fields like DOUBLEARRAY and INTARRAY are transformed to the new array size concerning to layercount or layerthickness
Configuration
requested structure of configuration element:
| <transform id="soil_transform" interface="simpool" resource="soil" source="vSoiltype" | class="net.simplace.sim.transformers.SoilLayerTransformer" > | <header> | <res id="soiltype" datatype="CHAR" key="vSoiltype" /> | <res id="dampingdepth" unit="m" datatype="DOUBLE"/> | <res id="soilwater_fc_global" unit="cm3*cm-3" datatype="DOUBLE"/> | ... | <res id="clay" unit="g/100g" datatype="DOUBLEARRAY"/> | <res id="carbon" unit="g/100g" datatype="DOUBLEARRAY"/> | </header> | <input id="layercount" /> | <input id="layerthickness">0.03</input> | <input id="depthfieldid">depth</input> | </transform>
- Author:
- Andreas Enders
Component Variables
| Content Type | Name | Description | Data Type | Unit | Min Value | Max Value | Default Value |
|---|---|---|---|---|---|---|---|
| constant | depthfieldid | - | CHAR | - | - | ||
| constant | layercount | - | INT | 1 | 200 | - | |
| constant | layerthickness | - | DOUBLE | m | 1.0E-4 | 5.0 | 0.03 |
-
Nested Class Summary
Nested classes/interfaces inherited from class net.simplace.sim.io.FWSimIOAdapter
net.simplace.sim.io.FWSimIOAdapter.FREQUENCE -
Field Summary
Fields inherited from class net.simplace.sim.io.resources.FWSimResourceTransformer
iFieldMap, iIntColumnMap, iLastInputValuesMap, iLastProjectID, iLastUniqueID, iPoolName, iSourceNameFields inherited from class net.simplace.sim.io.resources.FWSimInputAdapter
iJexlScript, iShouldCacheToDBFields inherited from class net.simplace.sim.io.FWSimIOAdapter
iArrayMode, iFieldcount, iFrequence, iHeaderVariables, iInterface, iJexlRule, iKeyMap, iName, iOrderNumber, iProcessTime, iResourceElement, iSession, iSourceKey -
Constructor Summary
ConstructorsConstructorDescriptionused for ClassForNameSoilLayerTransformerLegacy(net.simplace.sim.FWSimSession aSession, Integer aOrderNumber) SoilLayerTransformerLegacy(net.simplace.sim.FWSimSession aSession, org.jdom2.Element aResourceElement, Integer aOrderNumber) -
Method Summary
Modifier and TypeMethodDescriptionnet.simplace.sim.io.resources.FWSimResourceCachegetData(net.simplace.sim.util.FWSimVarMap aVarMap) standard method from outsidenet.simplace.sim.io.resources.FWSimResourceCachegetData(net.simplace.sim.util.FWSimVarMap aVarMap, net.simplace.sim.io.resources.FWSimResourceCache aResourceCache) used by test casesnet.simplace.sim.io.resources.FWSimResourceCachereScaleSoilLayers(net.simplace.sim.util.FWSimVariable<Double> aThicknessOfLayers, net.simplace.sim.util.FWSimVariable<Integer> aLayerCount, net.simplace.sim.util.FWSimVariable<String> aDepthFieldName, String aProjectID, net.simplace.sim.io.resources.FWSimResourceCache aCache) Rescales the soil layervoidupdateFields(net.simplace.core.FWObservable aObservable) Methods inherited from class net.simplace.sim.io.resources.FWSimResourceTransformer
addVariable, createFormFields, createResourceTransformer, createResourceTransformer, createResourceTransformer, createSimTransformer, fillVarMap, getCreateFormXML, getEditFormXML, getSourceResourceCache, getVariable, isUpdated, toDocXML, toXMLMethods inherited from class net.simplace.sim.io.resources.FWSimInputAdapter
getContentType, getInputVariables, getJexlScript, getOutputVariables, getVarMap, isTransformer, shouldCacheToDB, toHTMLTablestringMethods inherited from class net.simplace.sim.io.FWSimIOAdapter
addProcessTime, checkCondition, createFormFields, finalize, getFieldMap, getFrequence, getHeaderVariables, getHeaderXML, getInterface, getJexlRule, getKeyMap, getName, getOrderNumber, isArrayMode, isConditionCheck, removeVariable, setInterface, setOrderNumber, toString, writeHeaderList
-
Constructor Details
-
SoilLayerTransformerLegacy
public SoilLayerTransformerLegacy(net.simplace.sim.FWSimSession aSession, org.jdom2.Element aResourceElement, Integer aOrderNumber) - Parameters:
aSession-aResourceElement-aOrderNumber-
-
SoilLayerTransformerLegacy
- Parameters:
aSession-aOrderNumber-
-
SoilLayerTransformerLegacy
public SoilLayerTransformerLegacy()used for ClassForName
-
-
Method Details
-
createVariables
- Specified by:
createVariablesin interfacenet.simplace.sim.util.FWSimFieldContainer- Overrides:
createVariablesin classnet.simplace.sim.io.FWSimIOAdapter
-
getData
public net.simplace.sim.io.resources.FWSimResourceCache getData(net.simplace.sim.util.FWSimVarMap aVarMap) throws net.simplace.sim.exceptions.MissingSimResourceException standard method from outside- Specified by:
getDatain classnet.simplace.sim.io.resources.FWSimInputAdapter- Throws:
net.simplace.sim.exceptions.MissingSimResourceException- See Also:
-
getData
public net.simplace.sim.io.resources.FWSimResourceCache getData(net.simplace.sim.util.FWSimVarMap aVarMap, net.simplace.sim.io.resources.FWSimResourceCache aResourceCache) throws net.simplace.sim.exceptions.MissingSimResourceException used by test cases- Parameters:
aVarMap- variable mapaResourceCache- Cached resources (soil data)- Returns:
- delivered new data from transformer
- Throws:
net.simplace.sim.exceptions.MissingSimResourceException
-
reScaleSoilLayers
public net.simplace.sim.io.resources.FWSimResourceCache reScaleSoilLayers(net.simplace.sim.util.FWSimVariable<Double> aThicknessOfLayers, net.simplace.sim.util.FWSimVariable<Integer> aLayerCount, net.simplace.sim.util.FWSimVariable<String> aDepthFieldName, String aProjectID, net.simplace.sim.io.resources.FWSimResourceCache aCache) throws net.simplace.sim.exceptions.MissingSimResourceException Rescales the soil layer- Parameters:
aThicknessOfLayers- thickness of the layersaLayerCount- total number of layersaDepthFieldName- name of the depth fieldaProjectID- id of the projectaCache- original soil info stored- Returns:
- the new created
FWSimResourceCache - Throws:
net.simplace.sim.exceptions.MissingSimResourceException
-
updateFields
public void updateFields(net.simplace.core.FWObservable aObservable) - Specified by:
updateFieldsin classnet.simplace.sim.io.resources.FWSimResourceTransformer- See Also:
-