Return to LAS FAQ


Merged datasets from individual files


Question:

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?

Explanation:

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.

Solution:

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:

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

   ...

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.

<pco2_dp 
  name="sea-air pCO2 (full correction)" 
  units="10^12 gram/year/4x5 degree box"
  url="file:LDEO_Takahashi_dp90_sea-air#pco2">
 <link match="/lasdata/grids/LDEO_Takahashi_monthly_X_Y_T_grid"/>
</pco2_dp>
<pco2_hf 
  name="sea-air pCO2 (half correction)"
  units="10^12 gram/year/4x5 degree box"
  url="file:LDEO_Takahashi_hf90_sea-air#pco2">
 <link match="/lasdata/grids/LDEO_Takahashi_monthly_X_Y_T_grid"/>
</pco2_hf>


Jonathan Callahan: Jonathan.S.Callahan@noaa.gov
Last modified: August 10, 2000