Skip to content

Commit

Permalink
better handle input dict
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenwh committed May 13, 2024
1 parent e222105 commit a3457f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nansat/mappers/mapper_meps_ncml.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ def __init__(self, ncml_url, gdal_dataset, gdal_metadata, netcdf_dim=None, *args
if not ncml_url.endswith(".ncml"):
raise WrongMapperError

ds = netCDF4.Dataset(ncml_url)
time = netcdf_dim["time"]
dt = time - np.datetime64(
datetime.datetime.fromisoformat(ds.time_coverage_start.replace("Z", "+00:00")))
dt = 0
if netcdf_dim is not None and "time" in netcdf_dim.keys():
ds = netCDF4.Dataset(ncml_url)
time = netcdf_dim["time"]
dt = time - np.datetime64(
datetime.datetime.fromisoformat(ds.time_coverage_start.replace("Z", "+00:00")))
import ipdb
ipdb.set_trace()
url = self._get_odap_url(ncml_url, np.round(dt))

super(Mapper, self).__init__(url, gdal_dataset, gdal_metadata, *args, **kwargs)
Expand Down

0 comments on commit a3457f1

Please sign in to comment.