Re: how extract a smaller array from the mother array according the lat and lon information?

From: Mateus Teixeira <mateus.teixeira_at_nyahnyahspammersnyahnyah>
Date: Sat Jul 03 2010 - 10:04:52 MDT

Hi Tang,

Try to do this:

partt_var = grb_file->TMP_3_SFC_10({sty:edy},{stx:edx})

Always that you use the coordinates to get a small part of an array, you
should put that information between {}. Please, take a look at
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#Subscripts

Also, I think that you cannot use dimension names when get data directly
from files, as you are trying.

Best regards,

Mateus

2010/7/3 Jie TANG <totangjie@gmail.com>

> hi,every one .
> now I want to write a ncl script that get a smaller region dataset from
> the global fnl dataset (dss083.2 )..
>
> stx=20 ; stx is the start dimension of lon
> edx=40 ; edx is the end dimension of lon
> sty=80 ; sty is the start dimension of lat
> edy=120 ; edy is the end dimension of lat
> partt_var = grb_file->TMP_3_SFC_10(sty:edy,stx:edx) ;extract the dataset
>
> it seems that partt_var can get the(20:40,80:120) child array of
> grb_file->TMP_3_SFC_10
>
> Now I want to extract the child array according the lat and lon index
> information directly,
> How can I do it?
> I do this
> stx=100 ; stx is the start lon degree
> edx=140 ; edx is the end lon degree
> sty= 20,5 ; sty is the start lat degree
> edy=41,5 ; edy is the end lat degree
> partt_var = grb_file->TMP_3_SFC_10(lat_3|sty:edy,lon_3|stx:edx) ;extract
> the dataset
>
> when I write the script shown as above,it shows error and said that can not
> use it.
>
> how to modify the script ?
> thank you.
>
> --
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Mateus da Silva Teixeira
Registered Linux User #466740 (http://counter.li.org/)

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Jul 3 10:04:58 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 09 2010 - 16:06:22 MDT