[go: up one dir, main page]

Activity for henry Butowsky

  • henry Butowsky henry Butowsky posted a comment on discussion Developers

    Hi Todd, Not sure exatly what you want ? For now will assume you want an array of the number of uwnd obsrvations for each timestamp, totaled over lat/lon. nbr_good[time,lat,lon]=0; where(uwnd>=1) nbr_good=1; nbr_good_month=nbr_good.total($lat,$lon) ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Open Discussion

    A where should do the trick. given you have the times tstart and tend in your chosen units, you can do something like where( time < tstart || time > tend ) temperature = temperature._FillValue ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    A where should do the trick. given you have the times t0 and t1 in your chosen units, you can do something like where( time < t0 || time > t1 ) temperature = temperature._FillValue ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Open Discussion

    Hi All, I suppose we could add our github repo nco/antlr2 as a git submodule . Then in the nco/CMakeLists.txt include it with add_subdirectory() ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi All, I suppose we could add our github repo nco/antlr2 as a git submodule . Then in the nco/CMakeLists.txt include it with th it with add_subdirectory() ....Henry

  • henry Butowsky henry Butowsky posted a comment on ticket #30

    Either the dim ens_member is already defined as 0 (UNLIMITED) in the input file or your shell script is setting it to 0.

  • henry Butowsky henry Butowsky posted a comment on ticket #30

    its a bit tricky because you are redefining the variable "pre" that is already in input. try something like. defdim("ens",40 ); pre_new[$time,$latitude,$longitude,$ens]=pre; ...Henry

  • henry Butowsky henry Butowsky modified a comment on ticket #30

    I suggest you get the command working in a script first then once its working move it to the command line. eg test.nco defdim("ens",40 ); pre[$time,$latitude,$longitude,$ens]=pre; then run the above script with the command ncap2 -S test.nco in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on ticket #30

    I suggest you get the command working in a script first then once its working move it to the command line. eg test.nco defdim("ens",40 ); pre[$time,$latitude,$longitude,$ens]=pre then run the above script with the command ncap2 -S test.nco in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    to do it all on the command line - something like ncap2 -O -h -s "t2@units=\"hours since 2013-09-30 14:00:00\";" -S "$nco_script" "$input_file" "$output_file"

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    HI Paul, its bit fiddly, but you can do by first creating a regular time t2 variable. then using that and strftime() to create the timestamps t2=array(0.0,1.0,$Time); t2@units="hours since 2013-10-01 10:00:00"; sz=$Time.size; for(idx=0;idx<sz;idx++) Times(idx,:)=sprint(strftime(t2(idx),"%Y-%m-%d %H:%M:%S")); regards Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Paul, its bit fiddly, but you can do by first creating a regular time t2 variable. then using that and strftime() to create the timestamps t2=array(0.0,1.0,$Time); t2@units="hours since 2013-10-01 10:00:00"; sz=$time.size; for(idx=0;idx<sz;idx++) Times(idx,:)=sprint(strftime(t2(idx),"%Y-%m-%d %H:%M:%S")); regards Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    HI Paul, The point is that the "array" function has to return a proper variable that means it must use valid dimensions. You can of create your own dimension of the correct size. e.g defdim("my_west_east",61) ncap2 -O -s 'SST(1,60,30:90) = array(290.0f,0.1,$my_west_east);' test.nc output_test.nc The alternative is to use attributes e.g global@tmp=array(290.0f,0.1,$west_east); SST(1,60,30:90)=global@tmp(0:60); ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    HI Paul, The point is that the "array" function has to return a proper variable that means it must use valid dimensions. You can of create your own dimension of the correct size. e.g defdim("my_west_east",61) ncap2 -O -s 'SST(1,60,30:90) = array(290.0f,0.1,$my_west_east);' test.nc output_test.nc The alternative is to use attributes e.g gloabl@tmp=array(290.0f,0.1,$west_east); SST(1,60,30:90)=global@tmp(0:60); ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Paul, The point is that the "array" function has to return a proper variable that means it must use valid dimensions. You can of create your own dimension of the correct size. e.g defdim("my_west_east",61) ncap2 -O -s 'SST(1,60,30:90) = array(290.0f,0.1,$my_west_east);' test.nc output_test.nc The alternative is to use attributes e.g gloabl@tmp=array(290.0f,0.1,$west_east); SST(1,60,30:90)=global@tmp(0:30); ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Paul, Sorry for you confusion . The final argument of the array() function is overloaded usage: var_out=array(start_exp,inc_exp,$dim|dim_list|var) So the final argument can be a single dimension .eg ncap2 -v -O -s 'a1=array(0,1, $time );' in.nc out.nc Or a list of dimensions e.g ncap2 -v -O -s 'a1=array(0,1, /$time, $lat, $lon/ );' in.nc out.nc ( note the / .. / this indicates a list of dimensions Or a variable from which the array takes its shape e.g So if we have say variable float three_dmn_var(lat,...

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Francesco, You dont need the 't' index in the where statements. Try and nco script something like: for(*t=0;t<=time.size();t++){ if(data_occ(t)>5000){ mask_t=sst_mask(:,:,t); where(mask_t==1) sst_diff=votemper-adjusted_sea_surface_temperature-273.15; elsewhere st_diff=votemper.get_miss(); } else{ sst_diff(:,:,t)=votemper.get_miss(); } } ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    you could try anaconda - it has NCO and all its dependencies https://anaconda.org/conda-forge/nco

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    your command works for me. on version 5.07 I think mabe some files have been corrruped on your build. I suggest you do a reinstall of NCO or find another machine

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    looks fine

  • henry Butowsky henry Butowsky modified a comment on discussion Open Discussion

    hi there, Can you put your netcdf file in an accessible place and Ill take a closer look. Also can you please post the results of the command: ldd ncap2 ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    hi there, Can you put your netcdf file in an accessible place and Ill take a closer look ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Segio, Try this fragment ncap2 -v -O -s ' in.nc out.nc ncdump(out.nc); The function "max_index" should be missing value aware. If the above doesnt work - please put you netcdf file in an public place and Ill take a closer look Thanks ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Ale, ncap2 cant really deal with UNLIMITED dims. Its not possible with ncap2 to append to a variable with UNLIMITED and increase the dim size. So I suggest you define 'Time' dim with something greater than zero. Then after your manipulations use ncks to convert Time to UNLIMITED if that is what you want. run the below script with the command: ncap2 -S ex.nco aod3.nc aod4.nc // ex.nco defdim("Time",10); defdim("DateStrLen",19); // this step defines the var Times[Time,DateStrLen]="1"; Times@units="YYYY-MM-DD_HH:MM:SS";...

  • henry Butowsky henry Butowsky posted a comment on discussion Developers

    Hi Margarida, Its pretty tedious but you could remove the excess spaces from the text cdl file and then regenerate the binary nc file with ncgen !!! I acconnot think of a method to remove the spaces using NCO. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Developers

    HI Margarida, you could use netCDF4 strings -e.g ncap2 -v -4 -s 'sector[basin]={"atlantic_artic_ocean"s, "indian_pacific_ocean"s, "global_ocean"s }' forum.nc out.nc where the "s postfix denotes an NC_STRING ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Vinayak , I n the netcdf world time has the units (year|day| hour|minutes|seconds ) since blahblahdate for example days since 1850-01-01 00:00:00 seconds since 2019-03-12 00:00:00 UTC and the time variable with values time=1.,2.,3.,4.,5.,6.,7.,8.,9.,10.; So are you saying you have the Times variable And you wish to change its units to say hours since 2018-01-01_00:00:00 ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Vinyak, To rename a variable use ncrename e.g ncrename -v Times,"2018-01-01_00:00:00" in.nc out.nc Or are you trying to do something else with Times ? Like change the units ? ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    drop the '-v' switch and you will get all the vars

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    IT works its just warning you that the dim bnds already exists

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Jerry, Charlie Please try the following workaround , until I work out why the -v option is failing. ncap2 -s 'defdim("bnds",2);time_bnds=make_bounds(time,$bnds,"time_bnds");' in.nc out.nc -v -O Substitute in.nc, out.nc with relevent data files ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Stefano, Packed variables have the attributes scale_factor, add_offset ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Stefano, I just noticed that your latitude and longitude are packed try uncompressing then first with ncpdq -U in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Stefano, It maybe that the coordinates are messed because the latitude is monotonic decreasing rather than monotonic increasing. Try to reverse the latitude with the command. ncpdq -a -latitude in.nc out.nc If that doesn't work. Please put the file (compressed ?) in an accessible place and post a link here, and I will take a closer look. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Stefano, Sorry to lead you astray . If you have the indices of ilon_min, ilon_max, ilat_min, ilat_max ( not the values) You can try something like this ( Assuming that the shape of lsm is [time,lat,lon]) lsm(:, ilat_min:ilat_max, ilon_min:ilon_max)=-9999.0f; ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Stefano, Try with two where statements something like. w.nco where( lat >= ilat_min && lat<=ilat_max ) lsm=-9999.f; where( lon >= ilon_min && lon<=ilon_max ) lsm=-9999.f; put the above in a file - then run the script with: ncap2 -v -O -S w.nco in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Bikem, Try something like: ~~~ e=2.7182818284; RH=e^(17.625×DP / 243.04+DP) / e^(17.625×T / 243.04+T); ~~~ .... Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI feng, It appears that your ncap2 command is not working because the FillValue you are using is the same as the default integer FillValue ( see NC_FILL_INT in netcdf.h). A work around for now is to change the fillValue to something else by using the ncatted command e.g ncatted -a _FillValue,'.*',m,i,-10000 W_XX.nc BTW the convection for FillValue in packed variables is that it should be the same type as the expanded variable. So FillValue in your variables should be of type NC_DOUBLE.. ...Henr...

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Vinayak, your command ncap2 -O -s "where(ZN==0) ZN=0.01" input.nc output.nc Is not working because ZN is of type NC_SHORT and so the where command casts the float 0.01 to zero. It looks like the variable in your file are packed and yet they do not have the standard packing attributes 'scale_factor' and 'add_offset'

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI Vinayak, If the _FillValue = 0.0 then where() will not be able to modify these values So you have to change the _FillValue to something more sensible with ncatted

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Elyssa, ncap2 -4 -O -s "model[$model]=@all" in4.nc in4.nc I think the '$model' is being interpreted by the bash shell and not ncap2. Try without the $ e.g ncap2 -4 -O -s "model[model]=@all" in4.nc in4.nc or put you ncap2 command into an ncap2 script ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Elyssa, Try appending the @all attribute to the in.nc file with the following command ncap2 -A -s @all="${MODEL}" in.nc in.nc or ncap2 -A -s @all="${MODEL}" in.nc in.nc must be a NetCDF4 file. If it aint then convert it with the command. ncks -4 in.nc in4.nc ....Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    HI Elyssa, sorry what I meant was @all is short for global@all. Its NC_STRING attribute and contains your model names. So you can now use to populate your "model" variable. Either in the command line or in a script. model[$model]=@all; ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Elyssa, sorry what I meant was @all is short for global@all. Its NC_STRING attribute and contains your model names. So you can now use to populate your "model" variable. Either in the command line or in a script. model[$mode]=@all; ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Elyssa, I tried a few things in bash to add the quotes and "s" suffix. MODEL= $( printf "\"%s\"s," ${model_names[@]} ) MODEL="{${MODEL%\,}}" Then create a temporary attribute on the command line ncap2 -4 -v -s @all="${MODEL}" -S my_script in.nc out.nc Now you can use the golabal @all variable to assign model variable in your script. ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    Hi Steve, Create an empty NetCDF file with something like ncks -x -v '.*' in.nc empty.nc I remember there were some recent mods made regarding how scalar variables are handled. Try replacing csr[]=" " with csr=1 Or upgrade to the latest version ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Steve, Create an empty NetCDF file with something like ncks -x -v '.*' in.nc empty.nc I remember there were some recent mods made regarding how scalar variables are handled. So I you could let me know how you get on with the latest version ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    HI Steve, you can't associate dimensions with a scalar variable An ncap2 script to populate your file would be like below. ~~~ defdim("lat",200); defdim("lon",300); crs[]=" "; / nb empty string not allowed in ncap2 / crs@long_name = "Coordinate reference system" ; crs@grid_mapping_name = "latitude_longitude" ; crs@longitude_of_prime_meridian = 0. ; crs@semi_major_axis = 6378137. ; crs@inverse_flattening = 298.257223563 ; ~~~ put the above script in a file, say pop.nco. Then run the script wit the...

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Steve, you can't associate dimensions with a scalar variable An ncap2 script to populate your file would be like below. ~~~ defdim("lat",200); defdim("lon",300); crs=""; crs@long_name = "Coordinate reference system" ; crs@grid_mapping_name = "latitude_longitude" ; crs@longitude_of_prime_meridian = 0. ; crs@semi_major_axis = 6378137. ; crs@inverse_flattening = 298.257223563 ; ~~~ put the above script in a file, say pop.nco. Then run the script wit the command ncap2 -S pop.nco infile outfile .....

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Zoulikha, I can think of no easy way to do this . Charlie may have an idea ?! ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Zoulikha, I can think of no easy way to do this . Charlie may have an idea ?! ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Zoulikha, First off you have in the file latitude / longitude not lat/lon. Second these are not regular coordinate dimensions.; so to subset them you have to use "auxiliary coordinates". e.g ncks -X -20.0,-6.0,-30.0,46.0 sat08.nc sat08-aux.nc Please refer to manual for more info on these types of coordinates. http://nco.sourceforge.net/nco.html#Auxiliary-Coordinates ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Zoulikha, Can you please place the file in an accessible place, And post a link here. Then I'll take a look Thanks ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Open Discussion

    HI there, There's no need to sort, you can reorder the slabs along the longitude dimension. >ncks --msa_usr_rdr -d lon,-179.875,-0.125 -d lon,0.0,180.0 in.nc out.nc for more details on this method check the manual. http://nco.sourceforge.net/nco.html#Multislabs ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI there, This no need to sort, you can reorder the slabs along the longitude dimension. >ncks --msa_usr_rdr -d longitude,-179.875,-0.125 -d longitude,0.0,180.0 in.nc out.nc for more details on this method check the manual. http://nco.sourceforge.net/nco.html#Multislabs ....Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Open Discussion

    HI jim, well done for getting so far with variable pointers . At the moment there are no string/char comparison functions. The workaround is to convert the char attributes to integers and then compare them. Its pretty horrible . ` @time_i="time".int(); @nlat_i="nlat".int(); @nlon_i="nlon".int(); @all=get_vars_in(); nvars=@all.size(); idx=0; print(nvars); @var_nm=@all(nvars-1); @dims=*@var_nm.getdims(); @dim0_i=sprint(@dims(0)).int(); @dim1_i=sprint(@dims(1)).int(); @dim2_i=sprint(@dims(2)).int();...

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI jim, well done for getting so far with variable pointers . At the moment there are no string/char comparison functions. The workaround is to convert the char attributes to integers and then compare them. Its pretty horrible . ~~~ @time_i="time".int(); @nlat_i="nlat".int(); @nlon_i="nlon".int(); @all=get_vars_in(); nvars=@all.size(); idx=0; print(nvars); @var_nm=@all(nvars-1); @dims=*@var_nm.getdims(); @dim0_i=sprint(@dims(0)).int(); @dim1_i=sprint(@dims(1)).int(); @dim2_i=sprint(@dims(2)).int();...

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Solomon, try this ncap2 -s 'depth(0,:,:)=depth(0,:,:)*0.2;' in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Developers

    You are almost there try something like: where(variable!=0)variable=1;nbr_good=variable.total(); nbr_good is now the number of non-zero in 'variable' For more on arguments to total() please see : http://nco.sourceforge.net/nco.html#Methods-and-functions ....Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    HI Brian, you can avoid the warning by doing the following. ( which is what your single command is doing under the hood anyway) ncap2 -s 'var=var;var(0,:,:)=0.0f' infile.nc outfile.nc The warning is there as a reminder that your reading and writing from the same var . I guess we can make the warning msg an INFO msg. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Brian, you can avoid the waring by doing the odd following. ( which is what your single command is doing under the hood anyway) ncap2 -s 'var=var;var(0,:,:)=0.0f' infile.nc outfile.nc The warning is there as a reminder that your reading and writing from the same var . I guess we can make the warning msg an INFO msg. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Ying, There are some issues with the current version of pynco in anaconda. I suggest you concentrate your efforts on learning nco by using the nco operators directly and not though the pynco wrapper. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Solomon, off the top of my head I cannot think of anyway to do it in one go ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Soloman, I dont fully understand your question. You can split up your file along the dims time or vid or both. your command ncks -d prcp vid,1 Merged.nc file_1.nc is inccorect Use something like: e.g ncks -d time,0,4 -d vid,10,20 Merged.nc file_1.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Aravand, Now that your data has a record dim you can use the ncra operator to average the hourly data. nb with the -y switch you choose the arthmentic operation from: avg,mabs,mebs,mibs,min,max,tabs,ttl,sqravg,avgsqr,sqrt,rms,rmssdn the default is avg ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI Aravind, you need to make the time dim unlimited. Since your time coordinate is integer you'll need a very recent version of ncks. Use the following commands ncks --mk_rec_dmn time 1983-01.nc 1983-01-un.nc ncks --mk_rec_dmn time 1983-02.nc 1983-02-un.nc Then try your ncrcat command again. ncrcat -h 1983-01-un.nc 1983-02.-un.nc file_out_1_2.nc ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Aravind, both files must have a record dimension - and the variables to be processed must have this record dim as the first dim. Please post the meta data here using ncdump -h in.nc. if is still vast then put it in a public place and post a link here. checkout the manual ass well http://nco.sourceforge.net/nco.html#ncrcat-netCDF-Record-Concatenator ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Lyndon, I think its barfing on " - try putting the ncap2 commands into a script. ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI jun, can you be a bit specific about what you want ? You can extract points by hyperslabbing along a coordinate variable using the -d switch with most operators Its possible to regrid data using the ncremap operator. The ncap2 operator has function that does bilinear interpolation. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI Dimitis, What is your shell script defining as '$d' ? It must me a number ? ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    HI Dimitris, tried your ncap2 script on both files and it worked fine. They are NetCDF4 files ? Maybe an issue with your netcdf lib ? Can you try to run the perl test files in nco/bm directory you need to set th env var PATH - so that it includes the location of the nco executables And set DATA to your nco/data directory Then cd to nco/bm and run the test suite with nco_bm.pl --rgr ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Dimitris, your ncap2 script works for me . Can you put one of nc files in a public place and post a link here. Then I shall try it ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    H Elisa, try ncks -v '.*_south' in.nc out.nc or ncks -v '_south$' in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Well I guess if you get the arguments right you could do it directly with ncks. Ive no reports of users regridding with ncks on Windows !!! honsestly youll be better of with a UNIX/LINUX box ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Christelle, ncremap is a bash shell script. So youll need some terninal emulation software to run it on Windows. ncremap make use of the NCO ncks operator, and ESMF regridding software and Tempest software. So to get all this woking on Windows sounds like a total nightmare. What task exactly do you wish to do with ncremap ? ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Christelle, I have ainstalled nco-4.8.1 and all the NCO operators including ncremap are in my ~/ananconda3/bin directory !? ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Christelle I am no expoert in conda. but first you have to create an 'environment' or env, with a package list. Then you have to 'activate' the environment. A total HACK is to use the programs directly in the anconda/bin ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Jenny, Theres no quick way, you could use ncap2 and re-define each record at 0 index. It pretty tedious though ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Jenny, try the following ncks --msa_usr_rdr -d time,0 -d time,0, 366 in.nc out.nc ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Solomon, since the vars observed and moddled have the same shape you could do it all in a single where. e.g ncap2 -s 'where( obseved ==1.3 && th >1.0 && th < 1.5) th=1; elsewhere th=th.get_miss(); n.nc out.nc Or in an NCO script /*********** hits,nco *************************/ hits=th; where ( observed==1.3 && th>1.0 && th<1.5) hits=1; elsewhere hits=0; /**********************************************/ to run the script use the command ncap2 -v -O -S hits.nco in.nc out.nc You need to have the vars...

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Yanis, I dont understand what you are doing Cant you just do it in a single loop ? e.g ~~~ ncks -d Time,0,23 -v SNOW,SNOWH File1.nc filex.nc ncrename -v SNOW,WEASD -v SNOWH,SNODEP filex.nc ncks --abc -A -v WEASD,SNODEP filex.nc File2.nc ~~~ ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Liang, if all the values being averaged are _FillValue then the average will be _FillValue. The same applies to avg,mabs,mebs,mibs,min,max,tabs,ttl,sqravg,avgsqr,sqrt,rms,rmssdn ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Yanis, please post your bash script to this page ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Ida, 1) You need to make time the record dimension unlimitted for all your input file the command is ncks --mk_rec_dmn time in.nc out.nc You need some kind of shell script which loops over your 16 input files. 2) Try the following ncrcat `ncrcat -4 --cnk_dmn time,1 in*.nc cat.nc ` ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Shizhu, The first part is easy - use ncwa, of the var is like float Temp(lon,lat,lev) Then try something like: ncwa -v Temp -a lev -y max in.nc out.nc I can think of no easy way to get the indice(s) of the maximium Let me ponder this ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Lyndon, I understand what you want. The final output should be a boolean mask with the same dims as 'PREC' e.g int MASK(time,lon,lat) So when MASKis true(1) it implies that the previous 6 days of rain-fall have been greater than 5mm/day at that (lat,lon) location. Filtering out the rainfall less thatn 5mm/day using 'where' is a first step. ncap2 -v -O -s 'where(precip >5) precip=precip; elsewhere precip = -9.99e+08' rain_in.nc rain_out.nc But I can think of no easy or quick way to create the MASK...

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Thx Mathew, will do aan INTEL build right now

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Mathew, just added the vars nbr_tr and grd_lon_typ_out to the intel OpenMP list please try again. ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    Hi Aswin, for whats its worth, below is my bash script for config export NETCDF_LIB=/usr/local/netcdf/lib export NETCDF_INC=/usr/local/netcdf/include export LD_FLAGS="-L/usr/local/netcdf/lib -L/usr/local/lib -L/lib -L/usr/lib " export CFLAGS='-g -O2 -fopenmp -std=c99 -Wall -Wuninitialized -Winit-self -Wextra -Wmaybe-uninitialized -W -Wunused -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-prototypes -fno-common -Werror=format-security -D_DEFAULT_SOURCE' export CXXFLAGS='-g...

  • henry Butowsky henry Butowsky posted a comment on discussion Open Discussion

    hi Aswin, like you I have UDUNITS2 and libexpat in /usr/local In my bash build script I have the line: `export LD_FLAGS="-L/usr/local/netcdf/lib -L/usr/local/lib -L/lib -L/usr/lib " please try: export LD_FLAGS="-L/usr/local/lib -L/lib -L/usr/lib "` Hope this helps ...Henry

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    Sorry I missunderstod your original question 1) the file has packed variables. Unpack it first using > ncpdq -U ERAInterim_surface_precip_20110801_20110803.nc ERA_u.nc ncap2 -v -s "tp_new=tp;tp_new(1::2,:,:)=tp_new(1::2,:,:)-tp_new(0::2,:,:);" ERA-u.nc out.nc

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Sorry I missunderstod your original question 1) the file has packed variables. Unpack it first using > ncpdq -U ERAInterim_surface_precip_20110801_20110803.nc ERA_u.nc ncap2 -v -s "tp_new=tp;tp_new(1::2,:,:)=tp_new(1::2,:,:)-tp_new(0::2,:,:);" ERA-U.nc out.nc

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    The time coordinate in the above file looks fine: ncks -v time --cal ERAInterim_surface_precip_20110801_20110803.nc netcdf ERAInterim_surface_precip_20110801_20110803 { dimensions: time = UNLIMITED ; // (12 currently) variables: int time(time) ; time:units = "hours since 1900-01-01 00:00:00.0" ; time:long_name = "time" ; time:calendar = "gregorian" ; data: time = "2011-08-01 06:00:00", "2011-08-01 12:00:00", "2011-08-01 18:00:00", "2011-08-02", "2011-08-02 06:00:00", "2011-08-02 12:00:00", "2011-08-02...

  • henry Butowsky henry Butowsky modified a comment on discussion Help

    Hi The following command worked OK for me: ncap2 -v -s 'time_new=time ;time_new(1:1459:2)=time_new(1:1459:2)-time_new(0:1459:2);' infile.nc oufile.nc ` ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi The following command worked OK for me: ncap2 -v -s 'time_new=time ;time_new(1:1459:2)=time_new(1:1459:2)-time_new(0:1459:2);' infile.nc oufile.nc ` ...Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    please execute the following command and post the output here: ncks -C -v time infile.nc

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    HI Benin, looks like you have an odd number of elements in time . A full hyperslab defintion is srt - start index end - end index srd stride time( srt🔚srd) Add start and end to 'time_new(1::2)' 'time_new(0::2)' so that they return the same number of elements ....Henry

  • henry Butowsky henry Butowsky posted a comment on discussion Help

    Hi Benin, Ignore my previous post. You could do it with ncap2 e.g ncap2 -v -s 'time_new=time;time_new(1::2)=time_new(1::2)-time_new(0::2);' infile.nc outfile.nc ...Henry

1 >