Skip to content

Commit

Permalink
aggregation variables first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Apr 18, 2024
1 parent 261b55f commit 616c4c0
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 32 deletions.
35 changes: 27 additions & 8 deletions appl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[appendix]
== Aggregation Variable Examples

This appendix contains examples of aggregation variables. Details of how to encode and decode aggregation variables may found in <<aggregation-variables>>.
This appendix contains examples of aggregation variables.
Details of how to encode and decode aggregation variables may found in <<aggregation-variables>>.

[[example-L.1]]
[caption=]
Expand Down Expand Up @@ -70,7 +71,10 @@ data:
73, _,
144, _ ;
----
In this example, the `temperature` data variable is an aggregation variable. Its four-dimensional aggregated data with shape `(12, 1, 73, 144)` is constructed from two non-overlapping fragments, with shapes `(3, 1, 73, 144)` and `(9, 1, 73, 144)`, which span the first 3 and last 9 elements respectively of the `time` aggregated dimension. The fragment files names are taken as being relative to the current directory location of the aggregation file, since they are not fully qualified URIs. The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
In this example, the `temperature` data variable is an aggregation variable.
Its four-dimensional aggregated data with shape `(12, 1, 73, 144)` is constructed from two non-overlapping fragments, with shapes `(3, 1, 73, 144)` and `(9, 1, 73, 144)`, which span the first 3 and last 9 elements respectively of the `time` aggregated dimension.
The fragment files names are taken as being relative to the current directory location of the aggregation file, since they are not fully qualified URIs.
The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
====


Expand Down Expand Up @@ -144,7 +148,10 @@ data:
73, _,
144, _ ;
----
This example is similar to <<example-L.1>>, but now the fragment file names are fully qualified URIs, and two versions of the second fragment have been provided. The `fragment_file` fragment array variable has the extra trailing dimension `versions` to accommodate the extra fragment version. There is only one version of the first fragment, so its trailing dimension is padded with missing data. The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
This example is similar to <<example-L.1>>, but now the fragment file names are fully qualified URIs, and two versions of the second fragment have been provided.
The `fragment_file` fragment array variable has the extra trailing dimension `versions` to accommodate the extra fragment version.
There is only one version of the first fragment, so its trailing dimension is padded with missing data.
The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
====

[[example-L.3]]
Expand Down Expand Up @@ -235,7 +242,8 @@ data:
144, _ ;
fragment_shape_time = 3, 9 ;
----
This example is similar to <<example-L.2>>, but now the fragment file names have been defined using the string substitutions given by the **`substitutions`** attribute of the `fragment_file` fragment array variable `fragment_file`. The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
This example is similar to <<example-L.2>>, but now the fragment file names have been defined using the string substitutions given by the **`substitutions`** attribute of the `fragment_file` fragment array variable `fragment_file`.
The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
In addition, `time` is now an aggregation coordinate variable, with its aggregated data being derived from the same fragment files as `temperature`.
====
Expand Down Expand Up @@ -300,7 +308,10 @@ data:
91, 45, 45,
180, 180, _ ;
----
This example is an encoding for the fragment array described in <<example-fragment-array>>. The `temperature` data variable is an aggregation of 6 fragments. The fragment array shape is `(1, 3, 2)`, indicating that two of the three aggregated dimensions are spanned by multiple fragments. The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
This example is an encoding for the fragment array described in <<example-fragment-array>>.
The `temperature` data variable is an aggregation of 6 fragments.
The fragment array shape is `(1, 3, 2)`, indicating that two of the three aggregated dimensions are spanned by multiple fragments.
The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
====

[[example-L.5]]
Expand Down Expand Up @@ -374,7 +385,10 @@ data:
37, 36, _, _, _, _, _, _, _, _, _, _,
36, 36, 36, 36, _, _, _, _, _, _, _, _ ;
----
In this example, the `temperature` data variable is an aggregation of 96 fragments. The fragment array shape is `(12, 1, 2, 4)`, indicating that three of the four aggregated dimensions are spanned by multiple fragments. The `pressure` data variable is not an aggregation variable. The data for the `pressure`, `level`, `latitude` and `longitude` variables, and the `fragment_file` fragment array variable, are omitted for clarity.
In this example, the `temperature` data variable is an aggregation of 96 fragments.
The fragment array shape is `(12, 1, 2, 4)`, indicating that three of the four aggregated dimensions are spanned by multiple fragments.
The `pressure` data variable is not an aggregation variable.
The data for the `pressure`, `level`, `latitude` and `longitude` variables, and the `fragment_file` fragment array variable, are omitted for clarity.
====

[[example-L.6]]
Expand Down Expand Up @@ -465,7 +479,11 @@ data:
fragment_shape = 5000, 4000, 6000 ;
fragment_shape_latlon = 1, 1, 1 ;
----
In this example, three fragments are aggregated into a collection of DSG timeseries feature types with contiguous ragged array representation. The auxiliary coordinate variables which span either the `obs` or `station` dimensions are also aggregation variables. The time variables in the fragment files all have different netCDF variables names, which differ from the netCDF name of the `time` aggregation variable. The fragments for all aggregation variable come from the same three fragment files. No data have been omitted from the CDL.
In this example, three fragments are aggregated into a collection of DSG timeseries feature types with contiguous ragged array representation.
The auxiliary coordinate variables which span either the `obs` or `station` dimensions are also aggregation variables.
The time variables in the fragment files all have different netCDF variables names, which differ from the netCDF name of the `time` aggregation variable.
The fragments for all aggregation variable come from the same three fragment files.
No data have been omitted from the CDL.
====

[[example-L.7]]
Expand Down Expand Up @@ -538,5 +556,6 @@ data:
144, _ ;
fragment_id = "04821b9-7eb5-4046-937b-0bf06b01588", "056d1ee0-a183-43b3-ae67-1ec6aa1532a" ;
----
This example is similar to <<example-L.1>>, but now the **`aggregated_data`** attribute also includes the non-standardized keyword `id`, which has the fragment array variable `fragment_id`. The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
This example is similar to <<example-L.1>>, but now the **`aggregated_data`** attribute also includes the non-standardized keyword `id`, which has the fragment array variable `fragment_id`.
The data for the `level`, `latitude` and `longitude` variables are omitted for clarity.
====
Loading

0 comments on commit 616c4c0

Please sign in to comment.