This transformation calculates a weighted vertical average of a parameter (for example, water temperature) at a single X-Y location, but over a range of heights (e.g. in the water column). The input timeSeries is a vertical profile; in other words, the (water) depth is divided into layers and each layer has a value at the centerpoint. The portion of the vertical profile that should be averaged is configurable using the options "startDepth" and "endDepth". These depths should be in meters and use negative values (i.e. to average from the surface to 10 meters below the surface, use startDepth = 0 and endDepth = -10). The vertical average is weighted based on the thickness of each layer and assumes that values change linearly between layer centerpoints (i.e. no abrupt changes in values between layers). The transformation takes into account partial layers (i.e. if the start or end depth doesn't fall exactly at the edge of a vertical layer). When the start and end depth fall in the same vertical layer, or when the start and end depth are the same, the result is simply the value of the layer within which the start and end depth fall (no linear interpolation is assumed in this case).
The startDepth and endDepth over which to average can be specified relative to a standard point of comparison (0 m), or relative to a temporally varying water level (an additional timeSeries input to the transformation, specified in the transformation as "waterLevelReference"). If waterLevelReference is configured, the starting point of the top water layer is updated with each time step to match the water level. [To clarify: is this combined with changing z-layer centers?]
The input is a scalar timeSeriesSet with a domainParameterId that specifies the Z-layer elevations.
Config example:
<variable> <variableId>input_profiles</variableId> <timeSeriesSet> <moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId> <valueType>scalar</valueType> <parameterId>$PARAM$</parameterId> <domainParameterId>zcoordinate_c.simulated</domainParameterId> <locationSetId>$LOCATION_SET_ID$</locationSetId> <timeSeriesType>$TST$</timeSeriesType> <timeStep unit="minute" multiplier="10"/> <relativeViewPeriod unit="hour" start="$HR_START$" end="$HR_END$" startOverrulable="false" endOverrulable="true"/> <readWriteMode>read only</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>waterLevelReference</variableId> <timeSeriesSet> <moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.simulated</parameterId> <locationSetId>$LOCATION_SET_ID$</locationSetId> <timeSeriesType>$TST$</timeSeriesType> <timeStep unit="minute" multiplier="10"/> <relativeViewPeriod unit="hour" start="$HR_START$" end="$HR_END$" startOverrulable="false" endOverrulable="true"/> <readWriteMode>read only</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>output_depth_averaged_series</variableId> <timeSeriesSet> <moduleInstanceId>$MODULE_INSTANCE_ID$</moduleInstanceId> <valueType>scalar</valueType> <parameterId>$PARAM$.depthavg</parameterId> <locationSetId>$LOCATION_SET_ID$</locationSetId> <timeSeriesType>$TST$</timeSeriesType> <timeStep unit="minute" multiplier="10"/> <relativeViewPeriod unit="hour" start="$HR_START$" end="$HR_END$" startOverrulable="false" endOverrulable="true"/> <readWriteMode>add originals</readWriteMode> <expiryTime unit="day" multiplier="$CUSTOM_EXPIRY_TIME$"/> </timeSeriesSet> </variable> <transformation id="StatisticsVerticalAverageScalarZLayerFunctionTest"> <statisticsVerticalLayers> <averageScalarVerticalLayers> <input> <variableId>input_profiles</variableId> </input> <waterLevelReference> <variableId>waterLevelReference</variableId> </waterLevelReference> <startDepth>-2</startDepth> <endDepth>-15</endDepth> <outputVariable> <variableId>output_depth_averaged_series</variableId> </outputVariable> </averageScalarVerticalLayers> </statisticsVerticalLayers> </transformation>