I have been working in Python with the Acaconda Python distribution to create code that accomplishes the following algorithm:
I have multiple variable netCDF4 files [NCEP Reanalysis tmax(K), tmin(K), shum(%); prate(kg/m^2/s) daily values for an entire year(s)]. Each file spans between (Jan 1 2006- Dec 31 2010). They are 16(lat) by 16(long) grids. Data was downloaded from ESRL: PSD: NCEP Reanalysis. The dimension is time in days. What I'm trying to accomplish is if any given day (n) that satisfies conditions for all variables at each corresponding lat/lon:
tmax and tmin: 18°C ≤ T(n) ≤ 32°C [conversion to K: 291.15K ≤ T(n) ≤ 305.15K]
shum(Q): 20 ≤ Q(n) ≤ 80
prate(R): 1.5mm ≤ R(n) ≤ 20mm [conversion to (kg/m^2/s): R(n) / 84600]
I want to store the number of days PER YEAR in a 4 new netCDF4 - or ArcGIS 10.1 raster/compatible - files (one for each year).
From my understanding, I have not been able to find the correct function to loop through various time steps at specific lat/long/time variables. Perhaps, I have not used the correct phrasing in my search, but I am a novice in programming beyond simple routines.