Hi I have two .nc files (a land-sea mask and rainfall both for era-interim).
I am trying to calculate the time-series over a grid-box, however this grid-box includes the sea values as well which i do not want. To exclude the sea values i am trying to mask off all values over the sea, and have some difficulties in this aspect.
What i've done so far:
1) I removed a degenerate time dimension from the land-sea mask (the land-sea mask fron ERA-Interim only contains one variable 'lsm').
2) Appended the land-sea mask into my rainfall data
I've also ensure the latitude, longitude size of both files are the same, as well as their resolution.
From here I am not sure of what i should do, in previous threads that i have looked, some have suggested using ncwa or ncap2. Any help and advice is appreciated!
HI Karl,
you are almost there --
ill assume that rainfal var is "double pcp(time,lat,lon) " and that it has a missing_value or _FillValue
and the land-sea mask is "int mask(lat,lon)" ( 1 is land , 0 is sea )
Hi I have two .nc files (a land-sea mask and rainfall both for era-interim).
I am trying to calculate the time-series over a grid-box, however this grid-box includes the sea values as well which i do not want. To exclude the sea values i am trying to mask off all values over the sea, and have some difficulties in this aspect.
What i've done so far:
1) I removed a degenerate time dimension from the land-sea mask (the land-sea mask fron ERA-Interim only contains one variable 'lsm').
2) Appended the land-sea mask into my rainfall data
I've also ensure the latitude, longitude size of both files are the same, as well as their resolution.
From here I am not sure of what i should do, in previous threads that i have looked, some have suggested using ncwa or ncap2. Any help and advice is appreciated!
Last edit: Karl 2017-07-10
HI Karl,
you are almost there --
ill assume that rainfal var is "double pcp(time,lat,lon) " and that it has a missing_value or _FillValue
and the land-sea mask is "int mask(lat,lon)" ( 1 is land , 0 is sea )
to run the above script us ethe following command.
...Henry
Hi Henry, thank you for your reply.
A quick ncdump on my rainfall data gave me:
Would the above script still be applicable?
Cheers
HI Karl,
yep should still work -
just change lat to latitude and lon to longitude.
...Henry
Hi Henry,
i am receiving their error mssg after running ncaps2 line:
avg.nco:2:15: expecting (, found '=='
I am not sure what there error means..
Karl
sorry mask is a function -use yor var name s in the script e.g