Project

General

Profile

Slice nc into single time frames

Added by KM Florentine Weber almost 4 years ago

Hello,

I've got 69 ndvi3g_geo_v1 nc4 files in total. Half of them is called, like, _1981_0712.nc4 (year 1981, months July until December), the other half is, like, _1982_0106.nc4 (year 1982, months January until June); two files for each year (except for 1981 where I've got only the second half of the year). Within one file there are 12 frames, i.e. two for each month. They follow the system: 1, 1.5 (for January first half and second half), 2, 2.5 (for February first half and second half), ... 12, 12.5 (for December first half and second half).

I would like to calculate one nc4 (or nc) file containing all 69*6 months, monthly data.

One way, I thought, would be to slice all 69 files into single time frames, then to average for each month over the first and second half, and then to concatenate all monthly files. I am sure there is a much easier way! Can you give any advice, please?

Each file is 448 MB, so I am not able to attach any. You can download them here: https://ecocast.arc.nasa.gov/data/pub/gimms/3g.v1/

Thank you!


Replies (1)

RE: Slice nc into single time frames - Added by Brendan DeTracey almost 4 years ago

These files are not cdo compliant, which for netcdf files requires them to follow GDT, COARDS, or CF-Metadata conventions (https://www.unidata.ucar.edu/software/netcdf/conventions.html). The bottom of this thread (https://code.mpimet.mpg.de/boards/1/topics/9772) shows how to correct these files using NetCDF Operators(nco) so that the lat and lon coordinates are cdo compliant. However, you would also have to correct the time axis which is using an ad-hoc format. I think you are stuck with your idea of slicing them into individual frames. An awkward data format leads to an awkward solution requiring some scripting.

    (1-1/1)