Pytroll/Satpy coordinates in scripts


Daniele Guardigli
 

Good morning,

I'm trying to understand Satpy scripts included in StarterKit but I can't understand how to create a custom area (like Italy) since coordinates are not in lat/long format. Is there a doc file where to learn from? 

Thanks,

Daniele Guardigli


Ernst Lobsiger
 

Daniele,

In your personal   ...EMCtools/pppconfig/areas.yaml copy any whole area definition on top and edit it as the example below:

cyprus:                                                                        Change this to italy  (area name used in the script later)
  description: Do not buy a home ...                            Your personal comment goes here (anything)
  projection:
    proj: stere
    ellps: WGS84
    lat_0: 35.15                                                             Change this lat and lon in degrees (N/E positive) to what the center
    lon_0: 33.42                                                            of your map should be (use e.g. Google Earth to find lat and lon)
  shape:
    height: 1000                                                            This is your image height in pixels
    width: 1000                                                              This is your image width in pixels (without the legend at left)
  area_extent:
    lower_left_xy: [-150000.0, -150000.0]                     This is lower left corner (x,y) of the map from center (lat/lon) above     in Meters
    upper_right_xy: [150000.0, 150000.0]                    This is upper right corner (x,y) of the map from center (lat/lon) above  in Meters



All you have to take care is that your area_extent and the shape are in sync. Above the area_extent is square 300 x 300 km and shape is square 1000 x 1000 pixels.
If you make the area extent 600 km (high) and 300km (wide) then the image should be e.g. 2000 pixels high and 1000 pixels wide.  The lat/lon grid must cross in right
angles (stereographic projection used)! I suggest to begin with you just change the name of the area to italy and select the center (lat/lon). Then make a first image ...

Cheers,
Ernst


Daniele Guardigli
 

Thank you Ernst, it works! Now let's play with areas! 


Il giorno mer 17 nov 2021 alle ore 11:30 Ernst Lobsiger via groups.io <ernst.lobsiger=belponline.ch@groups.io> ha scritto:
Daniele,

In your personal   ...EMCtools/pppconfig/areas.yaml copy any whole area definition on top and edit it as the example below:

cyprus:                                                                        Change this to italy  (area name used in the script later)
  description: Do not buy a home ...                            Your personal comment goes here (anything)
  projection:
    proj: stere
    ellps: WGS84
    lat_0: 35.15                                                             Change this lat and lon in degrees (N/E positive) to what the center
    lon_0: 33.42                                                            of your map should be (use e.g. Google Earth to find lat and lon)
  shape:
    height: 1000                                                            This is your image height in pixels
    width: 1000                                                              This is your image width in pixels (without the legend at left)
  area_extent:
    lower_left_xy: [-150000.0, -150000.0]                     This is lower left corner (x,y) of the map from center (lat/lon) above     in Meters
    upper_right_xy: [150000.0, 150000.0]                    This is upper right corner (x,y) of the map from center (lat/lon) above  in Meters



All you have to take care is that your area_extent and the shape are in sync. Above the area_extent is square 300 x 300 km and shape is square 1000 x 1000 pixels.
If you make the area extent 600 km (high) and 300km (wide) then the image should be e.g. 2000 pixels high and 1000 pixels wide.  The lat/lon grid must cross in right
angles (stereographic projection used)! I suggest to begin with you just change the name of the area to italy and select the center (lat/lon). Then make a first image ...

Cheers,
Ernst



--
Daniele Guardigli


Ernst Lobsiger
 

Daniele,

remember that it is of no use to have very big numbers of pixels. Only the aspect ratio of area-extent and image shape must match.
The example I started with has 1000 pixels for 300 km.This is 300m per pixel. Only Sentinel- 3A/B OLCI (EFR) has this resolution.
Meteosat has 3km resolution for all channels but HRV that has 1km resolution. This is at SubSatelltePoint (SSP) on the equator.
For Europe (slant view) the resolution is even less. So for 600km high x 300km wide imaged with SEVIRI even 600 x 300 pixels is
enough. The more pixels the longer the reprojection (resampling) with the Satpy script will take. It's good practice to have e.g.
italy1 with smaller image size for GEO sats and italy2 with 500m resolution for LEO sats like NOAA20 and SuomiNPP (VIIRS).

Regards,
Ernst