Results 1 to 5 of 5

Thread: Help in extracting points in NetCDF file

  1. #1
    Join Date
    Jul 2014
    Location
    Institute for Energy Systems
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help in extracting points in NetCDF file

    Hi

    I have a netcsf with size 81x49 (longitude=81 and 49=latitude) within i have multiple data of Hs, Tp and other spectral components

    I am using python to isolate a specific point only and write the quantities in the format of

    TIMESTEP 10 15 5 25 (TIMESTEP A B C D)

    but i can't isolate the problem only to one point

    does anybody have a code of example for that reason?

    thank you

  2. #2
    Join Date
    Dec 2004
    Location
    Centre for Climate Change Research, Indian Institute of Tropical Meteorology, India
    Posts
    438
    Thanks
    16
    Thanked 5 Times in 5 Posts
    if you use cdo, the following command will work:

    cdo sellonlatbox,lon1,lon2,lat1,lat2 input.nc output.nc

  3. #3
    Join Date
    Jul 2014
    Location
    Institute for Energy Systems
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rocksea View Post
    if you use cdo, the following command will work:

    cdo sellonlatbox,lon1,lon2,lat1,lat2 input.nc output.nc

    Thank you rocksea, i am using the latest version of cdo, i indeed isolated the points with CDO when i use the expression "manually" point by point it works, when I although incorporate into a bash looping script, it prompts me that it need more than one inputs.

    any idea to why that is?

  4. #4
    Join Date
    Dec 2004
    Location
    Centre for Climate Change Research, Indian Institute of Tropical Meteorology, India
    Posts
    438
    Thanks
    16
    Thanked 5 Times in 5 Posts
    could you post your bash script? i have used cdo with bash scripts, and it works fine.

  5. #5
    Join Date
    Jul 2014
    Location
    Institute for Energy Systems
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Its a simple script it goes like this

    side=North
    lon1=8
    lat1=61
    lon2=6
    lon3=4
    lon4=2


    cdo sellonlatbox,$lon1,$lon2,$lat1,$lat2 input.nc output.nc

    and i get this error,

    cdo sellonlatbox (Abort): Too few arguments! Need 4 found 3.

Similar Threads

  1. Converting ASCII data file to netCDF file
    By blmadhavan in forum Oceanographic Applications & Data Analysis
    Replies: 2
    Last Post: 5th October 2015, 12:51 PM
  2. multi netcdf file in one file in matlab
    By toti in forum Upper ocean processes/Air-sea interaction
    Replies: 1
    Last Post: 21st July 2010, 01:55 AM
  3. How to convert NETCDF file to ASCII file
    By S.V.V.ARUN KUMAR in forum Oceanographic Applications & Data Analysis
    Replies: 1
    Last Post: 27th June 2010, 05:26 PM
  4. How to convert .dat BINARY FILE into ASCII FILE using MATLAB?
    By blmadhavan in forum Oceanographic Applications & Data Analysis
    Replies: 1
    Last Post: 7th November 2009, 12:41 AM
  5. netCDF file combaining--help needed.
    By prasanth in forum Oceanographic Applications & Data Analysis
    Replies: 2
    Last Post: 20th November 2007, 03:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •