Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions esmvalcore/preprocessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from .._provenance import TrackedFile
from .._task import BaseTask
from ..cmor.check import cmor_check_data, cmor_check_metadata
from ..cmor.fix import fix_data, fix_file, fix_metadata
from ._area import (area_statistics, extract_named_regions, extract_region,
extract_shape, meridional_statistics, zonal_statistics)
from ._cycles import amplitude
Expand All @@ -21,8 +23,6 @@
mask_landsea, mask_landseaice, mask_outside_range)
from ._multimodel import multi_model_statistics
from ._other import clip
from ._reformat import (cmor_check_data, cmor_check_metadata, fix_data,
fix_file, fix_metadata)
from ._regrid import extract_levels, extract_point, regrid
from ._time import (annual_statistics, anomalies, climate_statistics,
daily_statistics, decadal_statistics, extract_month,
Expand Down Expand Up @@ -54,6 +54,7 @@
'extract_month',
# Data reformatting/CMORization
'fix_data',
'cmor_check_data',
# Level extraction
'extract_levels',
# Weighting
Expand Down Expand Up @@ -106,7 +107,6 @@
'anomalies',
'regrid_time',
'timeseries_filter',
'cmor_check_data',
'convert_units',
# Save to file
'save',
Expand All @@ -130,8 +130,8 @@
DEFAULT_ORDER = tuple(__all__)

# The order of initial and final steps cannot be configured
INITIAL_STEPS = DEFAULT_ORDER[:DEFAULT_ORDER.index('fix_data') + 1]
FINAL_STEPS = DEFAULT_ORDER[DEFAULT_ORDER.index('cmor_check_data'):]
INITIAL_STEPS = DEFAULT_ORDER[:DEFAULT_ORDER.index('cmor_check_data') + 1]
FINAL_STEPS = DEFAULT_ORDER[DEFAULT_ORDER.index('save'):]

MULTI_MODEL_FUNCTIONS = {
'multi_model_statistics',
Expand Down
13 changes: 0 additions & 13 deletions esmvalcore/preprocessor/_reformat.py

This file was deleted.

2 changes: 2 additions & 0 deletions esmvalcore/preprocessor/_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def anomalies(cube, period, reference=None, standardize=False):
cube_stddev = climate_statistics(
cube, operator='std_dev', period=period)
cube = cube / cube_stddev
cube.units = '1'
return cube

cube = _compute_anomalies(cube, reference, period)
Expand All @@ -490,6 +491,7 @@ def anomalies(cube, period, reference=None, standardize=False):
)
cube.data = cube.core_data() / da.concatenate(
[cube_stddev.core_data() for _ in range(int(reps))], axis=tdim)
cube.units = '1'
return cube


Expand Down
1 change: 1 addition & 0 deletions tests/unit/preprocessor/_time/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ def test_standardized_anomalies(period, standardize=True):
result.data,
expected
)
assert result.units == '1'
else:
expected = np.ma.masked_invalid(expected_anomalies)
assert_array_equal(
Expand Down