Skip to content

Commit

Permalink
Add modifications from black.
Browse files Browse the repository at this point in the history
  • Loading branch information
pirmink committed Jan 22, 2024
1 parent d14758b commit 8280c74
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
12 changes: 11 additions & 1 deletion src/pyflexplot/input/fix_nc_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
class FlexPartDataFixer:
"""Fix issues with FlexPart NetCDF output."""

cosmo_models = ["COSMO-2", "COSMO-1", "COSMO-E", "COSMO-1E", "COSMO-2E", "ICON-CH1-CTRL", "ICON-CH2-CTRL", "ICON-CH1-EPS", "ICON-CH2-EPS"]
cosmo_models = [
"COSMO-2",
"COSMO-1",
"COSMO-E",
"COSMO-1E",
"COSMO-2E",
"ICON-CH1-CTRL",
"ICON-CH2-CTRL",
"ICON-CH1-EPS",
"ICON-CH2-EPS",
]
ifs_models = ["IFS-HRES", "IFS-HRES-EU"]

def __init__(self, file_reader):
Expand Down
12 changes: 11 additions & 1 deletion src/pyflexplot/input/meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,17 @@ def time_step_idx(self) -> int:

def derive_variable_name(model: str, variable: str, species_id: int) -> str:
"""Derive the NetCDF variable name given some attributes."""
cosmo_models = ["COSMO-2", "COSMO-1", "COSMO-E", "COSMO-2E", "COSMO-1E", "ICON-CH1-CTRL", "ICON-CH2-CTRL", "ICON-CH1-EPS", "ICON-CH2-EPS"]
cosmo_models = [
"COSMO-2",
"COSMO-1",
"COSMO-E",
"COSMO-2E",
"COSMO-1E",
"ICON-CH1-CTRL",
"ICON-CH2-CTRL",
"ICON-CH1-EPS",
"ICON-CH2-EPS",
]
ifs_models = ["IFS-HRES", "IFS-HRES-EU"]
if variable == "concentration":
if model in cosmo_models:
Expand Down
30 changes: 27 additions & 3 deletions src/pyflexplot/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@ def get_domain(field: Field, aspect: float) -> Domain:
mask_nz = field.time_props.mask_nz
domain: Optional[Domain] = None
if domain_type == "full":
if model_name in ["COSMO-1", "COSMO-1E", "COSMO-2", "COSMO-E", "ICON-CH1-CTRL", "ICON-CH2-CTRL"]:
if model_name in [
"COSMO-1",
"COSMO-1E",
"COSMO-2",
"COSMO-E",
"ICON-CH1-CTRL",
"ICON-CH2-CTRL",
]:
domain = Domain(lat, lon, config={"zoom_fact": 1.01})
elif model_name in ["COSMO-2E", "ICON-CH1-EPS", "ICON-CH2-EPS"]:
domain = Domain(lat, lon, config={"zoom_fact": 1.025})
Expand Down Expand Up @@ -270,7 +277,15 @@ def get_domain(field: Field, aspect: float) -> Domain:
},
)
elif domain_type == "ch":
if model_name in ["COSMO-1", "COSMO-1E", "COSMO-2E", "ICON-CH1-CTRL", "ICON-CH2-CTRL", "ICON-CH1-EPS", "ICON-CH2-EPS"]:
if model_name in [
"COSMO-1",
"COSMO-1E",
"COSMO-2E",
"ICON-CH1-CTRL",
"ICON-CH2-CTRL",
"ICON-CH1-EPS",
"ICON-CH2-EPS",
]:
domain = Domain(
lat, lon, config={"zoom_fact": 3.6, "rel_offset": (-0.02, 0.045)}
)
Expand Down Expand Up @@ -1554,7 +1569,16 @@ def format_model_info(model_setup: ModelSetup, words: TranslatedWords) -> str:
# SR_TMP >
model_info = None
if simulation_type == "deterministic":
if model_name in ["COSMO-1", "COSMO-2", "ICON-CH1-CTRL", "ICON-CH2-CTRL", "ICON-CH1-EPS", "ICON-CH2-EPS", "IFS-HRES", "IFS-HRES-EU"]:
if model_name in [
"COSMO-1",
"COSMO-2",
"ICON-CH1-CTRL",
"ICON-CH2-CTRL",
"ICON-CH1-EPS",
"ICON-CH2-EPS",
"IFS-HRES",
"IFS-HRES-EU",
]:
model_info = model_name
elif model_name in ["COSMO-E", "COSMO-1E", "COSMO-2E"]:
model_info = f"{model_name} {words['control_run']}"
Expand Down

0 comments on commit 8280c74

Please sign in to comment.