@all, GeoCAT is developing examples that you may find useful:
https://geocat-examples.readthedocs.io/en/latest/
See also:
https://geocat.ucar.edu/blog/2020/03/02/geocat-plotting-examples
I am trying to use the geocat interp_hybrid_to_pressure function and getting an error importing it. Here's the error:
| ImportError: cannot import name 'interp_hybrid_to_pressure' from 'geocat.comp' (/glade/work/duvivier/miniconda3/envs/antarctica_som_env/lib/python3.7/site-packages/geocat/comp/__init__.py)
I have geocat in my environment and use it for some other purposes, so it's just importing this one function that isn't working. So it's probably something with my environment, but when I do a conda list in my environment it looks like I have this installed already:
|geocat-comp 0.2 py_0 ncar
|geocat-datafiles 2021.1.0 py_0 ncar
|geocat-ncomp 0.1a py37h03ebfcd_0 ncar
|geocat-viz 2020.7.30.1 pyh39e3cac_0 ncar
I'm kind of stuck on how to proceed and would appreciate some help figuring this environment issue out. Unfortunately I don't think I'll be able to come to ESDS office hours next week to ask then (family visiting).
If it helps, I've been following the example here:
https://geocat-examples.readthedocs.io/en/latest/gallery/Contours/NCL_conwomap_5.html#sphx-glr-gallery-contours-ncl-conwomap-5-py
And gone through the function documentation here:
https://geocat-comp.readthedocs.io/en/latest/user_api/generated/geocat.comp.interpolation.interp_hybrid_to_pressure.html
@Alice DuVivier this sounds like an issue with an outdated version of geocat.comp
-- interp_hybrid_to_pressure
was added in v2021.03.0
, and "geocat-comp 0.2" looks like an older version numbering system altogether. Could you create a new environment with the latest version of each package you are using, and see if everything works there? (if your luck is anything like mine, you'll get a handful of errors before you even get to the interp_hybrid_to_pressure()
call)
@Jesse Nusbaumer gave a solution that works
|import geocat.comp as gcomp
Then use gcomp.interpolation.interp_hybrid_to_pressure(XXXX)
I had been unsuccessfully trying
|from geocat.comp import interp_hybrid_to_pressure
based on following the geocat example:
https://geocat-examples.readthedocs.io/en/latest/gallery/Contours/NCL_conwomap_5.html#sphx-glr-gallery-contours-ncl-conwomap-5-py
Alice DuVivier said:
I am trying to use the geocat interp_hybrid_to_pressure function and getting an error importing it. Here's the error:
| ImportError: cannot import name 'interp_hybrid_to_pressure' from 'geocat.comp' (/glade/work/duvivier/miniconda3/envs/antarctica_som_env/lib/python3.7/site-packages/geocat/comp/__init__.py)I have geocat in my environment and use it for some other purposes, so it's just importing this one function that isn't working. So it's probably something with my environment, but when I do a conda list in my environment it looks like I have this installed already:
|geocat-comp 0.2 py_0 ncar
|geocat-datafiles 2021.1.0 py_0 ncar
|geocat-ncomp 0.1a py37h03ebfcd_0 ncar
|geocat-viz 2020.7.30.1 pyh39e3cac_0 ncarI'm kind of stuck on how to proceed and would appreciate some help figuring this environment issue out. Unfortunately I don't think I'll be able to come to ESDS office hours next week to ask then (family visiting).
If it helps, I've been following the example here:
https://geocat-examples.readthedocs.io/en/latest/gallery/Contours/NCL_conwomap_5.html#sphx-glr-gallery-contours-ncl-conwomap-5-pyAnd gone through the function documentation here:
https://geocat-comp.readthedocs.io/en/latest/user_api/generated/geocat.comp.interpolation.interp_hybrid_to_pressure.html
cc @geocat
Beat me to it, Michael! I agree, it looks like your version is out of date with GeoCAT-comp, our most recent version is 2021.10.0 and I couldn't find the last time we had 0.2 as a version, which implies outdated version for your environment
@Alice DuVivier even if you solved the issue, I'd highly recommend to follow @Michael Levy 's suggeestion and update your environment to use the newest GeoCAT-comp as yours seems to be outdated. This is important not only for geocat-comp version, but we made significant changes on GeoCAT stack, left using geocat-ncomp and replaced it with geocat-f2py for example.
@Orhan Eroglu @Michaela Sizemore @Michael Levy @geocat
I am in the process of doing this. Hopefully the update all goes smoothly. I agree that updating makes a lot of sense even if I did figure out the loading part.
@Alice DuVivier , we'd love to hear your feedback about using the interp_hybrid_to_pressure
function, e.g. performance, any issues, thoughts as well as if your environment update goes smooth, etc. Best,
@geocat
I got the versions updated (See below). Honestly it was a bit confusing to follow how to do this just from the geocat documentation and be sure I was installing all the pieces of geocat (comp, viz, and datafiles separately). And the documentation doesn't have specific instructions for how to add geocat to an existing environment or updating it. Those would be useful things for those of us who are not python super-users.
But now my notebook is running reasonably. I'll give you any thoughts about the function as I work with it more. :)
geocat-comp 2021.10.0 py_0 ncar
geocat-datafiles 2021.1.0 py_0 ncar
geocat-f2py 2022.02.0 py37h3d0eb6f_0 ncar
geocat-viz 2020.7.30.1 pyh39e3cac_0 ncar
Good to hear that it's working.
As a conda environment improvement, I'd suggest running the following commands:
conda config --prepend channels conda-forge
conda clean --all
conda install python=3.9
conda update conda
conda update --all
conda clean --all
NumPy ended support for python 3.7 last August, and we are ending support for python 3.7 as well, starting with release 2022.03.0
@Alice DuVivier
Done!
Alea Kootz said:
Good to hear that it's working.
As a conda environment improvement, I'd suggest running the following commands:conda config --prepend channels conda-forge conda clean --all conda install python=3.9 conda update conda conda update --all conda clean --all
Alice DuVivier said:
@geocat
I got the versions updated (See below). Honestly it was a bit confusing to follow how to do this just from the geocat documentation and be sure I was installing all the pieces of geocat (comp, viz, and datafiles separately). And the documentation doesn't have specific instructions for how to add geocat to an existing environment or updating it. Those would be useful things for those of us who are not python super-users.
But now my notebook is running reasonably. I'll give you any thoughts about the function as I work with it more. :)
geocat-comp 2021.10.0 py_0 ncar
geocat-datafiles 2021.1.0 py_0 ncar
geocat-f2py 2022.02.0 py37h3d0eb6f_0 ncar
geocat-viz 2020.7.30.1 pyh39e3cac_0 ncar
This sounds great! I have created a GeoCAT issue regarding your thoughts and initially assigned @Anissa Zacharias and @Heather Craker as they were currently discussing/working about improvements to. the GeoCAT contributor's guide, but we will have our team discussion on this as well.
Sounds good. I'm happy to provide feedback as needed. I did get to the actual interpolation today with interp_hybrid_to_pressure and it worked great.
Hi @Alice DuVivier I'm working on the GitHub issue that Orhan opened for this. Can you tell me which documentation pages you were looking at? We have installation instructions linked in the GeoCAT-examples gallery as well as in the documentation for GeoCAT-comp and GeoCAT-f2py. The contributor's guide also has installation of the entire GeoCAT project rather than instructions for one package like geocat-comp.
I believe this was related to the installation instructions here:
https://geocat-comp.readthedocs.io/en/latest/installation.html
All these directions show how to create a new environment with geocat. However, as someone who already had an environment I just needed to update the environment and had a hard time determining how to do that from the page. I got a lot of guidance on this forum directly but not through the formal documentation.
Heather Craker said:
Hi Alice DuVivier I'm working on the GitHub issue that Orhan opened for this. Can you tell me which documentation pages you were looking at? We have installation instructions linked in the GeoCAT-examples gallery as well as in the documentation for GeoCAT-comp and GeoCAT-f2py. The contributor's guide also has installation of the entire GeoCAT project rather than instructions for one package like geocat-comp.
Thank you @Alice DuVivier! I'll be sure to update that page along with our contributor's guide. I can let you know once I have a GitHub pull request to fix this if you would like.
I have opened a PR to add clarification to the geocat-comp installation webpage. If anyone wants to take a look at make sure the instructions makes sense now, please feel free to leave comments and reviews https://github.com/NCAR/geocat-comp/pull/214
Last updated: May 16 2025 at 17:14 UTC