Skip to content

Commit

Permalink
fixed issues with OFS renamed files
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Oct 9, 2024
1 parent cecfe27 commit 38d790e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions examples/soundspeed/atlas/ex_atlases_auto_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ModelOptions(IntEnum):


# Choose Model
switch = ModelOptions.WOA18 # Choose a ModelOptions Value to test
switch = ModelOptions.GoMOFS # Choose a ModelOptions Value to test

app = QtWidgets.QApplication([]) # PySide stuff (start)
mw = QtWidgets.QMainWindow()
Expand All @@ -62,9 +62,9 @@ class ModelOptions(IntEnum):
# (72.852028, -67.315431, dt.utcnow()) # Baffin Bay
# (18.2648113, 16.1761115, dt.utcnow()), # in land -> middle of Africa
# (39.725989, -104.967745, dt.utcnow()) # in land -> Denver, CO
(37.985427, -76.311156, dt.utcnow()), # Chesapeake Bay
# (37.985427, -76.311156, dt.utcnow()), # Chesapeake Bay
# (39.162802, -75.278057, dt.utcnow()), # Deleware Bay
# (43.026480, -70.318824, dt.utcnow()), # offshore Portsmouth
(43.026480, -70.318824, dt.utcnow()), # offshore Portsmouth
# (40.662218, -74.049306, dt.utcnow()) # New York Harbor
# (30.382518, -81.573615, dt.utcnow()) # Mill Cove, St. Johns River
# (28.976225, -92.078882, dt. utcnow()) # Offshore Louisiana
Expand Down Expand Up @@ -291,4 +291,4 @@ class ModelOptions(IntEnum):
raise RuntimeError("invalid switch value: %s" % switch)
logger.info("execution time: %.3f s" % (time.time() - start_time))

app.exec_() # no need to actually run the message loop
app.exec() # no need to actually run the message loop
2 changes: 1 addition & 1 deletion hyo2/ssm2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
logger.addHandler(logging.NullHandler())

name = "Sound Speed"
__version__ = '2024.1.3'
__version__ = '2024.1.4'
__copyright__ = 'Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping'

pkg_info = PkgInfo(
Expand Down
6 changes: 3 additions & 3 deletions hyo2/ssm2/lib/atlas/regofsonline.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def query(self, lat: Optional[float], lon: Optional[float], dtstamp: Union[dt, N
logger.critical("while converting location to grid coords, %s" % e)
return None

ocean_time = self._file.variables['ocean_time']
ocean_time = self._file.variables['time']
datetime_retrieved = num2date(ocean_time[0], units=ocean_time.units, calendar=ocean_time.calendar)
logger.debug(('Query datetime:\t\t\t%s' % original_datestamp.isoformat()))
logger.debug("Retrieved datetime:\t\t%s" % datetime_retrieved.isoformat())
Expand Down Expand Up @@ -363,12 +363,12 @@ def _build_opendap_url(self, input_date: dt, name: str) -> str:
# nos.gomofs.regulargrid.n006.20200601.t00z.nc
if (name == self.Model.NGOFS.name) or (name == self.Model.CREOFS.name) or (name == self.Model.SFBOFS.name):
url = 'https://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/%s/MODELS/%s/%s/%s/' \
'nos.%s.regulargrid.n003.%s.t03z.nc' \
'%s.t03z.%s.regulargrid.n003.nc' \
% (name.upper(), input_date.strftime("%Y"), input_date.strftime("%m"), input_date.strftime("%d"),
name.lower(), input_date.strftime("%Y%m%d"))
else:
url = 'https://opendap.co-ops.nos.noaa.gov/thredds/dodsC/NOAA/%s/MODELS/%s/%s/%s/' \
'nos.%s.regulargrid.n003.%s.t00z.nc' \
'%s.t00z.%s.regulargrid.n003.nc' \
% (name.upper(), input_date.strftime("%Y"), input_date.strftime("%m"), input_date.strftime("%d"),
name.lower(), input_date.strftime("%Y%m%d"))
return url
Expand Down

0 comments on commit 38d790e

Please sign in to comment.