Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Feb 25, 2024
1 parent 988479b commit 235d104
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 4 additions & 5 deletions climetlab/readers/netcdf/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def to_bounding_box(self):
)

@cached_property
def projection(self):
def grid_mapping(self):
def tidy(x):
if isinstance(x, np.ndarray):
return x.tolist()
Expand All @@ -95,17 +95,16 @@ def tidy(x):
return x

return tidy(
self.owner.xr_dataset[self.owner.xr_dataset[self.variable].grid_mapping].attrs
self.owner.xr_dataset[
self.owner.xr_dataset[self.variable].grid_mapping
].attrs
)

# Compatibility to GRIb fields below

def grid_points(self):
return DataSet(self.owner.xr_dataset).grid_points(self.variable)

def grid_points_xy(self):
return DataSet(self.owner.xr_dataset).grid_points_xy(self.variable)

def to_numpy(self, reshape=True, dtype=None):
dimensions = dict((s.name, s.index) for s in self.slices)
values = self.owner.xr_dataset[self.variable].isel(dimensions).values
Expand Down
1 change: 0 additions & 1 deletion climetlab/readers/netcdf/fieldset.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ def __init__(self, *args, **kwargs):
MaskIndex.__init__(self, *args, **kwargs)
self.path = "<mask>"


@cached_property
def fields(self):
return list(self.index[i] for i in self.indices)
Expand Down

0 comments on commit 235d104

Please sign in to comment.