[Thread Prev][Thread Next][Index]

[ferret_users] Multiplying by days in month

Ferret gurus —

I have a NetCDF dataset that shows, for each month, the mean daily burned area in each grid cell. I want to convert these daily rates to monthly values, which requires multiplying them by the number of days in each month. As a kludge, I’ve just been multiplying the entire dataset by 365.25/12, but I’d like to do it properly. That is, I want to multiply the values for each January by 31, each February by 28 (29 in leap years!), etc.

I will need to do this regularly in the future, so any advice pertinent to making an external function and/or .jnl script would be much appreciated. Please note that the length of the time axis can differ wildly between instances, so I’d need something general. (Although if it helps, the time axis will almost always be a multiple of 12 months starting in January.)

If it helps, info on the variable (BA_RATE) can be found after my signature.

Thanks in advance!


yes? show grid BA_RATE
 name       axis              # pts   start                end
 LON       LONGITUDE          144mr   1.25E                1.25W
 LAT       LATITUDE            90 i   89.494S              89.494N
 normal    Z
 TIME      TIME              1488 i   16-JAN-1501 12:00    16-DEC-1624 12:00
yes? list BA_RATE[i=@sum,j=@sum,l=1:5]
             VARIABLE : Burned area (km2/day)
             DATA SET : SSR_force30_luN_esm2mb-FIREunpacked_meanFx_avgProper
             FILENAME : land_month_meanFxAvgProper_1_1501-1624.nc
             SUBSET   : 5 points (TIME)
             CALENDAR : JULIAN
             LONGITUDE: 0E to 0E(360) (XY summed)
             LATITUDE : 90S to 90N (XY summed)
 16-JAN-1501 12 / 1:     80.
 15-FEB-1501 00 / 2:   2339.
 16-MAR-1501 12 / 3:   9201.
 16-APR-1501 00 / 4:  13500.
 16-MAY-1501 12 / 5:  14870.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement