CoastWatch Utilities: Excercise 2c - Using CoastWatch Utility commands to plot U-V Component vectors
This exercise will use the Sea Level Anomaly (SLA) Level-4 dataset from NOAA Laboratory for Satellite Altimetry. The daily product is generated from the RADS database and contains SLA and u-v components for geostrophic currents. The product is available from https://coastwatch.noaa.gov/cw/satellite-data-products/sea-surface-height/sea-level-anomaly-and-geostrophic-currents-multi-mission-global-optimal-interpolation-gridded.html Links to an external site.
Goal: Generate vectors on a mapped image of the loop current in the Gulf of Mexico using CW Utility commands.
Start CDAT: From a command window, type ‘cdat’<enter> or use your OS Desktop to locate the software and run it.
From the tool bar, select the ‘Open’ icon:
Navigate to the “SampleData2022/SatelliteData” directory and select the SLA NetCDF dataset :
rads_global_nrt_sla_20220925_20220926_001.nc
Select all products by holding the ‘Ctrl’ key down while selecting variables. Click OK .
Apply a color palette and Zoom to the South China Sea. Observe the sea level anomaly product below.
The product below is using an ‘anomaly’ palette, namely “CRW_SSTAnomaly. “
We observe the cold and warm core eddies, where cyclonic (counter-clockwise) rotation is a cold core eddy (lower and cooler) and anticyclonic (clockwise) is a warm core eddy where the center is warmer and higher than surrounding waters. Here is a look at the analysed_sst.
Optional / best practice: Use the cwimport command to import the NetCDF data to the internal CW format of HDF. This is not always necessary, but alleviates many issues that may arise from the wide variety of NetCDF implementations. [Use this if having difficulty in working with data]
C: \SampleData2022\SatelliteData>cwimport rads_global_nrt_sla_20220925_20220926_001.nc rads_global_nrt_sla_20220925_20220926_001.hdf
[WARNING] Chunking request ignored for 'time'
[WARNING] Chunking request ignored for 'latitude'
[WARNING] Chunking request ignored for 'longitude'
The command to render images at the command line is cwrender. From the User Guide, Man pages, CDAT, or command help the following can be constructed:
cwrender --enhance=ugos,vgos --enhancevector=uvcomp/arrow --magnify=14.0/114.0/12--range=0/3 rads_global_nrt_sla_20191020_20191021_001.nc currents.png
This command will output the following image:
Further modification of the command can apply the same visualizations accessible within CDAT:
Apply the oceanographic overlay, bathymetry, blue background and the Ocean Optics 2022 Logo.
cwrender --enhance=ugos,vgos --enhancevector=uvcomp/arrow --range=0/3 --logo=..\ResourceFiles\ocean-optics-logo.png --magnify=14.0/114.0/12 --group=Oceanographic --bath=gray --background=0x1187B0 rads_global_nrt_sla_20191020_20191021_001.nc currents2.png
Optional: Use cwmath to calculate the vector magnitude, adding it to the dataset.
NOTE: Here you need to work within the HDF working format!!!! (see cwimport above)
cwmath --template=ugos --longname="Geostrophic Current Magnitude" -v --expr="gos_mag=sqrt(pow(ugos,2)+pow(vgos,2))" rads_global_nrt_sla_20220925_20220926.hdf