Lookup Data
Added by Rajarajan Rathinavelu over 7 years ago
Dear all, Hope this will save lot of time for me. I have a .nc file which has 3 variables (u,v,W). I would like replace a range of values of variable 'w' with variable 'P' for with a specific value. This is just a wind turbine power produced for different wind speeds. There are two ways of I can to do this 1) find a slope equation and using in 'expr' to get 'P' from 'W'. In arcgis, use convert .nc to raster and then 're-class raster with ascii file". Imagine 3 Columns 1) with starting wind speed value, 2) ending wind speed value 3) corresponding wind power for that range.
,
w(m/s) P(KW)
0-1 0.00
1-2 0.00
2-3 0.10
3-4 0.40
4-5 0.85
I would like to know if there any other way to do in CDO, to estimated 'P' using external lookup file?. If I could do this with NCO would be also great.
Cheers
Raj
Replies (1)
RE: Lookup Data - Added by Ralf Mueller over 7 years ago
CDO's expr operators can handle logical expression based on data variables. just check the docu with
cdo -h expr
a possible solution might look like
cdo -expr,'w=((27.0 < P) && (P < 35.0))?P:w' <ifile> <ofile>