Joining several data files with CDO and IsoFuse

From gfi
Revision as of 10:14, 14 April 2020 by Hso039 (talk | contribs)

CDO mergetime command

Instruments often process their data on a daily or hourly basis. Longer analyses then require that many individual datafiles are merged together into one longer time series. With daily data files for several years, this quickly becomes a process that is difficult to handle.

It is then often easier to join several daily files into monthly or yearly data files. The command line tool CDO with command "mergetime" can help with that.

module load CDO
cdo mergetime <inputfiles.nc> <outputfile.nc>

The mergetime command will create one new output file with a common time axis. Therefore, all inputfiles must have a common time axis, and the same variables, essentially they must have the same netcdf file format.

Here is an example for how to create a monthly file from the daily TPS-3100 (Hotplate) data files:

cd /Data/gfi/scratch/metdata/hotplate/netcdf/2019/01
cdo mergetime TPS_201901* ../TPS_201901.nc

Joining data files from different instruments with common time averaging

While CDO gets the job done when working with many datafiles from the same instrument, it is more challenging to combine variables from several instruments in one file. Time intervals may be different, there may be duplicate variable names, different units, and so on. However, data analysis becomes much more simple and powerful once several instruments are on a common averaging time scale.

At GFI, we have the python tool IsoFuse available to help with that work.