Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:07
    greglucas commented #1948
  • 14:56
    greglucas commented #1907
  • 14:11
    ludwigVonKoopa commented #1907
  • 09:38
    fmaussion edited #1947
  • 04:33
    QuLogic milestoned #1949
  • 04:33

    QuLogic on master

    MNT: Remove requests and flufl … Merge pull request #1949 from g… (compare)

  • 04:33
    QuLogic closed #1949
  • 02:51
    CyanideCN opened #1950
  • Nov 27 23:02
    greglucas commented #1907
  • Nov 27 18:50
    ludwigVonKoopa commented #1907
  • Nov 27 15:27
    greglucas opened #1949
  • Nov 27 13:46
    fmaussion commented #1947
  • Nov 27 08:31
    QuLogic commented #1948
  • Nov 27 06:24
    HojinCho opened #1948
  • Nov 26 22:17
    fmaussion commented #1947
  • Nov 26 22:08
    fmaussion opened #1947
  • Nov 26 20:23
    Friptick commented #1239
  • Nov 26 14:21
    Demetrio92 commented #1239
  • Nov 25 22:43
    Friptick commented #1239
  • Nov 25 22:08
    Demetrio92 commented #1239
eocene
@eocene
Hi! How can I plot different continents with Cartopy? I.e. paleo continents...
Ryan May
@dopplershift
You’ll need some data (e.g. shapefiles) that you can use to plot or turn into some kind of Shapely feature
Elliott Sales de Andrade
@QuLogic
You can usually search for X shapefile and find something that'd work for that, e.g., plate tectonic shapefiles like https://github.com/fraxen/tectonicplates
eocene
@eocene
ok - thank you!
Stefan
@Stimj
Hi! Is this project open to adding more/unconventional projections? I'd be interested in adding support for the Dymaxion projection (e.g. https://github.com/Teque5/pydymax) if that's something that'd be interesting for the maintainers. If not then I can just hack together what I'm looking for
Elliott Sales de Andrade
@QuLogic
usually we defer the actual calculation to proj
Stefan
@Stimj
That makes more sense - I was getting pretty confused about where the actual work was done after looking through crs.py
I'll have a look at OSGeo, thank you!
Gregor Herda
@gregorhd
Hi all, in case anbody here has experience with cProfile, would you mind having a look at a Matplotlib Discourse issue of mine? It's part of an MSc thesis project. Much appreciated: https://discourse.matplotlib.org/t/cprofiling-cartopys-vs-geopandass-interface-with-matplotlib-puzzling-results/22255
Greg Lucas
@greglucas
@gregorhd, you may need to put fig.savefig() inside your function (or fig.canvas.draw()). A lot of rendering functions are lazily executed and don't happen until a draw is explicitly requested.
Gregor Herda
@gregorhd
Thanks, @greglucas. That did help a bit! For both options, the cartopy average goes up to around 13.5 seconds (vs GeoPandas' 59 seconds) - still the general behaviour persists though that the cProfiles are dumped to file (one after the other since I'm running the function through a for loop n-times) before each of the figures is rendered n-times afterwards. Hmm....
Greg Lucas
@greglucas
You need to make a blocking call in your loop then I think. fig.savefig('/tmp/data.png') I think blocks until the buffer is fully written to disk. To compare all of these cases you'll really need to read up a lot more about profiling all of these various libraries because all of them do different things under the hood that may be beneficial in certain ways, like blitting or re-using the same canvas. If you're writing to disk or just showing an in-memory representation.
Gregor Herda
@gregorhd
Ah I see! Thanks a mil. Clearly more complicated then I thought.
*than
Greg Lucas
@greglucas
Don't be discouraged by what I said either, just know it will take some thought and time to try and get right :) I'm guessing people will be interested in your findings!
Gregor Herda
@gregorhd
Thanks! I appreciate the encouragement :)
Greg Lucas
@greglucas
Testing with the upcoming MPL v3.5 is going to break quite a few people using coastlines due to the ordering of patches being different. We discussed this at length yesterday on the MPL side and think it is best to try and push a release for Cartopy with a fix for this out before the MPL release. That means in the next ~2-3 weeks we should be cutting a v0.20 release.
Elliott Sales de Andrade
@QuLogic
Fixing the zorder goes from 23 down to 8 failures; those remaining seem to be some sort of clipping/boundary changes
Greg Lucas
@greglucas
I think that some of the failures are pretty minor tolerance increases that have just pushed them over the edge of tolerance. i.e., the clipping/boundary was already wrong in the previous MPL version and we just bumped the tolerance. For instance, I think the "bleeding" of pcolor over into the spine and anti-aliasing with the colors was present before as well? I'm pretty sure these boil down to some MPL issues you've opened up previously: matplotlib/matplotlib#15952 and matplotlib/matplotlib#15946
Elliott Sales de Andrade
@QuLogic
Oh, it's possible they're old things like that, I hadn't looked too closely at the remaining ones yet
anuappu
@anuappu
Hi, I am encountering an issue while running cartopy. This is the error: TopologyException: side location conflict at -5505010.9196614036 8482555.2457595281. Please advise
Greg Lucas
@greglucas
@QuLogic, do you know when we should be aiming for the v0.20 release? I think we mentioned mid-september, so about this weekend.
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!