-
Notifications
You must be signed in to change notification settings - Fork 301
Update the mesh-data-model feature branch wrt main
#4254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
13ff24f
1c699a3
e0fb557
7e541ec
59fa3f1
520d135
0bc9bee
e719ae0
208e020
48028e9
c34662c
18faa96
be62cdf
7828e95
dc092a3
3b8f492
de2372b
04e71c1
615bfd5
ac12231
8c08d14
b0f6245
8f6bb44
bbeb543
a7a8fce
88cfb7e
1ed885e
c088c33
3be8c61
cbdb0df
39a4b30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,9 +23,9 @@ Collapsing Entire Data Dimensions | |
|
|
||
| In the :doc:`subsetting_a_cube` section we saw how to extract a subset of a | ||
| cube in order to reduce either its dimensionality or its resolution. | ||
| Instead of simply extracting a sub-region of the data, | ||
| we can produce statistical functions of the data values | ||
| across a particular dimension, | ||
| Instead of simply extracting a sub-region of the data, | ||
| we can produce statistical functions of the data values | ||
| across a particular dimension, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On master this has a space. We haven't touch the user guide in the UGRID yet, so I'm just wondering why this change is introduced
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My IDE will fix any poorly formatted text in files that it touches, and unfortunately I accidentally touched some extra files and didn't catch it in time (4cf57f0). The spaces at ends of lines shouldn't be there; this is an improvement, just not one that was asked for or expected!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes aren't associated with any unstructured work. Please can you back them out as they are highly likely to cause conflicts when merging onto main later.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having discussed offline, we haven't been able to work out a way to avoid the potential conflict. If this happened again I would have spent the extra 15mins undoing the original mistake, to avoid this later problem. |
||
| such as a 'mean over time' or 'minimum over latitude'. | ||
|
|
||
| .. _cube-statistics_forecast_printout: | ||
|
|
@@ -57,9 +57,9 @@ For instance, suppose we have a cube: | |
| um_version: 7.3 | ||
|
|
||
|
|
||
| In this case we have a 4 dimensional cube; | ||
| to mean the vertical (z) dimension down to a single valued extent | ||
| we can pass the coordinate name and the aggregation definition to the | ||
| In this case we have a 4 dimensional cube; | ||
| to mean the vertical (z) dimension down to a single valued extent | ||
| we can pass the coordinate name and the aggregation definition to the | ||
| :meth:`Cube.collapsed() <iris.cube.Cube.collapsed>` method: | ||
|
|
||
| >>> import iris.analysis | ||
|
|
@@ -88,8 +88,8 @@ we can pass the coordinate name and the aggregation definition to the | |
| mean: model_level_number | ||
|
|
||
|
|
||
| Similarly other analysis operators such as ``MAX``, ``MIN`` and ``STD_DEV`` | ||
| can be used instead of ``MEAN``, see :mod:`iris.analysis` for a full list | ||
| Similarly other analysis operators such as ``MAX``, ``MIN`` and ``STD_DEV`` | ||
| can be used instead of ``MEAN``, see :mod:`iris.analysis` for a full list | ||
| of currently supported operators. | ||
|
|
||
| For an example of using this functionality, the | ||
|
|
@@ -103,14 +103,14 @@ in the gallery takes a zonal mean of an ``XYT`` cube by using the | |
| Area Averaging | ||
| ^^^^^^^^^^^^^^ | ||
|
|
||
| Some operators support additional keywords to the ``cube.collapsed`` method. | ||
| For example, :func:`iris.analysis.MEAN <iris.analysis.MEAN>` supports | ||
| a weights keyword which can be combined with | ||
| Some operators support additional keywords to the ``cube.collapsed`` method. | ||
| For example, :func:`iris.analysis.MEAN <iris.analysis.MEAN>` supports | ||
| a weights keyword which can be combined with | ||
| :func:`iris.analysis.cartography.area_weights` to calculate an area average. | ||
|
|
||
| Let's use the same data as was loaded in the previous example. | ||
| Since ``grid_latitude`` and ``grid_longitude`` were both point coordinates | ||
| we must guess bound positions for them | ||
| Let's use the same data as was loaded in the previous example. | ||
| Since ``grid_latitude`` and ``grid_longitude`` were both point coordinates | ||
| we must guess bound positions for them | ||
| in order to calculate the area of the grid boxes:: | ||
|
|
||
| import iris.analysis.cartography | ||
|
|
@@ -155,24 +155,24 @@ including an example on taking a :ref:`global area-weighted mean | |
| Partially Reducing Data Dimensions | ||
| ---------------------------------- | ||
|
|
||
| Instead of completely collapsing a dimension, other methods can be applied | ||
| to reduce or filter the number of data points of a particular dimension. | ||
| Instead of completely collapsing a dimension, other methods can be applied | ||
| to reduce or filter the number of data points of a particular dimension. | ||
|
|
||
|
|
||
| Aggregation of Grouped Data | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| The :meth:`Cube.aggregated_by <iris.cube.Cube.aggregated_by>` operation | ||
| combines data for all points with the same value of a given coordinate. | ||
| To do this, you need a coordinate whose points take on only a limited set | ||
| of different values -- the *number* of these then determines the size of the | ||
| The :meth:`Cube.aggregated_by <iris.cube.Cube.aggregated_by>` operation | ||
| combines data for all points with the same value of a given coordinate. | ||
| To do this, you need a coordinate whose points take on only a limited set | ||
| of different values -- the *number* of these then determines the size of the | ||
| reduced dimension. | ||
| The :mod:`iris.coord_categorisation` module can be used to make such | ||
| 'categorical' coordinates out of ordinary ones: The most common use is | ||
| to aggregate data over regular *time intervals*, | ||
| The :mod:`iris.coord_categorisation` module can be used to make such | ||
| 'categorical' coordinates out of ordinary ones: The most common use is | ||
| to aggregate data over regular *time intervals*, | ||
| such as by calendar month or day of the week. | ||
|
|
||
| For example, let's create two new coordinates on the cube | ||
| For example, let's create two new coordinates on the cube | ||
| to represent the climatological seasons and the season year respectively:: | ||
|
|
||
| import iris | ||
|
|
@@ -188,8 +188,8 @@ to represent the climatological seasons and the season year respectively:: | |
|
|
||
| .. note:: | ||
|
|
||
| The 'season year' is not the same as year number, because (e.g.) the months | ||
| Dec11, Jan12 + Feb12 all belong to 'DJF-12'. | ||
| The 'season year' is not the same as year number, because (e.g.) the months | ||
| Dec11, Jan12 + Feb12 all belong to 'DJF-12'. | ||
| See :meth:`iris.coord_categorisation.add_season_year`. | ||
|
|
||
|
|
||
|
|
@@ -206,10 +206,10 @@ to represent the climatological seasons and the season year respectively:: | |
| iris.coord_categorisation.add_season_year(cube, 'time', name='season_year') | ||
|
|
||
| annual_seasonal_mean = cube.aggregated_by( | ||
| ['clim_season', 'season_year'], | ||
| ['clim_season', 'season_year'], | ||
| iris.analysis.MEAN) | ||
|
|
||
|
|
||
| Printing this cube now shows that two extra coordinates exist on the cube: | ||
|
|
||
| .. doctest:: aggregation | ||
|
|
@@ -238,20 +238,20 @@ These two coordinates can now be used to aggregate by season and climate-year: | |
| .. doctest:: aggregation | ||
|
|
||
| >>> annual_seasonal_mean = cube.aggregated_by( | ||
| ... ['clim_season', 'season_year'], | ||
| ... ['clim_season', 'season_year'], | ||
| ... iris.analysis.MEAN) | ||
| >>> print(repr(annual_seasonal_mean)) | ||
| <iris 'Cube' of surface_temperature / (K) (time: 19; latitude: 18; longitude: 432)> | ||
| The primary change in the cube is that the cube's data has been | ||
| reduced in the 'time' dimension by aggregation (taking means, in this case). | ||
| This has collected together all data points with the same values of season and | ||
|
|
||
| The primary change in the cube is that the cube's data has been | ||
| reduced in the 'time' dimension by aggregation (taking means, in this case). | ||
| This has collected together all data points with the same values of season and | ||
| season-year. | ||
| The results are now indexed by the 19 different possible values of season and | ||
| season-year in a new, reduced 'time' dimension. | ||
|
|
||
| We can see this by printing the first 10 values of season+year | ||
| from the original cube: These points are individual months, | ||
| We can see this by printing the first 10 values of season+year | ||
| from the original cube: These points are individual months, | ||
| so adjacent ones are often in the same season: | ||
|
|
||
| .. doctest:: aggregation | ||
|
|
@@ -271,7 +271,7 @@ so adjacent ones are often in the same season: | |
| djf 2007 | ||
| djf 2007 | ||
|
|
||
| Compare this with the first 10 values of the new cube's coordinates: | ||
| Compare this with the first 10 values of the new cube's coordinates: | ||
| All the points now have distinct season+year values: | ||
|
|
||
| .. doctest:: aggregation | ||
|
|
@@ -294,7 +294,7 @@ All the points now have distinct season+year values: | |
|
|
||
| Because the original data started in April 2006 we have some incomplete seasons | ||
| (e.g. there were only two months worth of data for 'mam-2006'). | ||
| In this case we can fix this by removing all of the resultant 'times' which | ||
| In this case we can fix this by removing all of the resultant 'times' which | ||
| do not cover a three month period (note: judged here as > 3*28 days): | ||
|
|
||
| .. doctest:: aggregation | ||
|
|
@@ -306,7 +306,7 @@ do not cover a three month period (note: judged here as > 3*28 days): | |
| >>> full_season_means | ||
| <iris 'Cube' of surface_temperature / (K) (time: 17; latitude: 18; longitude: 432)> | ||
|
|
||
| The final result now represents the seasonal mean temperature for 17 seasons | ||
| The final result now represents the seasonal mean temperature for 17 seasons | ||
| from jja-2006 to jja-2010: | ||
|
|
||
| .. doctest:: aggregation | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't on master. Is it explicitly added for UGRID work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the extra comma is an artifact of this list being expanded in #4080, then the additional tuple being removed again in #4114.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can keep it as long as the change isn't in the 3.0.x branch. Personally if not needed i'd remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that side. I'm mostly put off by the prospect of a noisy commit history since we're not using the squash strategy for this PR. Is that a non-issue for you - an extra commit to remove the comma is fine?