I am analyzing GOES-16 Satelite data and need to calculate the underlying lat, lon of each grid coordinate as part of further analysis. I am currently attempting to use pyproj to do this and am running into longitude values outside of the expected extent for the image, the longitude values are within the expected extent.
Downloading the image:
import boto3
import xarray as xr
s3 = boto3.client('s3')
s3.download_file('noaa-goes17', 'ABI-L1b-RadC/2019/022/21/OR_ABI-L1b-RadC-M3C02_G17_s20190222102189_e20190222104562_c20190222104588.nc',
'test.nc')
ds = xr.open_dataset('test.nc')
Converting the projection:
from pyproj import Proj
p = Proj(proj='geos', h='35786023.0', lon_0='-137.0', sweep='x')
dat = ds.metpy.parse_cf('Rad')
cord_grid = np.meshgrid(dat['x'].values, dat['y'].values)
lons, lats = p(cord_grid[0], cord_grid[1], inverse=True)
the min and max lon value here is -179.99 and 179.9 here respectively. I would only expect this image to contain data between -89.6 and 175.6 as shown below.
When I check the expected geographical extent for this image I get the following:
ds['geospatial_lat_lon_extent']
Out[61]:
<xarray.DataArray 'geospatial_lat_lon_extent' ()>
array(9.96921e+36, dtype=float32)
Coordinates:
t datetime64[ns] ...
y_image float32 ...
x_image float32 ...
Attributes:
long_name: geospatial latitude and longitude refere...
geospatial_westbound_longitude: 175.62358
geospatial_northbound_latitude: 53.50006
geospatial_eastbound_longitude: -89.62357
geospatial_southbound_latitude: 14.57134
geospatial_lat_center: 29.967
geospatial_lon_center: -137.0
geospatial_lat_nadir: 0.0
geospatial_lon_nadir: -137.0
geospatial_lat_units: degrees_north
geospatial_lon_units: degrees_east
I am still relatively new to geospatial data manipulation. What am I doing wrong here?