How to get sat/solar zenith and solar reflection angles from GOES16 data?

576 views
Skip to first unread message

Paulo Victorino

unread,
Mar 8, 2018, 9:28:40 AM3/8/18
to pytroll
Hello pytroll community.

Anyone knows how to get satellite/solar zenith angles and solar reflection angle from GOES 16 raw data?

I'm using the pytroll to detect fire on GOES 16 data, but I couldn't identify which module I could used to get the angles.

Thanks for help.
Victorino

Martin Raspaud

unread,
Mar 9, 2018, 2:53:41 AM3/9/18
to pyt...@googlegroups.com
Hi Paulo,

You should be able to use pyorbital for this. I'm not sure what you call solar reflection angle (is it the azimuth difference ?), but the zenith angles you can definitely get from pyorbital.

Best regards,
Martin

--
You received this message because you are subscribed to the Google Groups "pytroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Martin Raspaud, PhD
Software engineer
SMHI, SE-60176

Diego Souza

unread,
Sep 25, 2018, 2:32:56 PM9/25/18
to pytroll
Hi Paulo, 

This is what I do:

# Satellite height
sat_h
= file4.variables['goes_imager_projection'].perspective_point_height
# Satellite longitude
sat_lon
= file4.variables['goes_imager_projection'].longitude_of_projection_origin
# Satellite sweep
sat_sweep
= file4.variables['goes_imager_projection'].sweep_angle_axis
# The projection x and y coordinates equals
# the scanning angle (in radians) multiplied by the satellite height (http://proj4.org/projections/geos.html)
X
= file4.variables['x'][:][::1] * sat_h
Y
= file4.variables['y'][:][::1] * sat_h
# map object with pyproj
p
= Proj(proj='geos', h=sat_h, lon_0=sat_lon, sweep=sat_sweep, a=6378137.0)
# Convert map points to latitude and longitude with the magic provided by Pyproj
XX
, YY = np.meshgrid(X, Y)
lons
, lats = p(XX, YY, inverse=True)

utc_time
= datetime(2018, 9, 5, 22, 30)
sun_zenith
= np.zeros((data4.shape[0], data4.shape[1]))
sun_zenith
= astronomy.sun_zenith_angle(utc_time, lons, lats)


David Hoese

unread,
Sep 25, 2018, 2:49:52 PM9/25/18
to pyt...@googlegroups.com
Hi Paulo,

As Martin mentioned this can be done with pyorbital. It is something
that will eventually be automatic in SatPy but right now is limited to
an internal process of generating composites. You could perform the same
calculations the composites are using here and copying it to your own
function:
https://github.com/pytroll/satpy/blob/master/satpy/composites/__init__.py#L387

So your example code might look like:

from satpy import Scene
scn = Scene(reader='abi_l1b', filenames=filenames)
scn.load(['C02']) # where you load whatever channel you want
angles for
sata, satz, suna, sunz = get_angles(scn['C02'])

Note that the results of this are dask arrays and not xarray DataArrays.
If you'd like to convert these to DataArrays let me know otherwise
`sata.compute()` will compute them and give you a numpy array.

If you have any further questions (I know it has been a while since you
originally asked this question) feel free to reply here, create a github
issue, or join our slack team for quicker responses.

Dave


On 9/25/18 1:32 PM, Diego Souza wrote:
> Hi Paulo,
>
> This is what I do:
>
> |
> # Satellite height
> sat_h =file4.variables['goes_imager_projection'].perspective_point_height
> # Satellite longitude
> sat_lon
> =file4.variables['goes_imager_projection'].longitude_of_projection_origin
> # Satellite sweep
> sat_sweep =file4.variables['goes_imager_projection'].sweep_angle_axis
> # The projection x and y coordinates equals
> # the scanning angle (in radians) multiplied by the satellite height
> (http://proj4.org/projections/geos.html)
> X =file4.variables['x'][:][::1]*sat_h
> Y =file4.variables['y'][:][::1]*sat_h
> # map object with pyproj
> p =Proj(proj='geos',h=sat_h,lon_0=sat_lon,sweep=sat_sweep,a=6378137.0)
> # Convert map points to latitude and longitude with the magic provided
> by Pyproj
> XX,YY =np.meshgrid(X,Y)
> lons,lats =p(XX,YY,inverse=True)
>
> utc_time =datetime(2018,9,5,22,30)
> sun_zenith =np.zeros((data4.shape[0],data4.shape[1]))
> sun_zenith =astronomy.sun_zenith_angle(utc_time,lons,lats)
> |
>
>
>
> On Thursday, March 8, 2018 at 11:28:40 AM UTC-3, Paulo Victorino wrote:
>
> Hello pytroll community.
>
> Anyone knows how to get satellite/solar zenith angles and solar
> reflection angle from GOES 16 raw data?
>
> I'm using the pytroll to detect fire on GOES 16 data, but I couldn't
> identify which module I could used to get the angles.
>
> Thanks for help.
> Victorino
>
> --
> You received this message because you are subscribed to the Google
> Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pytroll+u...@googlegroups.com
> <mailto:pytroll+u...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages