Actions

Difference between revisions of "Elle full"

From Lrose Wiki

(Undo revision 938 by Barbero (talk))
Tag: Undo
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=== '''Full elle tutorial''' ===
 
=== '''Full elle tutorial''' ===
  
This workflow will convert raw radar files to the CfRadial format and estimate the surface rain rate, emphasizing some parameters that need to be defined for each application. This workflow assumes that soundings need to be estimated from GFS analysis data. Note, the current parameter files are currently optimized to work on Unix systems. It is also helpful to have the programs [https://formulae.brew.sh/formula/ncview ncview] and [https://formulae.brew.sh/formula/nco nco] to debug by plotting and dumping the contents of .nc files, which can be downloaded using [https://brew.sh/ Homebrew].  
+
This workflow will convert raw radar files to the CfRadial format and estimate the surface rain rate, emphasizing some parameters that need to be defined for each application. This workflow assumes that soundings need to be estimated from GFS analysis data. Note, the current parameter files are currently optimized to work on Unix systems. It is also helpful to have the programs [https://formulae.brew.sh/formula/ncview ncview] and [https://formulae.brew.sh/formula/nco nco] to debug by plotting and dumping the contents of .nc files during intermediate steps, and which can be downloaded using [https://brew.sh/ Homebrew].  
  
  
Line 38: Line 38:
 
<li>Download the GFS analysis from [https://www.ncdc.noaa.gov/data-access/model-data/model-datasets/global-forcast-system-gfs NCEI]. Under 'Data on NCEI Servers,' select the HAS access option for the 0.5º domain of GFS Analysis (GFS-ANL). Since the tutorial includes two different files, select all UTC cycles and enter the start and end dates. Select the batch option and enter your email. Download the data when your order is ready and put it in a folder named gfs within the elle_full directory.</li></ol>
 
<li>Download the GFS analysis from [https://www.ncdc.noaa.gov/data-access/model-data/model-datasets/global-forcast-system-gfs NCEI]. Under 'Data on NCEI Servers,' select the HAS access option for the 0.5º domain of GFS Analysis (GFS-ANL). Since the tutorial includes two different files, select all UTC cycles and enter the start and end dates. Select the batch option and enter your email. Download the data when your order is ready and put it in a folder named gfs within the elle_full directory.</li></ol>
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
<li>Download the topography data using the following command. ''Note: the folder is approximately 22 GB.'' If you know which region of the globe you need, you can poke around the website to determine which subfolder is necessary for your dataset. Unzip the contents and make note of the resulting directory.</li></ol>
+
<li>Download the [https://lpdaac.usgs.gov/products/srtmgl3sv003/#tools SRTM topography data] using wget, curl, or manually downloading the files. A full example of how to download the data using wget is shown in the [http://wiki.lrose.net/index.php/RadxBeamBlock#Digital_elevation_model_data RadxBeamBlock documentation]. ''Note: the folder is approximately 22 GB.'' If you know which region of the globe you need, you can poke around the website to determine which subfolder is necessary for your dataset. Unzip the contents and make note of the resulting directory.</li></ol>
  wget -r https://dds.cr.usgs.gov/srtm/version2_1/SRTM3/ *link has moved*
+
  wget --user=$USERNAME --password=$PASSWORD https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/N${lat}E${lon}.SRTMGL1.hgt.zip
  
 
=== '''Running Radx Applications''' ===
 
=== '''Running Radx Applications''' ===
Line 50: Line 50:
 
==== '''RadxConvert''' ====
 
==== '''RadxConvert''' ====
 
<ol start="1" style="list-style-type: decimal;">
 
<ol start="1" style="list-style-type: decimal;">
<li>Convert the raw file to a CfRadial file. If you have data from more than one day, run the command in a for loop or simply run each day one at a time replacing $days with each date (YYYYMMDD).</li></ol>
+
<li>Convert the raw file to a CfRadial file. If you have data from more than one day, run a for loop or run each day one at a time replacing $days with the date (YYYYMMDD).</li></ol>
 
  /path/to/RadxConvert -params ./params/RadxConvert.* -f $RAW/$RADAR_NAME/$days/*.raw*
 
  /path/to/RadxConvert -params ./params/RadxConvert.* -f $RAW/$RADAR_NAME/$days/*.raw*
  
Line 64: Line 64:
 
<ol start="5" style="list-style-type: decimal;">
 
<ol start="5" style="list-style-type: decimal;">
 
<li>In the params folder, insert the radar wavelength (cm), horizontal (degrees), and vertical (degrees) beamwidths in lines 215, 225, and 235 of RadxBeamBlock.RCWF.new, respectively.</li></ol>
 
<li>In the params folder, insert the radar wavelength (cm), horizontal (degrees), and vertical (degrees) beamwidths in lines 215, 225, and 235 of RadxBeamBlock.RCWF.new, respectively.</li></ol>
Note: for steps 4 and 5, you can use RadxPrint on the raw or converted .nc radar file to view this information.
 
RadxPrint -printVars -f /path/to/radar/file
 
 
<ol start="6" style="list-style-type: decimal;">
 
<ol start="6" style="list-style-type: decimal;">
 
<li>In the params folder, insert the range gate, azimuth, and elevation geometries in lines 263-306 of RadxBeamBlock.RCWF.new, respectively. The range gate and azimuth fields should match the observed spacing. If your elevation angles are unevenly spaced, it might be easier to artificially set the spacing to 0.25 or 0.5 degrees. The programs will interpolate the estimated blockage to the actual elevation angle later. The max elevation angle will depend on the radar location. Near Houston, TX, for example, only 2-3 degrees is probably sufficient, but a 10-20 degrees might be necessary near Taiwan.</li></ol>
 
<li>In the params folder, insert the range gate, azimuth, and elevation geometries in lines 263-306 of RadxBeamBlock.RCWF.new, respectively. The range gate and azimuth fields should match the observed spacing. If your elevation angles are unevenly spaced, it might be easier to artificially set the spacing to 0.25 or 0.5 degrees. The programs will interpolate the estimated blockage to the actual elevation angle later. The max elevation angle will depend on the radar location. Near Houston, TX, for example, only 2-3 degrees is probably sufficient, but a 10-20 degrees might be necessary near Taiwan.</li></ol>
 +
Note: for steps 4, 5, and 6, you can use RadxPrint on the raw or converted .nc radar file to view this information.
 +
RadxPrint -printVars -f /path/to/radar/file
 
<ol start="7" style="list-style-type: decimal;">
 
<ol start="7" style="list-style-type: decimal;">
 
<li>Run RadxBeamBlock for the RCWF radar location</li></ol>
 
<li>Run RadxBeamBlock for the RCWF radar location</li></ol>
Line 78: Line 78:
 
<li>In Grib2toMdv.gfs.taiwan, insert the projection parameters in lines 764-770. PROJ_LATLON is a fine choice and does not require the other parameters to be set.</li></ol>
 
<li>In Grib2toMdv.gfs.taiwan, insert the projection parameters in lines 764-770. PROJ_LATLON is a fine choice and does not require the other parameters to be set.</li></ol>
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
<li>In Grib2toMdv.gfs.taiwan, insert the desired output grid in lines 792-798. minx (lon) and miny (lat) set the lower left corner of the box around the radar, dx and dy indicate the spacing in degrees, and nx and ny indicate the number of points.</li></ol>
+
<li>In Grib2toMdv.gfs.taiwan, insert the desired output grid in lines 792-798. You will need to choose a grid that contains your area of interest as well as the radar(s) you are using.</li></ol>
 +
minx: initial longitude [-180 to 180]
 +
miny: initial latitude [-90 to 90]
 +
nx: # of longitude points (# of dx)
 +
ny: # of latitude points (# of dy)
 +
dx: preferred longitude grid spacing
 +
dy: preferred latitude grid spacing
 +
Example: if minx=118, miny=20, nx=50, ny=50, dx=0.1, dy=0.1, the grid will span from 118º to 123º E and 20º to 25º N.
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
<li>In Mdv2SoundingSpdb.gfs, insert the radar lat, lon, and elevation in lines 286-289.</li></ol>
+
<li>In Mdv2SoundingSpdb.gfs, insert the radar's longitude, latitude, and elevation in lines 286-289.</li></ol>
 
<ol start="4" style="list-style-type: decimal;">
 
<ol start="4" style="list-style-type: decimal;">
<li>Convert the GFS Grib2 files to Mdv (Grib2toMdv) and then extract the sounding closest to the RCWF radar (Mdv2SoundingSpdb)</li></ol>
+
<li>Convert the GFS grib2 files to Mdv (Grib2toMdv) and then extract the sounding closest to the RCWF radar (Mdv2SoundingSpdb)</li></ol>
 
  /path/to/Grib2toMdv -params ./params/Grib2toMdv.* -f ./gfs/*.grb2
 
  /path/to/Grib2toMdv -params ./params/Grib2toMdv.* -f ./gfs/*.grb2
 
  /path/to/Mdv2SoundingSpdb -params ./params/Mdv2SoundingSpdb.* -f ./gfs/mdv/$i/*.mdv
 
  /path/to/Mdv2SoundingSpdb -params ./params/Mdv2SoundingSpdb.* -f ./gfs/mdv/$i/*.mdv
 +
Note: before moving on, check that your Spdb sounding files are populated with data by using the SpdbQuery command below. All parameters except w wind and divergence should be populated.
 +
SpdbQuery -url /path/to/spdb/folder -start "YYYY MM DD HH MM SS" -end "YYYY MM DD HH MM SS"
  
 
==== '''RadxRate''' ====
 
==== '''RadxRate''' ====
Line 110: Line 119:
 
==== '''Finished!''' ====
 
==== '''Finished!''' ====
 
<ol start="1" style="list-style-type: decimal;">
 
<ol start="1" style="list-style-type: decimal;">
<li>In the elle_full directory, you should now see 3 new directories: convert, rate, and qpe. You can look through the the files in those directories to inspect the new files and check the quality of the data.</li></ol>
+
<li>In the elle_full directory, you should now see 3 new directories: convert, rate, and qpe. You can look through the the files in those directories to inspect the new files and check the quality of the data. A tutorial on how to add and view retrieve/calculated variables in HawkEye such as the RATE variables, PID, etc., can be found [http://wiki.lrose.net/index.php/HawkEye#Adding_variables_to_HawkEye_parameter_file here].</li></ol>
  
 
=== '''Run programs from a sample script''' ===
 
=== '''Run programs from a sample script''' ===

Latest revision as of 20:19, 5 August 2022

Full elle tutorial

This workflow will convert raw radar files to the CfRadial format and estimate the surface rain rate, emphasizing some parameters that need to be defined for each application. This workflow assumes that soundings need to be estimated from GFS analysis data. Note, the current parameter files are currently optimized to work on Unix systems. It is also helpful to have the programs ncview and nco to debug by plotting and dumping the contents of .nc files during intermediate steps, and which can be downloaded using Homebrew.


For more information, refer to the following pages on how LROSE calculates KDP, estimates the dominant PID category, calculates rain rates, and estimates the surface precipitation rate.


Download parameter files

  1. Download the elle_full.tar.gz file
  1. Extract contents into the desired directory
tar -zxvf elle_full.tar.gz


The user can create their own parameter files for each function as shown in this example, but then directories in each parameter file will need to be set manually. The environment files included in the elle_full.tar.gz file will set the directory structure with modifications to only two lines of code. These lines will have to be rerun if opening a new terminal workspace.

Set up environment variables

  1. Either place the raw radar data in a subdirectory of elle_full called "raw" or make a note of the path to the radar data.
  1. In /elle_full/env_dirs, edit the directories (note: there is purposely no slash at the beginning of PROJ). Together, HOMED/PROJ should direct you to the elle_full directory. RAW is the full path to the raw radar data.
export HOMED="/path/to/home/directory"
export PROJ=“short/path/to/elle_full”
export RAW="/path/to/elle_full/raw"
  1. In /elle_full/env_vars, edit radar name (e.g., KHGX for Houston). This will set future directories in other parameter files and reduce the number of edits that need to be made.
export RADAR_NAME="RADAR"
export radar_name="radar"
export days="date1 date2 date3"
export daysbb="date1"
  1. In /elle_full/env_vars, set the coefficients for the rain rate equations. More information regarding the equations available in LROSE are described on this page and on page 4 of this AMS manuscript. The default Z-R relationship included in env_vars is from the Mismo dataset.

Obtain GFS and topographic data

  1. Download the GFS analysis from NCEI. Under 'Data on NCEI Servers,' select the HAS access option for the 0.5º domain of GFS Analysis (GFS-ANL). Since the tutorial includes two different files, select all UTC cycles and enter the start and end dates. Select the batch option and enter your email. Download the data when your order is ready and put it in a folder named gfs within the elle_full directory.
  1. Download the SRTM topography data using wget, curl, or manually downloading the files. A full example of how to download the data using wget is shown in the RadxBeamBlock documentation. Note: the folder is approximately 22 GB. If you know which region of the globe you need, you can poke around the website to determine which subfolder is necessary for your dataset. Unzip the contents and make note of the resulting directory.
wget --user=$USERNAME --password=$PASSWORD https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/N${lat}E${lon}.SRTMGL1.hgt.zip

Running Radx Applications

  1. Set the variables in the terminal and set the dates in the format YYYYMMDD. Print out the directory structure to make sure it's pointing to the right directory.
source env_dirs
source env_vars
echo $HOMED/$PROJ

RadxConvert

  1. Convert the raw file to a CfRadial file. If you have data from more than one day, run a for loop or run each day one at a time replacing $days with the date (YYYYMMDD).
/path/to/RadxConvert -params ./params/RadxConvert.* -f $RAW/$RADAR_NAME/$days/*.raw*

RadxBeamblock

  1. Replace "RCWF" in the filename for RadxBeamBlock.RCWF.new with the name of the radar (e.g., RadxBeamBlock.KHGX.new).
  1. In the params folder, modify line 53 of RadxBeamBlock.RCWF.new to indicate the directory of the unzipped topographic data.
  1. In the params folder, modify line 170 of RadxBeamBlock.RCWF.new to indicate the radar name.
  1. In the params folder, modify line 188-191 of RadxBeamBlock.RCWF.new to indicate the latitude, longitude, and altitude (terrain + antenna height) of the radar.
  1. In the params folder, insert the radar wavelength (cm), horizontal (degrees), and vertical (degrees) beamwidths in lines 215, 225, and 235 of RadxBeamBlock.RCWF.new, respectively.
  1. In the params folder, insert the range gate, azimuth, and elevation geometries in lines 263-306 of RadxBeamBlock.RCWF.new, respectively. The range gate and azimuth fields should match the observed spacing. If your elevation angles are unevenly spaced, it might be easier to artificially set the spacing to 0.25 or 0.5 degrees. The programs will interpolate the estimated blockage to the actual elevation angle later. The max elevation angle will depend on the radar location. Near Houston, TX, for example, only 2-3 degrees is probably sufficient, but a 10-20 degrees might be necessary near Taiwan.
Note: for steps 4, 5, and 6, you can use RadxPrint on the raw or converted .nc radar file to view this information.
RadxPrint -printVars -f /path/to/radar/file
  1. Run RadxBeamBlock for the RCWF radar location
/path/to/RadxBeamBlock -params ./params/RadxBeamBlock.$RADAR_NAME.*

Sounding

  1. In the params directory, rename the Grib2toMdv.gfs.taiwan file to whatever you prefer.
  1. In Grib2toMdv.gfs.taiwan, insert the projection parameters in lines 764-770. PROJ_LATLON is a fine choice and does not require the other parameters to be set.
  1. In Grib2toMdv.gfs.taiwan, insert the desired output grid in lines 792-798. You will need to choose a grid that contains your area of interest as well as the radar(s) you are using.
minx: initial longitude [-180 to 180]
miny: initial latitude [-90 to 90]
nx: # of longitude points (# of dx)
ny: # of latitude points (# of dy)
dx: preferred longitude grid spacing
dy: preferred latitude grid spacing

Example: if minx=118, miny=20, nx=50, ny=50, dx=0.1, dy=0.1, the grid will span from 118º to 123º E and 20º to 25º N.

  1. In Mdv2SoundingSpdb.gfs, insert the radar's longitude, latitude, and elevation in lines 286-289.
  1. Convert the GFS grib2 files to Mdv (Grib2toMdv) and then extract the sounding closest to the RCWF radar (Mdv2SoundingSpdb)
/path/to/Grib2toMdv -params ./params/Grib2toMdv.* -f ./gfs/*.grb2
/path/to/Mdv2SoundingSpdb -params ./params/Mdv2SoundingSpdb.* -f ./gfs/mdv/$i/*.mdv

Note: before moving on, check that your Spdb sounding files are populated with data by using the SpdbQuery command below. All parameters except w wind and divergence should be populated.

SpdbQuery -url /path/to/spdb/folder -start "YYYY MM DD HH MM SS" -end "YYYY MM DD HH MM SS"

RadxRate

  1. Ensure that you have the proper pid_thresholds file for your radar. Make any necessary modifications.
  1. Make sure the filtering/processing parameters in RadxKdp, RadxPid, and RadxRate are appropriate for your needs.
  1. In RadxPid.new, insert the accurate path to your pid_thresholds file in line 27.
  1. In RadxRate.new, make sure the paths to the RadxKdp, RadxPid, and rain rate parameter files are correct in lines 284, 303, and 350.
  1. Run RadxRate to calculate Kdp, the PID, and various rain rates. If you have data from more than one day, run a for loop or run each day one at a time replacing $days with the date (YYYYMMDD).
/path/to/RadxRate -params ./params/RadxRate.* -f ./convert/$RADAR_NAME/$days/*.nc

RadxQpe

  1. In RadxQpe.new, set your preferred output azimuthal resolution in line 32.
  1. In RadxQpe.new, check that the path to the beamblock file matches the path in line 269.
  1. Run RadxQpe to estimate the near-surface rainfall using the hybrid method. If you have data from more than one day, run a for loop or run each day one at a time replacing $days with the date (YYYYMMDD).
/path/to/RadxQpe -params ./params/RadxQpe.* -f ./rate/$RADAR_NAME/$days/*.nc

Finished!

  1. In the elle_full directory, you should now see 3 new directories: convert, rate, and qpe. You can look through the the files in those directories to inspect the new files and check the quality of the data. A tutorial on how to add and view retrieve/calculated variables in HawkEye such as the RATE variables, PID, etc., can be found here.

Run programs from a sample script

  1. If you'd like to run these applications through a script or on a cluster, you can use the script run_radx.sh (or make your own!). Follow all of the steps above, except for last item in each subsection where you run the Radx applications. Make sure you source the env_dirs and env_vars files.
  1. Edit directories in run_radx.sh script (lines 3 and 12)
cd /PATH/TO/elle_full
rdir="/PATH/TO/lrose/bin"
  1. Edit the days (YYYYMMDD) in run_radx.sh script (lines 10-11)
days="date1 date2 date3..."
daysbb="date1"
  1. Make the file executable, if it isn't already
chmod u+x run_radx.sh
  1. Run shell script
./run_radx.sh
  1. In the elle_full directory, you should now see 4 new directories: beamblock, convert, rate, and qpe.