Re: str_get_field

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 17 2012 - 15:51:28 MDT

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 15:51:36 2012

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