Project

General

Profile

Modify fields by time?

Added by Ian MacKenzie almost 11 years ago

Hello,
I have a NetCDF of daily mean fields of a single variable for one year, so 365 timesteps. Is it possible to set all values of the field to the missing value for one particular timestep, say April 10th? I don't see an obvious way to do this from the documentation.

Regards,
Ian


Replies (3)

RE: Modify fields by time? - Added by Jaison-Thomas Ambadan almost 11 years ago

I think it is possible: here is one way

first select the particular time (-seldate) and set all values to a constant (simply multiply zero,) and then assign the constant to missing value "setctomiss"

set -setctomiss,-999 -addc,-999 -mulc,0 -seldate,2013-07-19T00:00:00 ifile.nc ofile.nc

or simply set "0" as a missing value using setmisstoc,0 but you may not want that

you could use the existing missing value of the variable (have a look at ncdump -h varible attributes) instead of -999.

Cheers,
J

RE: Modify fields by time? - Added by Ian MacKenzie almost 11 years ago

Hi Jaison,
Thanks for the helpful reply. That command seems to produce a new file containing only the single timestep with all values set to missing as desired. Using delete and mergetime I think I can now recreate the original file with the single timestep overwritten.

Regards,
Ian

RE: Modify fields by time? - Added by Jaison-Thomas Ambadan almost 11 years ago

I forgot to mention about deleting & merging -but you figured out - that's very good good!!

    (1-3/3)