Skip to content
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

Ipc forests #746

Merged
merged 115 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
0e07a83
starts ipc forests reader
dulte Aug 10, 2022
b165d8b
Halfway through making reader
dulte Sep 8, 2022
4ee082c
First working version of reader
dulte Sep 12, 2022
c4bf576
Sampler type filter added
dulte Sep 12, 2022
0381478
Adds sea salt correction to so4 dep
dulte Sep 15, 2022
d5c78c1
Changes how and where ts_type is calculated
dulte Sep 15, 2022
c047ba2
Adds some docstrings to metadata.py
dulte Sep 15, 2022
638316a
Adds total dep, check quality flags, and uses only the lowest sea sal…
dulte Sep 26, 2022
c0ef4d4
Merge branch 'main-dev' into ipc-forests
dulte Sep 26, 2022
b4b14ee
Can now read new model data
dulte Oct 6, 2022
8dfe6bb
Adds multiple variables
dulte Oct 11, 2022
9b250a0
More variables for task4041
dulte Oct 26, 2022
6527c4f
Adds vmr to conc for aerocom model data, in a compicated way
dulte Oct 26, 2022
f7ec1a7
Adds more variables to task4041
dulte Oct 31, 2022
fb69568
Merge branch 'main-dev' into ipc-forests
dulte Nov 14, 2022
a73f473
Adds fakedrydep and totdep
dulte Nov 23, 2022
6c90924
change path to standard aerocm location
Jan 2, 2023
42a29db
Merge branch 'griesie_fix_802' into ipc-forests
Jan 9, 2023
bedee59
switch to storeB
jgriesfeller Jan 11, 2023
7ba24e0
remove another storeA location
jgriesfeller Jan 11, 2023
e3eb3ce
Merge remote-tracking branch 'origin/ipc-forests' into ipc-forests
Jan 12, 2023
f23f897
Merge branch 'griesie-fix-759' into ipc-forests
Jan 12, 2023
d844879
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
Jan 23, 2023
539a7f0
make compatible to Python versions < 3.10
jgriesfeller Jan 26, 2023
13ff522
added udunit for mg/m2/h
jgriesfeller Jan 30, 2023
79d5aba
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
Feb 2, 2023
d667105
implement color scales from Hilde
lewisblake Feb 3, 2023
f10a0aa
run black
lewisblake Feb 3, 2023
04fae58
added alias prmm = pr used in task4041
Feb 6, 2023
ade062d
Merge pull request #818 from metno/ipc-forest-update-color_defaults
jgriesfeller Feb 7, 2023
fa6de39
Merge branch 'main-dev' into ipc-forests
jgriesfeller Feb 7, 2023
b3ab8f1
added udunit for mg/m2/h
jgriesfeller Feb 7, 2023
e647162
create fake wetdep variables for EBASMC obs network
Feb 8, 2023
f96b939
removed raise MetaDataError for data without flags. See comment for d…
jgriesfeller Feb 10, 2023
9c92244
updated version
jgriesfeller Feb 15, 2023
fd94da8
Merge branch 'griesie_fix_802' into ipc-forests
jgriesfeller Feb 27, 2023
683492d
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
Mar 23, 2023
6776152
add apt update to get recent IPs
Mar 23, 2023
8921f82
move apt update from docs yo venv
Mar 23, 2023
7a639f2
linting
Mar 23, 2023
30ef259
move code to plugins
Mar 23, 2023
2f34f03
move code location
Mar 23, 2023
a9ed982
linting
Mar 23, 2023
9ce7c6c
Merge branch 'griesie-fix-837' into ipc-forests
Mar 24, 2023
59fc53e
adjust tests to new variables
Mar 24, 2023
157b969
remove private path
Mar 24, 2023
74d47b7
remove private clutter
Mar 24, 2023
2fa2dbc
linting
Mar 24, 2023
f4fc181
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller Mar 27, 2023
052a514
linting
jgriesfeller Mar 27, 2023
bb6b8cb
remove clutter
jgriesfeller Mar 27, 2023
99a73a8
added data_searchdirno; there's one absolute path in path.ini now
jgriesfeller Mar 27, 2023
9ca9a86
linting
jgriesfeller Mar 27, 2023
b12a6e8
start ipcforests testing
jgriesfeller Mar 27, 2023
c621108
some more testing
jgriesfeller Mar 27, 2023
6aeef68
linting
Mar 28, 2023
c007b97
take years without data for a species into account
Mar 28, 2023
cc22095
added a simple metadata test
Mar 28, 2023
7160181
linting
Mar 28, 2023
80119c7
replace fake with proxy in all variable names; linting
Mar 29, 2023
2be6358
linting
Mar 29, 2023
613f2e1
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller Apr 11, 2023
d425203
updated due to PR review
jgriesfeller Apr 11, 2023
f01a4f9
Merge remote-tracking branch 'origin/ipc-forests' into ipc-forests
jgriesfeller Apr 11, 2023
8a845a7
add some deepcopy calls
jgriesfeller Apr 14, 2023
407e3d7
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller May 8, 2023
9857f49
WIP on correcting the diurnal cycle calculation
jgriesfeller May 8, 2023
34ee6ea
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller May 11, 2023
73b1be0
Merge branch 'griesie-865-adjust-aeroval-color-scales' into ipc-forests
May 23, 2023
4c13574
Merge remote-tracking branch 'origin/ipc-forests' into ipc-forests
May 23, 2023
5eb9aae
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller Jun 21, 2023
6b9b90b
corrected wetso4 definition
jgriesfeller Jul 3, 2023
c70fc31
introduced wetoxst and wetoxsc as variables
jgriesfeller Jul 4, 2023
e662d4c
introduced wetoxst and wetoxsc as variables
jgriesfeller Jul 4, 2023
e4fcfe6
introduced wetoxst and wetoxsc as variables
jgriesfeller Jul 4, 2023
19e7a8d
add DOMOS path
jgriesfeller Jul 4, 2023
14e2778
addes wetsoxsc and wetoxst definition
jgriesfeller Jul 4, 2023
a0d6d87
Merge branch 'main-dev' into ipc-forests
jgriesfeller Aug 21, 2023
d69f9ad
adjusted some colorbars
jgriesfeller Aug 28, 2023
0eaf4e1
linting
Sep 28, 2023
5d3742b
try to solve CI linting
Sep 28, 2023
419a82d
try to solve CI linting
Sep 28, 2023
97ae41a
remove black version
Sep 28, 2023
e9ee2f6
update black version
Sep 28, 2023
75a2b5d
linting (isort)
Sep 28, 2023
01a28b2
linting
Sep 28, 2023
7fc386f
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller Sep 29, 2023
0c5aef3
added variable wetna
jgriesfeller Sep 29, 2023
c13c2c2
adjusted wetoxs, wetrdn and wetoxn color bars
Oct 5, 2023
86362a3
Merge remote-tracking branch 'origin/ipc-forests' into ipc-forests
Oct 5, 2023
bd43541
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
Oct 5, 2023
2c325fd
added variable wetna
jgriesfeller Oct 6, 2023
143cc9a
Merge remote-tracking branch 'origin/ipc-forests' into ipc-forests
jgriesfeller Oct 6, 2023
827ca7a
Merge remote-tracking branch 'origin/fix922' into ipc-forests
jgriesfeller Oct 10, 2023
f5d9504
various changes to variable wetna for aeroval
Oct 11, 2023
41b4669
added deposition to forrest variables
jgriesfeller Oct 12, 2023
4021179
Merge remote-tracking branch 'origin/ipc-forests' into ipc-forests
jgriesfeller Oct 12, 2023
3bf5929
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller Oct 12, 2023
7ee8042
add statistics_model_only again that was accidently removed during merge
jgriesfeller Oct 12, 2023
ec52c40
added proxy wetdeps
jgriesfeller Oct 12, 2023
d3a65af
Merge remote-tracking branch 'origin/fix_diurnal' into ipc-forests
Oct 13, 2023
3d1d71b
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
jgriesfeller Oct 16, 2023
671f417
linting
jgriesfeller Oct 16, 2023
f3b8b3d
adjust to new plugin structure for obs reading
jgriesfeller Oct 16, 2023
b943b20
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
Oct 18, 2023
8e0ab9d
adjust tests
Oct 18, 2023
322d9f1
adjust tests
Oct 19, 2023
7862fcd
linting
Oct 19, 2023
1f84fce
Merge remote-tracking branch 'origin/main-dev' into ipc-forests
Oct 31, 2023
47529cb
added more variables
Oct 31, 2023
d0b18cd
removed duplicate wetpm10 entry introduced by merging mein-dev
Oct 31, 2023
288de77
removed unused code
Oct 31, 2023
e978e28
adjusted to review
Oct 31, 2023
da622bf
adjusted to review
Oct 31, 2023
1016ee7
adjusted test
Oct 31, 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
25 changes: 15 additions & 10 deletions pyaerocom/aeroval/coldatatojson_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from copy import deepcopy
from datetime import datetime
from typing import Literal

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -381,12 +382,16 @@
return output_array


def _get_period_keys(resolution):
if resolution == "seasonal":
period_keys = ["DJF", "MAM", "JJA", "SON"]
elif resolution == "yearly":
period_keys = ["Annual"]
return period_keys
def _get_period_keys(resolution: Literal["seasonal", "yearly"]):
period_keys = dict(
seasonal=["DJF", "MAM", "JJA", "SON"],
yearly=["All"],
)

if resolution not in period_keys:
raise ValueError(f"Unknown {resolution=}")

Check warning on line 392 in pyaerocom/aeroval/coldatatojson_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aeroval/coldatatojson_helpers.py#L392

Added line #L392 was not covered by tests

return period_keys[resolution]


def _process_one_station_weekly(stat_name, i, repw_res, meta_glob, time):
Expand Down Expand Up @@ -426,8 +431,8 @@

ts_data = {
"time": time,
"seasonal": {"obs": yeardict, "mod": yeardict},
"yearly": {"obs": yeardict, "mod": yeardict},
"seasonal": {"obs": deepcopy(yeardict), "mod": deepcopy(yeardict)},
"yearly": {"obs": deepcopy(yeardict), "mod": deepcopy(yeardict)},
Comment on lines +434 to +435
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the need for deepcopy to create different copies of the same empty dictionary, but would not be better to use collections.defaultdict (see docs)?

Here is how it looks like with collections.defaultdict

from collections import defaultdict
...

    ts_data = {
        "time": time,
        "seasonal": {"obs": defaultdict(dict), "mod": defaultdict(dict)},
        "yearly": {"obs": defaultdict(dict), "mod": defaultdict(dict)},
    }

Copy link
Member

@jgriesfeller jgriesfeller Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did not know about defaultdict, but did you see the init of yeardict?

years = list(repw_res["seasonal"].year.values)
yeardict = {}
for year in years:
yeardict[f"{year}"] = {}

yeardict has some predifined keys which wouldn't be in your defaultdict(dict), right?

}
ts_data["station_name"] = stat_name
ts_data.update(meta_glob)
Expand Down Expand Up @@ -526,8 +531,8 @@
for regid, regname in region_ids.items():
ts_data = {
"time": time,
"seasonal": {"obs": yeardict, "mod": yeardict},
"yearly": {"obs": yeardict, "mod": yeardict},
"seasonal": {"obs": deepcopy(yeardict), "mod": deepcopy(yeardict)},
"yearly": {"obs": deepcopy(yeardict), "mod": deepcopy(yeardict)},
jgriesfeller marked this conversation as resolved.
Show resolved Hide resolved
}
ts_data["station_name"] = regname
ts_data.update(meta_glob)
Expand Down
3 changes: 3 additions & 0 deletions pyaerocom/aeroval/experiment_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from pyaerocom.aeroval.glob_defaults import (
extended_statistics,
statistics_defaults,
statistics_model_only,
statistics_obs_only,
statistics_trend,
var_ranges_defaults,
Expand Down Expand Up @@ -574,6 +575,8 @@
def _create_statistics_json(self):
if self.cfg.statistics_opts.obs_only_stats:
stats_info = statistics_obs_only
elif self.cfg.statistics_opts.model_only_stats:
stats_info = statistics_model_only

Check warning on line 579 in pyaerocom/aeroval/experiment_output.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aeroval/experiment_output.py#L579

Added line #L579 was not covered by tests
else:
stats_info = statistics_defaults
stats_info.update(extended_statistics)
Expand Down
122 changes: 119 additions & 3 deletions pyaerocom/aeroval/glob_defaults.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name "fake" probably should be changed at some point to something more descriptive like "synthetic"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with @MichaelSchulzMETNO we already said that we will use the word proxy instead. I will go through it and change the names.

Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,17 @@
"scale": [0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0],
"colmap": "coolwarm",
},
"wetoxs": {"scale": [0, 1.25, 2.5, 3.75, 5, 6.25, 7.5, 8.75, 10], "colmap": "coolwarm"},
"wetoxn": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"wetoxs": {"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5], "colmap": "coolwarm"},
"wetna": {"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5], "colmap": "coolwarm"},
"wetoxn": {"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5], "colmap": "coolwarm"},
"wetrdn": {
"scale": [0, 0.75, 1.5, 2.25, 3.0, 3.75, 4.5, 5.25, 6.0, 6.75, 7.5, 8.25],
"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5],
"colmap": "coolwarm",
},
"wetoxsf": {"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5], "colmap": "coolwarm"},
"wetoxnf": {"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5], "colmap": "coolwarm"},
"wetrdnf": {
"scale": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 1, 1.5],
"colmap": "coolwarm",
},
"prmm": {"scale": [0, 1.25, 2.5, 3.75, 5, 6.25, 7.5, 8.75, 10], "colmap": "coolwarm"},
Expand All @@ -215,6 +222,7 @@
"colmap": "coolwarm",
},
"drydust": {
# "scale": [0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

"scale": [0.0, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, 200.0, 500.0, 1000.0],
"colmap": "coolwarm",
},
Expand Down Expand Up @@ -255,6 +263,58 @@
"colmap": "coolwarm",
},
"ts": {"scale": [265, 270, 275, 280, 285, 290, 300, 305, 310, 315, 320], "colmap": "coolwarm"},
"proxydryo3": {"scale": [0, 0.5, 1, 15, 20, 25, 0.30, 40, 50], "colmap": "coolwarm"},
"proxydrypm10": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"proxydrypm25": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"proxydryno2": {
"scale": [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4],
"colmap": "coolwarm",
},
"proxydryhono": {"scale": [0.001, 0.002, 0.003, 0.004, 0.005, 0.006], "colmap": "coolwarm"},
"proxydryn2o5": {"scale": [0.01, 0.02, 0.03, 0.04, 0.05], "colmap": "coolwarm"},
"proxydryhno3": {
"scale": [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4],
"colmap": "coolwarm",
},
"proxydryno3c": {
"scale": [0.01, 0.02, 0.03, 0.04, 0.05],
"colmap": "coolwarm",
},
"proxydryno3f": {"scale": [0.01, 0.02, 0.03, 0.04, 0.05], "colmap": "coolwarm"},
"proxydrynh3": {
"scale": [0, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80],
"colmap": "coolwarm",
},
"proxydrynh4": {
"scale": [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4],
"colmap": "coolwarm",
},
"proxydryso2": {
"scale": [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4],
"colmap": "coolwarm",
},
"proxydryso4": {
"scale": [0.01, 0.02, 0.03, 0.04, 0.05],
"colmap": "coolwarm",
},
"proxydryoxs": {
"scale": [0, 0.05, 0.1, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40],
"colmap": "coolwarm",
},
"proxydryoxn": {
"scale": [0, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80],
"colmap": "coolwarm",
},
"proxydryrdn": {
"scale": [0, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80],
"colmap": "coolwarm",
},
"depoxs": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"depoxn": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"deprdn": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"depoxsf": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"depoxnf": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
"deprdnf": {"scale": [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], "colmap": "coolwarm"},
}

#: Default information for statistical parameters
Expand Down Expand Up @@ -451,6 +511,18 @@
},
}

# For experiments where only model data is interesting, as with proxy drydep
statistics_model_only = {
"data_mean": {
"name": "Mean-Mod",
"longname": "Model Mean",
"scale": None,
"colmap": "coolwarm",
"unit": "1",
"decimals": 2,
},
}

#: Mapping of pyaerocom variable names to web naming conventions
## Note: A 2D variable is defined under Column on the website, 3D is defined under Surface
var_web_info = dict(
Expand Down Expand Up @@ -487,6 +559,7 @@
concNno=["NO", "3D", "Concentration"],
concno2=["NO2", "3D", "Gas concentrations"],
concNno2=["NO2", "3D", "Gas concentrations"],
vmrno=["NO", "3D", "Volume mixing ratios"],
vmrno2=["NO2", "3D", "Volume mixing ratios"],
concno3=["NO3", "3D", "Gas concentrations"],
conctno3=["tNO3", "3D", "Concentration"],
Expand All @@ -509,6 +582,11 @@
concco=["CO", "3D", "Particle concentration"],
vmrco=["CO", "3D", "Volume mixing ratios"],
vmrco2=["CO2", "3D", "Volume mixing ratios"],
vmrc2h2=["Ethyne", "3D", "Volume mixing ratios"],
vmrc2h4=["Ethylene", "3D", "Volume mixing ratios"],
vmrc2h6=["Ethane", "3D", "Volume mixing ratios"],
vmrhcho=["Formaldehyde", "3D", "Volume mixing ratios"],
vmrisop=["Isoprene", "3D", "Volume mixing ratios"],
vmrch4=["CH4", "3D", "Volume mixing ratios"],
# PMs
concpm10=["PM10", "3D", "Particle concentrations"],
Expand Down Expand Up @@ -543,9 +621,47 @@
drydust=["DryDustDep", "3D", "Deposition"],
wetdust=["WetDustDep", "3D", "Deposition"],
wetoxs=["WetOXS", "3D", "Deposition"],
wetoxsc=["WetOXScorr", "3D", "Deposition"],
wetoxst=["WetOXStot", "3D", "Deposition"],
wetoxn=["WetOXN", "3D", "Deposition"],
wetrdn=["WetRDN", "3D", "Deposition"],
prmm=["Precipitation", "3D", "Deposition"],
# Temperature
ts=["Surface Temperature", "3D", "Temperature"],
# proxy drydep
proxydryoxs=["proxyDryOXS", "3D", "Deposition"],
proxydryso2=["proxyDrySO2", "3D", "Deposition"],
proxydryso4=["proxyDrySO4", "3D", "Deposition"],
proxydryoxn=["proxyDryOXN", "3D", "Deposition"],
proxydryno2=["proxyDryNO2", "3D", "Deposition"],
proxydryno2no2=["proxyDryNO2NO2", "3D", "Deposition"],
proxydryhono=["proxyDryHONO", "3D", "Deposition"],
proxydryn2o5=["proxyDryN2O5", "3D", "Deposition"],
proxydryhno3=["proxyDryHNO3", "3D", "Deposition"],
proxydryno3c=["proxyDryNO3Coarse", "3D", "Deposition"],
proxydryno3f=["proxyDryNO3Fine", "3D", "Deposition"],
proxydryrdn=["proxyDryRDN", "3D", "Deposition"],
proxydrynh3=["proxyDryNH3", "3D", "Deposition"],
proxydrynh4=["proxyDryNH4", "3D", "Deposition"],
proxydryo3=["proxyDryO3", "3D", "Deposition"],
proxydrypm10=["proxyDryPM10", "3D", "Deposition"],
proxydrypm25=["proxyDryPM2.5", "3D", "Deposition"],
# proxy wetdep
proxywetoxs=["proxyWetOXS", "3D", "Deposition"],
proxywetso2=["proxyWetSO2", "3D", "Deposition"],
proxywetso4=["proxyWetSO4", "3D", "Deposition"],
proxywetoxn=["proxyWetOXN", "3D", "Deposition"],
proxywetno2=["proxyWetNO2", "3D", "Deposition"],
proxywetno2no2=["proxyWetNO2NO2", "3D", "Deposition"],
proxywethono=["proxyWetHONO", "3D", "Deposition"],
proxywetn2o5=["proxyWetN2O5", "3D", "Deposition"],
proxywethno3=["proxyWetHNO3", "3D", "Deposition"],
proxywetno3c=["proxyWetNO3Coarse", "3D", "Deposition"],
proxywetno3f=["proxyWetNO3Fine", "3D", "Deposition"],
proxywetrdn=["proxyWetRDN", "3D", "Deposition"],
proxywetnh3=["proxyWetNH3", "3D", "Deposition"],
proxywetnh4=["proxyWetNH4", "3D", "Deposition"],
proxyweto3=["proxyWetO3", "3D", "Deposition"],
proxywetpm10=["proxyWetPM10", "3D", "Deposition"],
proxywetpm25=["proxyWetPM2.5", "3D", "Deposition"],
)
2 changes: 1 addition & 1 deletion pyaerocom/aeroval/obsentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ObsEntry(BrowseDict):
(c.g. :class:`pyaerocom.io.ReadUngridded`).
"""

SUPPORTED_VERT_CODES = ["Column", "Profile", "Surface"]
SUPPORTED_VERT_CODES = ["Column", "Profile", "Surface"] # , "2D"]
ALT_NAMES_VERT_CODES = dict(ModelLevel="Profile")

SUPPORTED_VERT_LOCS = DataSource.SUPPORTED_VERT_LOCS
Expand Down
1 change: 1 addition & 0 deletions pyaerocom/aeroval/setupclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def __init__(self, **kwargs):
self.use_fairmode = False
self.use_diurnal = False
self.obs_only_stats = False
self.model_only_stats = False
self.update(**kwargs)


Expand Down
110 changes: 110 additions & 0 deletions pyaerocom/aux_var_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,52 @@
return _compute_wdep_from_concprcp_helper(data, "wetoxs", "concprcpoxs", "pr")


def compute_wetoxs_from_concprcpoxst(data):
"""Compute wdep from conc in precip and precip data

Note
----
In addition to the returned numpy array, the input instance of
:class:`StationData` is modified by additional metadata and flags for
the new variable. See also :func:`_compute_wdep_from_concprcp_helper`.

Parameters
----------
StationData
data object containing concprcp and precip data

Returns
-------
numpy.ndarray
array with wet deposition values

"""
return _compute_wdep_from_concprcp_helper(data, "wetoxs", "concprcpoxst", "pr")

Check warning on line 586 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L586

Added line #L586 was not covered by tests


def compute_wetoxs_from_concprcpoxsc(data):
"""Compute wdep from conc in precip and precip data

Note
----
In addition to the returned numpy array, the input instance of
:class:`StationData` is modified by additional metadata and flags for
the new variable. See also :func:`_compute_wdep_from_concprcp_helper`.

Parameters
----------
StationData
data object containing concprcp and precip data

Returns
-------
numpy.ndarray
array with wet deposition values

"""
return _compute_wdep_from_concprcp_helper(data, "wetoxs", "concprcpoxsc", "pr")

Check warning on line 609 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L609

Added line #L609 was not covered by tests


def compute_wetoxn_from_concprcpoxn(data):
"""Compute wdep from conc in precip and precip data

Expand Down Expand Up @@ -609,6 +655,22 @@
return _compute_wdep_from_concprcp_helper(data, "wetrdn", "concprcprdn", "pr")


def compute_wetnh4_from_concprcpnh4(data):
return _compute_wdep_from_concprcp_helper(data, "wetnh4", "concprcpnh4", "pr")

Check warning on line 659 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L659

Added line #L659 was not covered by tests


def compute_wetno3_from_concprcpno3(data):
return _compute_wdep_from_concprcp_helper(data, "wetno3", "concprcpno3", "pr")

Check warning on line 663 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L663

Added line #L663 was not covered by tests


def compute_wetso4_from_concprcpso4(data):
return _compute_wdep_from_concprcp_helper(data, "wetso4", "concprcpso4", "pr")

Check warning on line 667 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L667

Added line #L667 was not covered by tests


def compute_wetna_from_concprcpna(data):
return _compute_wdep_from_concprcp_helper(data, "wetna", "concprcpna", "pr")

Check warning on line 671 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L671

Added line #L671 was not covered by tests


def vmrx_to_concx(data, p_pascal, T_kelvin, vmr_unit, mmol_var, mmol_air=None, to_unit=None):
"""
Convert volume mixing ratio (vmr) to mass concentration
Expand Down Expand Up @@ -725,3 +787,51 @@
# print(data.var_info)
# exit()
return o3max


def identity(data):
return data

Check warning on line 793 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L793

Added line #L793 was not covered by tests


def make_proxy_drydep_from_O3(data):
# sort of prototype to add a compted variable
# one has to extend the data structures of the station data object
# 'right', but has to return just the data array
# That concept is a bit confusing (why not do everything in data here?)
var_name = "vmro3"
new_var_name = "proxydryo3"

Check warning on line 802 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L801-L802

Added lines #L801 - L802 were not covered by tests

flags = data.data_flagged[var_name]
new_var_data = data[var_name]
units = data.var_info[var_name]["units"]

Check warning on line 806 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L804-L806

Added lines #L804 - L806 were not covered by tests
# data.var_info[new_var_name]["units"] = units

if not new_var_name in data.var_info:
data.var_info[new_var_name] = {}
data.var_info[new_var_name] = data.var_info[var_name]
data.var_info[new_var_name]["units"] = "mg m-2 d-1"

Check warning on line 812 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L809-L812

Added lines #L809 - L812 were not covered by tests

data.data_flagged[new_var_name] = flags
return new_var_data

Check warning on line 815 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L814-L815

Added lines #L814 - L815 were not covered by tests


def make_proxy_wetdep_from_O3(data):
# sort of prototype to add a compted variable
# one has to extend the data structures of the station data object
# 'right', but has to return just the data array
# That concept is a bit confusing (why not do everything in data here?)
var_name = "vmro3"
new_var_name = "proxyweto3"

Check warning on line 824 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L823-L824

Added lines #L823 - L824 were not covered by tests

flags = data.data_flagged[var_name]
new_var_data = data[var_name]
units = data.var_info[var_name]["units"]

Check warning on line 828 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L826-L828

Added lines #L826 - L828 were not covered by tests
# data.var_info[new_var_name]["units"] = units

if not new_var_name in data.var_info:
data.var_info[new_var_name] = {}
data.var_info[new_var_name] = data.var_info[var_name]
data.var_info[new_var_name]["units"] = "mg m-2 d-1"

Check warning on line 834 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L831-L834

Added lines #L831 - L834 were not covered by tests

data.data_flagged[new_var_name] = flags
return new_var_data

Check warning on line 837 in pyaerocom/aux_var_helpers.py

View check run for this annotation

Codecov / codecov/patch

pyaerocom/aux_var_helpers.py#L836-L837

Added lines #L836 - L837 were not covered by tests
2 changes: 1 addition & 1 deletion pyaerocom/colocation_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class ColocationSetup(BrowseDict):
#: file for ec550aer at the surface ('*ec550aer*Surface*.nc'), then, the
#: colocation routine will look for '*ec550aer*ModelLevel*.nc' and if this
#: exists, it will load it and extract the surface level.
OBS_VERT_TYPES_ALT = {"Surface": "ModelLevel"}
OBS_VERT_TYPES_ALT = {"Surface": "ModelLevel", "2D": "2D"}

#: do not raise Exception if invalid item is attempted to be assigned
#: (Overwritten from base class)
Expand Down
Loading
Loading