Skip to content
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

Merged
merged 9 commits into from
Apr 28, 2019

Conversation

msmith-ccom
Copy link
Collaborator

Initial pull request addressing issue #23 points 1 and 2

@msmith-ccom
Copy link
Collaborator Author

msmith-ccom commented Apr 24, 2019

@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.

Copy link
Collaborator

@giumas giumas left a 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
Copy link
Collaborator

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:
Copy link
Collaborator

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
Copy link
Collaborator

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):
Copy link
Collaborator

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()))
Copy link
Collaborator

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!

@giumas giumas merged commit fb60459 into hydroffice:master Apr 28, 2019
@msmith-ccom msmith-ccom deleted the support_regional_OFS_models branch May 6, 2019 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants