Return to LAS FAQ

Merged datasets from individual files


How do I configure LAS to build a single multi-variable dataset from several single-variable files? And what if the variable names are the same in each file?


Often, you would like to consolidate data from multiple files into a single dataset heading. LAS handles this transparently for the user, but you'll have to configure the xml file by hand. For more documentation on the xml syntax, see Understanding the xml.


To create a merged dataset from individual files you'll need to attach a url attribute to the variable element. Normally, it's attached to the dataset element but any url attached to an individual variable will override the dataset-wide url. The url attribute describes the location of the data with file:data_file for local data files and http://dods_address for remote data access via DODS. An example would be these two fields from the COADS time series served at PMEL:

  name="COADS monthly time series (1854-1993)"
  <air name="Air temperature" units="deg C" url="file:coads_air.cdf">
   <link match="/lasdata/grids/coads_time_series_1854_1993_grid"/>
  <cldc name="Cloudiness" units="okta" url="file:coads_cldc.cdf">
   <link match="/lasdata/grids/coads_time_series_1854_1993_grid"/>


In the example above, both variables are on the same grid. If the variables are on separate grids, you need only specify the appropriate grid in the link element for each variable. Each grid must then be defined separately within the <grids>...</grids> section.

If you have separate files which share variable names, you will need to create fictitious variable names and then modify the url attribute to be file:data_file#actual_var_name. An example from the <variables>...</variables> section of another xml file differentiates two variables that each have the name "pco2" in their respective data files.

  name="sea-air pCO2 (full correction)" 
  units="10^12 gram/year/4x5 degree box"
 <link match="/lasdata/grids/LDEO_Takahashi_monthly_X_Y_T_grid"/>
  name="sea-air pCO2 (half correction)"
  units="10^12 gram/year/4x5 degree box"
 <link match="/lasdata/grids/LDEO_Takahashi_monthly_X_Y_T_grid"/>

Jonathan Callahan:
Last modified: August 10, 2000