school13 miriad scripts debugging

8 views
Skip to first unread message

Peter Teuben

unread,
Aug 2, 2013, 12:14:06 AM8/2/13
to mir...@googlegroups.com

Mostly interesting for the school13 students,
but of general interest to those who don't know this shells script trick
for debuging:



One of the scripts you are probably using is a cloned version of
$MIR/examples/school/carma_calibrate.csh.

Two of you have sent me a problem when it runs into some fatal error.
The very first line in the
script has the (unix) magic incantation

#!/bin/csh -fe

which tells unix this is a "csh" c-shell script. The '-e' flag makes
that script in case of an error,
instead of just trotting along, most likely uselessly. The -'f' flag is
for fast startup, not important
in this context, but lets leave it alone.

If you run into an error, it's most useful for me to get that last
offending line, plus the dataset
that was used in that line. However, the -fe flag isn't useful to spit
that information out, you would
need to add the -vx flags. You could edit the file, but you can also do
it as follows:


csh -fvxe carma_calibrate.csh ....

(where ... are any options you gave to the command)

this way you will see a lot on the screen, but most importantly, the
last line
would be something like

........
mfcal vis=$vis_noise interval=$interval_pb refant=$refant
mfcal vis=noise_base_cj.mir interval=20.0 refant=9
MfCal: version 1.1 11-jan-10
Selecting parallel-hand polarisations
Reading the data ...
ovro
### Fatal Error [mfcal]: Too many spectral windows for me to handle


You will see that each command given in the script is shown twice, once
before the expansion of the shell ($)
variables, and once expanded, literally as it has been executed as if
you did that on the unix command
line. It's that latter one we want, so

mfcal vis=noise_base_cj.mir interval=20.0 refant=9


This would be the command I would want to know, and I probably also
want to know where your data are.
If they are from your laptop, you should copy (using scp -r) it to
/opt/summerschoolscratch/YOUR_NAME
or so, so I can pick it up or re-run it on the linux cluster to confirm
and debug.

thanks


peter


Reply all
Reply to author
Forward
0 new messages