Re: str_get_field -- Thank you so much.

From: Wen.J.Qu <wen.j.qu_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 17 2012 - 16:04:22 MDT

Thank you so much, Kyle and Mary.

Thanks a lot for your prompt response. It make me feel warm as a new learner in the NCL family :)

All my best!

Shawn




Wen.J.Qu
2012-08-17



发件人: Mary Haley
发送时间: 2012-08-17 16:51:29
收件人: Wen.J.Qu@gmail.com
抄送: ncl-talk
主题: Re: [ncl-talk] str_get_field

No difference. That second colon is for striding.

For example, if you had said "data(1::2)" this would have grabbed every other value, starting with the second value.

When you say "data(1::)", it automatically puts a "1" after the second colon, which is
effectively every value, and hence the same as "data(1:)"

You can learn more about striding and subscripting NCL arrays in the NCL Reference Manual:

http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#Subscripts

--Mary


On Aug 17, 2012, at 3:35 PM, Wen.J.Qu wrote:

> Hi, All
>
> Could anyone pleas tell me what is the difference between the below two lines?
>
> lat = stringtofloat(str_get_field(data(1::), 2," "))
>
> lat = stringtofloat(str_get_field(data(1:), 2," "))
>
> I find they get the same result. What is the use for the colon or two colons used here?
>
> Thank you very much!
>
> Shawn
>
> Wen.J.Qu
> 2012-08-17
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Aug 17 16:04:29 2012

This archive was generated by hypermail 2.1.8 : Thu Aug 23 2012 - 16:16:15 MDT