Skip to content

Commit

Permalink
Add variable long names to provenance record in monitoring diagnostics (
Browse files Browse the repository at this point in the history
  • Loading branch information
bsolino authored Jun 16, 2023
1 parent e17d1c8 commit 81fbf42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/sphinx/source/community/diagnostic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ It is also possible to add more information for the implemented diagnostics usin
- :code:`domains` a list of spatial coverage of the dataset
- :code:`plot_types` a list of plot types if the diagnostic created a plot, e.g. error bar
- :code:`statistics` a list of types of the statistic, e.g. anomaly
- :code:`long_names` a list of long names of used variables, e.g. Air Temperature

Arbitrarily named other items are also supported.

Expand Down
1 change: 1 addition & 0 deletions esmvaltool/diag_scripts/monitor/monitor_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def record_plot_provenance(self, filename, var_info, plot_type, **kwargs):
prov = self.get_provenance_record(
ancestor_files=[var_info['filename']],
plot_type=plot_type,
long_names=[var_info[names.LONG_NAME]],
**kwargs,
)
provenance_logger.log(filename, prov)
Expand Down
5 changes: 5 additions & 0 deletions esmvaltool/diag_scripts/monitor/multi_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,7 @@ def create_timeseries_plot(self, datasets, short_name):
'authors': ['schlund_manuel'],
'caption': caption,
'plot_types': ['line'],
'long_names': [var_attrs['long_name']],
}
with ProvenanceLogger(self.cfg) as provenance_logger:
provenance_logger.log(plot_path, provenance_record)
Expand Down Expand Up @@ -1332,6 +1333,7 @@ def create_annual_cycle_plot(self, datasets, short_name):
'authors': ['schlund_manuel'],
'caption': caption,
'plot_types': ['seas'],
'long_names': [var_attrs['long_name']],
}
with ProvenanceLogger(self.cfg) as provenance_logger:
provenance_logger.log(plot_path, provenance_record)
Expand Down Expand Up @@ -1406,6 +1408,7 @@ def create_map_plot(self, datasets, short_name):
'authors': ['schlund_manuel'],
'caption': caption,
'plot_types': ['map'],
'long_names': [dataset['long_name']],
}
with ProvenanceLogger(self.cfg) as provenance_logger:
provenance_logger.log(plot_path, provenance_record)
Expand Down Expand Up @@ -1483,6 +1486,7 @@ def create_zonal_mean_profile_plot(self, datasets, short_name):
'authors': ['schlund_manuel'],
'caption': caption,
'plot_types': ['vert'],
'long_names': [dataset['long_name']],
}
with ProvenanceLogger(self.cfg) as provenance_logger:
provenance_logger.log(plot_path, provenance_record)
Expand Down Expand Up @@ -1585,6 +1589,7 @@ def create_1d_profile_plot(self, datasets, short_name):
'authors': ['schlund_manuel', 'winterstein_franziska'],
'caption': caption,
'plot_types': ['line'],
'long_names': [var_attrs['long_name']],
}
with ProvenanceLogger(self.cfg) as provenance_logger:
provenance_logger.log(plot_path, provenance_record)
Expand Down

0 comments on commit 81fbf42

Please sign in to comment.