User Tools

Site Tools


atmos:software:lrose:cshrc

Setup LROSE-TITAN on Calgary

If you haven't done so already, clone lrose-core and lrose-titan and run the auto-build script. More information on installing LROSE-TITAN can he found here: https://github.com/NCAR/lrose-titan/blob/master/docs/pdf/TitanInstall.pdf. IF YOU HAVE ALREADY DONE THIS, SKIP TO THE 'Directory Setup' SECTION BELOW.

First, make sure you have lrose-core installed in your ~/git directory on Calgary.

mkdir ~/git
cd git

Clone repositories

git clone https://github.com/NCAR/lrose-core
git clone https://github.com/NCAR/lrose-titan

Set up and build lrose-core by running the checkout_and_build_auto.py script in the ~/git/lrose-core/build directory:

cd lrose-core/build
./checkout_and_build_auto.py

Directory Setup

In your home directory ($HOME), remove exiting symbolic link and set new one.

rm ~/projDir
ln -s /nas/und/Florida/2019/Radar/projDir.kmlb projDir
ln -s /nas/und/Florida/2019/Radar/projDir.kmlb projDir.kmlb

System Variable Setup

The params files use a lot of system variables that are set in the lrose-calgary.cshrc.tar file. Place this .tar file into your home directory.

First, untar the .tar file. You should see a .cshrc file within the .tar file.

tar -xvf lrose-calgary.cshrc.tar

Check to see if the .cshrc file is there:

ls -a

To set system variables, source the .cshrc file from your home directory within the tcsh shell (will not work using bash).

tcsh

Next, source the .tar file:

source .cshrc

From here you should now be able to access all the scripts/executables from lrose-titan. To verify this, type in Radx in your terminal and hit the tab button twice to see if the many different executables pop up. If they do, you successfully cloned lrose-titan/lrose-core on Calgary.

Convert Data Files

Now, If you want to apply the lrose executables for NEXRAD level 2 radar data (can be in .ar2v format) you first want to convert these radar files into cfradial format. For example, lets go through the work flow in converting level 2 NEXRAD radar data (in compressed .ar2v format) to cfradial format using RadxConvert, and then re-grid those files to a Cartesian coordinate system using Radx2Grid. When regridding using Radx2Grid you can choose to output the new file in cf.NETCDF4 format or MDV format; in this case we will be regridding and concurrently converting the new files into MDV format that can then be read using Rview.

First we must configure the Radx2Grid params file located in:

cd ~/projDir.kmlb/ingest/params

The params file for Radx2Grid is named Radx2Grid.nexrad. Just for safe keeping create a new copy of the params file so you have a non-modified params file in case your modified params file creates issues:

cp -r Radx2Grid.nexrad Radx2Grid_copy.nexrad

Next, open the copied params file in vim:

vi Radx2Grid_copy.nexrad

It is suggested that you read this file completely. This params file has key information that you may want to adjust/change in order for your specific radar data you are using and what you may want to convert the data into (mdv, netCDF, ect.).

Now, if you scroll down to line 79 you should see a section titled /mode/. Switch the Operating mode to ARCHIVE on line 102:

mode = ARCHIVE;

Next, if you scroll down to line 117 you should see a section titled /start_time/ and on line 129 you should see a section titled /end_time/. Modify the start time and end time for which your radar files cover. In this case we will be looking at radar files from 07/25/2019 from the KMLB radar site. So modify as such:

start_time = "2019 07 25 00 00 00";
end_time = "2019 07 25 23 59 59";

Next, on line 157 insert a slash after radar and before cart. The directory structure is important for Radx2Grid to run. Line 157 should now look like this:

output_dir = "$(DATA_DIR)/mdv/radar/cart/";

Next, scroll down to line 159 where you should see a section titled /output_format/. On line 177 & 178, comment out by inserting 2 slashes in front of the output format you do not want, and delete the 2 slashes in front of the output format you would like when reggriding the data. In this case, we want MDV output format:

output_format = MDV;
//output_format = CF_NETCDF;

Now your params files are configured to convert the radar data from 07/25/2019 using Radx2Convert and Radx2Grid, you may now exit and save your Radx2Grid_copy.nexrad file (hit ESC then type :wq and hit enter)!

Now, return to your home directory:

cd ~

Run RadxConvert by first pointing where your radar data is stored followed by the necessary params file:

RadxConvert -f projDir.kmlb/data/raw/20190725/* -params ~/projDir.kmlb/ingest/params/RadxConvert.nexrad

This may take a few minutes. Once this is completed, check to see if the new cfradial radar files were generated:

cd projDir.kmlb/data/cfradial/kmlb/20190725

If the new cfradial radar files were generated go back to your home directory and then run Radx2Grid

cd ~
Radx2Grid -params ~/projDir.kmlb/ingest/params/Radx2Grid_copy.nexrad

This will also take a few minutes depending on how many radar files you are reading/converting. Once this is completed, check to see if new .mdv files were generated:

cd projDir.kmlb/data/mdv/radar/cart/

The regridded .mdv radar files will be located here.

Now, we can run Rview to display the .mdv files, but first we must do some manipulation to the Rview.archive file. Create a copy of this file:

cp -r Rview.archive Rview_copy.archive

Next use vim to look into this file and change the code on line 29 to date and time of the first generated .mdv file. In this example, the new line of code should look like this:

vi Rview_copy.archive
Rview.time_requested: 2019 07 25 00 04 31

Once done with the previous step, get out of vim. Ne need to create a tmp directory in your data directory for Rview.

cd ~/projDir/data/
mkdir tmp

Now, we can run Rview:

Rview -params ~/projDir/display/params/Rview_copy.archive


Errors with Radx2Grid

Keep in mind that Radx2Grid may throw you errors if environment variables are not set. To set the environment for a given variable (for example, $radar_name) type the following in your command line:

setenv radar_name kmlb

To see if the environment is set up correctly for the given variable, type the following in the command line to check:

echo $radar_name

Another way around this is to manually input these variables in the params file itself. For example, in the Radx2Grid.nexrad params file (or the one you copied) there is a variable on line 357 named: $(CART_GRID_START_HT). You can manually delete that variable (or comment that line out as shown below), and replace it with 1 and it will work just the same as if you were to use setenv.

//minz = $(CART_GRID_START_HT),  
minz = 1,
atmos/software/lrose/cshrc.txt · Last modified: 2020/06/24 15:00 by cnairy