Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
K. O'Neil and J. McMullin
The are a number of different version of AIPS++ available at Arecibo:
To start AIPS++, issue the following commands (from the c shell):
> source /pkg/aips++/stable/aipsinit.csh > aips++ -l naic.g
Here are several hints for speeding up your performance, if the operation/startup of AIPS++ seems sluggish.
user.aipsdir: /tmp/username_aips++ where username is your username, e.g., user.aipsdir: /tmp/rphillips_aips++
toolmanager.fullgui: F toolmanager.gui.auto: F
The toolmanager isn't directly needed for any DISH operations. Should you want it, it can be used at a later time by typing:
tm.gui();
AIPS++ builds its cache file structure the first time it is started with a new user.aipsdir, and each time you start a new version. Judge its startup speed on the second time you start it up, not the first.
If you find that error messages, code, and data listings scroll off of your terminal window, you might need to assign the PAGER environment variable. You can remedy this by setting PAGER to 'less' in your UNIX startup scripts.
export PAGER='less'
Arecibo data must first be converted from its native format into single-dish FITS format, through use of the "sdtest" program (/usr/S2local/bin/sdtest). Single-dish fits data are stored as FITS binary tables with a single row for each spectrum: A single dump usually generates 4 or 8 spectra (four subcorrelators with either one or two polarizations per board). If data are taken with different numbers of channels per spectrum, the file size will be as if they all had the largest number of channels. If the number of channels increases during the conversion, then sdtest will resize the entire file, which may take a while.
Before running the sdtest program you need to know the following:
Once you feel confident you know these things, login to an Arecibo computer and then go to whatever directory you wish your files to reside in. Type sdtest to run the SDFITS conversion program. The program will will ask a few questions and then start converting your data.
Note that you can also run this program "on-the-fly" to continuously update a datafile with the online data via: sdtest -c.
In that case, when you are finished you must quit out of the conversion program by typing
^C(possibly a few times).
See http://www.naic.edu/ãstro/data/aips++/ for more complete details.
A data file with only two observations, each of a different galaxy (UGC 3489 and UGC 4431). Each cycle consisted of ON, OFF, CAL ON, CAL OFF
sdtest Enter Input (AO) filename: /proj/a9999/corfile.01jan00.a9999.1 Enter Output File: 01Jan00a.fits Channel A system temp? :35 Channel B system temp? :35 Linear or Circular inputs? :C Total number of scans in a cycle:4 Scan 930900005, UTC=2000-01-05T12:06:42, AST=2000-01-05T08:06:42 Object: U3489 nter Command (UPPER CASE) or Object Name: (cr will keep U3489 QUIT to stop converting, DRIVE to finish entire file with same object name, UNTIL <num|scan> to continue for num or until reaching scan, NEWCYCLE <num> to change the number of scans in a cycle to num, SKIP [num | scan] to skip this scan, or num scans, or until scan ASKFREQ to prompt for frequencies each time, ASK to ask basic questions again.): U3489 Scan 930900009: U3489-1. RA 11:12:24.40 Dec +31:24:41.0 Scan 930900010: U3489-2. Offset 5400.000000 (5400.165333) Scan 930900011: U3489-3. Offset 5400.000000 (5399.659220) Scan 930900012: U3489-4. Offset 5400.000000 (5399.719945) Object:U3489 Enter Command (UPPER CASE) or Object Name: (cr will keep U3489 QUIT to stop converting, DRIVE to finish entire file with same object name, UNTIL <num|scan> to continue for num or until reaching scan, NEWCYCLE <num> to change the number of scans in a cycle to num, SKIP [num | scan] to skip this scan, or num scans, or until scan ASKFREQ to prompt for frequencies each time, ASK to ask basic questions again.): U4431 Scan 930900009: U4131-1. RA 07:59:11.43 Dec +31:48:23.6 Scan 930900010: U4131-2. Offset 5400.000000 (5400.165333) Scan 930900011: U4131-3. Offset 5400.000000 (5399.659220) Scan 930900012: U4131-4. Offset 5400.000000 (5399.719945) 9632 records translated
A data file with three observations, two of one galaxy (U5361) and one of another (U5592). Each cycle consisted of ON, OFF, CAL ON, CAL OFF
sdtest Enter Input (AO) filename: /proj/a9999/corfile.01jan00.a9999.4 Enter Output File: 01Jan00d.fits Channel A system temp? :9.2 Channel B system temp? :9.2 Linear or Circular inputs? :L Total number of scans in a cycle:4 Scan 930900061, UTC=2000-01-05T15:30:13, AST=1999-11-05T11:30:13 Object: U5361 Enter Command (UPPER CASE) or Object Name: U5361 Enter Command (UPPER CASE) or Object Name: (cr will keep U5361 QUIT to stop converting, DRIVE to finish entire file with same object name, UNTIL <num|scan> to continue for num or until reaching scan, NEWCYCLE <num> to change the number of scans in a cycle to num, SKIP [num | scan] to skip this scan, or num scans, or until scan ASKFREQ to prompt for frequencies each time, ASK to ask basic questions again.): U5361 Scan 930900061: U5361-1. RA 09:55:03.25 Dec +25:12:10.6 Scan 930900062: U5361-2. Offset 8955.000000 (8948.313686) Scan 930900063: U5361-3. Offset 8955.000000 (8948.299047) Scan 930900064: U5361-4. Offset 8955.000000 (8948.302798) Scan 930900065, UTC=2000-01-05T15:42:43, AST=1999-11-05T11:42:43 Object: U5361 Enter Command (UPPER CASE) or Object Name: (cr will keep U5361 QUIT to stop converting, DRIVE to finish entire file with same object name, UNTIL <num|scan> to continue for num or until reaching scan, NEWCYCLE <num> to change the number of scans in a cycle to num, SKIP [num | scan] to skip this scan, or num scans, or until scan ASKFREQ to prompt for frequencies each time, ASK to ask basic questions again.): Scan 930900065: U5361-1. RA 09:55:03.25 Dec +25:12:10.2 Scan 930900066: U5361-2. Offset 8955.000000 (8948.189632) Scan 930900067: U5361-3. Offset 5400.000000 (5399.836752) Scan 930900068: U5361-4. Offset 8955.000000 (8948.473693) Scan 930900069, UTC=2000-01-05T15:57:01, AST=1999-11-05T11:57:01 Object: U5361 Enter Command (UPPER CASE) or Object Name: (cr will keep U5361 QUIT to stop converting, DRIVE to finish entire file with same object name, UNTIL <num|scan> to continue for num or until reaching scan, NEWCYCLE <num> to change the number of scans in a cycle to num, SKIP [num | scan] to skip this scan, or num scans, or until scan ASKFREQ to prompt for frequencies each time, ASK to ask basic questions again.): U5592 Scan 930900069: U5592-1. RA 10:21:31.63 Dec +22:32:51.0 Scan 930900070: U5592-2. Offset 5400.000000 (5401.432019) Scan 930900071: U5592-3. Offset 5400.000000 (5400.222629) Scan 930900072: U5592-4. Offset 5400.000000 (5400.127029) 14448 records translated
The following provides details on the available routines to apply gain/temperature corrections for Arecibo data, as well as details of the "ao.import" routine:
These files are designed for the import and calibration of data taken at Arecibo Observatory. A typical session for this may go something like: % aips++ -l naic_start.g - ao.import('U3564.sdfits') - aoname:='U3564_ms1' - ao.gaincorr() - ao.plot('average1') After the above commands, the calibrated data is shown in the dish pgplotter screen. Note that the variable "aoname" is assumed to be the name of a measurement set as it appear in the dish results manager (i.e. aoname:='U3564_ms1' and NOT aoname:='U3564_ms') KNOWN PROBLEMS: (1) The use of a hybrid to convert a receiver from linear <-> circular has not been dealt with (in a large part due to a lack of knowledge of what happens to the cal values). (2) The baseline routines need to be updated to allow baseline fitting to the cals. Plus, the "gaincorr" routine needs baseline fitting. (3) The baseline routines do not yet allow for the user to interactively select (i.e. with a mouse) their ranges (4) The user cannot yet calibrate their data into units of T_main_beam (and probably never will be allowed to....) PLANNED UPGRADES: - Make routines more generic. This means having the routines automatically recognize the ON, OFF, CAL_ON, CAL_OFF - No calibration for mapping data is in place yet - Others? ______________________________________________ The primary files are: (1) ao.import Description: This program imports sdfits data and converts it into a measurement set. In the process, the program adds a couple 'missing' columns to the data. Syntax: ao.import(sdfitsname) Where sdfitsname is the full name of the sdfits file, and which is assumed to be of the form <name>.<ending>. The output measurement set will have the name <name>_ms Subroutines called: ao.fixpnt (2) ao.gaincorr Description: This routine reads in data from a measurement set, does (ON - OFF)/OFF for the individual data dumps, and then applies the gain/temp correction to the individual (ON - OFF)/OFF data dumps. The output is a measurement set whose data column contains the calibrated data. The measurement set will be named msname_on_off. Additionally, the calibrated data will be averaged and the average will be written to the dish results manager as X records, where X is the number of boards x the number of polarizations of the scan. Note that the data is currently assumed to be in the form of ON, OFF, CAL_ON, CAL_OFF. The temperature is determined from the CAL measurements, and the gain correction is obtained from the 'standard' AO gain curves, as described in the subroutines below. After the routine is run, the tys and tcal calculated from the noise diode data is placed into the data headers. Syntax: ao.gaincorr([name=aoname,onscan=0,calscan=0,tsys=0,gainval=0,offscan=0,weight='none',convert='T']) Here name is the name of the measurement set which contains the data of interest. As with all these routines, it defaults to th definition of the aoname variable. The other options are: onscan = Scan number of the ON source observation Default is the first scan of the data set calscan = First scan number of affiliated noise diode observation Default is onscan+2 tsys = array of tsys values. This must be a X by 6 array, where X is the number of (polarizations)x(boards). Default is to calculate this value from the cals. Note entering a value here will override any entry for the "calscan" gainval = array of gain values. This must be a X by 4 array, where X is the number of (polarizations)x(boards). Default is to calculate this value from the gain curve. offscan = Scan number of the OFF source observation Default is onscan+1 weight = weighting scheme for the averaging of the scans. The options are "none" (the default), "rms" (rms across each spectra is used for weighting), and "tsys" (the weight for all channels in each spectra is the same value). convert = convert the data to Janskies (value of 'T', the default), System temperature (value of 'Tsys') or leave as raw data (value of 'F') Subroutines Called: ao.tsys, ao.gain, ao.onoff, ao.avg, get_scan (3) ao.gaincorr2 Description: This routine will read in data, average the on and off scans, do (on - off)/off, apply the gain curve, and then multiply the result by the tsys (obtained from the associated CAL observations. The output is sent to the dish results manager as X records, where X is the number of boards x the number of polarizations of the scan. Note that the data is currently assumed to be in the form of ON, OFF, CAL_ON, CAL_OFF. The temperature is determined from the CAL measurements, and the gain correction is obtained from the 'standard' AO gain curves, as described in the subroutines below. After the routine is run, the tys and tcal calculated from the noise diode data is placed into the data headers. This routine allows the user to fit a baseline to the data in place of using an off scan. Note that for the moment the system temperature is always found via (CAL_ON-CAL_OFF(/CAL_OFF). Syntax: ao.gaincorr2([name=aoname,onscan=0,calscan=0,tsys=0,gainval=0,offscan=0,fitbase='F',weight='none',convert='T',order=2,range='F']) Here name is the name of the measurement set which contains the data of interest. As with all these routines, it defaults to th definition of the aoname variable. The other options are: onscan = Scan number of the ON source observation Default is the first scan of the data set calscan = First scan number of affiliated noise diode observation Default is onscan+2 tsys = array of tsys values. This must be a X by 6 array, where X is the number of (polarizations)x(boards). Default is to calculate this value from the cals. Note entering a value here will override any entry for the "calscan" gainval = array of gain values. This must be a X by 4 array, where X is the number of (polarizations)x(boards). Default is to calculate this value from the gain curve. offscan = Scan number of the OFF source observation Default is onscan+1 fitbase = if set to true (T, t, or 1), the routines will fit a baseline to the averaged on scan, and use that baseline in place of an 'off' spectra. The fitted baseline will be a polynomial, of the order, and across the range, set with the "order" and "range keywords. weight = weighting scheme for the averaging of the scans. The options are "none" (the default), "rms" (rms across each spectra is used for weighting), and "tsys" (the weight for all channels in each spectra is the same value). convert = convert the data to Janskies (value of 'T', the default), System temperature (value of 'Tsys') or leave as raw data (value of 'F') order = this is the order of the polynomial used for fitting a baseline to the data. This option is used only with the baseline fitting option. range = the range of data (in channel numbers) to which a baseline is fit, when using the baseline fitting option (otherwise, this keyword is ignored). If, for example, you wish to fit a base line to channels 500 through 1500, you would type: range='[500:1500]' Subroutines Called: ao.tsys, ao.gain, ao.onoff, ao.avg, get_scan (4) ao.calmany Description: This routine allows the user to run the above ao.gaincorr function on a list of objects (scans), provided the scans all lie within the same measurement set. For a more complete description of the routine, see the ao.gaincorr description. Syntax: ao.calmany([name=aoname,numpairs=1,pattern=4,onscan=0,calscan=0,tsys=0,gainval=0,offscan=0, weight='none', convert='T']) The entries are identical to those of the ao.gaincorr routine, bar: numpair = number of dataset (objects) to reduce pattern = the number of scans in a given pattern (i.e. a set which consists of an ON, OFF, CAL_ON, CAL_OFF would have pattern=4). Subroutines Called: ao.gaincorr,ao.tsys, ao.gain, ao.onoff, ao.avg, get_scan (5) ao.calmany2 Description: This routine allows the user to run the above ao.gaincorr2 function on a list of objects (scans), provided the scans all lie within the same measurement set. For a more complete description of the routine, see the ao.gaincorr2 description. Syntax: ao.calmany([name=aoname,numpairs=1,pattern=4,onscan=0,calscan=0,tsys=0,gainval=0,offscan=0, fitbase='F', weight='none', convert='T',order=2, range='F']) The entries are identical to those of the ao.gaincorr routine, bar: numpair = number of dataset (objects) to reduce pattern = the number of scans in a given pattern (i.e. a set which consists of an ON, OFF, CAL_ON, CAL_OFF would have pattern=4). Subroutines Called: ao.gaincorr,ao.tsys, ao.gain, ao.onoff, ao.avg, get_scan ______________________________________________ The subroutines (all of which can be called separately) are: (1) ao.avg Description: This routine takes in a typical AO measurement set, determines the total number of boards, polarizations, and dumps, and then averages all the dumps for each board/polarization. The output will be X records which are placed in the dish results manager, where X is the number of scans X the number of polarizations Syntax: ao.avg([name=aoname,scan=0,weight="none"]) If no scan number is given, the average is done on the first scan in the given measurement set. The weight keyword describes the weighting scheme for the averaging of the scans. The options are "none" (the default), "rms" (rms across each spectra is used for weighting), and "tsys" (the weight for all channels in each spectra is the same value). Subroutines called: ao.numdumps, ao.getscan (2) ao.gain Description: This routine determines the gain correction for the individual dumps of the entered scan number/measurement set. The coefficients for the gain curves are taken from the gain.datRX files in the AOgains directory (X is the AO receiver number). If no gain.dat file is available, the program provides an error message and returns a gain value of 1. The result is output as an X by 4 array, where X is the (number of boards) x (number of polarizations). The columns of the output array are: column 1: The unique number to describe the board/pol column 2: The center freq. of the board, used for the gain corr. column 3: The polarization i.d. column 4: The gain correction (in K/Jy) Syntax: ao.gain([name=aoname,scan=0]) If no scan number is given, the gain is determined from the first scan in the given measurement set. Note that if you enter this command as, say, "gain:=ao.gain([,scan])", The resultant gain will be placed into the "gain" variable. Subroutines called: ao.getgainval,ao.convertdate,ao.convertmjd,ao.numscans,ao.getscan (3) ao.onoff Description: This routine will calculate the (ON-OFF)/OFF for all the dumps, boards, and polarizations in the measurement set. Additionally, if desired, the routine will convert the data from raw counts to Jy using the entered gain and Tsys values. The output of the routine is a table. Syntax: ao.onoff([name=aoname,onscan=0,convert='T',temp=0,gainval=0,offscan=0]) As with all the routines, if no name is given, this function defaults to the name given to the aoname variable, while the default for the "onscan" id simply the first scan in the measurement set. Additionally, if the "convert" variable is set to "T" or "Tsys" (or "t", "1", or "tsys"), the program will quit unless a nonzero value of the temperature and gain is entered. Additionally, the user may enter a scan number to be used for the OFF source scan. If no value is entered, the routines will default to offscan=onscan+1 Subroutines called: ao.numscans (4) ao.tsys Description: This routine will calculate the system temperature from a pair of ON+OFF noise diode observations. The system temperature is calculated per channel and then the mean value is returned. The temperatures of the noise diodes are found in the cal.datRX files in the AOgains directory (X is the number of the AO receiver). The result is output as an X by 6 array, where X is the (number of boards) x (number of polarizations). The columns of the output array are: column 1: The unique number to describe the board/pol column 2: The center freq. of the board, used for the gain corr. column 3: The polarization i.d. column 4: The noise diode temperature used in the calculations column 5: The (mean) temperature of the given board/polarization column 6: The standard deviation for the temperature measurement Syntax: ao.tsys([name=aoname,calscan=0]) Here the calscan number should be the scan of the CAL_ON observation. Again, if no scan number is given the routine assumes the first scan in the measurement set is the CAL_ON. Subroutines called: ao.getcalval,ao.convertdate,ao.convertmjd,ao.numscans,ao.getscan (5) ao.convertdate Description: This routine determines the number of days which have passed in a year based off the entered date. That is, if the entered date is 01 January, 2001, the returned day would be 1 (as January 01 is the first day of the year), while if the entered date is 29 January, 2001, the returned day would be 29. Syntax: ao.convertdate(day,month,year) The day, month, and year should be entered as whole numbers. The year should be given completely (i.e. 2002 and not 02). Subroutines called: none (6) ao.convertmjd Description: This routine converts the mean Julian date into the month, day, and year. The result is returned as a 3 component array with: column 1: day column 2: month column 3: year Syntax: ao.convertmjd(mjd) Subroutines called: none (7) ao.converttime Description: This routine converts the number of seconds since 1970.0 into a day and year. Syntax: ao.converttime(tnow) Typically, tnow:=time() Subroutines called: none (8) ao.getscan Description: This routine determines the scan number of the first scan in a measurement set, and returns it. Syntax: ao.getscan([name=aoname]) Subroutines called: none (9) ao.getcalval Description: This routine returns the temperature of a given noise diode with a given configuration. The temperatures of the noise diodes are found in the cal.datRX files in the AOgains directory (X is the number of the AO receiver). Syntax: ao.getcalval(rcvnum, freqin, calnum[, day=-1, year=-1, pol=0]) rcvnum = AO receiver numbers (1-12) freqin = the frequency of interest for the diode temperature calnum = configuration number for the noise diode day, year = the day (1-366) and year for which you want the cal values. (these default to the present date if no value is entered) pol = polarization of interest for the diode temperature (this defaults to pol=0 of no value is entered) Subroutines called: ao.converttime (10) ao.getgainval Description: This routine returns the gain correction for a given receiver at a given azimuth, zenith angle, and date. The coefficients for the correction are found in the gain.datRX files in the AOgains directory (X is the number of the AO receiver). If no gain.datRX file is found, an error message is printed and the program returns a value of 1. Syntax: ao.getgainval(rcvnum,freqin[,az=90,za=12,day=-1,year=-1,pol=0]) rcvnum = AO receiver number freqin = the frequency of interest for the diode temperature az = azimuth angle of interest (equal to 90 deg. if not entered) za = zenith angle of interest (equal to 12 deg. if not entered) day, year = the day (1-366) and year for which you want the cal values. if not entered, this defaults to the current date pol = polarization of interest for the diode temperature. Default is 0. Subroutines called: ao.converttime (10) ao.numdumps Description: This routine determines the number of data dumps within a given scan number, and returns this value. Syntax: ao.numdumps([name=aoname,scan=0]) Here name is the name of the measurement set of interest, and scan is the scan number of the scan of interest. Subroutines called: none (12) ao.numscans Description: This routine determines the (number of boards) x (number of polarizations) within a given measurement set, and returns this value. Syntax: ao.numscans([name=aoname,scan=0]) Here name is the name of the measurement set of interest, and scan is the scan number of the scan of interest. Subroutines called: none (11) ao.base Description: This function will calculate (On-OFF)/OFF using an input baseline as the OFF. It can also convert the data into Tsys, or Jy if desired. This will be expanded in the near future to accommodate a much wider variety of baseline fitting options. Syntax: ao.base(basel,[name=aoname, onscan=0, convert='T', temp=0, gainval=0) Here, basel is the name of the baseline (in the dish results manager). This variable MUST be given. Name is the name of the measurement set of interest. onscan is the scan number of the scan of interest. Convert can be set to 'T' (convert to Janskies, the default), 'Tsys' (convert to system temperature, or 'F' (leave as raw data), and temp and gain are the temperature and gain arrays, usually obtained from the ao.tsys and ao.gain routines. Subroutines called: ao.numscans (12) ao.gainone, ao.gaintwo, ao.gainthree Description: These functions obtain the gain for the variety of possible equations Syntax: ao.gainone(az,za,coef,zac) ao.gaintwo(az,za,coef,zac) ao.gainthree(az,za,coef,zac) Here az, za are the azimuth and zenith angle (in degrees) coef is the array of coefficients for the equation, and zac is the zenith angle at which the gain curve turns over. All the entries are usually supplies by the ao.gain routine. Subroutines called: none (12) ao.plot Description This routine just calls the d.plotscan() routine. Syntax: ao.plot(name) Here name is the name of an sdrecord (i.e. ao.plot('average1')). Subroutines called: none (13) ao.fixpnt Description: This routine corrects for the absence of a REF_FREQ, which enables viewing in msplot. It also adds a column entitled "NRAO_GBT_STATE_ID" which is required by the uni2.g routines. Note that this column (NRAO_GBT_STATE_ID) is simply a mirror of the DATA_DESC column. This routine is called by the import command. Syntax: ao.fixpnt([name=aoname]) Subroutines called: none
This example assumes that an AIPS++ installation is available in directory /pkg/aips++/stable and that the AIPS++ sample data is available in the data repository at /pkg/aips++/data/demo/dishdemo/U3294.sdfit. Modify the first few lines of this example appropriately if your installation has a different path.
% source /pkg/aips++/stable/aipsinit.csh % cp /pkg/aips++/data/demo/dishdemo/U3294.sdfit . % aips++ -l naic.g ... Time to initialize DISH = 11.978507 DISH tool is --> d AO tool is --> ao Glish version 2.7. - ao.import('/pkg/aips++/data/demo/dishdemo/U3294.sdfit'); T - #this automatically opens up the file - ao.gaincorr('U3294_ms1');
After the above commands, the calibrated data is placed in the dish results manager. It can be plotted with the "ao.plot" command.