Re: [python-users] Displaying GOES in mercator projection

  • To: Ryan May <rmay@xxxxxxxx>
  • Subject: Re: [python-users] Displaying GOES in mercator projection
  • From: "Weber, Jim" <Jim.Weber@xxxxxxx>
  • Date: Fri, 19 Nov 2021 15:49:01 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fox.com; dmarc=pass action=none header.from=fox.com; dkim=pass header.d=fox.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EscVFELKmdlTbgZKvEF90Mh/19tVTET/kSNPxB0wlbc=; b=hzC5Po8v4r9xaBLC2ktapR1iqZo/woqxiMTVtRxIFL3bujhMbE1CCFZd6F9uPCSEAkw06+WlqnGhNHtyAJigmWVeMXipXKnxlx0k+Tf3xgEUU0Xh6jEJ7sBvXscdHrSLpNIbYFFxridbhtjM/zNamadwD3ykEpO/y3hSJYJ5b5fCkztsg6blwtj+yYqqLbwKWSkBjIMZTQ6+lKop2Jfx8H32wHjLqD0vXAOCKadxHGlRcBStle9HH6VrWLGp51Sy4wexdZbYsbrwhbwuE63eOPPiZ2zLotgcZIH5lamV5YYfqZmGBUugkSJUv59Hl0BJxjw7snRgp5xqnMhkEqbTkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9nZvs477fcu8OGdF9laIHCCjjtcNMSQYy8mUj0DKJk4TeonK0ATh8KxFReFyaxkX0dRNg+PKPHd2iJW9aw0XBu/v7utAwLxC9REvRNra+POVS8GMQG1aDP356P0HV30vjQUT38JLdCZDH6fdVNZiEtw72Lw89JH3t9YbusUL8ZcUkUgDb2zTXJq3BDPyzHdxnOEgQMjLcHhd1vmNGTlylnd6/a4U00jiL99FXi7XQCM0re3SNpjbz6NFnfyma58U6Wl+un1K9sTyACZx11g/fAnEooqjGRXzqLZF9SrOoWo6E4MrU+oA1F8tGHEXD5Mg7zfaMCdhPniCi0JxdgnfQ==
Thanks Ryan!

That worked! It is one of those things that you look at it and go in circles 
trying to figure out your problem. As soon as someone points it out you sit 
back and say it was starring me in the face the whole time ;)

Thanks again!

Jim Weber


From: Ryan May <rmay@xxxxxxxx>
Sent: Thursday, November 18, 2021 2:53 PM
To: Weber, Jim <Jim.Weber@xxxxxxx>
Cc: python-users@xxxxxxxxxxxxxxxx
Subject: Re: [python-users] Displaying GOES in mercator projection

Hi Jim

So when you type:

    ax.set_extent([-135, -60, 10, 65], crs=ccrs.Mercator())

You are telling cartopy "set the extents of the axes to a box with lower left 
corner (-135, 10) and upper right corner (-60, 65); those points are native 
coordinates in the Mercator() projection". You essentially specified a 75m x 
55m box. To plot with Mercator you want:

    # Tell cartopy the axes we're plotting on should be in Mercator
    ax = fig.add_subplot(1, 1, 1, projection=Mercator())
    # Specify the extent as lat/lon
    ax.set_extent([-135, -60, 10, 65], crs=ccrs.PlateCarree())

Hope this helps!

Ryan

On Thu, Nov 18, 2021 at 11:54 AM Weber, Jim 
<Jim.Weber@xxxxxxx<mailto:Jim.Weber@xxxxxxx>> wrote:
Below is a snippet of code from Brian Blaylock’s True Color Recipe.  I am 
trying to instead display imagery in a Mercator projection. I thought I would 
do this with a line such as:
mc=cartopy.ccrs.Mercator(central_longitude=0.0, min_latitude=-80.0, 
max_latitude=84.0, globe=None)

and then have lines:
ax = fig.add_subplot(1, 1, 1, projection=mc)
ax.set_extent([-135, -60, 10, 65], crs=ccrs.Mercator())

but this does not work. Can someone point out what I am doing wrong or point me 
to the correct resource so I might understand my problem better?


Thanks, Jim

------ Code snippet ---------


fig = plt.figure(figsize=(15, 12))

# Generate an Cartopy projection
lc = ccrs.LambertConformal(central_longitude=-97.5, standard_parallels=(38.5,
                                                                        38.5))

ax = fig.add_subplot(1, 1, 1, projection=lc)
ax.set_extent([-135, -60, 10, 65], crs=ccrs.PlateCarree())

ax.imshow(RGB, origin='upper',
          extent=(x.min(), x.max(), y.min(), y.max()),
          transform=geos,
          interpolation='none')
ax.coastlines(resolution='50m', color='black', linewidth=0.5)
ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.5)

plt.title('GOES-16 True Color', loc='left', fontweight='bold', fontsize=15)
plt.title('{}'.format(scan_start.strftime('%d %B %Y %H:%M UTC ')), loc='right')

plt.show()




This message and its attachments may contain legally privileged or confidential 
information. It is intended solely for the named addressee(s). If you are not 
an addressee indicated in this message (or responsible for delivery of the 
message to an addressee), you may not copy or deliver this message or its 
attachments to anyone. Rather, you should permanently delete this message and 
its attachments and kindly notify the sender by reply e-mail. Any content of 
this message and its attachments that does not relate to the official business 
of Fox Corporation, or its subsidiaries must be taken not to have been sent or 
endorsed by any of them. No representation is made that this email or its 
attachments are without defect.
_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.


python-users mailing list
python-users@xxxxxxxxxxxxxxxx<mailto:python-users@xxxxxxxxxxxxxxxx>
For list information, to unsubscribe, or change your membership options, visit: 
https://www.unidata.ucar.edu/mailing_lists/<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.unidata.ucar.edu_mailing-5Flists_&d=DwMFaQ&c=uw6TLu4hwhHdiGJOgwcWD4AjKQx6zvFcGEsbfiY9-EI&r=KKIRMcmZ6BcKOjHM4171gGDDLEx31ZuiUy6Gn81J_cs&m=Dju-khXjVNwMkFRTeG6BiULMjvFWWbYJZw2JqMh3Y-0zskbHNhX_gw46N_S1RVQg&s=H5kIUV2OGqI87QlfppViciSCAuUEEQSg0GWui0zjYjg&e=>


--
Ryan May, Ph.D.
Software Engineer
UCAR/Unidata
Boulder, CO


This message and its attachments may contain legally privileged or confidential 
information. It is intended solely for the named addressee(s). If you are not 
an addressee indicated in this message (or responsible for delivery of the 
message to an addressee), you may not copy or deliver this message or its 
attachments to anyone. Rather, you should permanently delete this message and 
its attachments and kindly notify the sender by reply e-mail. Any content of 
this message and its attachments that does not relate to the official business 
of Fox Corporation, or its subsidiaries must be taken not to have been sent or 
endorsed by any of them. No representation is made that this email or its 
attachments are without defect.
  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the python-users archives: