-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support regional ofs models #24
Support regional ofs models #24
Conversation
…e included, even ones without regular grids.
@giumas please note that all Regional OFS models are able to be queried. Ones that do not have regular grids return url fetch errors currently. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few minors to correct.
logging.basicConfig(level=logging.DEBUG, | ||
format="%(levelname)-9s %(name)s.%(funcName)s:%(lineno)d > %(message)s") | ||
logger = logging.getLogger(__name__) | ||
|
||
switch = "LEOFS" # WOA09 or WOA13 or RTOFS or GoMOFS or LEOFS or LHOFS | ||
# Choose Model | ||
switch = 21 # Choose a ModelOptions Value to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hard-coding of an integer is not the intent of having an enumeration. Use ModelOptions.TBOFS
!
if switch == "WOA09": | ||
model = ModelOptions | ||
|
||
if switch == model.WOA09.value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be: switch is ModelOption.WOA09
] | ||
|
||
if switch == "WOA09": | ||
model = ModelOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doing this aliasing?
@@ -10,26 +10,76 @@ | |||
from hyo2.soundspeedmanager.qt_callbacks import QtCallbacks | |||
|
|||
|
|||
class ModelOptions(IntEnum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you duplicating this enumeration? You should just import and use the one in regofs.py
.
@@ -153,6 +161,11 @@ def query(self, lat: Optional[float], lon: Optional[float], datestamp: Union[dat | |||
logger.critical("while converting location to grid coords, %s" % e) | |||
return None | |||
|
|||
ocean_time = self._file.variables['ocean_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())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are better ways to align text than using tabs!
Initial pull request addressing issue #23 points 1 and 2