I've got 40 NetCDF files that all constitute one simulation from an ocean model. The time series of data for each variable is split into multiple files, so that the directory listing looks like this:
$ ls ./output/*.nc
1_hvel.nc 3_hvel.nc 5_hvel.nc 7_hvel.nc
1_MeanPeriod.nc 3_MeanPeriod.nc 5_MeanPeriod.nc 7_MeanPeriod.nc
1_PeakPeriod.nc 3_PeakPeriod.nc 5_PeakPeriod.nc 7_PeakPeriod.nc
1_pwd.nc 3_pwd.nc 5_pwd.nc 7_pwd.nc
1_SigWaveHeight.nc 3_SigWaveHeight.nc 5_SigWaveHeight.nc 7_SigWaveHeight.nc
1_WaterLevel.nc 3_WaterLevel.nc 5_WaterLevel.nc 7_WaterLevel.nc
2_hvel.nc 4_hvel.nc 6_hvel.nc 8_hvel.nc
2_MeanPeriod.nc 4_MeanPeriod.nc 6_MeanPeriod.nc 8_MeanPeriod.nc
2_PeakPeriod.nc 4_PeakPeriod.nc 6_PeakPeriod.nc 8_PeakPeriod.nc
2_pwd.nc 4_pwd.nc 6_pwd.nc 8_pwd.nc
2_SigWaveHeight.nc 4_SigWaveHeight.nc 6_SigWaveHeight.nc 8_SigWaveHeight.nc
2_WaterLevel.nc 4_WaterLevel.nc 6_WaterLevel.nc 8_WaterLevel.nc
Is it possible to aggregate each variable along the time dimension and then join all these aggregations together?
Yes, you can nest aggregations using NcML, so you can use a type
union
aggregation around several typejoin_existing
aggregations ontime
.If the
join_existing
aggregations ontime
turn out to have different time bases, you can just renametime
variable and dimension totime2
on one of the aggregations and then change the attributes of those variables to use the newly named coordinates.An example should make this clearer: