Comments (8)
Hi,
Does this mean that mercator grid in general is not supported by iris-grib?
Yes, I'm afraid so. The process of adding mercator is entirely achievable, but it is multi-staged:
- Add the Mercator coordinate system to iris.coord_systems. Turns out, Iris already has it in https://github.com/SciTools/iris/blob/master/lib/iris/coord_systems.py#L826.
- Get iris-grib to construct a Mercator coordinate system much like is done for LambertConformal in https://github.com/SciTools/iris-grib/blob/master/iris_grib/__init__.py#L439
- If you want save support for your cube, add it much like LambertConformal in
iris-grib/iris_grib/_save_rules.py
Line 595 in 2680176
In all cases, take a look at the pull requests that created the reference work, so that you can follow a similar pattern of testing (a pre-requisite for accepting changes to the repository).
Hope that is helpful. Let me know if you need any more detail.
Cheers,
Phil
from iris-grib.
Hi @loxn8773, we've now added support to iris-grib for loading the Mercator grid definition template, which is available on the latest iris-grib master (with save support coming soon along with an iris-grib release that contains load and save support for Mercator). Could you check whether this fixes the issue you reported here?
from iris-grib.
Thank you all for your effort! I'm not sure if I did everything correct, so I set up a new conda env, installed iris and iris_grib from conda-forge.
The result is
(Iris) user@blablabla:~$ python iris-plot.py
iris.__version__: 2.1.0
iris_grib.__version__: 0.13.0
Traceback (most recent call last):
File "iris-plot.py", line 27, in <module>
cubes = iris.load(each)
File "miniconda2/envs/Iris/lib/python2.7/site-packages/iris/__init__.py", line 343, in load
return _load_collection(uris, constraints, callback).merged().cubes()
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/__init__.py", line 313, in _load_collection
result = iris.cube._CubeFilterCollection.from_cubes(cubes, constraints)
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/cube.py", line 145, in from_cubes
for cube in cubes:
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/__init__.py", line 300, in _generate_cubes
for cube in iris.io.load_files(part_names, callback, constraints):
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/io/__init__.py", line 210, in load_files
for cube in handling_format_spec.handler(fnames, callback):
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/fileformats/rules.py", line 429, in load_cubes
user_callback_wrapper=loadcubes_user_callback_wrapper):
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/fileformats/rules.py", line 348, in _load_pairs_from_fields_and_filenames
for field, filename in fields_and_filenames:
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris/fileformats/rules.py", line 412, in _generate_all_fields_and_filenames
filename, **loader.field_generator_kwargs):
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris_grib/__init__.py", line 711, in _load_generate
message = GribWrapper(message_id, grib_fh=grib_fh)
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris_grib/__init__.py", line 169, in __init__
self._compute_extra_keys()
File "/miniconda2/envs/Iris/lib/python2.7/site-packages/iris_grib/__init__.py", line 458, in _compute_extra_keys
raise TranslationError("unhandled grid type: {}".format(gridType))
iris.exceptions.TranslationError: unhandled grid type: mercator
from iris-grib.
Hi @loxn8773, sorry this still isn't working for you! Interestingly all worked fine when loading the Mercator GRIB2 test file we were working from... I'll investigate further and see what I can come up with.
from iris-grib.
Thanks @dkillick. I think my files were GRIB1, but anyways, pygrib did the work for now and as long as nobody else had this issue you may also consider this closed.
from iris-grib.
Thanks @loxn8773 - the changes made were for GRIB2 only, which might explain this difference in behaviour...
from iris-grib.
I can confirm this issue, plus the suspicion that it's related to GRIB1 support. After using grib_set edition=2
on my files (output from some customized WRF model, I believe), the mercator
grid was correctly parsed.
from iris-grib.
Since old comment above
@lkugler Thanks @dkillick. I think my files were GRIB1, but anyways, pygrib did the work for now and as long as nobody else had this issue you may also consider this closed.
Can be closed.
from iris-grib.
Related Issues (20)
- iris-grib pyproject.toml
- iris-grib pre-commit-config HOT 1
- iris-grib dependabot
- iris-grib codespell HOT 1
- iris-grib prettier HOT 1
- iris-grib repo review GHA with exclusions HOT 1
- iris-grib sprint consider using more reusable workflows HOT 1
- iris-grib test coverage and test folder HOT 1
- iris-grib pytest tests HOT 2
- Direct users to "iris.load" rather than "iris_grib.load_cubes" HOT 2
- Stop using nose HOT 1
- Linkchecks for new GHA tests HOT 1
- Adopt automatic versioning
- Shift all the package code from `iris_grib` to `src/iris_grib`. HOT 1
- Add pytest-mock to deps
- Remove _iris_mercator_support.py
- add zenodo badge
- add contributor covenant code of conduct
- (after sprint) Review all the excluded rules + checks
- iris min pin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iris-grib.