[python #NHC-140532]: Satellite reprojections
- Subject: [python #NHC-140532]: Satellite reprojections
- Date: Wed, 01 Apr 2020 14:56:14 -0600
Yes, the `subset` that was left was a left-over that I missed--it should be
That exact code ran for me within Jupyter, no problem--takes 40 seconds on my
2017 Macbook Pro. Did it ever complete for you? If not, what's your OS and
version of Python? How did you install? What version of CartoPy?
The square root was a quick way to get what I understand is often called the
"square root enhancement". My own goal was just to make the lakes/water show up
better so I could make sure it was lined up properly. This is one document that
talks about it (section 188.8.131.52):
> This is fantastic and very close to what I am trying to do, but I am getting
> an error as the variable subset is not defined.
> ax.imshow(np.sqrt(data), extent=(data.metpy.x, data.metpy.x[-1],
> data.metpy.y, data.metpy.y[-1]),
> origin='lower', cmap='Greys_r', transform=subset.metpy.cartopy_crs)
> I changed it to data and It is running (and probably not going to stop).
> Remember I am using Jupyter.
> Also, I am very curious as to why the data you are plotting is the square
> root of the dataâcan you point to a reason or a source?
> > On Apr 1, 2020, at 4:02 PM, Unidata Python Support <address@hidden> wrote:
> > Greetings!
> > The following code is able to re-project and runs in less than a minute
> > within a notebook on my mac on Python 3.8:
> > import cartopy.crs as ccrs
> > import cartopy.feature as cfeature
> > import matplotlib.pyplot as plt
> > import metpy
> > import numpy as np
> > from siphon.catalog import TDSCatalog
> > # Access data using Siphon
> > cat =
> > TDSCatalog('https://thredds.ucar.edu/thredds/catalog/satellite/goes/east/products/CloudAndMoistureImagery/CONUS/Channel02/current/catalog.xml')
> > nc = cat.datasets.remote_access(use_xarray=True)
> > data = nc.metpy.parse_cf('Sectorized_CMI')
> > # Set up our target projection
> > target = ccrs.LambertConformal(central_longitude=-80,
> > standard_parallels=)
> > # Create the figure, making sure to set extent before plotting
> > fig = plt.figure(figsize=(10, 10))
> > ax = fig.add_subplot(1, 1, 1, projection=target)
> > ax.set_extent((-85, -75, 35, 45), crs=ccrs.Geodetic())
> > # Plot image and add some map features
> > ax.imshow(np.sqrt(data), extent=(data.metpy.x, data.metpy.x[-1],
> > data.metpy.y, data.metpy.y[-1]),
> > origin='lower', cmap='Greys_r',
> > transform=subset.metpy.cartopy_crs)
> > ax.add_feature(cfeature.COASTLINE.with_scale('10m'), edgecolor='orange')
> > ax.add_feature(cfeature.LAKES.with_scale('10m'), edgecolor='cyan',
> > facecolor='none')
> > Does this work for you? If there's something significantly different that
> > your code is doing, can you share it so I can see what's going on?
> > Hope this helps,
> > Ryan
> >> Hi there-
> >> I have a question regarding the satellite data found on the threads data
> >> server.
> >> I would like to begin building products for our universtity departmentâs
> >> web site, but I have been struggling mightily when trying to take the NEW
> >> (not GINI) satellite data and reproject it (for example, taking the CONUS
> >> view from GOES-E and placing it into a LambertConformal projection of the
> >> Northeast US (using cartopy).
> >> Any attempt to reproject the data on the unidata threads server is never
> >> completing â
> >> Is there a guide for this? I am developing w/ jupyter, but am open to any
> >> ideas to make this work.
> > Ticket Details
> > ===================
> > Ticket ID: NHC-140532
> > Department: Support Python
> > Priority: Low
> > Status: Closed
> > ===================
> > NOTE: All email exchanges with Unidata User Support are recorded in the
> > Unidata inquiry tracking system and then made publicly available through
> > the web. If you do not want to have your interactions made available in
> > this way, you must let us know in each email you send to us.
Ticket ID: NHC-140532
Department: Support Python
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata
inquiry tracking system and then made publicly available through the web. If
you do not want to have your interactions made available in this way, you must
let us know in each email you send to us.