-
Notifications
You must be signed in to change notification settings - Fork 284
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
NIMROD loading #54
NIMROD loading #54
Conversation
osgb_cs = iris.coord_systems.HorizontalCS(datum="PLACEHOLDER OSGB") | ||
# osgb_cs = iris.coord_systems.TransverseMercator(GeogCS(6377563.396, 6356256.909, 299.3249646, "m"), | ||
# origin=(49,-2), false_origin=(-400,100), | ||
# scale_factor=0.9996012717) |
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.
@bblay I've taken a look at nimrod.py and put a bunch of comments inline. I've also looked over your proposed changes to the file format mechanism. I have a number of issues that I'd like to discuss on this, and I'd rather not mix up the two discussions or hold up the NIMROD functionality any more than necessary. Could you split these two sets of changes out into two separate pull requests? |
All review avctions implemented except:
Format recognition moved into https://github.com/bblay/iris/tree/formats for later. |
cube.units = self.units.strip() | ||
except ValueError: | ||
# Just add it as an attribute. | ||
cube.attributes["invalid_units"] = self.units.strip() |
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.
Not sure about this behaviour. Have you come across such units?
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.
yeah, the sample data I'm loading is in m/2-25k
!
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.
I'm a little uneasy about this too, but improving the unit handling is a significant chunk of work. Although this differs from the rest of the loaders (which don't attempt to catch the exception) I think it's reasonable workaround. I think a warning is in order though to let the user know the units could not be parsed and have been squirrelled away.
On the whole, I think the nimrod reading would benefit from using |
I should add that it would be nice to extract the names of the nimrod variables out to a tuple so that should anyone wish to implement saving in the future, the process would be fairly straight forward. |
def __init__(self, from_file=None): | ||
"""Create a NimrodField object and optionally read from an open file. | ||
|
||
Example: |
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.
Should there be a double ':' here?
Ready. |
class TestGribLoad(tests.GraphicsTest): | ||
|
||
def test_load(self): | ||
cube = iris.load(tests.get_data_path(('NIMROD', 'uk2km', 'WO0000000003452', '201007020900_u1096_ng_ey00_visibility0180_screen_2km')))[0] |
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.
long line
i do believe it is ok to go. |
raise TranslationError("Corner {0} not yet implemented".format(self.origin_corner)) | ||
|
||
def to_cube(self): | ||
"""Return a new :class:`~iris.cube.Cube`, created from this NimrodField.""" |
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.
Don't need the ~
.
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 ~ make it say Cube rather than iris.cube.Cube.
Will keep if that's ok.
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.
Until we can agree on a standard for this I'm going to go with the author's preference. Easy fix if we change our minds.
With hindsight, it's probably not helpful for me to be continually doing review actions and pushing rebased commits while you're still going. Probably better to wait until reviewers signal they have finished. |
No description provided.