Reputation: 69
I have been struggling with Cartopy ever since I started using it few months ago. Many times, the Jupyter notebooks have crashed, and even running scripts from the command line didn't work.I am currently using Linux OS and 8GB memory laptop.
Is Cartopy computationally heavy? What would be the ideal system configuration for running it smoothly?
For example, a code snippet like the one below (by xarray) won't run on my system.
from __future__ import division
import xarray as xr
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
# Load the data
ds = xr.tutorial.load_dataset('air_temperature')
air = ds.air.isel(time=[0, 724]) - 273.15
# This is the map projection we want to plot *onto*
map_proj = ccrs.LambertConformal(central_longitude=-95, central_latitude=45)
p = air.plot(transform=ccrs.PlateCarree(), # the data's projection
col='time', col_wrap=1, # multiplot settings
aspect=ds.dims['lon'] / ds.dims['lat'], # for a sensible figsize
subplot_kws={'projection': map_proj}) # the plot's projection
# We have to set the map's options on all four axes
for ax in p.axes.flat:
ax.coastlines()
ax.set_extent([-160, -30, 5, 75])
# Without this aspect attributes the maps will look chaotic and the
# "extent" attribute above will be ignored
ax.set_aspect('equal', 'box-forced')
plt.show()
I am on the verge of upgrading my laptop. If someone could suggest a better laptop or an ideal configuration for such a laptop, it would be of great help.
Many thanks in advance!
Upvotes: 0
Views: 56