Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 24 09:41
    dchirst synchronize #2105
  • Nov 24 09:40
    dchirst synchronize #2105
  • Nov 23 19:42
    greglucas labeled #2106
  • Nov 23 19:42
    greglucas milestoned #2106
  • Nov 23 19:42
    greglucas opened #2106
  • Nov 23 19:42
    greglucas milestoned #2106
  • Nov 23 19:25
    felixdivo commented #2080
  • Nov 23 19:24
    felixdivo commented #2080
  • Nov 23 16:20
    greglucas commented #2080
  • Nov 23 16:06
    greglucas commented #2083
  • Nov 23 12:48
    dchirst synchronize #2105
  • Nov 23 12:47
    SciTools-assistant unlabeled #2105
  • Nov 23 12:47
    dchirst synchronize #2105
  • Nov 23 12:45
    dchirst commented #2105
  • Nov 23 12:42
    dchirst synchronize #2105
  • Nov 23 12:38
    dchirst synchronize #2105
  • Nov 23 12:36
    dchirst opened #2105
  • Nov 23 11:38
    felixdivo commented #2080
  • Nov 19 16:45
    PBrockmann commented #2103
  • Nov 19 16:44
    PBrockmann commented #2103
winash12
@winash12
ax1.quiver(lons[::3],lats[::3],uipvPlot,vipvPlot,transform=ccrs.PlateCarree()) File "/usr/local/lib/python3.8/dist-packages/Cartopy-0.18.0-py3.8-linux-x86_64.egg/cartopy/mpl/geoaxes.py", line 310, in wrapper return func(self, *args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/Cartopy-0.18.0-py3.8-linux-x86_64.egg/cartopy/mpl/geoaxes.py", line 1841, in quiver u, v = self.projection.transform_vectors(t, x, y, u, v) File "lib/cartopy/_crs.pyx", line 568, in cartopy._crs.CRS.transform_vectors UserWarning: Some vectors at source domain corners may not have been transformed correctly
Stephane Raynaud
@stefraynaud
Appveyor is failing while travis is not: it is hard working on grid labels, since it takes more time to solve CI issues than coding! I have to way to test a windows installation.
Greg Lucas
@greglucas
I hear you on that one, it always seems to be something new on various CI systems. You're in a particularly tricky part of the code base because of all the small changes to text/line alignment too. I can't see anything obvious in the Appveyor for why those images would be failing on Windows and not on Linux though. The MPL being used is from the testing labels.
It does look like there are some warnings with pyshp out there and it is getting the most recent pyshp version which had some changes to how they read in the objects. You may want to try adding Fiona to the appveyor installation and see if it is bad shapefiles causing the errors.
winash12
@winash12

ax1.quiver(lons[::3],lats[::3],uipvPlot,vipvPlot,transform=ccrs.PlateCarree()) File "/usr/local/lib/python3.8/dist-packages/Cartopy-0.18.0-py3.8-linux-x86_64.egg/cartopy/mpl/geoaxes.py", line 310, in wrapper return func(self, *args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/Cartopy-0.18.0-py3.8-linux-x86_64.egg/cartopy/mpl/geoaxes.py", line 1841, in quiver u, v = self.projection.transform_vectors(t, x, y, u, v) File "lib/cartopy/_crs.pyx", line 568, in cartopy._crs.CRS.transform_vectors UserWarning: Some vectors at source domain corners may not have been transformed correctly

I forgot to mention that this warning does not generate a plot. The program just exits

Ryan May
@dopplershift
Are uipvPlot and vipvPlot the same size as lons[::3] and lats[::3]? Have you tried making PlateCarree() the projection for plotting just to see if that works or if there's a data issue?
Stephane Raynaud
@stefraynaud
The gridliner is revised in #PR1537 to fix a few issues. Figure samples are available here: https://drive.google.com/drive/folders/15Sz5buIrjPcEz1FwniLgBDYn6GCXvNV7
If ok, I will update baseline images and add a few ones.
Hakkeh4x0r
@Hakkeh4x0r
Hello. What is the plan and timeline for next release (days or weeks)?
dsitaram
@dsitaram
hello, when I try to turn off the axis labels in grid liner (eg. gl.xlabels_top = False), the axis labels remain. I am using the EquidistantConic Projection. Does anyone know how to fix this?
Greg Lucas
@greglucas
Which version are you using? It changed to gl.top_labels = False in 0.18 I believe. https://scitools.org.uk/cartopy/docs/latest/matplotlib/gridliner.html
@Hakkeh4x0r , there is not currently any definitive plan for the next release.
emsterr
@emsterr
(@Hakkeh4x0r here), @greglucas okey, I have a couple of PRs that is needed in my production line and hoped they would be accepted in the near future. But I will just set up a in-house solution for now and wait. I created issue #1671, could you give me some feedback when you have the time.
Stephane Raynaud
@stefraynaud
You should probably never wait for official releases for your production line.
emsterr
@emsterr
I do agree @stefraynaud and that is why i asked :) if you have had a release in days or a week, I wouldn't bother wasting time on local integration.
winash12
@winash12

Are uipvPlot and vipvPlot the same size as lons[::3] and lats[::3]? Have you tried making PlateCarree() the projection for plotting just to see if that works or if there's a data issue?

@dopplershift Sorry about that. I will try to keep it here. The original shapes are (73) lats and (144) lons. When I take lons[:3] and lats[:3] I get 48 and 25. So the shapes of uipvPlot and vipvPlot are (25,48) and (25,48) . The thing is that this error does not happen for all data sets. It is sporadic and happens periodically. What more information I need to print out so that I can move forward ?

1 reply
Ray Bell
@raybellwaves
Hopefully this is a quick one. Trying to plot a quiver key to the right of a map. tried the various tight_layout() etc. but didn't work. https://stackoverflow.com/questions/64708303/matplotlib-cartopy-quiver-key-cut-off/64709087#64709087
Stephane Raynaud
@stefraynaud
I'm not sure to understand the problem. What happens if you set x > 1?
1 reply
Stephane Raynaud
@stefraynaud
I see it when I save the figure, but not in spyder for example. so as you suggested, it comes from tight_layout and the way quiverkey objects are registered.
Ray Bell
@raybellwaves
Thanks @stefraynaud. I created a separate matplotlib Q : https://stackoverflow.com/questions/64717968/matplotlib-quiver-key-label-getting-cut
but one person is unable to reproduce it
Karl Schneider
@karlwx
Hi all, I've been a user for a while but decided I'll try contributing for the first time. I have successfully forked cartopy and made my own local repo and a new branch where I'll make some changes. I created a new conda environment, installed all the dependencies, and ran setup.py. However, when I make changes to the code in my local repo it seems to have no effect when I import cartopy and use it. What do I need to be doing to import my changed version?
Greg Lucas
@greglucas
It depends on where you're running the code from (in the same directory as the build, or in an external location). I usually install in editable mode pip install -e . and then you shouldn't need to recompile any of the extensions if you're just working in the Python code.
Karl Schneider
@karlwx
Thanks, that's what I needed!
Greg Lucas
@greglucas
No problem, looking forward to your contributions! :tada:
Philipe Riskalla Leal
@PhilipeRLeal
Dear all, I have recently made a pull request adding some functionalities for cartopy. Nevertheless, SciTools CLA returns an error in my pull request. When I click on SciTools link, I am redirected towards another page with some general information about SciTools, but no info regarding the error message.
Does anyone has any thoughts on the subject?
Greg Lucas
@greglucas
Here is a link to the CLA form: https://scitools.org.uk/cla/v4/form
That wasn't the easiest to find... We should put that somewhere more obvious in the documentation/contributing area.
Greg Lucas
@greglucas
The PyPI release uploads are taken care of with an encrypted Travis key. Does anyone have that password that we can port over to a secret in GitHub to let the GitHub Actions take care of the release uploads?
Ryan May
@dopplershift
Actualy, only Travis has the password for that key. But I have access to CartoPy and can create a new key.
Done. So authentication for PyPI on GH Actions should be done using the username __token__. The password is stored in ${{ secrets.pypi_token }} now.
Really, just use this to upload:
    - name: Publish Package
      uses: pypa/gh-action-pypi-publish@v1
      with:
        user: __token__
        password: ${{ secrets.pypi_token }}
Greg Lucas
@greglucas
:+1: Thanks. I just pushed that up. It looks like it is grabbing that "uses" container right away and it takes ~30 seconds to install. I wonder if we should put that in another job instead so it only gets called on tagged pushes...
Ryan May
@dopplershift
@greglucas I can say that's what I do on MetPy. I don't worry about tests passing, I just have it build releases artifacts and upload.
jadelilymay
@jadelilymay
Hi guys, I'm just new to Cartopy and I'm trying to plot out my data based on some given latitude and longitude, I tried to look into matplotlib but can't seem to find anything
Greg Lucas
@greglucas
Hi @jadelilymay, have you looked at the Cartopy docs? https://scitools.org.uk/cartopy/docs/latest/gallery/index.html
Specifically, https://scitools.org.uk/cartopy/docs/latest/matplotlib/intro.html, might help. If you have data and want to plot on a map projection, generally speaking you need to initialize the MPL axes with the projection you want to display the data in. Then you need to supply the transform= argument to your plotting functions with the projection that the data is coming from.
Philipe Riskalla Leal
@PhilipeRLeal

Dear @jadelilymay, I have managed to implement a small code snippet that reads your TIFF file, and plots it using cartopy. See if it helps you. The code is in the file test.py I just sent

Sincerely,

Philipe Riskalla Leal
@PhilipeRLeal
Dear @jadelilymay, in my last test.py file, I had forgotten to insert the extent attribute from the plt.imshow function. Therefore, the plotting wasn't making much sense.
This new file below solves the Issue. Check it out.
Kyle Penner
@kdpenner
have y'all thought of organizing a sprint at the scipy conference?
robertique
@robertique
Hi there! Is it possible to represent data on a map from a csv file which contain: time, longitude, latitude, 200 measured GSM channel levels. The representation should take into consideration the signal level in choosing colors..Thanks!
Leonardo
@leonardojimenez1990

hi, I use Ubuntu, python3.8 pip, pycharm. I have a problem with Cartopy. ModuleNotFoundError: No module named 'cartopy.crs'; 'cartopy' is not a package

r: ~ $ which python
/ usr / bin / python
r: ~ $ python -c 'import sys; print (sys.prefix) '
/ usr
r: ~ $ python -c 'import cartopy.crs as ccrs'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named cartopy.crs

Ryan May
@dopplershift
@leonardojimenez1990 How did you install cartopy?
@robertique You should be able to do that with ax.scatter(lon, lat, c=level, transform=ccrs.PlateCarree())
Leonardo
@leonardojimenez1990
@dopplershift Thanks, I could solve the error by configuring cartopy with python3.
Leonardo
@leonardojimenez1990

Hello. I would like to know how I can plot on a map the data from the variable "r" (relative humidity) of a NetCDF file with cartopy?

#

from netCDF4 import Dataset
import numpy as np
import xarray as xr
import cartopy.crs as ccrs
import matplotlib.pyplot as plt

leer el archive

ds=Dataset('relative_humidityEne_Dic2003_2020CMAS.nc', 'r')

print(ds)

mostar las variables del archive

print(ds.variables.keys())

accede a las variables

lon = ds.variables["longitude"]

print("longitude:===== ",lon)

lat = ds.variables["latitude"]

print("latitude:======= ",lat)

level = ds.variables["level"]

print("level:=========",level)

time = ds.variables["time"]

print("time:========= ",time)

r = ds.variables["r"]

print("humendad:===== ",r)

leer las dimenciones de las variables

print("las dimenciones variable r es: ", ds.variables['r'].dimensions)
print(r.shape)

dict_keys(['longitude', 'latitude', 'level', 'time', 'r'])
las dimenciones variable r es: ('time', 'level', 'latitude', 'longitude')
(53, 8, 241, 480)

crear la proyeccion con cartopy y matplotlib

ax = plt.axes(projection=ccrs.PlateCarree())

ax.coastlines()

plotear variables en el mapa

r_ds = ds.variables['r'][0, :, :, :]

print(r_ds)

plt.contourf(lon, lat, r_ds, transform=ccrs.PlateCarree())
ax.coastlines()
plt.show()

#

Error message

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-403ea023eab8>", line 1, in <module>
runfile('/home/leo/Documentos/Universidad/Trabajo_de_investigación/PerfilesVerticalesContaminantesAtmosfera/Datos/readNetdcf42003_2020CMAS.py', wdir='/home/leo/Documentos/Universidad/Trabajo_de_investigación/PerfilesVerticalesContaminantesAtmosfera/Datos')
File "/snap/pycharm-professional/230/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/snap/pycharm-professional/230/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File"/home/leo/Documentos/Universidad/Trabajo_de_investigación/PerfilesVerticalesContaminantesAtmosfera/Datos/readNetdcf42003_2020CMAS.py", line 65, in <module>
plt.contourf(lon, lat, r_ds, transform=ccrs.PlateCarree())
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2577, in contourf
ret = gca().contourf(
File "/home/leo/.local/lib/python3.8/site-packages/cartopy/mpl/geoaxes.py", line 321, in wrapper
return func(self, args, **kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/cartopy/mpl/geoaxes.py", line 1586, in contourf
result = matplotlib.axes.Axes.contourf(self,
args, **kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/
init.py", line 1447, in inner
return func(ax, map(sanitize_sequence, args), **kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 6335, in contourf
contours = mcontour.QuadContourSet(self,
args, **kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/contour.py", line 816, in
init
kwargs = self._process_args(args, *kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/contour.py", line 1430, in _process_args
x, y, z = self._contour_args(args, kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/contour.py", line 1488, in _contour_args
x, y, z = self._check_xyz(args[:3], kwargs)
File "/home/leo/.local/lib/python3.8/site-packages/matplotlib/contour.py", line 1514, in _check_xyz
x = np.asarray(x, dtype=np.float64)
File "/usr/local/lib/python3.8/dist-packages/numpy/core/_asarray.py", line 102, in asarray
return array(a, dtype, copy=False, order=order)
TypeError:
array__() takes no arguments (1 given)

Rei 머호
@rei_wu:matrix.org
[m]

techprog:matrix.org

Elliott Sales de Andrade
@QuLogic
@leonardojimenez1990 it seems like that's a netcdf+matplotlib problem, and not specific to cartopy