Two of the scripts supplied by NWCSAF are specifically designed to plot the high resolution winds (HRW) products. These winds are generated by tracking cloud features in sequential satellite images. As such there is sometimes a requirement that there are several timesteps available for the plotting routines to work. With this in mind please make sure that you select times to plot where there is sufficient data in the export archive to produce the plots.
The first script to plot the HRW product that we will look at is called nwcpy_hrw.py. This script takes the data from the HRW data files as well as L1SD for the backgound data (same as the RDT product) and produces a grey-scale image of the 12 micron radiance with wind barbs plotted on top. The colour of the wind barbs references either the pressure level that the winds are valid for or the speed of the wind. This choice is made through the use of an argument to the script.
Once again lets get some information on how we should run this script by running it with no arguments.
python nwcpy_hrw.py
The output below shows us which arguments are required to run this script.
Summary of the h5py configuration
---------------------------------
h5py 2.9.0
HDF5 1.10.4
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
[GCC 7.3.0]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.16.4
Usage: python nwcpy_hrw.py <path/file.nc> <width> <height> <type> [<pressure_interval>]
where type = p (pressure level), ws (wind speed)
pressure_interval = 0 (only background), 1 (100-400hPa), 2 (400-600hPa), 3 (600-800hPa), 4 (800-1000hPa)
Example: python nwcpy_hrw.py /home/NWCGEO/export/HRW/S_NWC_HRW_MSG3_Spain-BS_20151013T150000Z.nc 0 0 p 1
The top section is not useful for us here, however, the bottom half details that we are required to provide the location of the HRW data file, the height and width, the type (where type is either pressure levels or wind speed) and the optional argument of the pressure interval.
Now lets run the script with the appropriate arguments to produce an image showing the wind barbs on all pressure levels.
python nwcpy_hrw.py ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T181500Z.nc 0 0 p
This should give you the output similar to that shown below.
Summary of the h5py configuration
---------------------------------
h5py 2.9.0
HDF5 1.10.4
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
[GCC 7.3.0]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.16.4
inDir= ../export_archive/HRW
outDir= /home/swift/safnwc/NWCPY
File ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T181500Z.nc
plot type: pressure level
all pressure intervals
L1SD file ../export_archive/L1SD/S_NWC_IR120-BT_MSG4_Ghana-VISIR_20180801T181500Z.nc
data type: float32 | max = 303.337 min = 185.16182
prod size (512, 512)
validRange -10000000000.0 10000000000.0
wxh 1100.0 x 800.0
Writing /home/swift/safnwc/NWCPY/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T181500Z.p_all.gif
When we change the level argument from p to ws,
python nwcpy_hrw.py ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T181500Z.nc 0 0 ws
we get output that looks like this.
Summary of the h5py configuration
---------------------------------
h5py 2.9.0
HDF5 1.10.4
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
[GCC 7.3.0]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.16.4
inDir= ../export_archive/HRW
outDir= /home/swift/safnwc/NWCPY
File ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T181500Z.nc
plot type: wind speed
all pressure intervals
L1SD file ../export_archive/L1SD/S_NWC_IR120-BT_MSG4_Ghana-VISIR_20180801T181500Z.nc
data type: float32 | max = 303.337 min = 185.16182
prod size (512, 512)
validRange -10000000000.0 10000000000.0
wxh 1100.0 x 800.0
Writing /home/swift/safnwc/NWCPY/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T181500Z.ws_all.gif
The images generated should look like this. As you can see the barbs are in the same positions and show the tails indicate the same wind-speeds but the colours are indicating different properties.
By adding the optional argument to the end of the command when running in pressure level mode (values 0 to 4) you can output just the background image, or smaller groups of pressure levels.any of the any of the
In order to plot trajectories based on cloud motion vector winds we need to make sure that we have the appropriate files prior to the image's valid time. In this case we will initially be selecting to use the time-step 4 steps ago (1 hour into the past) to produce our trajectories. It is also important to note that there is a requirement for winds to be present in the data files for the cloud motion vectors and therefore the trajectories to be calculated. Therefore in situations where there are no clouds in the domain NWCSAF-GEO is being run for there cannot be any cloud motion vectors and consequently in the above images there would be no wind barbs and the script to create a trajectory image would fail.
As always lets initially run our code with no arguments to learn what we need to supply the script with.
python nwcpy_hrw_traj.py
The output you should see looks like this
Summary of the h5py configuration
---------------------------------
h5py 2.9.0
HDF5 1.10.4
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
[GCC 7.3.0]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.16.4
Usage: python nwcpy_hrw_traj.py <path/file.nc> <width> <height> <n_slots> [<pressure_interval>]
where n_slots >= 2
pressure_interval = 0 (only background), 1 (100-400hPa), 2 (400-600hPa), 3 (600-800hPa), 4 (800-1000hPa)
Example: python nwcpy_hrw_traj.py /home/NWCGEO/export/HRW/S_NWC_HRW_MSG3_Spain-BS_20151013T154500Z.nc 0 0 4 1
This tells us that we need to provide the script with the location of the HRW data file (for the last time step of the trajectory), the height and width of the image the number of time slots to calculate the trajectory and the optional argument of the pressure interval (same as the HRW plots above).
First lets try to generate a trajectory using the the proceeding 4 timeslots.
python nwcpy_hrw_traj.py ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T210000Z.nc 0 0 4
The output should look like this.
Summary of the h5py configuration
---------------------------------
h5py 2.9.0
HDF5 1.10.4
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
[GCC 7.3.0]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.16.4
inDir= ../export_archive/HRW
outDir= /home/swift/safnwc/NWCPY
File ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T210000Z.nc
number of slots: 4
all pressure intervals
L1SD file ../export_archive/L1SD/S_NWC_IR120-BT_MSG4_Ghana-VISIR_20180801T210000Z.nc
data type: float32 | max = 303.337 min = 185.16182
prod size (512, 512)
validRange -10000000000.0 10000000000.0
wxh 1100.0 x 800.0
Warning: No data available for band wind_hrvis
Extracting trajectory data for band wind_ir108 ...
Warning: No data available for band wind_ir120
Extracting trajectory data for band wind_vis06 ...
Warning: No data available for band wind_vis08
Extracting trajectory data for band wind_wv062 ...
Extracting trajectory data for band wind_wv073 ...
Plotting trajectories ...
Writing /home/swift/safnwc/NWCPY/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T210000Z.traj_all_4slots.gif
Now lets do the same but increase the number of time slots used for the trajectory to 8.
python nwcpy_hrw_traj.py ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T210000Z.nc 0 0 8
This should give the result on screen...
Summary of the h5py configuration
---------------------------------
h5py 2.9.0
HDF5 1.10.4
Python 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 21:00:58)
[GCC 7.3.0]
sys.platform linux2
sys.maxsize 9223372036854775807
numpy 1.16.4
inDir= ../export_archive/HRW
outDir= /home/swift/safnwc/NWCPY
File ../export_archive/HRW/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T210000Z.nc
number of slots: 8
all pressure intervals
L1SD file ../export_archive/L1SD/S_NWC_IR120-BT_MSG4_Ghana-VISIR_20180801T210000Z.nc
data type: float32 | max = 303.337 min = 185.16182
prod size (512, 512)
validRange -10000000000.0 10000000000.0
wxh 1100.0 x 800.0
Warning: No data available for band wind_hrvis
Extracting trajectory data for band wind_ir108 ...
Warning: No data available for band wind_ir120
Extracting trajectory data for band wind_vis06 ...
Warning: No data available for band wind_vis08
Extracting trajectory data for band wind_wv062 ...
Extracting trajectory data for band wind_wv073 ...
Plotting trajectories ...
Writing /home/swift/safnwc/NWCPY/S_NWC_HRW_MSG4_Ghana-VISIR_20180801T210000Z.traj_all_8slots.gif
The two images generated by these commands are shown below. Notice the additional length of the trajectories (still straight lines) but the fact that there are fewer of them. This is due to the fact that the clouds used to generate the trajectory have moved further as the period being calculated for is twice the length. There are also far fewer trajectory lines, this is due to the fact that features cannot always be tracked over greater periods of time and so fewer trajectories are produced. The number of time-slots argument should be considered to show the motion of clouds but also make sure the features can be tracked.