Skip to content

Commit

Permalink
Merge branch 'main-dev' into 1175-evaluation-of-uemep-output-in-pyaer…
Browse files Browse the repository at this point in the history
…oval
  • Loading branch information
heikoklein committed Jul 24, 2024
2 parents 54bde5e + 034fe3c commit d3d409f
Show file tree
Hide file tree
Showing 39 changed files with 2,858 additions and 97 deletions.
6 changes: 6 additions & 0 deletions docs/api-aeroval.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ High-level utility functions
.. automodule:: pyaerocom.aeroval.utils
:members:

High-level functions for emep reporting
---------------------------------------

.. automodule:: pyaerocom.aeroval.config.emep.reporting_base
:members:

Helper modules
--------------

Expand Down
15 changes: 14 additions & 1 deletion pyaerocom/aeroval/coldatatojson_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
_process_sites,
_process_sites_weekly_ts,
_process_statistics_timeseries,
_remove_less_covered,
_write_site_data,
_write_stationdata_json,
add_profile_entry_json,
Expand Down Expand Up @@ -115,8 +116,11 @@ def process_coldata(self, coldata: ColocatedData):
diurnal_only = coldata.get_meta_item("diurnal_only")

add_trends = self.cfg.statistics_opts.add_trends
trends_min_yrs = self.cfg.statistics_opts.trends_min_yrs
trends_min_yrs = self.cfg.statistics_opts.stats_min_yrs

min_yrs = self.cfg.statistics_opts.obs_min_yrs
sequential_yrs = self.cfg.statistics_opts.sequential_yrs
avg_over_trends = self.cfg.statistics_opts.avg_over_trends
use_fairmode = self.cfg.statistics_opts.use_fairmode
use_diurnal = self.cfg.statistics_opts.use_diurnal

Expand Down Expand Up @@ -168,6 +172,11 @@ def process_coldata(self, coldata: ColocatedData):
model_name=model_name,
var_name_web=var_name_web,
)
if min_yrs > 0:
logger.info(
f"Removing stations with less than {min_yrs} years of continuous data, with sequential_yrs = {sequential_yrs}"
)
coldata = _remove_less_covered(coldata, min_yrs, sequential_yrs)

# get region IDs
(regborders, regs, regnames) = init_regions_web(coldata, regions_how)
Expand Down Expand Up @@ -209,6 +218,7 @@ def process_coldata(self, coldata: ColocatedData):
regs=regs,
stats_min_num=stats_min_num,
use_fairmode=use_fairmode,
avg_over_trends=avg_over_trends,
)
if coldata.ts_type == "hourly" and use_diurnal:
logger.info("Processing diurnal profiles")
Expand Down Expand Up @@ -335,6 +345,7 @@ def _process_stats_timeseries_for_all_regions(
regs: dict = None,
stats_min_num: int = 1,
use_fairmode: bool = False,
avg_over_trends: bool = False,
):
input_freq = self.cfg.statistics_opts.stats_tseries_base_freq
for reg in regnames:
Expand Down Expand Up @@ -370,6 +381,7 @@ def _process_stats_timeseries_for_all_regions(
seasons,
add_trends,
trends_min_yrs,
avg_over_trends,
)

for freq, hm_data in hm_all.items():
Expand Down Expand Up @@ -412,6 +424,7 @@ def _process_stats_timeseries_for_all_regions(
seasons,
add_trends,
trends_min_yrs,
avg_over_trends,
use_fairmode,
obs_var,
drop_stats,
Expand Down
Loading

0 comments on commit d3d409f

Please sign in to comment.