Activity for Stuart

  • Stuart Stuart posted a comment on discussion User Forum

    I've had a bit of a look through the documentation, and I think something like this should work. Is this the best approach? def Load_Tool_Libraries(Verbose): ... if Verbose == True: print 'Python - Version ' + sys.version print saga_api.SAGA_API_Get_Version() saga_api.SG_OMP_Set_Max_Num_Threads(2) print 'number of maximum threads used: ' + str(saga_api.SG_OMP_Get_Max_Num_Threads()) print 'number of loaded libraries: ' + str(saga_api.SG_Get_Tool_Library_Manager().Get_Count()) print return saga_ap...

  • Stuart Stuart posted a comment on discussion User Forum

    Hi, just wondering if there is a way to control the number of cores used by tools when called through the python saga_api? I'm working with a large python package that uses saga_api extensively, and I am trying to run some scripts in parallel - the problem being that by default saga uses all the available cores. This really bottlenecks my scripts, and I would like to limit the number of cores that are used by the tools. I can only use version 7.6 of saga_api. Python 2.7.15+ (default, Jul 9 2019,...

  • Stuart Stuart posted a comment on discussion Help

    After reading the manual again and thinking about this more, I think this might need to be scripted? This is my first attempt. As before, any help/guidance is greatly appreciated. infile="foo.nc" outfile=${infile%%.*}_appended.nc for ((year = 1; year <= 10; year++)); do echo $year outyear=${infile%%.*}_$year.nc # subset to year ncks -F -v temp_mm_1_5m -d time,$year $infile $outyear # delete redundant year dimension ncwa -O -a time $outyear $outyear # Change "month" to record dimension, then rename...

  • Stuart Stuart modified a comment on discussion Help

    Hi, I have a large netcdf file of a paleoclimate simulation which should contain 24000 layers/timesteps. Unfortunately the variable of interest (monthly mean temp) is stored as {time, mon, lat, lon} where mon is set-up as a level. This means I only have 2000 timesteps with 12 levels for each timestep. netcdf test_file { dimensions: depth = 1 ; lat = 181 ; lon = 720 ; time = 2000 ; month = 12 ; variables: float depth(depth) ; depth:positive = "up" ; depth:units = "m" ; float lat(lat) ; lat:units =...

  • Stuart Stuart posted a comment on discussion Help

    Hi, I have a large netcdf file of a paleoclimate simulation which should contain 24000 layers/timesteps. Unfortunately the variable of interest (monthly mean temp) is stored as {time, mon, lat, lon} where mon is set-up as a level. This means I only have 2000 timesteps with 12 levels for each timestep. netcdf test_file { dimensions: depth = 1 ; lat = 181 ; lon = 720 ; time = 2000 ; month = 12 ; variables: float depth(depth) ; depth:positive = "up" ; depth:units = "m" ; float lat(lat) ; lat:units =...

  • Stuart Stuart modified a comment on discussion Open Discussion

    Hi Charlie, I'm trying to do a similar thing but the steps are producing some strange output. I have 2 files, one for the NH (-180,180,0,90) and one for SH (-180,180,-90,0). Each file has 2399 timesteps (the example datasets posted here have 10 timesteps). I have tried following your advice above, expecting a continuous global output (expected.png), but unfortunately I am ending up with a file where the x-axis remains as longitude but the y-axis becomes time (see actual.png). ncpdq -O -a lat,time...

  • Stuart Stuart modified a comment on discussion Open Discussion

    Hi Charlie, I'm trying to do a similar thing but the steps are producing some strange output. I have 2 files, one for the NH (-180,180,0,90) and one for SH (-180,180,-90,0). Each file has 2399 timesteps (the example datasets posted here have 10 timesteps). I have tried following your advice above, expecting a continuous global output (expected.png), but unfortunately I am ending up with a file where the x-axis remains as longitude but the y-axis becomes time (see actual.png). ncpdq -O -a lat,time...

  • Stuart Stuart posted a comment on discussion Open Discussion

    Hi Charlie, I'm trying to do a similar thing but the steps are producing some strange output. I have 2 files, one for the NH (-180,180,0,90) and one for SH (-180,180,-90,0). Each file has 2399 timesteps (the example datasets posted here have 10 timesteps). I have tried following your advice above, expecting a continuous global output (expected.png), but unfortunately I am ending up with a file where the x-axis remains as longitude but the y-axis becomes time (see actual.png). ncpdq -O -a lat,time...

  • Stuart Stuart modified a comment on discussion Help

    FYI, I could not get your CDO command to work: CDO doesn't recognise the -o option. Last file is simply the output file. If you don't use -o the command works. Using the ncremap command you suggested gives a plot like the one attached. ncremap -R '--rgr lat_nm=latitude#lon_nm=longitude#lat_dmn_nm=latitude#lon_dmn_nm=longitude' -a bilinear -d dest_grid.nc -i infile.nc -o foo.nc

  • Stuart Stuart posted a comment on discussion Help

    FYI, I could not get your CDO command to work: CDO doesn't recognise the -o option. Last file is simply the output file. If you don't use -o the command works. Using the ncremap command you suggested gives a plot like the one attached. ncremap -R '--rgr lat_nm=latitude#lon_nm=longitude#lat_dmn_nm=latitude#lon_dmn_nm=longitude' -a bilinear -d dest_grid.nc -i infile.nc -o foo.nc

  • Stuart Stuart posted a comment on discussion Help

    Thanks Charlie. So your output of 3 and 4 works correctly, where the correct output coordinates are produced? I have just reinstalled NCO in a new miniconda environment but I'm still having the same issue

  • Stuart Stuart modified a comment on discussion Help

    Hi, I am trying to use ncremap to regrid some CMIP6 SST data to a regular 0.5 x 0.5° grid with bilinear interpolation. I am having particular trouble with 1 file not producing the correct output - although other software (e.g. CDO) does produce the correct output. Using the following command ncremap -a bilinear -d dest_grid.nc -i infile.nc -o regridded_file_NCO.nc -v tos --rnr=0.0 generates an output file with the following structure, where lat/long are still represented by j/i netcdf regridded_file_NCO...

  • Stuart Stuart posted a comment on discussion Help

    Using the default NCO conservative algorithm throws the following error: ncremap -d dest_grid.nc -i infile.nc -o regridded_NCOcon.nc -v tos --rnr=0.0 Input #00: /mnt/c/Users/Stu/Desktop/SST_Test/ex/infile.nc Grid(src): /tmp/ncremap_tmp_grd_src.nc.pid2548 Grid(dst): /tmp/ncremap_tmp_grd_dst.nc.pid2548 ncks: ERROR kd_neighbour_intersect3 reports that the kd-tree overlap buffer (size=6000) is now full and currenly cannot be dynamically expanded. We are trying to fix this. In the meanwhile consider increasing...

  • Stuart Stuart modified a comment on discussion Help

    Hi, I am trying to use ncremap to regrid some CMIP6 SST data to a regular 0.5 x 0.5° grid with bilinear interpolation. I am having particular trouble with 1 file not producing the correct output - although other software (e.g. CDO) does produce the correct output. Using the following command ncremap -a bilinear -d dest_grid.nc -i infile.nc -o regridded_file_NCO.nc -v tos --rnr=0.0 generates an output file with the following structure, where lat/long are still represented by j/i netcdf regridded_file_NCO...

  • Stuart Stuart posted a comment on discussion Help

    Hi, I am trying to use ncremap to regrid some CMIP6 SST data to a regular 0.5 x 0.5° grid with bilinear interpolation. I am having particular trouble with 1 file not producing the correct output - although other software (e.g. CDO) does produce the correct output. Using the following command ncremap -a bilinear -d dest_grid.nc -i infile.nc -o regridded_file_NCO.nc -v tos --rnr=0.0 generates an output file with the following structure, where lat/long are still represented by j/i netcdf regridded_file_NCO...

1
MongoDB Logo MongoDB