Re: create array subset

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 01 Sep 2009 22:53:27 -0600

  ncl <return>
'ncl 0> time = fspan(63.75,66.375,22)
  ncl 1> work = time-floor(time) ; temporary, use for clarity
  ncl 2> i = ind(work.ge.0.25 .and. work.le.0.75)
  ncl 3> print(i)
  ncl 4> print(time(i))

http://www.ncl.ucar.edu/Document/Functions/Built-in/ind.shtml

Good luck

Daniele Rosa wrote:
> Dear Support,
>
> say i have an array that has a time coordinate with these values:
>
> (0) 63.75
> (1) 63.875
> (2) 64
> (3) 64.125
> (4) 64.25
> (5) 64.375
> (6) 64.5
> (7) 64.625
> (8) 64.75
> (9) 64.875
> (10) 65
> (11) 65.125
> (12) 65.25
> (13) 65.375
> (14) 65.5
> (15) 65.625
> (16) 65.75
> (17) 65.875
> (18) 66
> (19) 66.125
> (20) 66.25
> (21) 66.375
> .
> .
> .
>
> and i want only the one with the decimal part between .25 and .75.
> What do i do?
> Things like myarray({(time-floor(time)).ge.(0.25).and.(time-floor(time)).le.(0.75)},:)
> are not possible right?
>
> I tried to create an array of indexes dynamically with
> array_append_record but the "is not defined" errors are a nightmare.
>
> Any suggestion?
>
> Thanks
> Best regards,
>
> Daniele
> _______________________________________________
> 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 Tue Sep 01 2009 - 22:53:27 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 03 2009 - 07:55:08 MDT