Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:56
    greglucas commented #1992
  • 04:53
    greglucas opened #1998
  • 04:53
    greglucas labeled #1998
  • 04:53
    greglucas milestoned #1998
  • Jan 25 22:54
    QuLogic closed #1996
  • Jan 25 22:54
    QuLogic commented #1996
  • Jan 25 22:26
    mathause commented #1997
  • Jan 25 20:41
    mnky9800n commented #1996
  • Jan 25 19:29
    mathause opened #1997
  • Jan 25 17:00
    mnky9800n opened #1996
  • Jan 25 16:28
    weatherfrog commented #1992
  • Jan 25 15:31
    greglucas synchronize #1980
  • Jan 25 15:31
    greglucas synchronize #1980
  • Jan 25 15:30
    greglucas synchronize #1990
  • Jan 25 15:30
    greglucas synchronize #1990
  • Jan 25 15:26
    greglucas synchronize #1991
  • Jan 25 14:39
    greglucas closed #1995
  • Jan 25 14:39
    greglucas commented #1995
  • Jan 25 11:31
    ninglk opened #1995
  • Jan 25 04:53
    greglucas commented #1994
Elliott Sales de Andrade
@QuLogic
Yea, that sounds good
Around now or so
Greg Lucas
@greglucas
:( We need to get a release out ASAP to fix the download issue... I can't believe how many duplicate issues we are getting.
Elliott Sales de Andrade
@QuLogic
On the up side, it means we're actually getting used
Sunny Li
@taiyangie
hi! wondering if I could ask a pretty low level question. When plotting, I can't seem to get coastlines to be visible and ax.coastlines() doesn't appear to be doing anything. When running the following code, I just get a blank white figure. would appreciate any help!
ax=plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()
plt.show()
Karl Schneider
@karlwx
Hey everyone, this might be more of a matpolitlib question, but I figured someone here might have a quick answer. I know how to set clipping on matplotlib artists that are outside of the map boundary, which works well in most instances. However, when an artist intersects the map boundary (such as text) the part of the text inside the map is kept and the rest is cut off. I'm wondering if there's any easy way to remove all artists that fall entirely outside AND artists that intersect the map boundary
So any text objects that would be partially cut off would be removed entirely
Greg Lucas
@greglucas
The gridliner handles some of that to turn off the visibility on some ticks based upon that criteria. There could be some useful code in there to build from: https://github.com/SciTools/cartopy/blob/019f0130ec9320cad8ac2532697afb51db0f97a9/lib/cartopy/mpl/gridliner.py#L1276-L1280
4 replies
eocene
@eocene

Hello!

When I plot a high resolution satellite image (tiff format) in imshow and save as jpeg with very high dpi (1000) the quality of the image is retained.

But when I plot the same image with cartopy the image is resampled (I assume onto the resolution of the lat-lon grid) and I loose alot of image quality.

Please could some one advice me how to plot a high resolution sat. image in cartopy retaining the original image quality?

Thank you very much!

Greg Lucas
@greglucas
4 replies
tfardet
@tfardet:matrix.org
[m]
Hi there, I have a question regarding the natural earth resources. The Naciscdn server has been down for days now. I've seen that the fix is to use the aws link instead but I like to avoid amazon whenever I can so I was wondering whether someone was in touch with nacis and would now if the server would get back up some day or whether it's been taken down or something
Greg Lucas
@greglucas
No, that is the new location of the data. It is an AWS s3 resource with no login required. My guess is you are hitting many sites that serve their resources through AWS, so it is likely very hard to avoid them ;)
Karl Schneider
@karlwx
img_1.PNG
img_2.PNG
Sorry, those were supposed to be in that thread @greglucas. Weird behavior here. I'm pretty sure image 2 just results in a blank image because when I take off the cartopy features and set_extent, there's still nothing
Karl Schneider
@karlwx
img_3.PNG
Tried with pcolormesh (passing rgba tuples to color kwarg) and the transform works, but all these dots appear. Frustrating day!
Greg Lucas
@greglucas
Hm... My initial guess is that your image 2 may have to do with you using img1.size as the regrid_shape argument. That will be nm4 for an (n, m) RGBA image, not just the shape of the output, so I'm guessing that is producing a really large output array that may cause issues with the queries...? Just a stab in the dark there. I'd try just setting it to a large value at first (2000) and see if that works and increase appropriately to your problem. For the second pcolormesh idea, I'm not sure that pcolormesh takes RGBA tuples...? So it could be doing some odd resampling based on the strides in your array to produce those dots, or reordering the data in an odd way.
1 reply
Clément
@ludwigVonKoopa

Hi all, i want to test some modification on cartopy, so i forked the project and did python setup.py install to install it localy.
I got a error ModuleNotFoundError: No module named 'cartopy._version'

I saw that in v0.18 there was a file _version.py in the cartopy project, but there isn"t anymore. Do i have to do extra step to use it locally ? Thanks

image.png
Clément
@ludwigVonKoopa
ok i found in a commit message SciTools/cartopy@9ecdbb5 that i need setuptools-scm to be installed.
Greg Lucas
@greglucas
There is an environment.yml file listing a bunch of dependencies in the base repo now that you can use to create a new conda environment that will be able to compile/install Cartopy for testing. You can also just use that as a reference for which packages you'd need. There are also some install_requires and requirements.txt files for different dependencies
Karl Schneider
@karlwx
I'm experiencing some weirdness with pcolormesh. I'm trying to pass the kwarg shading='nearest', which per the matplotlib docs will work when C has the same dimensions of X and Y. It seems like the cartopy transformation adds an element to X and Y because I get the error: TypeError: Dimensions of C (300, 400) are incompatible with X (401) and/or Y (301); see help(pcolormesh)
Even though I double checked and the shape of C (300, 400) is the same as my input X and Y. I've tested and the same line that works with plain matplotlib fails with cartopy.
Greg Lucas
@greglucas
Possibly this: SciTools/cartopy#1892
Elliott Sales de Andrade
@QuLogic
I just noticed there's a tag for 0.20.1, but not a release, so I turned it into one
I don't think this makes much difference for anyone, except the GitHub UI
Karl Schneider
@karlwx
Thanks Greg, I didn't see that PR in my searches related to that issue. Upgraded to 0.20.1 and am happy to report that things are working as expected!
JuanJose9611
@JuanJose9611
Hi all, im trying to replicate the following srtm shading example https://scitools.org.uk/cartopy/docs/v0.14/examples/srtm_shading.html however when i run the code i get this error UserWarning: SRTM requires an account set up and log in to access. Use of this Downloader is likely to fail with HTTP 401 errors. warnings.warn('SRTM requires an account set up and log in to access.. I have looked at the documentation thoroughly and i can't find anything regarding this. Is there a new version of the srtm_shading example? Thanks.
Elliott Sales de Andrade
@QuLogic
The SRTM data requires an EarthData login
There is no direct API for setting that, but it uses regular urlopen, so you can set a password override using that
JuanJose9611
@JuanJose9611
Thank you for your answer Elliott, i will look into it.
Greg Lucas
@greglucas
Elliot, any interest in PRing your branch that removes the final PROJ dependencies in trace? QuLogic/cartopy@d109aac
I still think the benefits outweigh the decreased speed of spherical interpolators. Especially with all of the recent PROJ installation issues being opened.
Ryan May
@dopplershift
:+1: To that, we're caught in the middle of the worst of both worlds. We got slower, but we're also even more of a pain to install...
Leonardo
@leonardojimenez1990

Hello, someone how can I solve this problem?
Python 3.8.10 (default, Nov 26 2021, 20:14:08)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import cartopy.crs as ccrs

ImportError Traceback (most recent call last)

<ipython-input-1-139fa5ad2567> in <module>
----> 1 import cartopy.crs as ccrs

~/.local/lib/python3.8/site-packages/cartopy/init.py in <module>
102 # Commonly used sub-modules. Imported here to provide end-user
103 # convenience.
--> 104 import cartopy.crs
105 import cartopy.feature # noqa: F401 (flake8 = unused import)

~/.local/lib/python3.8/site-packages/cartopy/crs.py in <module>
20 from shapely.prepared import prep
21
---> 22 from cartopy._crs import (CRS, Geodetic, Globe, PROJ4_VERSION,
23 WGS84_SEMIMAJOR_AXIS, WGS84_SEMIMINOR_AXIS)
24 from cartopy._crs import Geocentric # noqa: F401 (flake8 = unused import)

ImportError: libproj.so.19: cannot open shared object file: No such file or directory

Leonardo
@leonardojimenez1990
Hi, How can I install Cartopy? I get the error:
pip3 install cartopy==0.20.2 --no-warn-script-location
Defaulting to user installation because normal site-packages is not writeable
Collecting cartopy==0.20.2
Using cached Cartopy-0.20.2.tar.gz (10.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/leo/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpxc5rsxyg
cwd: /tmp/pip-install-edx6ys1f/cartopy_faed090c1dd0401bb4dbbd520024780d
Complete output (3 lines):
setup.py:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or later installed, or installation may fail.
warnings.warn(

Proj 8.0.0 must be installed.

Ryan May
@dopplershift
Make sure you use your Linux package manager to install libproj-dev and libgeos-dev (or their equivalents) and that libproj-dev is at least version 8. If that's not possible, I'd recommend installing using conda, following the official install instructions: https://scitools.org.uk/cartopy/docs/latest/installing.html#conda-pre-built-binaries
Leonardo
@leonardojimenez1990
Thank you very much @dopplershift . I have not been able to install proj 8. Do you know a way to install proj 8?
Successfully built cartopy
Installing collected packages: cartopy
Successfully installed cartopy-0.19.0.post1