Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6bfc128
Added first working version of local_solar_time preproc
schlunma Nov 18, 2023
6da26e8
Improved function doc and structure
schlunma Nov 18, 2023
e289768
Also consider aux coord, cell measures and ancillary vars in local_so…
schlunma Nov 20, 2023
84beaf8
Added tests
schlunma Nov 21, 2023
07e442f
Fixed flake8
schlunma Nov 21, 2023
2649edf
Nicer variables names
schlunma Nov 21, 2023
0d09947
Added doc
schlunma Nov 21, 2023
7df9d83
Fixed Codacy issues
schlunma Nov 21, 2023
35b5d23
Optimized doc and fixed Codacy issues
schlunma Nov 21, 2023
a7ccf99
Added test case with aux coord without bounds
schlunma Nov 22, 2023
eca6998
Added better description of LST to doc
schlunma Nov 23, 2023
7cb6923
Merge branch 'local_time_preproc' of github.com:ESMValGroup/ESMValCor…
schlunma Nov 23, 2023
476030b
Optimized doc
schlunma Nov 23, 2023
b33cd3e
Make code that calculates final mask simpler and faster
schlunma Nov 23, 2023
256bce6
Fixed Codacy issue
schlunma Nov 23, 2023
199694e
Better docstrings
schlunma Nov 23, 2023
646c8af
Added rechunk_cube function to iris_helpers module
schlunma Nov 24, 2023
8456369
Update esmvalcore/preprocessor/_time.py
schlunma Dec 7, 2023
308375d
Merge remote-tracking branch 'origin/main' into local_time_preproc
schlunma Dec 7, 2023
8120593
Add only_lazy keyword arg to rechunk_cube
schlunma Dec 7, 2023
b77f6b9
Only use lazy data in local_solar_time for dask arrays
schlunma Dec 7, 2023
9a2fa74
Always leave numpy arrays unchanged in rechunk_cube
schlunma Dec 7, 2023
8ca8e65
Better way to check if coord has bounds
schlunma Dec 7, 2023
f7b75b8
Merge remote-tracking branch 'origin/main' into local_time_preproc
schlunma Dec 21, 2023
45024f7
Address @alistairsellar's comments
schlunma Dec 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions doc/recipe/preprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ The ``_time.py`` module contains the following preprocessor functions:
* regrid_time_: Aligns the time axis of each dataset to have common time
points and calendars.
* timeseries_filter_: Allows application of a filter to the time-series data.
* local_solar_time_: Convert cube with UTC time to local solar time.

Statistics functions are applied by default in the order they appear in the
list. For example, the following example applied to hourly data will retrieve
Expand Down Expand Up @@ -1653,6 +1654,32 @@ Examples:

See also :func:`esmvalcore.preprocessor.timeseries_filter`.

.. _local_solar_time:

``local_solar_time``
--------------------

This preprocessor transforms data with an existing UTC time coordinate so that
it corresponds to local solar time.
For this, the data is reordered along the time dimension based on the longitude
information.
For example, this kind of transformation is necessary to properly calculate
diurnal cycles.
Comment thread
bouweandela marked this conversation as resolved.
Outdated

Parameters:

This preprocessor does not need any parameters.

Example:

.. code-block:: yaml

calculate_local_solar_time:
local_solar_time:

See also :func:`esmvalcore.preprocessor.local_solar_time`.


.. _area operations:

Area manipulation
Expand Down
6 changes: 2 additions & 4 deletions esmvalcore/preprocessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
extract_season,
extract_time,
hourly_statistics,
local_solar_time,
monthly_statistics,
regrid_time,
resample_hours,
Expand Down Expand Up @@ -148,17 +149,14 @@
'extract_volume',
'extract_trajectory',
'extract_transect',
# 'average_zone': average_zone,
# 'cross_section': cross_section,
'detrend',
'extract_named_regions',
'axis_statistics',
'depth_integration',
'area_statistics',
'volume_statistics',
# Time operations
# 'annual_cycle': annual_cycle,
# 'diurnal_cycle': diurnal_cycle,
'local_solar_time',
'amplitude',
'zonal_statistics',
'meridional_statistics',
Expand Down
Loading