Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 803
News FAQ
Search Home


next up previous contents home.gif
Next: rtools4.g Up: Examples of using the table-module Previous: Count cases greater than a certain value

Maximum and minimum within a certain time range

Continuing with the example above, find the maximum and minimum temperature in the last 3 hours of the data.

- xstart:=dm.quantity(xtimeinseconds[1],'s') # get the beginning time and 
					     # convert it into a quantity with
					     # units of seconds.
- xstart
[unit=s, value=13098.2014] 
- xstop:=dm.add(xstart,'3.h')		     # set the end time to the start
					     # time plus 3 hours.
- xstop
[unit=s, value=23898.2014]
- platetemp:=data.getcol("RC08_10_PLATE15K") # make an array of all the 15 K
					     # plate temperatures.
- mask:=xtimeinseconds<xstop[value]          # define a boolean mask that is
					     # true only within the time range.
- maxinfirst3:=max(platetemp[mask])          # get the max in this range
- mininfirst3:=min(platetemp[mask])          # get the min in this range
- print mininfirst3, maxinfirst3
15.1367188 16.1132812


next up previous contents home.gif
Next: rtools4.g Up: Examples of using the table-module Previous: Count cases greater than a certain value   Contents
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2004-08-28