Data Format and Sample Code

Data Format

The datasets provide average daily gross primary productivity estimates (g C/m2/day) organized by day of the year (DOY) for the period 2002-2012. Each file represents an individual year. The data were written into binary files where the first dimension represents location in the spatial grid and the second dimension is time. Specific details follow:

Projection: Lambert conformal conic

Spatial Resolution: 4 km x 4 km

Temporal Resolution: Daily (UTC)

Dimensions (row x col): 240166 x # number of days in year

Data format: Single binary precision

Unit: g C/m2/day

Missing data flag: -9999 (water and urban pixels also flagged)

Sample Code – Matlab

A sample program for reading the binary files in Matlab are provided below. Note the sample code reads in daily data and thus the time step is the number of days in a year. The output data matrix has dimensions of nrow×ncol×timestep.

>> gridnum = 240166;

>> nrow = 454;

>> ncol = 529;

>> nday = 365; % or 366 for a leap year

>> fid = fopen(filename,`r’);

>> tmp = fread(fid,[gridnum,ndays],`single’);

>> fclose(fid);

>> gpp = reshape(tmp,nrow,ncol,nday);