Installing Madrigal for the first time
Prerequisites
Most of the prerequisites for Madrigal are pre-installed in any modern unix distribution. They are:
- A C, C++, and a FORTRAN compiler. The free GNU compilers may be downloaded from the GNU Website .
- tclsh, which may be downloaded from the Tcl Resource Center and libpng available from http://www.libpng.org/pub/png/libpng.html. Both these are typically included on unix distributions.
- A web server.
- The environmental variable MADROOT should be set to the path to the Madrigal installation directory. Its recommended this be done in your login script (eg, .bash_profile) because you will need it to run administrative scripts later.
- The environmental variable LD_LIBRARY_PATH should be set to $LD_LIBRARY_PATH:$MADROOT/lib. Its recommended this be done in your login script (eg, .bash_profile) because you will need it to run administrative scripts later.
The installation script will stop and issue a warning if any prerequisite is missing.
Installation instructions
Madrigal can be installed on any unix server with a web server. If you want to link your data in with data on other Madrigal servers, please notify the OpenMadrigal administrator. In general you do not need root permission to install madrigal once the prerequisites listed above are installed. You may need to be root to create the html and cgi directories in the web server. It is generally easiest to then chown for those two directories to the user that will be installing Madrigal.
- Create a directory to be used as your Madrigal root directory on your unix server. This directory will be referred to as MADROOT.
- Create the environment variable MADROOT with that directory path.
- Download the latest Madrigal distribution file, madrigal*.tar.gz from the OpenMadrigal distribution page to MADROOT.
- gunzip madrigal*.tar.gz
- tar -xf madrigal*.tar
- Repeat the 3 steps above to get and untar the Sample Experiments file experiments.tar.gz.
- Create two virtual directories on your webserver for your madrigal cgi files (which must allow scripts to run) and for your madrigal html files.
- In madroot, there will now be a file called madrigal.cfg.template. Copy it to madrigal.cfg, and edit all the configuration parameters, as described in the Editing madrigal.cfg section below.
- Edit the file MADROOT/metadata/siteTab.txt with a unique id to include your site. The format of siteTab.txt is described here. If you want to be an official Madrigal site that other Madrigal sites share data with, request the OpenMadrigal administrator to assign you this id. If this is just a test site, use any id not already in the siteTab.txt file. If you do not want all the sites in siteTab.txt included in your combined inventory listing, just remove these sites from siteTab.txt. Links to data from sites you leave in the siteTab.txt file will appear in your Madrigal web site.
- With Madrigal 2.6, users can now download cached HDF5 files. These cached HDF5 files are created during installation. You will want to make sure you have enough room in your experiments directory (typically about double the existing space used). You can create an ini file to modify how these HDF5 files are created. Instructions below describe how to added derived parameters and/or additional layouts for an given instrument, and optionally by kindat.
- Be sure to cd to MADROOT before running the following step. Then you should be able to complete the installation simply by typing
bash installMadrigal &> install.log &
There may be a long pause when running updateMaster near the end of the installation since the instParmTab.txt metadata file is being built for the first time by examining every data file, but future calls to updateMaster will be much faster since only new experiments are examined. Help with any installation errors is available from the OpenMadrigal administrator.
- If there were no errors, your madrigal installation should be running at the url given by madrigal. You can also test it by running MADROOT/bin/python testMadrigalBuild.py, which will test the ability to create plots.
- If you want to receive notices about updates to Madrigal, sign up for the openmadrigal-admin mailing list under www.openmadrigal.org.
- Set the script madroot/bin/updateMaster up as a cron job to run once a day.
- If you want to add any documentation pages specific to your site to the Madrigal documentation pages, see the other admin tasks section of this manual.
- If you want to add your own rules of the road to the Madrigal experiment page, see the other admin tasks section of this manual.
Editing the madrigal.cfg file
The madrigal.cfg file contains all the configuration information specific to your installation. This section discusses how to edit that file for each parameter. The madrigal.cfg.template file contains examples of each parameter.
- MADROOT - Madrigal root directory (absolute). This must be set as an environmental variable.
- MADSERVER - Web server for accessing Madrigal
- MADSERVERROOT - document virtual directory relative to MADSERVER.
If the full Madrigal Url is the same as the MADSERVER field
(for example, if the url is http://madrigal.hao.ucar.edu/), then set this field to a period. (Example:
MADSERVERROOT = . ) This directory should not allow files to be executed.
- MADSERVERCGI - script virtual directory relative to MADSERVER. The web server will need write permission in this directory. This directory should be set to execute only.
- MADSERVERDOCABS - Directory (absolute) where Madrigal documentation and images necessary for the Web software should be installed. You will need write permission to install files in this directory. You may need to be root to create this directory.
- MADSERVERCGIABS - Directory (absolute) where Madrigal CGI scripts will be installed. You will need write permission to install files in this directory. You may need to be root to create this directory.
- SITEID - Site ID - Must be unique and same as in siteTab.txt
- HTMLSTYLE - Body style of html pages
- INDEXHEAD - Heading in the top-level Madrigal page
- CONTACT - Mailto link of contact person(s) for this madrigal installation. Multiple email addresses may be included if separated by commas.
- MAILSERVER - Name of mailserver (possibly localhost if running sendmail)
- NOTESMANAGER - If you want someone to be notified whenever a user adds a note to an experiment, uncomment this optional line and add the email address. See below for a discussion of the optional notes feature and how to configure it after installation.
- MAXGLOBALQUERIES - The maximum number of global queries you want to allow to run on your webserver at any one time. Since a global query can take minutes or even hours to run, setting this value will limit the number of these background jobs running on your webserver. Users who request a global query when the server is at this maximum already will get a message requesting them to resubmit the query later.
- MAXTEMPREPORTS - Sets the maximum size of the tempReports directory in GB. If not set, defaults to 2 GB.
Creating or modifying MADROOT/cachedFiles.ini
By default, Madrigal will create cached HDF5 versions of all default files when Madrigal 2.6 or later is installed. These cached HDF5 files are created so that the user will get a fast response when an HDF5 file is requested for download. Large HDF5 files can take minutes to create from the Cedar source file. By default, these cached HDF5 files only contain the parameters in the Cedar file, and arrange the data only in the default table layout. If you want these cached HDF5 files to have any additional derived parameters or extra layout formats, you will need to create a file called cachedFiles.ini in your MADROOT directory.
With Madrigal 2.6, there is only one additional layout available: 'array'. If you ask for this additional layout, your HDF5 file will contain a subdirectory called array, which will contain one or more array layouts. An array layout has separate data for each parameter, arranged in a grid of one or more spatial parameters and time. This array layout is defined by passing it a tuple of two lists: 1) a list of independent spatial parameters, and 2) a list of parameters used to split the data into separate arrays. This argument is described in more detail below.
When defining how you want you array to look, you need to consider two questions:
- What are the independent spatial parameters of my array of data?
- Does all the data in this file have the same values of the independent spatial parameters?
For example, for radar data, you would typically use range or altitude as the single independent spatial parameter. More than one independent spatial parameter is allowed; for example, with TEC maps the two independent spatial parameters are latitude (gdlat) and longitude (glon). An instrument capable of measuring volumetric data might have three independent spatial parameters.
Sometimes it makes sense to split a Madrigal file into separate arrays. For example, with phased arrays that measure multiple beam simultaneously, it would be helpful to have each beam be its own array. You can do this by adding the beamid parameter to the second list in the array setup argument. At Millstone, we would like to have separate arrays if a single pulse or alternating code is used (parameter mdtyp) or if different pulse lengths are used (pl parameter). So at Millstone Hill we pass in two parameters for our radar data: mdtyp and pl. A separate array is created for each unique combination of mdtyp and pl. If any combination contains no data, that array is skipped. The examples below should help to make this clear.
You can use different arguments for any combination of instrument and kindat. The cachedFile.ini file has section headings which are simply instrument ids (kinst code). The key value pairs can be:
- <kindat>_parms = <comma-delimited parameter list>
- <kindat>_formats = <python dictionary>
- default_parms = <comma-delimited parameter list>
- default_formats = <python dictionary>
If an instrument does not have a section, then defaults are used. If a given instrument has a default_parms or default_formats key, then that will be used, unless a key with the matching kindat (kind or data) is found. If an instrument has kindat keys and no default, and the kindat does not match, the default is used.
Here's three example cachedFiles.ini files.
In the first case, for kinst=30 (the Millstone ISR), kindats 13204 and 13300 are listed separately. If any other kindat is found, the default key is used. For default files, range is the independent spatial parameter, and the parameters mdtyp and pl are used to split the file into separate arrays:
# Millstone Hill radars
[30]
# 13204 is F regions winds file
13204_parms =
13204_formats = {}
# 13300 is gridded ISR data
13300_parms =
13300_formats = {}
# all other kindats should be as follows
default_parms = gdlat,glon,gdalt,ne,dne
default_formats = {'array': (['range'], ['pl', 'mdtyp'])}
In the second case, for kinst=61 (the Poker Flat ISR), kindat 5960 is listed separately. For default files, range is the independent spatial parameter, and beamid is used to split the file into separate arrays:
# Poker Flat
[61]
# velocity vector is special case
5960_parms =
5960_formats = {'array':'cgm_lat'}
default_parms = gdlat,glon,gdalt
default_formats = {'array':(['range'],['beamid'])}
In the third case, for kinst=8000 (GPS data), both gdlat and glon are the independent spatial parameters, and there is no splitting into separate arrays:
# gps data
[8000]
default_parms = gdlat,glon,gdalt
default_formats = {'array':(['gdlat', 'glon'],[])}