Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.naic.edu/~astro/spectral_line/handbook_old/app/old_analyz.html
Дата изменения: Wed Sep 20 02:21:10 2000
Дата индексирования: Sun Dec 23 05:24:20 2007
Кодировка:

Поисковые слова: arp 220
OLD Basic Analyz Routines - documentation next up previous
Next:OLD ANALYZ instruction sequences Up:Spectral Line Appendices Previous:Using the Spectrum Analyzer

OLD Basic Analyz Routines - documentation

For use with data taken BEFORE March 7, 2000

Note: There are other libraries available. However, all libraries function very closely to the below libraries. Additionally, these libraries are used in the HI analyz routines below. When information on the other libraries becomes available, it will be placed in the link at http://www.naic.edu/ ~ csalter/toppage.html

correlator library help summary.
this file is located (at AO) in /usr/local/src/Analyz/help/cat/other/corlibv1
expanded help available for SEE ALSO functions below the
expanded documentation is in /usr/local/src/Analyz/help/cat/other
last modified: 28dec99
FUNCTION
atoldata            ..attach default  online datafile
coravgp         reg ..average two polarizations.
corazzal        regOut scan numrecs... sto az regout,za regout+1
corclose            ..close monitoring socket.
corcmbab        rega regb .. move pola followed by polb to x-reg
cordisp             .. display spectra in corget current display mode.
corfrqcfr       cfrsbc1 cfrsbc2 cfrsbc3 cfrsbc4.. set center frequency each sbc
corfrq          0,1 .. stofreq array in x. 0-->a,1-->polb. use @frqX arrays
corget          parm..input scan.grp to reg1-4. pola,b to reg 5,6.
corhdr              .. print out cor header from last corget.
corhor          sbcnum.. set horizontal scale for sbc n (0=all)
corinfodef          ..set default values for corinfo
corld           reg pol(0,1) {unp:1}..spectra->x,from reg.
corldf          reg pol(0,1) {unp:1}..spectra->y,freq->x.from reg.
corlist             .. list summary of current correlator file attached as data
corpl           {reg}{sbc:1-4,0=all}..plt  vs frq 2pol
corpl.          {reg}{sbc:1-4,0=all}..plt. vs frq 2pol
corpla          {reg}{sbc:1-4,0=all}..plt  vs frq polA
corpla.         {reg}{sbc:1-4,0=all}..plt. vs frq polA
corplb          {reg}{sbc:1-4,0=all}..plt  vs frq polB
corplb.         {reg}{sbc:1-4,0=all}..plt. vs frq polB
corplit         sbcNum(0=all) pol(=0a,1=b)(flag 0/1 donot reset cipl%).corpl uses.
corpos          scan.rec ..position to scan.rec (rec is 5 digits)
corposnr        scan.rec ..position to scan.rec (rec is 5 digits) no rewind.
corprint                 .. print hdr info to stdout
corpw           regstart scan numrecs.. store polA,B,az,za to 8 registers.
corpwr              ..move power info to x . 4 numbers each board
corpwrl         regOut scan numrecs.. sto pwr info,az,za
correw          ..reset pointer to start of current file
corsec          sbcnum pol(0,1)..sec section for sbc 1-4, 0 all A or B,-1 all A+B
corseek         recnum.. seek to record num..no input
corsmooth             ..called before display.. data in x-reg
corsplab        reg1  .. split xpolA->reg1, xpolB->reg1+1
corsum          scan nrecs.. compute summary rec for scan. sto in 5,6
doit            scan recs ..
domany          regSrc regCal scanSt numSets recSrcOn..doset numSets times
doset           regSrc regCal scanSt recSrcOn .on/off src then on/off cal
dosrc           reg scan npairs rec/scan... load avg
gzacor             ..compute gain(za) for za in xreg. return in xreg
gzacor1         za .. compute gain(za) for input za. return in pl(1)
medfonoff       regStore scan numrecs.. medianfilter then on/off-1
medfscan        regStore scan numrecs.. median filter recs of scan
ndoit           scan numpairs numrecs ..
ndoitsto        regSt scanSt numPairs numrecs..sto (on-off)/off
npair           numpairs numrecs.. accumulate n pairs
pair            numrecs.. process 1 pair
pairpl          {sbc:1-4,0=all}..load,plt  vs frq last onoff
pairpl.         {sbc:1-4,0=all}..load,plt. vs frq last onoff
pairpla         {sbc:1-4,0=all}..load,plt  vs frq polA last onoff
pairpla.        {sbc:1-4,0=all}..load,plt. vs frq polA last onoff
pairplb         {sbc:1-4,0=all}..load,plt  vs frq polB last onoff
pairplb.        {sbc:1-4,0=all}..load,plt. vs frq polB last onoff
stokesc         reg..load @i,@q,@u,@v,cmp delta,tau. plot delta. circdata
stokesl         reg..load @i,@q,@u,@v,cmp delta,tau. plot delta. lin data
storec          regSt scn nrecs .. sto bandpasses
storecnr        regSt scn nrecs .. sto bandpasses
strippr         reg1 reg2 offset step.. strip plt vs freq.
tzacor             ..compute za Tsys correction. input za in x. return in x
tzacor1         za .. compute Tsys za correction for za ,return in p1
DESCRIPTION
----------------
register usage:
----------------
1  - band1 both pol  raw data
2  - band2 both pol  raw data
3  - band3 both pol  raw data
4  - band4 both pol  raw data
5  - flipped,and scaled (polA) for all brds concantenated
6  - flipped,and scaled (polB) for all brds concantenated
7  - default freq array for corget,cordisp displays
8  -
9  - scratch reg for corpwrl,corsum (9,10)

10-27 scratch for tsyscon
      addon,addof for a single pair
20 - addon A
21 - addon B
22 - addoff A
23 - addoff B
24 - (on-off)/off A
25 - (on-off)/off B

28,29 - scratch for dosrcplx
--------------------------------------
variables used:
--------------------------------------
regS   - start reg set by dosrc, used by dosrcplx
regE   - end reg for storing pair on/off set by dosrc, used by dosrcplx
regA   - reg for average all pairs. set by dosrc, used by dosrcplxx
stroff - offset for first strip. set by dosrcsclx, used by dosrcpl1,2a,2b
strstp - step for each strip.    set by dosrcsclx, used by dosrcpl1,2a,2b
fcioff - function to change offset of polB when plotting. used by
         corget,cordisp,dosrcpl3,pairpl,pairpl1

--------------------
basic functions
--------------------
atoldata     .. attach online datafile default datafile

corinfo      .. display current state

corget     scan.rrrrr
            .. read in scan.rrrrrr (default next rec) and load data:
               reg 1-4  raw data, unflipped, unscaled
               reg 5-6  flipped, scaled,and smoothed data.
                     5  1st sbc of each board (polA) concatenated
                     6  2nd sbc of each board (polB) concatenated (if used)
               If fcidisp is not zero, cordisp will be called to display
                      the data.
            ex: corget            .. get next record
                corget    .00032  .. get record 32 of current scan
                corget 123.       .. get 1st rec scan 123
                corget 123.00003  .. get record 3 of scan 123
          note: use correw if you have positioned beyond the requested scan.
                scannumber 815600012 can be abbreviated 12 until you
                hit a day change (8157xxxxxx).

corsum     scan.rrrrr
            .. input and compute the summary record for the scan.
               Store the summary record in registers 5 and 6.
               The azimuth and zenith angle for each record is stored in
               the scratch arrays @az, @za.
               Use cordisp or corpl to disp the data.
            ex: corsum        .. compute summary at current position
            ex: corsum  123   .. compute summary for scan 123
          note: you need to do a correw if you are positioned beyond the
                requested scan.
storec   reg scan nrecs
            .. input nrec records starting at scan. store each record
               (bandpasses) starting at register reg. PolA and PolB are
               concatenated into a single register. This will happily
               cross scan boundaries. Use corpl1 reg to display the data.

^L
-----------------
general plotting
-----------------
 With data stored in a register pair (say reg 5=polA, reg 6=polB) use
 cordisp, corpl. When data is stored with all data in 1 register
 (pol A followed by polB) use corpl1 to display the data.

cordisp      .. display the data reg 1-4 (ficdisp 1) or reg 5-6
               (fcidisp 2). Use plotxy with freq reg set by fcifreq reg.
               polB is offset by the value from fcioff. You load whatever
               you want in the freq reg.

corpl  {reg} {sbcnum}
corpla {reg {sbcnum}optional reg}
corplb {reg} {sbcnum
              display the spectra vs frequency. If sbcnum is given, then
                            just plot that sub correlator. If A/B is used then just plot
                            polA. reg can be:
                        none - default to 5,6 .. registers loaded by corget.
                                < 30 - use reg and reg+1 for pola,polB
                            >=30.. register has polA,polB packed in 1 register
                                       (see storec, doset,domany, etc..)
                                see help corpl
            ex: corpl    .. plots 5  (polA), 6  (polB) vs corfrq
            ex: corpl 24 .. plots 24 (polA), 25 (polB) vs corfrq
SEE ALSO help corpl
corpl. {optional reg}
              same as corpl but uses plotxy. for plotting.
              multiple calls within a function will overplot.
            ex: corpl.    .. plots 5  (polA), 6  (polB) vs corfrq
            ex: corpl. 24 .. plots 24 (polA), 25 (polB) vs corfrq

corpos     scan
            .. position to start of scan. A rewind is automatically done
               before the positioning.
            ex: corpos 123   .. position to scan 123.

corposnr   scan
            .. position to start of scan with no rewind. Scan must be
                             after current position in file (if not use corpos). For
                                 large files doing seqential positioning, this routine is
                             than corpos.
            ex: corposnr 123   .. position to scan 123.

corseek  recnum
            .. seek to record recnum of current scan. The record is not input.
correw       .. rewind to start of file
corlist      .. list current file attached as data
corprint     .. print out hdr info of last record input
corhdr       .. print entire header of last record input

corpwr       .. extract power info from header for current record. 16 numbers
               in sbc order are stored in x reg:
               sbc1pcA sbc1pcB sbc1lag0A sbc1lag0B ..
               sbc2pcA sbc2pcB sbc2lag0A sbc2lag0B .. etc

corpwrl  reg1 scan numRecs
            .. read numRecs records starting at scan. extract the
               power information,az,za and store in registers.
               The nth entry in a register is from the nth record input.
               register 9 is used as a scratch register.
            reg1   : lag0A sbc1
            reg1+ 1: lag0A sbc2
            reg1+ 2: lag0A sbc3
            reg1+ 3: lag0A sbc4
            reg1+ 4: lag0B sbc1
            reg1+ 5: lag0B sbc2
            reg1+ 6: lag0B sbc3
            reg1+ 7: lag0B sbc4
            reg1+ 8: pwrCA sbc1
            reg1+ 9: pwrCA sbc2
            reg1+10: pwrCA sbc3
            reg1+11: pwrCA sbc4
            reg1+12: pwrCB sbc1
            reg1+13: pwrCB sbc2
            reg1+14: pwrCB sbc3
            reg1+15: pwrCB sbc4
            reg1+16: az position
            reg1+17: za position dome
              where reg(n) is the nth record from the start.
----------------------------------
utility routines
----------------------------------
coravgp  regnum
                        average polA,B. If regnum <=30 then pola is in regnum and
                        polB is in regnum+1. If regnum > 30 then polA,polB are packed
                        in regnum. The averaged funtions are left in the x-reg.
SEE ALSO help coravgp
corfrqcfr   cfrsbc1 cfrsbc2 cfrsbc3 cfrsbc4
           Define the center frequency for the 4 subbands.
           Used by corfrq, corpl...
           ex. if cfr 1370 1390 1410 1420:
               corfrqcfr  1370 1390 1410 1420:
               if 1 pol/sub correlator.. 1370A 1370B 1390A 1390B then:
               corfrqcfr 1370 1390

corfrqcfra/b  cfrsb1 cfrsb2 cfrsb3 cfrsb4
           define center frequency for polA or B sbc. Same as corfrqcfr
           but allows polA and polB to not cover the same frequency range.

corfrq  {0,1}
            load the x register with the frequency valuse for polA or polB.
            (0== polA, 1==polB). Used by corpl,pairpl, etc..
            ex. corfrq 0  .. loads x-reg with polA freq.

corext sbcN {reg}
            extract sbc N (N=1..4) from reg 5,6 or reg,reg+1r
            x=polA,y=polB,z=freqA.

corhor {1..4}
            set horizontal freqendy scale for sbc n =1 to 4.
SEE ALSO help corhor

corld   {reg} {polA,B 0,1} {unpacked:1/0}
                          load spectra into x-reg. used mainly by other functions.
SEE ALSO help corld

corsbci sbcnum 0/1
          return indices in reg 5,6 for sbcnum. 0==polA, 1==polB. return
          info in pl array.
          ex. corsbci 2 0
              pl(1 2) index start,end in reg
              pl(3 4) frequency start/end
              pl(5)   length this sbc.
corsec  {sbc} {pola,b: 0,1}
                        set section size to display sbc.
SEE ALSO help corsec

corcmbab reg1 reg2
           assume reg1,reg2 hold pola,polB. combine these in the x-reg
           so you have polA followed by polB.

corsplab reg1
           assume x-reg has polA followed by polb. Put polA in reg1
           and polB in reg1+1.

medfscan regStore scan numrecs
          median filter by channel the records in scan. There are
          numrecs records in scan. Leave the median filter spectra in
          x-reg. Use regStore to regStore+numrecs-1 as scratch.
          medfscan 101 123 50 ..

medfonoff  regStore scan numrecs
          median filter by channel scan and scan+1 and then compute
          on/off. Leave data in regs:
          reg 20 - median filtered on position.  polA followed by polB
          reg 21 - median filtered on position.  polB
          reg 22 - median filtered off position.  polA followed by polB
          reg 23 - median filtered off position.  polB
          reg 24 - on/off-1 .
medfonoff2  regStore scan numrecs
          compute on/off-1 by rec and then median filter.
                        used regStore to regStore +2*numrecs-1 as scratch
          Leave data in regs:
          reg 23 - median filtered off position.  polB
          reg 24 - on/off-1 .
^L
-----------------------------------
on/off position switching routines
-----------------------------------

general routines:

doit  scan recs
            .. position, do a single pair, then plot the results:
               corpos scan; pair recs; pairpl
            ex: doit 123 2  .. do a on/off pair starting at scan 123 with
                               2 recs in on and 2 in off.
               data is left in registers 24 polA, 25 polB

pairpl  {reg}
            .. plot on/off-1 for the data in registers reg (polA) and
               reg+1 (polB). offset polB by value from fcioff. Default
               register is 24,25. This routine is the same as corpl (
               except that the default register is different).
            ex: pairpl    .. plot on/off-1 from register 24,25 vs 8
                pairpl 28 .. plot on/off-1 from register 28,29 vs 8

dosrc    regSt scan numpairs recs/scan
            .. process numpairs on/off pairs starting at scan. Store the
               individual on/off-1 starting at regSt (polA followed by polB
               in one register). Compute the average for all the on/off-1
               and store in register regSt+numpairs. Set the variables
               regS:start reg, regE:endReg regA:average reg. These
               are used by the dosrcplXX routines.
            ex: dosrc 31 123 10 4 .. do 10 pairs starting at scan 123.
                store each on/off-1 starting at reg 31. There are 4 recs
                in an on or off. The average will be stored in
                reg 31+10=41. Plot the average with  corpl1 41.
domany   regSrc regCal scan numsets recsSrcon
            .. call doset to process an on/off src starting at scan, then
               process a cal on/off pair. repeat this for numSets times.
               This routine should be used to process data taken with the
               coronoffnewXX datataking routine.
               register usage:
                 regSrc,regSrc+numSets-1.. the on/off-1 for the src scans
                 regSrc+numSets         .. the avg for the src on/off-1
                 regCal,regCal+numSets-1.. the on/off-1 for the cal scans
                 regCal+numSets         .. the avg for the Cal on/off-1
              This routine assumes:
              1. that there are recsSrcOn records for the source on or
                 off in each scan.
              2. that the cal on /off each contain a single record.
              3. that the scan numbers are contiguous.
              4. the src average will be meaningfull if it was the
                 same src.
             ex: domany 101 151 123 10 5
                 Process 10 sets of on/off, cal pairs.
                 The scan for the first on is 123
                 Store the src data in reg 101-110, avg in 111
                 Store the cal data in reg 151-160, avg in 161
                 there are 5 records in each src scan.
                 corpl1 111 will look at the src average.

^L
routines used by the above:

clear
            .. clear on/off accum registers (20-23)
addon  numrecs
            .. add numrecs (default 1) to the  on registers (20,21)

addoff numrecs
            .. add numrecs (default 1) to the off registers (20,21)

pair   numrecs
            .. Do an on/off pair from the current disc position:
               clear;addon numrecs;addoff numrecs; compute on/off -1
               20,21 have the sum of ons, 22,23 have the sum of offs
               24,25 have on/off-1 (polA,polB)
            ex: pair 4 .. do on/off pairs with 4 records per scan

npair numpairs numrecs
           .. accumulate numpairs pairs startin at the current position,
              then compute on/off-1. The results  are stored in reg 20-25
           ex: npair 4 4  .. process 4 pairs. each pair has 4 recs in on,off.


ndoit scan numpairs numrecs
            .. position to scan, accumulate numpairs pairs, then plot
               the results. The data is stored in reg 20-25.The code is:
                 corpos;npair numpairs numrecs;pairpl
            ex: ndoit 123 5 2 ... position to scan 123 then accumulate 5 pairs
                each with 2 recs per on, off.

ndoitsto reg scan numpairs numrecs
            .. process numpairs pairs. Store the on/off-1 starting at
               register reg (polA followed by polB in 1 reg).
               each on/off pair should have numrecs records in an on or off.
            ex: ndoitsot 31 123 10 3 .. process 10 pairs starting at scan
                123. Each pair has 3 recs in the on or off. Store the
                individual on/off-1 starting at reg 31.

online:
corclose      . close socket for monitoring
^L
-----------------------------------
misc functions
-----------------------------------
gzacor1 za  ..compute the telescope gain at zenith angle=za. Return value
              in pl(1). Units are Tsys(za=3deg).

gzacor      ..compute the telescope gain fo zenth angles
              passed in via the x-register. Return the gain the in x-reg.
              Units are Tsys(za=3deg).

tzacor1 za  ..compute the system temperature correction for za.
              return value in pl(1). Normalized so Tsys(za=3) is unity.

tzacor      ..compute the system temperature correction for zenth angles
              passed in the x-register. Return the corrections in x-reg.
              Normalized so Tsys(za=3) is unity.
********************************************************************************
 


Karen O'Neil