DaViT Tutorials
Here at VT we use a variety of IDL functions to analyze and visualize data. Specifically, we have combined the Radar Software Toolkit (RST) and the THEMIS IDL routines, with radar data plotting routines from Leicester, UK, to form a powerful set of tools which we refer to as DaViT (Data and Visualisation Toolkit). DaViT was developed on a Linux platform, and should in theory work on MacOS (never been tested), but not on Windows. This website provides answers to some How-do-I... questions when using DaViT. If you have any questions not answered here, contact us. Please note that all the answers in this section assume that you work on a Linux-type computer. |
Installing and Running DaViT |
---|
How do I... |
... get DaViT?
We are discouraging use of these IDL routines as we are working toward moving to a python-based analysis package. If you need IDL support, please contact someone on our personnel page.
|
... install DaViT?
After you have downloaded the tarball, follow the instructions in DaViT Installation Guide.pdf.
|
... run DaViT?
Start the DaViT by opening a shell and typing path-to-davit/bin/davit. If you have your own set of IDL library procedures/functions that you would like to use in conjunction with DaViT, I recommend setting up a small shell script that changes into your working directory, add your IDL library path to the IDL_PATH system variable and then starts DaViT. This file could look like this:
cd /home/lbnc/idl |
... use the RST together with DaViT?
When installing the RST, it requires you to set a bunch of environment variables, including IDL_STARTUP. You might be worried that when you use DaViT that the RST will stop working. That is not so.
The DaViT env_davit shell script does all the things the RST did for you. You will notice for example, that the very first thing DaViT does when starting is to compile all the RST IDL routines. Also, DaViT comes bundled with the RST so that you don't need to install the RST in order to use it. |
... run DaViT at VT?
All Linux machines in the SuperDARN group at Virginia Tech should be set up such that when you open a shell and enter /davit/bin/davit, DaViT should start. If not check the following:
1) Is there a local directory called /davit? Enter ls /davit. If it says "No such file or directory", contact us. Or even better, just walk into my office, that should be faster than emailing. 2) Is there an entry in /etc/fstab that mounts the /davit directory? Enter more /etc/fstab | grep davit. If nothing is printed, contact us - walk, office, you remember? 3) Is the /davit directory mounted? Enter more /etc/mtab | grep davit. If nothing is printed, contact us. 4) Is IDL installed? Enter idl and see if that starts up. If not, contact us. 5) Did you change the IDL_STARTUP system variable? 6) If you get compile errors thrown by IDL during the startup, your IDL_PATH variable might not be set properly. Enter env | grep IDL_PATH. If nothing is printed, contact us. |
... get DaViT to access my data?
DaViT's default settings rely on a specific structure to access radar data (though some flexibility is possible).
Once you provide the path to your data directory, DaViT searches for data in 'YYYY/file_format/radar_code/YYYYMMDD.HHMM.radar_code.file_format[.bz2]', where YYYY is the 4-digit year, MM the 2-digit month, DD the 2-digit day, radar_code the 3-letter radar code (bks, wal...) and file_format the file format (fitacf, fitex, rawacf...).
|
Misc |
---|
How do I... |
... find that function which name I forgot?
DaViT includes a little function called pri. You can use it to tell you what functions there are and what their syntax is. So say you remember that there is a function to read radar fit data, but you don't remember the name. just enter
pri,'fit'
pri,'fitread' Caveat: pri only works on routines written in IDL. If you provide just a part of the function name, like in the first example, only the already compiled IDL routines are found. However, pri will try and compile a function of the name that you are providing. So it will give you the syntax of fitread even if that function is not compiled yet. |
Reading Radar Data |
---|
How do I... |
... read fitACF/fitEX files?
Use the rad_fit_read command. The syntax is
rad_fit_read, yyyymmdd, 3letterradarcode [, time=[hhmm,hhmm] ] This command will read the fitACF/EX data found in the RAD_FIT_DATA_PATH set in path-to-davit/bin/davit. It will first look for zipped fitEX files, then fitEX files, then zipped fitACF and finally fitACF files. The data is read into a structure called rad_fit_data in the RAD_DATA_BLK common block. Type rad_fit_info to display some information about the data currently present in that variable. You can also give the command a filename as string (which can contain wildcards) of the file(s) you would like to read. See the documentation for details. |
... read grd/grdEX files?
Use the rad_grd_read command. The syntax is
rad_grd_read, yyyymmdd [, /north ] [, /south ] This command will read the grdEX/grd data found in the RAD_GRD_DATA_PATH set in path-to-davit/bin/davit. It will first look for zipped grdEX files, then grdEX files, then zipped grd and finally grd files. The data is read into the structure called rad_grd_data in the RAD_DATA_BLK common block. Type rad_grd_info to display some information about the data currently present in that variable. You can also give the command a filename as string (which can contain wildcards) of the file(s) you would like to read. See the documentation for details. |
... read map/mapEX files?
Use the rad_map_read command. The syntax is
rad_map_read, yyyymmdd [, /north ] [, /south ] This command will read the mapEX/map data found in the RAD_MAP_DATA_PATH set in path-to-davit/bin/davit. It will first look for zipped mapEX files, then mapEX files, then zipped map and finally map files. The data is read into the structure called rad_map_data in the RAD_DATA_BLK common block. Type rad_map_info to display some information about the data currently present in that variable. You can also give the command a filename as string (which can contain wildcards) of the file(s) you would like to read. See the documentation for details. |
Plotting |
---|
How do I... |
... plot a range-time plot of radar data?
Use the rad_fit_plot_rti command. The syntax is
rad_fit_plot_rti That will plot a range-time plot of the selected parameter for a given beam with title and colorbar. Of course, you need to read data before you can plot any. If you just want to plot the panel without a title and colorbar, use the rad_fit_plot_rti_panel command. The syntax israd_fit_plot_rti_panel Suppose you want to plot Hankalsami spectral width data for March 3rd, 2003, 12:00-18:00 UT. Just enter:
rad_fit_read, 20030303, 'han', time=[1200,1800] |
... redirect graphic output to a PostScript?
Use the ps_open command to open and the ps_close command to close the PostScript. The syntax is
ps_open, filename andps_close command. One advantage of using these higher level procedures (as opposed to IDL's native SET_PLOT and DEVICE) is that ps_close will write a comment into the header of the PostScript file. This comment contains the name of the IDL procedure that created that plot - actually, it is a complete stack trace. That is very helpful if one day all your PostScript files are called asdf.ps and test.ps and you have no idea how you made this plots. You can then simply open the PostScript file in any text editor and look at these comments to remind yourself.Here's an example. Suppose you want to plot Hankalsami spectral width data for March 3rd, 2003, 12:00-18:00 UT. Just enter:
rad_fit_read, 20030303, 'han', time=[1200,1800] |
... plot a timeseries plot of radar data?
Use the rad_fit_plot_tsr command. The syntax is
rad_fit_plot_tsr That will plot a timeseries plot of the selected parameter for a given beam and gate. It will also plot a title and colorbar. Of course, you need to read data before you can plot any. If you just want to plot the panel without a title and colorbar, use the rad_fit_plot_tsr_panel command. The syntax israd_fit_plot_tsr_panel Suppose you want to plot Hankalsami spectral width data for March 3rd, 2003, 12:00-18:00 UT, beam 4 and gate 25. Just enter:
rad_fit_read, 20030303, 'han', time=[1200,1800] |
... plot a FFT of a timeseries of radar data?
As so often in programming, there are a million ways to do this. But it all reaks down to this
1) Read the data
; read data |
... plot a fan/scan of radar data?
Use the rad_fit_plot_scan command. The syntax is
rad_fit_plot_scan That will overlay a scan of the selected parameter over a map in geomagnetic (AACGM) coordinates. It will also plot a title and colorbar. Of course, you need to read data before you can plot any. If you just want to plot the panel without a title and colorbar, use the rad_fit_plot_scan_panel command. The syntax israd_fit_plot_scan_panel Suppose you want to plot Hankalsami spectral width data for March 3rd, 2003, 12:18 UT, on a geographic map. Just enter:
v
rad_fit_read, 20030303, 'han', time=[1200,1300] |
... plot multiple panels on one page?
There's a million ways to do that! Which, of course, is not the answer you wanted.
So here is a scenario: You would like to plot a panel of OMNI data on the top and then Blackstone RTI data from beam 4 and then Rankin Inlet data from beam 7 and 12. All data is from March 10th, 2008, 12:00 to 15:00 UT. Here's the code that does that:
omn_read, 20080310 But alas, you realize there is no colorbar and no title and you wanted it in magnetic coordinates and not gate and you wanted to plot velocity, not power! Hence you do this:
omn_read, 20080310
rad_fit_plot_rti_panel, 1, 4, 0, 2, date=20080310, time=[1200,1500], beam=7, /bar, yrange=[60,90] |
... plot multiple radar scans on one map?
You achive that by plotting an empty map, reading the fit data for one radar, overlay the scan, read fit data for the next radar, overlay the scan...
Here's some code that plots an empty map in MLT coordinates and overlays a scan from Blackstone and Fort Hays East. The scan is that closest to 20091207 at 13:32 UT:
clear_page
clear_page |
... overlay the data I downloaded from somewhere on a map?
First of all, you need to have the position of the data you would like to overlay in some kind of coodinate system. Once you have that, we will do some coordinate transformations, plot a map using map_plot_panel and then overlay the data.
The answers varies a little bit, depending on the coordinate system you would like to display the data in. Also, it depends in what coordinate system the data you wish to overlay is in. In this example, let's assume that your data is in geographic coordinates but you would like to plot the whole shebang in MLT. The approach is as follows:
1) Read your data and their positions.
; calculate the year and seconds since beginning |
... get the footprints in the previous example from?
You need the spacecraft positions in some coordinate system, say GSM. DaViT includes the THEMIS Data Analysis Software (TDAS). That software includes the Tsyganenko magnetic field models and an IDL routine called trace2iono. Its basic syntax is
trace2iono, time_array, in_pos_array, out_foot_array, external_model=external_model, To convert the spacecraft position in GSM into footprints in GEO using the Tsyg 96 model with Dst=-10 nT, pdyn=2.0 nPa, By=0.0 nT and Bz=0.0 nT, simply enter
trace2iono, time_array, in_pos_array, out_foot_array, external_model='t96', You can now look at the previous example to learn how to plots these footprints onto a map in MLT coordinates. Well actually, you first need to convert the footprints from the geocentric coordinates returned by trace2iono to the geocentric latitude and longitude system. But I trust you are able to figure that one out by yourself. |
... plot a map, overlay THEMIS all-sky imager and radar data?
DaViT includes the THEMIS Data Analysis Software (TDAS). That software allows you to download all space and ground-based data within the THEMIS mission.
Say you want to plot the data in geomagnetic coordinates. So here's what we'll do: 1) Download the all-sky imager (ASI) data and its calibration 2) Read ASI data 3) Convert the positions of the field-of-view of the ASIs to geomagnetic and then map coordinates 4) Plot the data This script does just that:
; call some TDAS routines to get the right data Of course, you can now overlay radar data using the rad_fit_overlay_scan command. |
Radar File Issues |
---|
How do I... |
... create my own fitACF/EX files?
This method has become deprecated. Please refer to RST for data processing.
You use one of the two binaries provided by DaViT, located in path-to-davit/bin. To create fitACF, use: path-to-davit/bin/make_fit -new file.rawacf > file.fitacf To create fitEX, use:path-to-davit/bin/make_fitex2 -new file.rawacf > file.fitex |
... create my own grd files?
This method has become deprecated. Please refer to RST for data processing.
You use the binary provided by DaViT, located in path-to-davit/bin. To create a grd file from several fitEX files, use: path-to-davit/bin/make_grid -new -c -i integration_in_seconds file*.fitacf > file.grd |
... create my own map files?
This method has become deprecated. Please refer to RST for data processing.
You can use the binary provided by DaViT They are located in path-to-davit/bin. To create a map file from a grd file, do the following steps:
path-to-davit/bin/map_grd -new file.grd > file.map |