-
Notifications
You must be signed in to change notification settings - Fork 301
Revised grib load+save #482
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,8 +33,10 @@ | |
| iris.proxy.apply_proxy('gribapi', globals()) | ||
|
|
||
| import iris.coord_systems as coord_systems | ||
| # NOTE: careful here, to avoid circular imports (as iris imports grib) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove please |
||
| from iris.fileformats.grib import grib_phenom_translation as gptx | ||
| from iris.fileformats.grib import grib_save_rules | ||
| import iris.unit | ||
| import grib_save_rules | ||
|
|
||
|
|
||
|
|
||
|
|
@@ -308,7 +310,29 @@ def _compute_extra_keys(self): | |
| '_x_coord_name':unknown_string, '_y_coord_name':unknown_string, | ||
| # These are here to avoid repetition in the rules files, | ||
| # and reduce the very long line lengths. | ||
| '_x_points':None, '_y_points':None} | ||
| '_x_points':None, '_y_points':None, | ||
| '_cf_data':None} | ||
|
|
||
| # cf phenomenon translation | ||
| if edition == 1: | ||
| # Get centre code (N.B. self.centre has default type = string) | ||
| centre_number = gribapi.grib_get_long(self.grib_message, "centre") | ||
| # Look for a known grib1-to-cf translation (or None). | ||
| cf_data = gptx.grib1_phenom_to_cf_info( | ||
| table2_version=self.table2Version, | ||
| centre_number=centre_number, | ||
| param_number=self.indicatorOfParameter) | ||
| self.extra_keys['_cf_data'] = cf_data | ||
| elif edition == 2: | ||
| # Don't attempt to interpret params if 'master tables version' is | ||
| # 255, as local params may then have same codes as standard ones. | ||
| if self.tablesVersion != 255: | ||
| # Look for a known grib2-to-cf translation (or None). | ||
| cf_data = gptx.grib2_phenom_to_cf_info( | ||
| param_discipline=self.discipline, | ||
| param_category=self.parameterCategory, | ||
| param_number=self.parameterNumber) | ||
| self.extra_keys['_cf_data'] = cf_data | ||
|
|
||
| #reference date | ||
| self.extra_keys['_referenceDateTime'] = \ | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is a mismatch between the name
_cf_dataand the comment "ECMWF GRIB1 local params"