[Thread Prev][Thread Next][Index]

Re: [ferret_users] count number of values



I can just give an example, this might help you to complete your code

akshay@Aix:~$ f
     NOAA/PMEL TMAP
     FERRET v6.842 
     Linux 2.6.32-279.19.1.el6.x86_64 32-bit - 02/01/13
      5-Mar-14 22:37    

yes? let test = {10,15,20,25,50,100,120}

yes? let threshold = 30

yes? let mask = if test le threshold then test

yes? list test,mask
             X: 0.5 to 7.5
 Column  1: TEST is {10,15,20,25,50,100,120}
 Column  2: MASK is IF TEST LE THRESHOLD THEN TEST
          TEST   MASK
1   / 1:   10.0  10.00
2   / 2:   15.0  15.00
3   / 3:   20.0  20.00
4   / 4:   25.0  25.00
5   / 5:   50.0   ....
6   / 6:  100.0   ....
7   / 7:  120.0   ....

yes? let tmp = test * mask   
     
yes? let count = `tmp[i=@ngd]`
 !-> DEFINE VARIABLE count = 4


Thank you,

Regards,
Akshay Hegde,
Moderator,
The Unix and Linux Forum Users.



On Wed, Mar 5, 2014 at 9:55 PM, Paul Goddard <goddarpb@xxxxxxxxx> wrote:
Hello,

I am working on finding the amount of values that fall below a certain threshold. By using let aa = if TEMP LE THRESHOLD then TEMP, I can get aa to be a list of values where TEMP is less than or equal to THRESHOLD. What I would also like to do is define a new variable that is equal to the amount of values that are in aa  (ie, the non .... values).  Is there any command for this? I know in Excel the function COUNT will retrieve the number of values in a column/array etc. Is there command in Ferret that does a similar act?  Thank you very much for your help


Paul Goddard
University of Arizona


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement