Skip to content
Open
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
12 changes: 9 additions & 3 deletions src/CSET/loaders/histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def load(conf: Config):

# Surface (2D) fields.
for atype, field in itertools.product(AGGREGATION_TYPES, conf.SURFACE_FIELDS):
if conf.HISTOGRAM_SURFACE_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.HISTOGRAM_SURFACE_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_surface_histogram_series_case_aggregation_{atype}.yaml",
variables={
Expand All @@ -118,7 +120,9 @@ def load(conf: Config):
for atype, field, plevel in itertools.product(
AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS, conf.PRESSURE_LEVELS
):
if conf.HISTOGRAM_PLEVEL_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.HISTOGRAM_PLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_histogram_series_case_aggregation_{atype}.yaml",
variables={
Expand All @@ -139,7 +143,9 @@ def load(conf: Config):
for atype, field, mlevel in itertools.product(
AGGREGATION_TYPES, conf.MODEL_LEVEL_FIELDS, conf.MODEL_LEVELS
):
if conf.HISTOGRAM_MLEVEL_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.HISTOGRAM_MLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_histogram_series_case_aggregation_{atype}.yaml",
variables={
Expand Down
8 changes: 6 additions & 2 deletions src/CSET/loaders/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def load(conf: Config):
for atype, field in itertools.product(
AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS
):
if conf.PROFILE_PLEVEL_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.PROFILE_PLEVEL_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_domain_mean_vertical_profile_series_case_aggregation_{atype}.yaml",
variables={
Expand All @@ -93,7 +95,9 @@ def load(conf: Config):

# Model level fields.
for atype, field in itertools.product(AGGREGATION_TYPES, conf.MODEL_LEVEL_FIELDS):
if conf.PROFILE_MLEVEL_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.PROFILE_MLEVEL_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_domain_mean_vertical_profile_series_case_aggregation_{atype}.yaml",
variables={
Expand Down
18 changes: 9 additions & 9 deletions src/CSET/loaders/spatial_difference_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ def load(conf: Config):
for model, atype, field in itertools.product(
models[1:], AGGREGATION_TYPES, conf.SURFACE_FIELDS
):
if conf.SPATIAL_DIFFERENCE_SURFACE_FIELD_AGGREGATION[
AGGREGATION_TYPES.index(atype)
]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.SPATIAL_DIFFERENCE_SURFACE_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
base_model = models[0]
yield RawRecipe(
recipe=f"surface_spatial_difference_case_aggregation_mean_{atype}.yaml",
Expand All @@ -511,9 +511,9 @@ def load(conf: Config):
for model, atype, field, plevel in itertools.product(
models[1:], AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS, conf.PRESSURE_LEVELS
):
if conf.SPATIAL_DIFFERENCE_PLEVEL_FIELD_AGGREGATION[
AGGREGATION_TYPES.index(atype)
]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.SPATIAL_DIFFERENCE_PLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
base_model = models[0]
yield RawRecipe(
recipe=f"level_spatial_difference_case_aggregation_mean_{atype}.yaml",
Expand All @@ -536,9 +536,9 @@ def load(conf: Config):
for model, atype, field, mlevel in itertools.product(
models[1:], AGGREGATION_TYPES, conf.MODEL_LEVEL_FIELDS, conf.MODEL_LEVELS
):
if conf.SPATIAL_DIFFERENCE_MLEVEL_FIELD_AGGREGATION[
AGGREGATION_TYPES.index(atype)
]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.SPATIAL_DIFFERENCE_MLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
base_model = models[0]
yield RawRecipe(
recipe=f"level_spatial_difference_case_aggregation_mean_{atype}.yaml",
Expand Down
12 changes: 9 additions & 3 deletions src/CSET/loaders/spatial_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,9 @@ def load(conf: Config):
for model, atype, field in itertools.product(
models, AGGREGATION_TYPES, conf.SURFACE_FIELDS
):
if conf.SPATIAL_SURFACE_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.SPATIAL_SURFACE_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_surface_spatial_plot_sequence_case_aggregation_mean_{atype}.yaml",
variables={
Expand All @@ -604,7 +606,9 @@ def load(conf: Config):
for model, atype, field, plevel in itertools.product(
models, AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS, conf.PRESSURE_LEVELS
):
if conf.SPATIAL_PLEVEL_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.SPATIAL_PLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_spatial_plot_sequence_case_aggregation_mean_{atype}.yaml",
variables={
Expand All @@ -625,7 +629,9 @@ def load(conf: Config):
for model, atype, field, mlevel in itertools.product(
models, AGGREGATION_TYPES, conf.MODEL_LEVEL_FIELDS, conf.MODEL_LEVELS
):
if conf.SPATIAL_MLEVEL_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.SPATIAL_MLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_spatial_plot_sequence_case_aggregation_mean_{atype}.yaml",
variables={
Expand Down
29 changes: 26 additions & 3 deletions src/CSET/loaders/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ def load(conf: Config):
aggregation=False,
)

# Single point timeseries
if conf.SURFACE_SINGLE_POINT_TIME_SERIES:
for field in conf.SURFACE_FIELDS:
yield RawRecipe(
recipe="generic_surface_single_point_time_series.yaml",
variables={
"VARNAME": field,
"MODEL_NAME": [model["name"] for model in models],
"LATITUDE_POINT": conf.LATITUDE_POINT,
"LONGITUDE_POINT": conf.LONGITUDE_POINT,
"LATLON_IN_TYPE": conf.LATLON_IN_TYPE,
"SINGLE_POINT_METHOD": conf.SINGLE_POINT_METHOD,
},
model_ids=[model["id"] for model in models],
aggregation=False,
)

# Surface time series: land mask.
if conf.TIMESERIES_SURFACE_FIELD_LAND_MASK:
for field in conf.SURFACE_FIELDS:
Expand Down Expand Up @@ -450,7 +467,9 @@ def load(conf: Config):

# Surface (2D) fields.
for atype, field in itertools.product(AGGREGATION_TYPES, conf.SURFACE_FIELDS):
if conf.TIMESERIES_SURFACE_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.TIMESERIES_SURFACE_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_surface_domain_mean_time_series_case_aggregation_{atype}.yaml",
variables={
Expand All @@ -469,7 +488,9 @@ def load(conf: Config):
for atype, field, plevel in itertools.product(
AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS, conf.PRESSURE_LEVELS
):
if conf.TIMESERIES_PLEVEL_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.TIMESERIES_PLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_domain_mean_time_series_case_aggregation_{atype}.yaml",
variables={
Expand All @@ -490,7 +511,9 @@ def load(conf: Config):
for atype, field, mlevel in itertools.product(
AGGREGATION_TYPES, conf.MODEL_LEVEL_FIELDS, conf.MODEL_LEVELS
):
if conf.TIMESERIES_MLEVEL_FIELD_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.TIMESERIES_MLEVEL_FIELD_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"generic_level_domain_mean_time_series_case_aggregation_{atype}.yaml",
variables={
Expand Down
10 changes: 6 additions & 4 deletions src/CSET/loaders/transects.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def load(conf: Config):
for model, atype, field in itertools.product(
models, AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS
):
if conf.PLEVEL_TRANSECT_AGGREGATION[AGGREGATION_TYPES.index(atype)]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.PLEVEL_TRANSECT_AGGREGATION
if len(aggregations) > index and aggregations[index]:
yield RawRecipe(
recipe=f"transect_case_aggregation_{atype}.yaml",
variables={
Expand All @@ -105,9 +107,9 @@ def load(conf: Config):
for model, atype, field in itertools.product(
models[1:], AGGREGATION_TYPES, conf.PRESSURE_LEVEL_FIELDS
):
if conf.PLEVEL_TRANSECT_AGGREGATION_DIFFERENCE[
AGGREGATION_TYPES.index(atype)
]:
index = AGGREGATION_TYPES.index(atype)
aggregations = conf.PLEVEL_TRANSECT_AGGREGATION_DIFFERENCE
if len(aggregations) > index and aggregations[index]:
base_model = models[0]
yield RawRecipe(
recipe=f"transect_case_aggregation_difference_{atype}.yaml",
Expand Down