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


next up previous contents home.gif
Next: rtools4.g Up: NOTE 207 - Guide to gbtlogview Previous: Running gbtlogview

Subsections


Tables

AIPS++ manipulates and stores all data in the form of tables. These tables consist of an unlimited number of columns of data with optional column keywords and table keywords. Manipulating these tables is the key to fully utilizing gbtlogview. Within AIPS++, the table module is equiped with various methods and functions for this purpose. Please refer to the table - Module in the Reference Manual.

Initially, after hitting the 'Fill' button, the table "logdata" will be created on disk in the current directory. To verify this type:

- tableopentables()
logtable
- table("logtable").colnames()
Time ROW_FLAG RC08_10_DMJD RC08_10_PLATE15K RC08_10_PLATE50K RC08_10_AMBIENT RC0
8_10_DEWARVAC RC08_10_PUMPVAC RC08_10_CRYOSTATECTL RC08_10_XFERSWCTL RC08_10_AMP
PWRCTL RC08_10_IFFILTER RC08_10_CRYOSTATEMON RC08_10_XFER_NOISEMON RC12_18_DMJD
RC12_18_PLATE15K RC12_18_PLATE50K RC12_18_AMBIENT RC12_18_DEWARVAC RC12_18_PUMPV
AC RC12_18_CRYOSTATECTL RC12_18_XFERSWCTL RC12_18_AMPPWRCTL RC12_18_IFFILTER RC1
2_18_CRYOSTATEMON RC12_18_XFER_NOISEMON RC18_26_DMJD RC18_26_PLATE15K RC18_26_PL
ATE50K RC18_26_AMBIENT RC18_26_DEWARVAC RC18_26_PUMPVAC RC18_26_CRYOSTATECTL RC1
8_26_XFERSWCTL RC18_26_AMPPWRCTL RC18_26_IFFILTER RC18_26_CRYOSTATEMON RC18_26_X
FER_NOISEMON Weather1_DMJD Weather1_WINDVEL Weather1_WINDDIR Weather1_AMB_TEMP W
eather1_PRESSURE Weather1_DEWP Gps_DMJD Gps_ID Gps_DAY Gps_DOY Gps_DATE Gps_TIME
 Gps_SV Gps_EL Gps_AZM Gps_SN Gps_AGE Gps_ION Gps_INTRNL Gps_DF_F Gps_AVG_DF_F G
ps_NO1 Gps_TI Gps_TI_FIT Gps_TI_RATE Gps_NO2

The second command, 'table("logtable").colnames()' lists all of the column names within the table. The list displayed is if all of the receiver, weather and gps data had been selected; typically, this list will be shorter.

The structure of the table as constructed by the filler is as follows:

Time    Device1_DMJD  Device1_Quantity_X... Device2_DMJD Device2_quantity_Y...
t1          t1          x @ t1                     t4      y @ t4
t2          t2          x @ t2                     t4      y @ t4
t3          t3          x @ t3                     t4      y @ t4
t4          t3          x @ t3                     t4      y @ t4
t5          t5          x @ t5                     t4      y @ t4
t6          t6          x @ t6                     t4      y @ t4
t7          t6          x @ t6                     t7      y @ t7
t8          t8          x @ t8                     t7      y @ t7

Where the Time column is the running time stamp which will be equal to the most rapidly sampled variable and t1<t2<tn.

The filler essentially pads those columns which are more coarsely sampled with duplicate records until the monitoring program updates that variable. At that time, the device's time column "Devicen_DMJD" will be equal to the "Time" column.

At this point, you can construct a table object within glish (data) and then manipulate the table according to your needs.

- data:=table("logtable")

Examples of using the table-module

A simple regridding routine

Regrid a rapidly sampled variable to the same sampling rate of a more coarsely sampled variable. Use monitoring of 15 K stage on 8-10 GHz receiver versus ambient temperatures from the weather station.

- data:=table("logtable")                 # Build a table object within glish.
- sub:=data.query("Time == RC08_10_DMJD") # Select a subtable of that data
                                          # based on the condition that the
					  # 8-10 GHz time stamp is equal to
					  # the current time (that is, a 
					  # sample has just been taken of
					  # the 8-10 GHz receiver).
- sub.nrows()                             # The number of unique samples of
1432   					  # 8-10 GHz receiver data.
- data.nrows()                            # The original number of samples
86118                                     # based on the most finely sampled
                                          # variable.
- xaxis:=sub.getcol("RC08_10_DMJD")       # Get the time field for the 8-10 
                                          # GHz data.
- xtimeinseconds:=(xaxis-as_integer(xaxis[1]))*86400. # convert from days->sec
- y1axis:=sub.getcol("RC08_10_PLATE15K")  # Get 15 K Plate Temperature.
- y2axis:=sub.getcol("Weather1_AMB_TEMP") # Get Ambient temp from Weather Stat.
- clear() 				  # Clear plot
T 
- timeY(xtimeinseconds,y1axis,"")         # Plot time vs. 15 K plate temp on Y1
0 
- timeY2(xtimeinseconds,y2axis,"")        # Plot time vs. Amb temp on Y2
1

Clicking on the far right button will blow up the plot screen to full size. Using the cursor, one can select subregions and see that the ambient temperature data (which is sampled at approximately a 1.5 second rate) is now on the 1 minute grid of the 15 K Plate data.

Count cases greater than a certain value

If one wanted to know, how many times the 8-10 GHz receiver's 15 K plate had gone above 17 K.

- bigtemp:=data.query("RC08_10_PLATE15K > 17.0")
- bigtemp.nrows()
49224

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: NOTE 207 - Guide to gbtlogview Previous: Running gbtlogview   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
2006-10-15