For your viewing pleasure, here's an example AIPS script. What the script does is calibrate a VLA continuum data set (including polarization). Note that this script is NOT guaranteed to work for YOUR data! DO NOT USE THIS SCRIPT BLINDLY. I am posting this as an example of AIPS scripting, not as an example of how to reduce data.
See below the cut for the code.
*
* REDUCE.099
*
* Purpose: a set of routines designed to aid in the calibration process. Note that
* these procedures use stuff in VLAPROCS. RUN VLAPROCS before running
* routines in this file.
*
* NOTES on Run Files with AIPS:
*
* AIPS is stupid, so indenting stuff with tab characters causes AIPS to
* barf on a run file.
*
* To run a RUNFILE, create an environment variable in your shell with the
* directory where the runfile is. Name the runfile with something short
* ending in .099 (user number in hex; use EHEX in AIPS to find). In AIPS,
* change your version to version='myvlar080705'. Caution: you don't want
* any of your routine names or values to be the same as something already
* in AIPS. For example, naming a routine CLCAL will cause AIPS to use your
* CLCAL routine rather than the actual CLCAL routine. You read in your
* runfile with 'RUN reduce.099'. Changed the file and need to run again?
* Then just do RUN reduce.099 again. Note that AIPS doesn't get rid of
* the first instance of RUN reduce.099 in memory, so you need to use
* COMPRESS periodically to get rid of old reduce.099 stuff. COMPRESS also
* helps when you have issues after redefining variables etc. To nuke a
* procedure from the procedures list (help procs to see), use scratch.
* The procedure still takes up memory however until you run a compress. I
* haven't figured out how to get rid of old adverbs.
*
* Getting errors that say 'AIPS: SYMBOL?' means that POPS (the scripting
* language) doesn't recognize the command. Try help popsym to get a list
* of the commands available to you.
*
* 'TXTMAT: NO MEMBER NAME GIVEN' means that you should make sure there's
* procedure in the memory of AIPS.
*
* Note that the read command expects single quotes about whatever you
* enter on the keyboard. Respond 'Y' rather than Y to any prompts.
*
* Make sure that the last line of the file is empty otherwise the last
* line of the program will not be read.
*
*
* Date Programmer Description of Changes
* ----------------------------------------------------------------------
* 3/21/06 A.A. Kepley Original Code
* 3/23/06 A.A. Kepley Modified for new 12/05/05 dataset
* 9/12/06 A.A. Kepley Modified for use with AM694 dataset
* 2/09/06 A.A. Kepley Modified for use with AM643 dataset
* ======================================================================
*
proc dreduceme
*
* Purpose: dummy procedure to create variables used later
*
* Inputs: none
*
* Outputs: none
*
* Method: none
*
* Date Programmer Description of Changes
* ----------------------------------------------------------------------
* 3/21/06 A.A. Kepley Original Code
* 3/23/06 A.A. Kepley Modified for new 12/05/05 dataset
*
string*8 pri_cal $ name of primary calibrator.
string*8 sec_cal $ name of secondary calibrator. Also
$ used to calibrate the instrumental
$ polarization response.
string*8 obj_name(15) $ name of object (maybe more than 1).
scalar nobj $ number of objects
string*50 myoutname $ name of output file for various
$ tasks.
string*15 dataprefix $ what data set I'm reducing.
scalar myrefant $ reference antenna (1-29).
string*8 myprompt $ prompt value.
scalar polangle $ polarization angle
array pri_uvr(2) $ set uvrange for primary calibrator
array sec_uvr(2) $ set uvrange for secondary calibrators
scalar mysolint $ set my solution interval
scalar mypsolint $ set my solution interval for my polarization
*
return;finish
*
* ======================================================================
*
proc reduceme
*
* Purpose: Main calibration routine. This routine pretty thoroughly clobbers
* your AIPS environment you might want to do a save at the command
* line so you can go back to the way things were (using get)
*
* Inputs: The user needs to change the values for INNAME, INCLASS, INSEQ,
* INDISK, PRI_CAL, SEC_CAL, OBJ_NAME, DATAPREFIX, and MYREFANT for
* each data set. .
*
* Outputs: calibrated data set with final calibration table in CL 3 and
* gain and phase calibration table in CL 2. This task also produces a
* number of files in order to check on the calibration in your main home
* directory. If you run reduceme several times, the information from the
* later runs will be appended to the files. The files also include the
* task input parameters used to run the tasks. The files are named with
* the data set you are reducing, the object name, and the task which was
* run.
*
* Method: This calibration routine is for single channel continuum calibration
* including polarization calibration. It follows the procedures in
* Chapter 4 of the 31DEC05 version of the AIPS Cookbook closely.
* It uses the old method of calibrating the primary flux calibrator
* uv limits rather than a model of the source.
*
* REMEMBER TO CHECK ALL OUTPUT TO MAKE SURE THE REDUCTION WENT WELL AND
* THAT THE ROUTINE IS DOING WHAT YOU THINK IT SHOULD BE DOING.
*
* Date Programmer Description of Changes
* ----------------------------------------------------------------------
* 3/21/06 A.A. Kepley Original Code
* 3/23/06 A.A. Kepley Modified for new 12/05/05 dataset
* 9/12/06 A.A. Kepley Modified for AM694_1 dataset
* 2/09/07 A.A. Kepley Modified for AM643_1 dataset
* cleaning things up.
clrmsg
dowait true
default getjy
default setjy
default calib
default clcal
default listr
default pcal
default rldif
default clcor
* input file to calibrate
INNAME 'AM643_1 ' $ Input image name (name)
INCLASS 'X BAND' $ Input image name (class)
INSEQ 1 $ Input image name (seq. #)
INDISK 1 $ Input image disk unit #
* primary, secondary calibrator, and object to calibrate
pri_cal = '0521+166'
sec_cal = '0244+624'
obj_name = 'N1569',''
* Other defaults for calibration
nobj = 1
dataprefix = 'AM643_1.'
myrefant = 5
flagver 1
pri_uvr = 0,45 $ since the data are all less than 20 klamdba
sec_uvr = 0,0 $ this isn't too important
polangle = -20
mysolint = 0.0
mypsolint = 1.0
* Run setjy to find the flux value for the primary calibrator
prtask 'SETJY' $ clearing out the results
clrmsg $ of previous runs of setjy.
task 'SETJY'
sources pri_cal,''
optype 'calc'
calcode ''
freqid 1
aparm 0
go
* Save the results of the setjy run
myoutname dataprefix !! pri_cal !! '.SETJY'
docrt false
outprint myoutname
prtask 'AIPS'
clrmsg
inputs setjy $ printing out the setjy inputs
prtmsg
prtask 'setjy' $ printing out the setjy results
prtmsg
* Run VLACALIB on the primary calibrator
* calsour pri_cal,''
* calcode ''
* uvrange pri_uvr
* refant myrefant
* snver 1
* minamper 10
* minphser 10
* docalib false
* gainuse 0
* doprint 1
* myoutname dataprefix !! pri_cal !! '.CALIB'
* outprint myoutname
* vlacalib
* Run VLACALIB on the secondary calibrator
* calsour sec_cal,''
* calcode ''
* uvrange sec_uvr
* refant myrefant
* snver 1
* minamper 10
* minphser 10
* doprint 1
* myoutname dataprefix !! sec_cal !! '.CALIB'
* outprint myoutname
* vlacalib
* Run CALIB on the primary calibrator
prtask 'CALIB'
clrmsg
task 'CALIB'
calsour pri_cal,''
calcode ''
bchan 1
echan 0
antennas 0
uvrange pri_uvr
weightit 0
snver 1
minamper 10
minphser 10
docalib false
clr2name
clroname
refant myrefant
gainuse 0
dopol false
doband false
solint mysolint
solsub 0
solmin 0
soltype ''
aparm 4,0
aparm(6) 2
solmode 'A&P'
cparm 0, 0, minamper/10, minphser/10, 1, 0
go
* Save results of CALIB run
myoutname dataprefix !! pri_cal !! '.CALIB'
docrt false
outprint myoutname
prtask 'AIPS'
clrmsg
inputs calib
prtmsg
prtask 'calib'
prtmsg
* Run CALIB on the secondary calibrator
prtask 'CALIB'
clrmsg
task 'CALIB'
calsour sec_cal,''
calcode ''
bchan 1
echan 0
antennas 0
uvrange sec_uvr
weightit 0
snver 1
minamper 10
minphser 10
docalib false
clr2name
clroname
refant myrefant
gainuse 0
dopol false
doband false
solint mysolint
solsub 0
solmin 0
soltype ''
aparm 4,0
aparm(6) 2
solmode 'A&P'
cparm 0, 0, minamper/10, minphser/10, 1, 0
go
* Save results of CALIB run
myoutname dataprefix !! sec_cal !! '.CALIB'
docrt false
outprint myoutname
prtask 'AIPS'
clrmsg
inputs calib
prtmsg
prtask 'calib'
prtmsg
* Transfering the flux density scale determined by the primary calibrator
* to the secondary calibrator and the polarization angle calibrator
prtask 'getjy'
clrmsg
task 'getjy'
sources sec_cal,''
soucode ''
calsour pri_cal,''
calcode ''
bif 1; eif 2
freqid 1
snver 1
go
* Save the results of the setjy run
myoutname dataprefix !! sec_cal !! '.GETJY'
docrt false
outprint myoutname
prtask 'aips'
clrmsg
inputs getjy
prtmsg
prtask 'getjy'
prtmsg
* Applying the gain and phase solutions from the secondary calibrator to the data
prtask 'clcal'
clrmsg
task 'clcal'
sources sec_cal, obj_name, ''
soucode ''
calsour sec_cal,''
calcode ''
opcode 'cali'
interpol '2pt'
doblank 1
dobtween 0
snver 1
gainver 1
gainuse 2
refant myrefant
go
* Save the results of the calib run
myoutname dataprefix !! sec_cal !! '.CLCAL'
docrt false
outprint myoutname
prtask 'aips'
clrmsg
inputs clcal
prtmsg
prtask 'clcal'
prtmsg
* Applying the gain and phase solutions from the primary calibrator to the
* primary calibrator
prtask 'clcal'
clrmsg
task 'clcal'
sources pri_cal,''
soucode ''
calsour pri_cal,''
calcode ''
opcode 'cali'
interpol '2pt'
doblank 1
dobtween 0
snver 1
gainver 1
gainuse 2
refant myrefant
go
* Save the results of the calib run
myoutname dataprefix !! pri_cal !! '.CLCAL'
docrt false
outprint myoutname
prtask 'aips'
clrmsg
inputs clcal
prtmsg
prtask 'clcal'
prtmsg
* looking at the results of the gain and phase calibration
task 'listr'
optype 'matx'
sources pri_cal,''
uvrange pri_uvr
calcode ''
stokes ''
freqid 1
bif 1; eif 1
docalib 2
gainuse 2
dparm 5, 1, 0 $ plot scalar averaged amp+phase
docrt false
myoutname dataprefix !! pri_cal !! '.GPCALRES'
outprint myoutname
go
bif 2; eif 2
go
task 'listr'
optype 'matx'
sources sec_cal,''
uvrange sec_uvr
calcode ''
stokes ''
freqid 1
bif 1; eif 1
docalib 2
gainuse 2
dparm 5, 1, 0 $ plot scalar averaged amp+phase
docrt false
myoutname dataprefix !! sec_cal !! '.GPCALRES'
outprint myoutname
go
bif 2; eif 2
go
bif 1; eif 2
* prompting to see if I want to do polarization calibration
print 'Do polarization calibration (Y/N)?'
read myprompt
if myprompt = 'N' then
return
end
* Calibrating the instrumental polarization
prtask 'pcal'
clrmsg
task 'pcal'
calsour sec_cal,''
docalib 2
gainuse 2
solint mypsolint
soltype 'appr'
prtlev 1
bparm 0
cparm 0
go
* Save the results of the pcal run
myoutname dataprefix !! sec_cal !! '.PCAL'
docrt false
outprint myoutname
prtask 'aips'
clrmsg
inputs pcal
prtmsg
prtask 'pcal'
prtmsg
* calibrate the absolute phase angle using either 3C286 (1331+305) or
* 3C138 (0521+166)
prtask 'rldif'
clrmsg
task 'rldif'
sources pri_cal,''
uvrange pri_uvr
docalib 2
gainuse 2
dopol true
docrt false
myoutname dataprefix !! pri_cal !! '.RLDIF'
outprint myoutname
go
* changing RLdif output to a phase offset correction
* I've changed the following (9/12/06) so that the polarization angle is set
* earlier in the program depending on what polarization angle source is used.
for i = 1:2
clcorprm(i) = polangle - clcorprm(i)
end
print 'finish clcorprm'
* applying the polarization corrections to the data
prtask 'clcor'
clrmsg
task 'clcor'
sources ''
stokes 'L'
gainver 2
gainuse 3
opcode 'polr'
go
* saving the results of the clcor run
myoutname dataprefix !! obj_name(1) !! '.CLCOR'
docrt false
outprint myoutname
prtask 'aips'
clrmsg
inputs clcor
prtmsg
prtask 'clcor'
prtmsg
* checking the polarization calibration
task 'rldif'
sources pri_cal, sec_cal,''
uvrange pri_uvr
freqid 1
bif 1; eif 2
docalib 2
gainuse 3
dopol 1
docrt false
myoutname dataprefix !! pri_cal !! '.PCALRES'
outprint myoutname
go
return;finish
*
* ======================================================================
*
proc killcal
*
* Purpose: clean up old calibration to run new calibration.
*
* Inputs: none
*
* Outputs: deletes all CL tables except CL 1 and all SN tables.
*
* Method: none
*
* Date Programmer Description of Changes
* ----------------------------------------------------------------------
* 3/21/06 A.A. Kepley Original Code
*
*
vlareset
inext 'sn'
invers -1
extdest
return; finish
*
* ======================================================================
*
proc test
*
* Purpose: test stuff
*
print 'Y or N'
read myprompt
print myprompt
if myprompt = 'Y' then
print 'Yay for Yes!'
return
else
print 'Boo for no!'
end
print 'hello world'
return; finish
*
* ======================================================================
*
Wednesday, April 15, 2009
AIPS Scripting Example Sans Commentary
Posted by
amanda
at
3:24 PM
0
comments
Labels: scripting
AIPS Scripting: Progress Update
From reader Bruce:
This scripting stuff is very useful, but I can't find scripting AIPS #3 and etc. Is it out there?
I have lots of files to input, run sdgrid on, then write out. I have no idea how I could go about making sure stuff gets in the right slot to work for any given task.
The short answer is that I haven't gotten around to writing it yet. (thesis) I'll put it on my to-do list for my observing run next month. It's a good task for 2 in the morning. I'll post an example script without commentary, in case some one would find it useful.
The slightly longer answer is that you don't need to worry about catalog slots. Instead of dealing with stuff through the getn mechanism, i.e., getn 209, you want to use the actual name of the file (INNAME, INCLASS, INSEQ, INDISK, etc.). That way you know you have the file you want, and don't have to depend on the catalog number always being the same.
Read more!
Posted by
amanda
at
3:14 PM
0
comments
Labels: scripting
Thursday, August 21, 2008
Clearing AIPS Variables?
During my recent forays into AIPS scripting, I have often wanted to change how a variable is defined...say by changing an array from dimensions of 50 to 200. When I try to do this, AIPS tells me that the variable is 'ALREADY DF' (or defined, i'm guessing). Is there some way to clear a variable?
Well, I just thought to do a 'RESTORE 0', which seems to clear everything. So maybe that it is the best solution?
Posted by
Laura
at
11:56 AM
1 comments
Labels: scripting
Thursday, August 14, 2008
Reading ASCII Tables into AIPS?
I'm trying to write a script where I repeat some steps on lots of different objects, and therefore I want to read a list of coordinates into AIPS. I currently have an ASCII list of x and y values. Can i read it into AIPS as two arrays so that my script can access them? Or do I have to do something hideous like manually fill the arrays within my script?
Posted by
Laura
at
6:43 PM
2
comments
Labels: scripting, tips n' tricks
Thursday, October 4, 2007
Your friend, the tilde
Ever had to enter a lot of numbers into an array in an AIPS script and run out of room (like in this post)? Trying to figure out the mysteries of plcolor without typing 5 million numbers? In your time of need, the handy tilde will help you out. See below the fold for more details.
The popsym help file (type help popsym to access) gives you this handy tidbit of information on the tilde
A(i) ~ 1,2,3 Store values in A(i),A(i+1)... (change only as many as on RHS)
Now here's an example,
filename = '10208722.UVF','10208724.UVF','10208726.UVF','10208727.UVF'
filename(5) ~ '10208733.UVF','10303423.UVF','10303424.UVF','10303461.UVF'
Tah-Dah!! That's all there really is to it. Use the tilde, Luke -- your fingers will thank you.
Posted by
amanda
at
9:03 PM
0
comments
Labels: scripting, tips n' tricks
Wednesday, July 25, 2007
limited line length in runfiles
in runfiles you can't have lines longer than ~70 characters (i'm not sure what the actual limit is). i've only had a problem with this once when i was defining a large array of filenames for the multiple pointings in a mosaic. the only way to get the whole array defined was to fill in the last three entries manually. i've posted the code i used below.
string*8 obj_name(15)
obj_name = 'GH40-1','GH40-2','GH40-3','GH40-4','GH40-5','GH40-6'
obj_name(7) = 'GH40-7'
obj_name(8) = 'GH40-8'
obj_name(9) = 'GH40-9'
Note added by Amanda on 10/05/07: It's actually easier to use the tilde. See this post. Read more!
Posted by
emily
at
9:38 AM
1 comments
Labels: scripting
Tuesday, June 12, 2007
Tricky, Tricky FOR Loops
I was just trying to write a FOR loop which would run UVCOP many times. When I ran
for i = 1 to 10; bchan i; echan i; go uvcop; end
AIPS would set bchan and echan to 1, then it would run UVCOP once, then it would set bchan and echan to 2, and end the FOR loop. I really didn't know what the problem was-- this loop should work. Then Eric told me this trick: put WAIT before the END, so that now your loop looks like this:
for i = 1 to 10; bchan i; echan i; go uvcop; wait; end
I guess what was happening was that the loop was continuing on before uvcop had finished running, and the loop was getting all confused. It worked with a WAIT!
Posted by
Laura
at
2:43 PM
1 comments
Labels: scripting, tips n' tricks
Monday, April 23, 2007
Teaching the Monkey to Dance: Scripting AIPS #2
In the first installment of this thrilling saga, I talked about how to name your AIPS scripts and load them into AIPS. Now, we're going to get into the nitty gritty details of how to write your own AIPS scripts.
In AIPS scripts, you have access to all the usual AIPS commands and tasks like listr, calib, and imagr. You also have access to some basic programming tools. To see exactly what you have in your toolbox, type help popsym (POPS is the name of the AIPS scripting language). I've replicated the contents of the popsym help files below for your enjoyment:
Help on POPSYM in AIPS version 31DEC04
POPSYM
Type: Symbols used in the POPS interpretive language
VERB USE COMMENTS
----Arithmetic expressions
+ A + B Add the expression A to B
- A - B Subtract the expression B from A
* A * B Multiply the expression A with B
/ A / B Divide the expression A by B
** A ** B Calculate A to the power B
( ) (A+B)*C Grouping expressions as desired
= A = B Store the value of B into A
, A = 3,5,4 Separator of elements in an array
~ A(i) ~ 1,2,3 Store values in A(i),A(i+1)...
(change only as many as on RHS)
: TO Equivalent to the verb TO
; Separator between AIPS statements
----Logical expressions
> A > B A greater than B
< A < B A less than B
= A = B A equal B (numeric or string)
>= A >= B A equal to or greater than B
<= A <= B A equal to or less than B
<> A <> B A not equal to B (numeric or string)
! A ! B A or B
& A & B A and B
^ ^ A not A
----String expressions
!! A !! B string = string A followed by string B
SUBSTR SUBSTR(A,i,j) string = chars i through j of string A
LENGTH LENGTH(A) position last non-blank in A
CHAR CHAR(A) convert number A to string
VALUE VALUE(A) convert string A to number
----Looping constructions
(FOR-TO-BY-END) FOR I=1 TO 7 BY 2
END
(WHILE-END) WHILE
END
(IF-THEN-ELSE-END) IF
THEN
ELSE
END
----Built-in functions
ATAN Arctangent (one argument)
ATAN2 Arctangent (two arguments)
COS Cosine (degrees)
SIN Sine (degrees)
TAN Tangent (degrees)
EXP Exponential
LN Log base e
LOG Log base 10
SQRT Square-root
MAX Maximum i.e. X = MAX (A, B)
MIN Minimum i.e. X = MIN (A, B)
MODULUS Root-square sum of two arguments
MOD(A,B) A - (A/B) * B i.e. remainder of A/B
CEIL(A) Lowest integer >= A
FLOOR(A) Highest integer <= A
----Procedure building verbs
PROC PV Begin building a procedure
PROCEDUR PV Begin building a procedure
LIST pV List a procedure
EDIT PV Edit a procedure
ENDEDIT PV End editing a procedure
ERASE PV Delete line(s) of a procedure
MODIFY PV Modify a line in a procedure
RETURN V Last statement in a procedure
FINISH PV End procedure building
----Variable declarations
SCALAR pV Declare scalars
ARRAY pV Declare arrays
STRING pV Declare strings
----Input/Output functions
PRINT V Print the following keyword value(s)
TYPE V Print the following keyword value(s)
READ V Read value(s) from terminal after # prompt
----Other information
CORE pV Amount of core left in POPS
COMPRESS PV Compress the core area, recovering lost space
and acquiring any new vocabulary
CLRTEMP V Clear the temp data array
DEBUG pV Debug: turns on compiler debug information
DUMP V Dump K array on terminal screen
SCRATCH PV Remove procedures in POPS
$ PV Makes rest of input line a comment
As you can see, you have most of the basic programming tools like if/then statements, for loops, mathematical functions, and comparison operators. The only non-useful bits are in the "Procedure building verbs" section. Some of the verbs in this section (list, edit, endedit, erase, and modify) are left-over from the bad old days and were used for writing procedures using AIPS built-in line editor. Trust me, you don't want to use this editor. Just write your scripts outside AIPS in your favorite text editor and load them into AIPS.
Now that you know what tools you have to work with, let's move on to how AIPS scripts are actually structured. In general, an AIPS script has two parts. The first part declares all the variables one is going to use in a script, while the second part is the actual script itself. Note that you can have more than one script (declaration plus code) inside the file you created in part 1. The convention is to group scripts that work together in one file. For example, my custom calibration routines contain a declaration section, a calibration script, and a script to nuke the current calibration. Start each section with proc scriptname, substituting the name of your script for scriptname and end each section with return; finish.
Looking at the pops language commands, you only three options for variables. (No advanced data structures for you!) Scalars are just numbers, while strings are just letters. Arrays can either be a collection of numbers or letters. To declare a scalar, you just say scalar anumber. Strings need to have their length declared (just like Fortran): string*8 aname. This creates an eight character string. Now declaring an array is slightly tricky. First, you decide what sort of array you want, then you append a number telling AIPS how big to make the array. To create an array of 15 strings, you say string*8 obj_name(15). Variable names are limited to about nine characters, so choose them wisely!
Now to remember what you were thinking when you wrote a script originally you can put an asterisk (*) at the beginning of any line to indicate that the entire line is a comment. You can also put a dollar sign ($) anywhere in a line to indicate that the rest of the line is a comment.
Note that AIPS does NOT pay attention to the first line of a script file, so always start your files with a comment (put a * on the first line). In addition, AIPS gets cranky if you have any tab characters in your script. (This may just be an issue relating to how my editor of choice, emacs, stores files.) If everything looks fine in your script and AIPS still won't read it in, look for tabs. Usually if you move the cursors over the line of code with your arrow keys you can see where the tabs are because the arrow keys move the cursor more than one space.
Well, that's enough for now. Next time, I'll go through a simple example demonstrating everything I talked about in this entry.
Posted by
amanda
at
4:55 PM
6
comments
Labels: scripting
Wednesday, April 11, 2007
Teaching the Monkey to Dance: Scripting AIPS #1
Is your wrist tired from typing and re-typing all those AIPS commands and parameters? Then this tutorial is for you! My goal is to relay my hard-won AIPS scripting knowledge to the rest of the world. Enjoy! For the first post, I'm show you how to name your scripts and get them into AIPS.
First, we're going to learn how to get AIPS to figure out where your scripts are. Fire up AIPS in the directory where you're going to put your test scripts. To tell AIPS where to look for your scripts set version="PWD". Now AIPS will look at the directory you started it up to for your scripts. Now we need something to call your script. Unfortunately, you can't just call the script mywonderfulsupergreataipsscript. First, the name needs to be fairly short (try for less than 9 characters). (Note that it also needs to start with a letter NOT a number. Thanks for the tip, Emily!) Second, you need to take the obvious step (or at least obvious if you're AIPS) of appending your AIPS user number in hex to the end of the filename. Fortunately, the task EHEX in AIPS can help you with that. Put in your user number and it will return a four digit number that corresponds to your user number in hex. Append the LAST THREE digits of the number to your file name. Third, you need to have the filename all in uppercase letters because AIPS only understands uppercase.
For example, my user number is 333. EHEX tells me that this is the equivalent of the hex value 0099. Therefore, I call my first script HELLO.099.
Now comes the fun part, what to put in your new script? Below I give some sample code that will tell AIPS to say hi. Type this into the HELLO.099 file.
*
proc sayhello
print 'Hello'
return; finish
Now in AIPS, type run hello. You should see the contents of HELLO.099 printed out on the console. Then type sayhello and AIPS should say 'HELLO'. If so, congratulations! If not, go back and check on your script. If you're still having trouble, leave a comment.
Next time: We're going to get into the nitty-gritty of actually writing a script.
Posted by
amanda
at
4:58 PM
7
comments
Labels: scripting
If you have a question about AIPS that CANNOT be answered by reading the