CSN Operation Templates: Difference between revisions
From CSDMS
Line 1: | Line 1: | ||
= '''[[ | = '''[[CSDMS_Standard_Names | CSDMS Standard Names]] — Operation Templates''' = | ||
: | : | ||
* Operations are typically given as a prefix to an existing standard name. The prefix almost always (or always?) ends in the word "_of". It could therefore be used as a delimiter to separate the operation from the standard name it acts on. | * Operations are typically given as a prefix to an existing standard name. The prefix almost always (or always?) ends in the word "_of". It could therefore be used as a delimiter to separate the operation from the standard name it acts on. |
Revision as of 12:20, 26 July 2012
CSDMS Standard Names — Operation Templates
- Operations are typically given as a prefix to an existing standard name. The prefix almost always (or always?) ends in the word "_of". It could therefore be used as a delimiter to separate the operation from the standard name it acts on.
- In CF Standard Names, they use the word "transformation" in the same sense as we are using "operation".
- These templates attempt to avoid operations that require two standard names, say X and Y, like these from the CF Standard Names:
change_in_X_due_to_change_in_Y correlation_of_X_with_Y derivative_of_X_wrt_Y integral_of_X_wrt_Y and instead express operations as a prefix whenever possible.
- Some of the "transformations" in the CF Standard Names are:
change_in_X_due_to_change_in_Y curl_of_X derivative_of_X_wrt_Y direction_of_X divergence_of_X gradient_of_X integral_of_X_wrt_Y magnitude_of_X tendency_of_X (time_derivative)
Time Derivatives
operation_prefix = "derivative_wrt_time_of_"
- Examples
derivative_wrt_time_of_bedrock_surface_elevation derivative_wrt_time_of_sea_water_northward_velocity_component derivative_wrt_time_of_soil_saturated_hydraulic_conductivity
- We can extend this pattern to higher-order derivatives by adding a prefix like "second_", as in: "second_derivative_wrt_time_of_".
- "wrt" = "with respect to"
- Many quantity names built from process names have a sign connotation, such as "erosion_rate", "deposition_rate" and "accumulation_rate". If either sign is possible, the "derivative_wrt_time_of_X" pattern is generally less ambiguous and therefore preferable.
- We could possibly use a base quantity like "_change_rate" for time derivatives, but this seems limited and ambiguous and it isn't used much in practice.
- In CF Standard Names, a "transformation" called "tendency_of" is used to indicate a time derivative. There are 435 names that use this pattern. But it is not standard across the sciences.
- In CF Standard Names, there is also the transformation pattern: "derivative_of_X_wrt_Y" and "time" is a CF Standard Name.
- In CF Standard Names, the transformation pattern for the derivative of a vector component is: "[component]_derivative_of_X". In the CSDMS Standard Names, "_component" is used as a "quantity suffix" (like "increment") and the name would start with an operation prefix like "derivative_wrt_time_of".
- CF Standard Names also has the transformation pattern: "change_over_time_in_X", with bounds given in metadata.
Spatial Derivatives
operation_prefix = "derivative_wrt_east_of_"
operation_prefix = "derivative_wrt_x_of_"
operation_prefix = "derivative_wrt_north_of_"
operation_prefix = "derivative_wrt_y_of_"
- There are only 10 CF Standard Names that contain "derivative" and they do not follow a consistent pattern. Note, however, that in CF Standard Names, time derivatives start with "tendency_of" and don't contain the word "derivative".
- There are 4 CF Standard Names that use the "x_derivative_of_" or "y_derivative_of_" pattern.
General Derivatives
operation_pattern = "derivative_wrt_X_of_Y"
- In this case, it may not be possible to express the operation using an "operator prefix". This pattern is permitted in CF Standard Names, where both X and Y can also be standard names.
- In most cases, it appears that we can accommodate this pattern by replacing X by a single-word, base quantity name like "temperature" and replacing Y by a fully-qualified standard name.
Time Integrals
operation_prefix = "integral_wrt_time_of_"
- "wrt" = "with respect to"
- In CF Standard Names, there is also the transformation pattern: "integral_of_X_wrt_Y" and "time" is a CF Standard Name. Bounds for the integral are given in metadata. There are currently 18 CF Standard Names that contain "integral" and 12 of these end with "_wrt_time".
- Perhaps we should allow the time interval to be given in the operation_prefix, at least for intervals like "day" and "year". e.g.
integral_over_one_day_of_air_upward_longwave_radiation_flux OR one_day_integral_of_air_upward_longwave_radiation_flux Maybe replace "air" with "atmosphere" in these?
Applied Functions
operation_prefix = [ function_name ] + "_of_"
- Examples
log_of_X (instead of "ln_X" in CF) log10_of_X (instead of "log10_X" in CF) sin_of_X (not in CF) sqrt_of_X (not in CF) square_of_X (also a CF Standard Names transformation)
Statistical Operators
operation_prefix = [ operator_name ] + "_of_"
- Examples
max_of_X mean_of_X min_of_X variance_of_X
- Note that min, max or "peak" could also be used as adjectives/modifiers in the construction of a full quantity name if the meaning is clear.
- It may not always be clear how "mean_of_" should be interpreted unless extra adjectives/modifiers are used. For example, does "mean_of_channel_water_depth" mean the mean over a cross section or over an entire channel reach or over a grid of such values? This case needs a more prescriptive rule and/or the details of the operation could be provided in metadata along with units, etc.
- Maybe something like:
max_*_over_period or maximum_*_over_period min_*_over_period or minimum_*_over_period or instead use the adjective "peak" in the quantity name?
Mathematical Operators that Return Scalars
operation_prefix = [ operator_name ] + "_of_"
- Examples
direction_of_X (X must be a 2D vector field; returns an angle) magnitude_of_X (X must be a vector or tensor)
- In our "Quantity" templates, "magnitude" is a "quantity suffix" and turns a vector or tensor quantity into a scalar quantity. We may want to restrict "mathematical operators" to those that don't return a scalar value and require all "base quantities" to be scalars.
Mathematical Operators that Return Vectors
operation_prefix = [ operator_name ] + "_of_"
- Examples
curl_of_X (X must be a vector field; returns a vector.) divergence_of_X (X must be a vector field; returns a vector.) gradient_of_X (X must be a scalar field; returns a vector.) divergence_of_bedrock_surface_elevation_gradient ? divergence_of_air_pressure_gradient divergence_of_air_temperature_gradient
- These all return vectors, so if we require base quantities to be scalars they would not qualify unless combined with a scalar-producing operator like "magnitude_of_". So we could have derived quantities like: "magnitude_of_gradient_of_X".
Change Increments
- Instead of a "change_in_X" operator (as in CF), we have introduced a "quantity suffix" called "increment" that can be applied to any base quantity to create a new base quantity. See the discussion at the top of CSDMS Quantity Templates.