Skip to content

Commit

Permalink
Merge pull request #28 from NIVANorge/add-collection-attrs
Browse files Browse the repository at this point in the history
Add collection attrs to dataset defaults & loggers
  • Loading branch information
IvanaH8 authored Nov 26, 2024
2 parents 31a7555 + bd75a5f commit 9cd2180
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions dscreator/cfarray/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class DatasetAttrsDefaults:
# See https://htmlpreview.github.io/?https://github.com/metno/mmd/blob/master/doc/mmd-specification.html#iso-topic-categories
iso_topic_category: str = "Not available"
history: str = "Built with dscreator"
collection: str = "GEONOR"


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion dscreator/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def create(self, data_dict: dict[str, list]) -> xr.Dataset:

ds.attrs["id"] = self.uuid
ds["station_name"] = idarray(self.station_name, "timeseries_id")
ds.attrs["featureType"] = "timeseries"
ds.attrs["featureType"] = "timeSeries"

if self.is_acdd and ds.sizes["time"] > 0:
# need to have data to add acdd
Expand Down
1 change: 1 addition & 0 deletions dscreator/datasets/timeseries/msource.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def dataset_attributes(self, ds: xr.Dataset) -> DatasetAttrsDiscrete:
geospatial_lon_min=float(ds.longitude.min()),
geospatial_lon_max=float(ds.longitude.max()),
spatial_representation="point",
collection="GEONOR",
)

def variable_attributes(self, variable_name) -> dict:
Expand Down
3 changes: 2 additions & 1 deletion dscreator/datasets/timeseries/sios.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def dataset_attributes(self, ds: xr.Dataset) -> DatasetAttrsDiscrete:
geospatial_lon_max=float(ds.longitude.max()),
processing_level="Experimental",
comment="This dataset is not completely quality controlled",
spatial_representation="point"
spatial_representation="point",
collection="GEONOR, SIOSIN",
)


Expand Down

0 comments on commit 9cd2180

Please sign in to comment.