NOAA20 Sea Surface Temperature

33 views
Skip to first unread message

woo...@gmail.com

unread,
Jul 24, 2024, 12:12:59 PM (3 days ago) Jul 24
to pytroll
Hi
 
I wonder if someone with more extensive python programming knowledge can help me
 
I am trying to process the NOAA20 sea surface temperature from this file distributed
over Eumetcast in SAF-1 on the Basic service

S-OSI_-FRA_-NOAA20_-NARSST_FIELD-202407231200Z.nc
 
I run  python .\process-NorthAtlanticSST.py NA20202407231200
 
I have two problems
 
Firstly I cant seem to get a polar stereographic projection to work properly

Secondly the sea surface temperature wont plot because the  variable is empty and I dont know why - I think it may be something to do with the lat/long
 
Any help would be much appreciated
 
Thanks
 
Graham
process-NorthAtlanticSST.py

David Hoese

unread,
Jul 24, 2024, 2:16:59 PM (3 days ago) Jul 24
to pyt...@googlegroups.com
Hi Graham,

Please provide any error messages and their complete tracebacks (if available) for the two issues you identified. Thanks.

Dave

--
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.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/10911491-a6cd-4b16-a8fb-4d933fe6d88an%40googlegroups.com.
Message has been deleted

woo...@gmail.com

unread,
Jul 24, 2024, 4:26:12 PM (3 days ago) Jul 24
to pytroll
Hi Dave

These are the errors I get with the attached script

(pytroll) PS I:\SPStools\GEOscripts> python .\process-NorthAtlanticSST.py NA20202407231000
[[13.592773  13.598633  13.606445  ... 16.370117  16.364258  16.357422 ]
 [13.603516  13.611328  13.6171875 ... 16.381836  16.375977  16.370117 ]
 [13.615234  13.62207   13.628906  ... 16.393555  16.387695  16.381836 ]
 ...
 [43.756836  43.774414  43.791016  ... 51.24121   51.222656  51.20508  ]
 [43.760742  43.77832   43.79492   ... 51.24707   51.228516  51.210938 ]
 [43.76465   43.782227  43.799805  ... 51.251953  51.234375  51.21582  ]]
[[-31.868164 -31.856445 -31.844727 ...  26.786133  26.798828  26.810547]
 [-31.875    -31.863281 -31.851562 ...  26.791992  26.804688  26.817383]
 [-31.881836 -31.870117 -31.859375 ...  26.798828  26.810547  26.824219]
 ...
 [-75.96973  -75.96484  -75.958984 ...  72.89746   72.90527   72.91406 ]
 [-75.99414  -75.98828  -75.98242  ...  72.924805  72.93359   72.94336 ]
 [-76.01758  -76.01172  -76.00586  ...  72.9541    72.96289   72.9707  ]]
0
11942065
9576463
12460018
[]
Traceback (most recent call last):
  File "I:\SPStools\GEOscripts\process-NorthAtlanticSST.py", line 124, in <module>
    img = ax.imshow(data, vmin=vmin, vmax=vmax, origin='upper', extent=img_extent, cmap=cmap)
  File "C:\Users\graha\miniconda3\envs\pytroll\lib\site-packages\cartopy\mpl\geoaxes.py", line 307, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\graha\miniconda3\envs\pytroll\lib\site-packages\cartopy\mpl\geoaxes.py", line 1314, in imshow
    img, extent = warp_array(img,
  File "C:\Users\graha\miniconda3\envs\pytroll\lib\site-packages\cartopy\img_transform.py", line 192, in warp_array
    array = regrid(array, source_native_xy[0], source_native_xy[1],
  File "C:\Users\graha\miniconda3\envs\pytroll\lib\site-packages\cartopy\img_transform.py", line 293, in regrid
    temp_array = array.reshape((-1,) + array.shape[2:])
  File "C:\Users\graha\miniconda3\envs\pytroll\lib\site-packages\numpy\ma\core.py", line 4745, in reshape
    result = self._data.reshape(*s, **kwargs).view(type(self))
ValueError: cannot reshape array of size 0 into shape (0)
process-NorthAtlanticSST.py

woo...@gmail.com

unread,
Jul 24, 2024, 4:38:09 PM (3 days ago) Jul 24
to pytroll
Hi Dave

I should add that I am not very erprienced with python

This is a scrpit I have copied from the internet and adapted

It works with MSG and Metop data but not with NOAA20 - I get a blank map in the wrong projection with no data

Regards

Graham

Adam Dybbroe

unread,
Jul 24, 2024, 5:02:54 PM (3 days ago) Jul 24
to pyt...@googlegroups.com, adam.d...@smhi.se

Graham,

Satpy can read these files! So, since you are here, why not use Pytroll libraries?


from satpy import Scene
from satpy.utils import debug_on
debug_on()
    

SST_FILES = ["/path/to/your/SST/file/S-OSI_-FRA_-MTOP-NARSST_FIELD-202204061000Z.nc"]

scn = Scene(filenames=SST_FILES, reader='ghrsst_l2')
scn.load(['sea_surface_temperature'])

# Here we resample to the area "euron1", but you can take any area already defined in the "areas.yaml" file

local_scn = scn.resample('euron1')

local_scn.show('sea_surface_temperature')

-Adam

To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/18047abc-3ebc-43c8-b4f0-61ef53c92650n%40googlegroups.com.
-- 
Adam Dybbroe,
Satellite Remote Sensing Scientist
Research lead - Nowcasting and Remote Sensing
Meteorological Research unit, Research and Development
Swedish Meteorological and Hydrological Institute (SMHI)
www.pytroll.org
nwcsaf.smhi.se
www.smhi.se

woo...@gmail.com

unread,
Jul 24, 2024, 5:09:09 PM (3 days ago) Jul 24
to pytroll
Hi Adam

Thanks for the reply

I wasnt aware that you could do that with netcdf files - I will try it tomorrow

Can you do this with all SST netcdf  files from the various satellites and will it work for sea ice data too

Many thanks

Graham

Adam Dybbroe

unread,
Jul 24, 2024, 5:26:01 PM (3 days ago) Jul 24
to pyt...@googlegroups.com, adam.d...@smhi.se

The reader is supposed to handle the GHRSST netCDF format, and I know it reads the OSISAF NAR SSTs (Metop and JPSS) and also the SLSTR SSTs.

I haven't tried it myself on the Sea Ice parameters. But as you can see it at least reads the Sea Ice fraction which is part of the SST files:

In [3]: scn.available_dataset_names()
Out[3]:
['latitude_osisaf',
 'longitude_osisaf',
 'sea_ice_fraction',
 'sea_surface_temperature']


Good luck!

-Adam

woo...@gmail.com

unread,
Jul 25, 2024, 9:28:37 AM (2 days ago) Jul 25
to pytroll
Hi Adam

I now have an image which I have attached

I dont know how to add colour,coastlines and the colour scale bar to my image - its all black and grey

 My python skills arent quite there yet

Warm Wishes

Graham
tmpj5t8fm3d.PNG
process-NorthAtlanticSST.py
Reply all
Reply to author
Forward
0 new messages