Some glish procedures to process and view Spectrometer data.

Table of Contents



Lab Spectrometer

Getting Started with glish

# Note: Glish still works as of October 25, 2012 on euler, nearing the end as the RedHat 6 takes over. Requires REDHAT 5 ran on a 32 bit machine.

Ran from ~swhite/GbtTest/aips++ -l ac2.g

To use glish, login to a Linux workstation, e.g. prospero. Everything below assumes you are running the bash shell. All the files you need are in the directory /users/rnorrod/DataAnalysis/ACSrelease/. You should copy these files to a working directory in your area. The glish routines discussed below are embedded in a file called ac2.g. This is loaded into glish and in turn loads a couple of C clients to do some of the heavy computations.

To start glish and load the analysis routines, from the command line in your working directory use the following command:

# Note: This command changed March 2008, substituting aips++ for glish.
aips++ -l ac2.g               

If this fails, your environment may not be setup properly. Remedy that by:

source /home/gbt/gbt.bash

As glish starts, you will see several lines printed as stuff loads and initializes. Eventually, you should see:

Ready

Glish version 2.8. 
-

The dash is the glish prompt.

When ac2.g is loaded, a PGPlotter window appears. This is the window where data plots will be viewed.

PGPlotter.png

Buttons on the PGPlotter window allows you to print or save plots to postscript files. The dragging with the middle mouse button will zoom an area, and the Unzoom button will step back thru zooms.

Data Analysis

In order to begin data analysis, you need to set a variable with the ProjectID string, and set the network path to where data is stored by the spectrometer, e.g.:

- proj := 'TCRX12SEP06'
- s.setDataPath('/home/labdata/')
T
-

The next step is to retrieve a build a database of scans which have been taken under proj, using the s.filler command:

- s.filler(proj)
Scans:  [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117] 
OK 
- 

As shown above, s.filler responds with a list of the scans found. The s.filler routine must be repeated as more scans are run.

There are many routines embedded in s, and a list can be seen by entering the command:

- fields(s)
ASfiller             getLO1               plotTaBSWlist        
AntFiller            getLO1freq           plotTaByRecords      
CalibTsys            getSR                plotTaEaPair         
CbandFscale          getScan              plotTaFft            
IFfiller             getScanList          plotTaFsw            
KaFscale             getScansAvgEL        plotTaHoldingRecord  
LO1filler            getServo             plotTaNod2           
avgTa                getSpec              plotTaNod2Pairs      
avgTaNod2            getTa                plotTaPairs          
avgTsys              getTaBSW             plotTaRecs           
boxcar               getTaFsw             plotTaSeq            
calcBL               getTaNod2            plotTaTwoRecords     
calcTrx              getTaTwoRecords      plotTaTwoRecords2    
concatSpecMeans      getTaTwoRecords2     plotTsys             
diffSpecs            getTsys              plotTsysMeanForScans 
doFft                getTwo               plotTsysMeans        
fft                  getWeather           plotTsysRecs         
filler               glishifyArrays       plotTsysScans        
fitTcal              ntemp                printScans           
fits                 pg                   radio                
getAS                plot                 ratioSpecs           
getASstddev          plotAcf              readFile             
getAcf               plotCalOn_CalOff     regrid               
getAnt               plotFSW              setCbandScale        
getAntCoord          plotSR               setDataPath          
getCalOn_CalOff      plotSR_SR            setKaScale           
getCol               plotSpec             showScanHeader       
getData              plotSpecMeans        showScanSummary      
getDataPath          plotSpecRecs         specMeans            
getFits              plotSpecScans        statSpec             
getFour              plotTa               toFsky               
getIF                plotTaBSW            tsysMeans            
T 
- 

Note that the ac2.g file is just an ascii file containing the glish source code, so the details of each procedure can be viewed by reading the source code in an editor. Note that you have already used two, filler and setDataPath. Here are some examples of some of the more commonly used procedure:

Scan Summary

- s.showScanSummary(proj, 1)
Scan: 1 Object: C Band Rx, X Pol, Ambient Load
3-level [800 800 800 800]  MHz
SIGREF: [0 0]  CAL: [0 1] 
1024 channels 4 receivers 2 phases 6 records
F 
- 

The first line prints a string that is the "Source" field from the Labspec Acquire Data screen. We see that during scan 1 the lab spectrometer was setup to produce four 800MHz spectra, the SIGREF signal was in the '0' state (SIG), and the CAL signal was in the '0' state during the first phase and the '1' state in the second phase. Finally, the spectra have 1024 resolution channels, 4 receivers (samplers), 2 phases, and 6 records (integrations) in this scan.

Plot Spectra

- s.plotSpec(proj,469, rcvr=4, phase=1,newplot=T,linecolor=2,drop=100, normalize=F,rec_num=1:6) 
v_thresh: 0.735235351
T 
- 

Here we plotted the spectrum from scan 469, rcvr 4, phase 1, and averaged the six records. The resulting plot may look something like this:

PGPlotter2.png

It is possible to overlay plots using the newplot and linecolor parameters:

- s.plotSpec(proj,470, rcvr=4, phase=1,newplot=F,linecolor=3,drop=100, normalize=F,rec_num=1:6) 
v_thresh: 0.743287136
T 
- 

PGPlotter3.png

There are other parameters in the plotSpec procedure (as for most of the procedures), and these can be seen by looking at the source code.

Plot Baselines

- mrms := s.plotTaPairs(proj,[451:468],title=tit,offset=0.001,rec_num=1:6,rcvr=4,drop=100,meanOut=T)
- s.pg.setyscale(-.001,.012)  
-

Note that here we have used the setyscale procedure of s.pg to set the plot's vertical scale. The plotTaPairs procedure takes a list of scans (451 to 468 in this example), and plots the baseline for each pair in a waterfall style plot. For example, the first trace in the plot displays (Scan 452 - Scan 451)/(Scan 451). The next trace does the same for scan pair 453/454, offset up by an amount control by the offset parameter. Here is the resulting plot in this incidence:

PGPlotter4.png


Tips

  • The up and down arrow keys will move backward and forward in the glish command history, making it simple to recall a recent command, perhaps editing its parameters before hitting Enter.

  • [ctrl]r allows you to search back through the command history. For example, [ctrl]r plotSpec will find the most recent plotSpec command which can then be modified and re-entered. The history is even maintained between glish sessions on the same workstation. That simplifies getting started by recalling commands done days ago.

  • A utility is provided allowing one to change a plot title string without regenerating the plot. Enter s.changetitle(title) where title is any glish string, e.g. s.changetitle('Hello There').


GBT Spectrometer

The only difference is the GBT Spectrometer writes data to /home/gbtdata, so use:

- s.setDataPath('/home/gbtdata/')
-

Actually the data path defaults to this location, so you can just omit using setDataPath at all.

It can be a little tricky to find the output of a particular sampler. In calls, like to plotSpect, the "bank" (1-4 not A-D, defaults to 1), and "rcvr" (1 to N, where N depends on the spectrometer mode) must be specified. N for a particular scan and bank can be found by something like:

- s.showScanSummary(proj, 1, bank=1)
Scan: 1 Object: Modulated Noise Source into ACS
3-level [800 800 800 800]  MHz
SIGREF: [0 0]  CAL: [0 1] 
1024 channels 4 receivers 2 phases 6 records
F 
- 

In this case, N is 4, so four samplers were running in this scan on Bank A.


Topic attachments
I Attachment Action Size Date Who Comment
PGPlotter.pngpng PGPlotter.png manage 15 K 2010-04-05 - 14:39 PatrickBrandt  
PGPlotter2.pngpng PGPlotter2.png manage 15 K 2010-04-05 - 14:39 PatrickBrandt  
PGPlotter3.pngpng PGPlotter3.png manage 16 K 2010-04-05 - 14:39 PatrickBrandt  
PGPlotter4.pngpng PGPlotter4.png manage 31 K 2010-04-05 - 14:39 PatrickBrandt  
Topic revision: r10 - 2012-10-25, StevenWhite
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback