Science > Surveys > Little Things > Data > recipe_mapping_public.txt

LITTLE THINGS AIPS MAPPING Recipe
Combining data sets of different array configurations and different observation dates

=====================================================================================


1. Newly observed data

1a. If in the calibration recipe one has taken out only 10 channels from the
beginning and end channels for the new data (5 channels from both sides for the
old data), then a new UVCOP is necessary here for the new data which will take out
another ten channels on both sides.
***Note: One should take the same even number of channels from both sides of the band
and in such a way that one remains with a data set with an odd number of channels.
This preserves the convention that (n+1)/2 is the central channel.



DEFAULT UVCOP
outcla 'LINCOP';bchan 10;echan 231;
uvcopprm 0; uvcopprm(4) 1;

getn *.LINCOP

----> *.LINCOP.2


1b. Spliting the data and applying the calibration and the flags.

***Note: Check values for GAINUSE and FLAGVER in case of non-standard reduction.


DEFAULT SPLIT
Sources 'ddo133',''; Qual -1; Calcode ''; Timerang 0;
Stokes ' '; Selband -1; Selfreq -1; Freqid 1; Bif 0; Eif 0; Bchan 1;
Echan 0; Subarray 0; Docalib 1; Gainuse 3; Dopol -1; Blver -1;
Flagver 2; Doband 1; Bpver 1; Smooth 0; Douvcomp -1; Aparm 0; Nchav 1;
Chinc 1; Ichansel 0; Baddisk 0;


1c. Cliping the hot pixels

Either check the calibration recipe WIPER on source result or run a quick WIPER to select the CLIP level.
DO NOT SMOOTH within WIPER!!!


DEFAULT CLIP
aparm 0;
aparm(1) 6; $ clip any parallel hand visibilities amplitude greater than 6Jy;
$ the clipping level should be set according to the previous UVPLT
$ or WIPER checks.

getn *.SPLIT


1d.1 Shifting the data without Hanning smoothing to a common central velocity

1d.1.1

DEFAULT CVEL
outname 'ddo133.b1-nh'; outcl 'cvel'; outdi 1;
aparm 0, 111, 1, 0, 1420E6, 405752, 1, 0, 0; $aparm(2)=the reference pixel which can be found in
$the header;aparm(5) and aparm(6)set the Hydrogen
$rest frequency;aparm(3)to choose heliocentric as
$velocity type;aparm(7)=1 for VLA data;

aparm(1)=331e3; $the velocity you want in the central channel
aparm(9)=0 $don't smooth
sources ''; qual -1; timerang 0; selband -1; selfreq -1;
freqid 1; subarray 0;
flagver 1; $apply the flag table which we created when clipping
doband -1; bpver -1;
gainuse 0;

getn *.SPLIT

***CVEL should print in the messenger window something like this:

CVEL 1: CVELIN: using flag table version 1 on the data
uhppc5> CVEL 1: NOT USING FFT: I WILL BE SLOWWWW
uhppc5> CVEL 1: CONSIDER CHANGING THE NUMBER OF CHANNELS
uhppc5> CVEL 1: Will use velocity and frequency information from APARMS
uhppc5> CVEL 1: Velocity type is heliocentric
uhppc5> CVEL 1: Velocity definition is OPTICAL
uhppc5> CVEL 1: Rest frequency = 1420.405762 MHz
uhppc5> CVEL 1: Ref. pixel for new velocity is 111.00
uhppc5> CVEL 1: New velocity at given pixel is 331.0000 km/s
uhppc5> CVEL 1: Ant: 1 IF#: 1 Average shift = 3.52560
uhppc5> CVEL 1: Ant: 2 IF#: 1 Average shift = 3.52555
uhppc5> CVEL 1: Ant: 3 IF#: 1 Average shift = 3.52573
uhppc5> CVEL 1: Ant: 6 IF#: 1 Average shift = 3.52562
uhppc5> CVEL 1: Ant: 7 IF#: 1 Average shift = 3.52547
uhppc5> CVEL 1: Ant: 8 IF#: 1 Average shift = 3.52560
uhppc5> CVEL 1: Ant: 9 IF#: 1 Average shift = 3.52559
uhppc5> CVEL 1: Flag table applied - not copied to output
uhppc5> CVEL 1: If spectral flagging requested, spectra will have
uhppc5> CVEL 1: been interpolated before shifting
uhppc5> CVEL 1: Copied NX file from vol/cno/vers 1 103 1 to 1 179 1
uhppc5> CVEL 1: Copied OF file from vol/cno/vers 1 103 1 to 1 179 1
uhppc5> CVEL 1: Copied AN file from vol/cno/vers 1 103 1 to 1 179 1
uhppc5> CVEL 1: Copied WX file from vol/cno/vers 1 103 1 to 1 179 1
uhppc5> CVEL 1: Appears to have ended successfully
uhppc5> CVEL 1: uhppc51 31DEC08 TST: Cpu= 192.3 Real= 320 IO= 155


1d.1.2. Checks:

*** Spectrum is shifted, but there is no change in the header frequency,
so you need to run a few checks.


1d.1.2.1. CVEL shifts the spectum so some channels, either at the beginning,
or at the end will end up without valid information. To identify those
we use POSSM to look at the beginning and end channels. You will recognize
them by having very low values compared with the rest. The number of these
kind of channels depends on how much the spectrum has been shifted.

DEFAULT POSSM
docal -1 ;
doband -1;
freqid 1;
flagver -1;
aparm 0; $ Plot data
solint 0; $ average all time
nplots 0; $ average all baselines
aparm 0;
aparm(1) 0; $ scalar average
source='DDO133','' $ your galaxy
bchan 1;echan 20; $ choose the beginning 20 channels to make more obvious
$ the channels with invalid information
dotv 1;
tvinit;

getn *.CVEL


DEFAULT POSSM
docal -1 ;
doband -1;
freqid 1
flagver -1;
aparm 0; $ Plot data
solint 0; $ average all time
nplots 0; $ average all baselines
aparm 0;
aparm(1) 0; $ scalar average
source='DDO133','' $ your galaxy
bchan 195;echan 215; $ choose the last 20 channels to make more obvious
$ the channels with invalid information
dotv 1;
tvinit;

getn *.CVEL


----> The number of beginning channels with invalid information: 4
----> The number of end channels with invalid information: 0

***Note: For the moment we just take a note of this channels. We can get rid of
these channels at a later stage, when we are triming in preparation for DBCON,
which requires all data sets to have the same number of channels. If for any
particular reason we decide not to get rid of these invalid channels at that stage,
then they should be excluded from the continuum subtraction.


1d.2 Shifting the data with Hanning smoothing

This step is needed if data are to be combined with archive data observed with Hanning smoothing.

1d.2.1

DEFAULT CVEL
outname 'ddo133.b1-h'; outcl 'cvel'; outdi 1;
aparm 0, 111, 1, 0, 1420E6, 405752, 1, 0, 0; $aparm(2)=the reference pixel which can be found in
$the header;aparm(5) and aparm(6)set the Hydrogen
$rest frequency;aparm(3)to choose heliocentric as
$velocity type;aparm(7)=1 for VLA data;
aparm(1)=331e3; $the velocity you want in the central channel
aparm(9)=2; $smooth crosscorrelation spectra by Hanning
sources ''; qual -1; timerang 0; selband -1; selfreq -1;
freqid 1; subarray 0;
flagver 1; $apply the flag table which we created when clipping
doband -1; bpver -1;
gainuse 0;

getn *.SPLIT

1d.2.2. Checks:

***Spectrum is shifted, but there is no change in the header frequency,
so you need to run a few checks.

1d.2.2.1. Has CVEL done anything?

DEFAULT POSSM
docal -1 ;
doband -1;
freqid 1; $ set this to match the calibrator
flagver 1;
aparm 0; $ Plot data
solint 0; $ average all time
nplots 0; $ average all baselines
aparm 0;
aparm(1) 0; $ scalar average
source='DDO133','' $ your galaxy
dotv 1;
tvinit;
grchan 1;

getn *.SPLIT

flagver -1;grchan 2;

getn *.CVEL

***You should see the SPLIT and the CVEL do not overlap perfectly.

1d.2.2.2. CVEL shifts the spectum so some channels, either at the beginning,
either at the end will end up without real, valid information. To
identify those we use POSSM to look at the begining and ending channels.
You will recognize them by having very low values compared with the rest.
The number of these kind of channels depends on how much the spectrum has been shifted.

DEFAULT POSSM
docal -1 ;
doband -1;
freqid 1 ;
flagver -1;
aparm 0; $ Plot data
solint 0; $ average all time
nplots 0; $ average all baselines
aparm 0;
aparm(1) 0; $ scalar average
source='DDO133','' $ your galaxy
bchan 1;echan 20; $ choose the beginning 20 channels to make more obvious
$ the channels with invalid information
dotv 1;
tvinit;

getn *.CVEL


DEFAULT POSSM
docal -1 ;
doband -1;
freqid 1 ;
flagver -1;
aparm 0; $ Plot data
solint 0; $ average all time
nplots 0; $ average all baselines
aparm 0;
aparm(1) 0; $ scalar average
source='DDO133','' $ your galaxy
bchan 210;echan 231; $ choose the last 20 channels to make more obvious
$ the channels with invalid information
dotv 1;
tvinit;

getn *.CVEL

----> The number of beginning channels with invalid information: 2
----> The number of end channels with invalid information: 0

***Note: For the moment we just take a note of these channels. We can get rid of these
channels at a later stage, when we are triming in preparation for DBCON, which requires
all data sets to have the same number of channels. If for any paritcular reason we decide
not to get rid of these invalid channels at that stage, then they should be excluded from
the continuum subtraction.

1d.2.3.1 CVEL will shift and smooth for you, however it will not get you rid of the every
second channel which will be the case in a Hanning smoothed data set in the archive.
To do that we use UVDEC.


DEFAULT UVDEC
chinc 2; $to take every second channel
outn 'D133.B1H';outcl 'UVDEC'
bchan 1;echan 0;

getn *.CVEL

***In UVDEC it is necessary to ensure that among the channels you are taking is the reference pixel.
If before CVEL you had an odd number of channels, then the reference pixel will be in an odd
channel number, so in UVDEC you want to take chnnels 1, 3, 5 etc. (see above).

1d.2.3.2 UVDEC has been found not to update the header properly. The problem is with the ALTRPIX which
should be the same as the REFPIX. You will need to update the header by hand.

inp gethead

getn *.UVDEC

keyword 'ALTRPIX'

gethead


inp puthead
keyval 56,0
inp puthead

puthead

imh $ to check if it worked

***UVDEC is likely to introduce more trouble, it may introduce a phase shift. It will appear in the header as:

AIPS 1: Phase shifted in X 0.000 in Y 1800.000

***Check for it by comparing the headers before and after UVDEC. If after UVDEC you have a phase
shift, then correct for it as follows.

inp gethead

getn *.UVDEC

keyword 'YSHIFT'

gethead


inp puthead
keyval 0
inp puthead

puthead

imh $ to check if it worked


2. Archival data

2a. Spliting the data and applying the calibration and the flags


DEFAULT SPLIT
Sources 'ddo133',''; Qual -1; Calcode ''; Timerang 0;
Stokes ' '; Selband -1; Selfreq -1; Freqid 1; Bif 0; Eif 0; Bchan 1;
Echan 0; Subarray 0; Docalib 1; Gainuse 3; Dopol -1; Blver -1;
Flagver 2; Doband 1; Bpver 1; Smooth 0; Douvcomp -1; Aparm 0; Nchav 1;
Chinc 1; Ichansel 0; Baddisk 0

getn *.LINCOP.1;

2b. Clipping hot pixels

Either check calibration recipe WIPER on source result or run a quick WIPER to select
the CLIP level. DO NOT SMOOTH within WIPER!!!


DEFAULT CLIP
aparm 0;
aparm(1) 6; $clip any parallel hand visibilities amplitude greater than 6Jy;
$the clipping level should be set according to the previous UVPLT
$or WIPER checks

getn *.SPLIT

2c. Applying the flag table created in CLIP

***We need to apply the flag table here as we do not run CVEL on archival data.


DEFAULT SPLIT
Sources 'ddo133',''; Qual -1; Calcode ''; Timerang 0;
Stokes ' '; Selband -1; Selfreq -1; Freqid 1; Bif 0; Eif 0; Bchan 1;
Echan 0; Subarray 0; Docalib -1; Gainuse 3; Dopol -1; Blver -1;
Flagver 1; Doband -1; Bpver 1; Smooth 0; Douvcomp -1; Aparm 0; Nchav 1;
Chinc 1; Ichansel 0; Baddisk 0

getn *.SPLIT.1;

2d. If the data was observed in B1950 coordinates, then precess the data from B1950 to B2000 coordinates.

To correct the u,v,w's to the original (J2000) position:

DEFAULT UVFIX

getn *.SPLIT


To shift the phases and the u,v,w's to the new position:

DEFAULT UVFIX

getn *.UVFIX


4. Repeat 1 or 2 for all the data sets that you have on one particular galaxy


5. Now we glue the three array configurations together in one dataset.

5a. We trim the data sets where necessary to ensure the same number of channels in all
data sets and the same velocity in the central channel. At this stage one might
consider trimming away the channels with invalid information created by CVEL, or
alternatively if one is trimming the archival data to the number of channels of the new data,
it might be more time efficient to trim the beginning or end channels of invalid
information created by CVEL after the glueing stage of DBCON.


DEFAULT UVCOP
outcla 'TRIMCOP';
bchan 4;echan 110; $the decision is taken comparing all imheaders
uvcopprm 0; uvcopprm(4) 1;

getn *.CVEL

5b. Glueing.

***Unfortunately DBCON glues only two data sets at a time.


DEFAULT DBCON
Reweight 0 0; Outname 'Dummy'; Dopos 0; Doarray 0;
Fqtol 0

getn ddo133.D1.CP
get2n ddo133.D2.CP

----> dummy.dbcon

outname 'dummy1'
getn dummy.dbcon
get2n ddo133.C2H.UVDEC

----> dummy1.dbcon

outname 'dummy2'
getn dummy1.dbcon
get2n ddo133.C1H.UVDEC

----> dummy2.dbcon

outname 'dummy3'
getn dummy2.dbcon
get2n ddo133.B3H.UVDEC

----> dummy3.dbcon

outname 'dummy4'
getn dummy3.dbcon
get2n ddo133.B2H.UVDEC

----> dummy4.dbcon

outn 'ddo133.BCD'
getn dummy4.dbcon
get2n ddo133.B1H.UVDEC

----> DDO133.BCD.DBCON


5c. Checks:

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
outname 'ddo133.dirt'; cellsize 1.5; imsize 1024; niter 1000;
uvwtfn 'na'; dotv -1; calcode '-cal';

getn DDO47_BCD.DBCON


***Also inspect the data with TVMOVIE and find which are the line channels.

-----> The line channels are: 35 - 75


6. Continuum subtraction

6a. Subtracting the continuum:

***Before subtracting the continuum make sure that the channels with invalid
information created by CVEL when shifting were trimmed away using UVCOP.
Those channels should not be used in the continuum subtraction. If they were
not removed, their input can be avoided by setting ICHANSEL in UVLSF and AVSPC.

DEFAULT UVLSF
Shift 0 0; Flux 0; Dooutput -1;
Ichansel 1,30,1,0,77,107,1,0;
Order 1; infil ''

getn *.DBCON

6b. Creating the continuum map:

DEFAULT AVSPC
avoption ''; flagver -1;
bif 0;eif 0; channel 0; outcl 'UVCONT';
Ichansel 1,30,1,0,77,107,1,0; $the line free channels

getn *.DBCON

###To make a continuum map, we need a proper cleaning down to a flux level which
depends on how many line free channels we have. A quick and dirty IMAGR is
necessary here to establish the flux level to clean down to.

DEFAULT IMAGR
sources '',''; docalib -1;doband -1;outseq 0;
outname 'continuum'; cellsize 1; imsize 2048; niter 1000;
uvwtfn '';dotv -1; calcode '';robust 0.5;

getn *.UVCONT

-----> Rms noise is: 0.074mJy


DEFAULT IMAGR
sources '',''; docalib -1;doband -1;outseq 0;
outname 'continuum'; cellsize 1;
imsize 1024; $in a complex field one might need 2048
niter 10000;
uvwtfn ''; dotv -1; calcode '';robust 0.5;
flux 0.00015; $it should be set to a 2 sigma level

getn *.UVCONT

6c. Checks
Making a dirty cube of the continuum subtracted data

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
outname 'ddo133'; cellsize 1.5; imsize 1024; niter 1e6;
uvwtfn ''; dotv -1; calcode '-cal';imagrprm(10) 1;
bchan 1; echan 0;robust 0.5;
flux 0.0025; $set this to 3 times the sigma of the B array dirty cube

getn *.UVLSF

***Having a whole dirty cube at this stage will enable you to decide what the
MSCLEAN IMAGR window should be. Use TVWIN to get coordinates of the window
you mark yourself on the TV screen.
***Some close by galaxies might need a 2048 imsize in IMAGR; this necessity will become
obvious when looking at the D array data.
***Inspect the cube and note down the noise level.

-----> In this particular case it was: 0.47 mJy


7. Imaging

7a. Noise TESTS:

We need the rms noise in a line free channel as given by MSCLEAN with no cleaning.
The rms noise is measured by setting a window with TVWIN and than running an IMSTAT.
It is this noise level that we will further use with MSCLEAN.

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
cellsize 1.5; imsize 1024;
uvwtfn ''; dotv -1; calcode '-cal';
robust 0.5;
ngauss 4;wgauss 0,15,45,135;
fgaus 0; $ no fgauss levels are necessary as we are not cleaning
niter 0; $ no cleaning, we just want to quantify the rms noise
nbox 1;
clbox 341.00 348.00 705.00 740.00; $enough to hold all the signal in every channel
$its size should have been decided at step 6c.
bchan 30;echan 35; $select one or more line free channels
outn 'noise';
imagrprm 0;
imagrprm(10) 1; $multiplier of max image size to set beam size
imagrprm(11) 0.2; $the alpha parameter, which steers MSCLEAN towards certain scale components

-----> The rms noise measured in a line free channel is:
Field 1(5asec resolution): 0.45 mJy
Field 2(15 asec resolution):0.58 mjy
Field 3(45 asec resolution):0.59 mJy
Field 4(135 asec resolution):0.81 mJy

7b. Tuning our multi-resolution clean parameters

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
cellsize 1.5; imsize 1024;
uvwtfn ''; dotv -1; calcode '-cal';
robust 0.5;
ngauss 4;wgauss 0,15,45,135;
fgaus 2*0.45e-3 2*0.58e-3 2*0.59e-3 2*0.81e-3 $ fgaus 2sigma in all fields
niter 1e6; $ just to ensure we reach the Fgauss limits
nbox 1
clbox 341.00 348.00 705.00 740.00; $enough to hold all the signal in every channel
$its size should have been decided at step 6c.
bchan 50;echan 55;outn 'test1';
imagrprm 0;
imagrprm(10) 1; $multiplier of max image size to set beam size
imagrprm(11) 0.2; $the alpha parameter, which steers MSCLEAN towards certain scale components


getn DDO133_BCD.UVLSF

-----> Noise level: 0.39 - 0.49 mJy

***Look at the maps, see if there are any indicatives of calibration problems or imaging problems.
***Monitor the AIPS_MSGRV for any warning messeages especiallly ones like:
"SOMETHING IS GOING WRONG. ABANDON CLEAN" or "Clean has begun to diverge. Stopping".
The easiest way is after running IMAGR, run a PRTMSG and write the messages to a text file.

DEFAULT PRTMSG
prtask 'IMAGR' $ the task for which you want the aips messages
prtime 1; $ all IMAGRS younger than 1 day
ouprint '/data6/dvicas/Imagrmsg
docrt -1;

prtmsg $ prtmsg is a verb not a task


7c. If satisfied with the above, then put the whole cube through this imaging recipe.

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
outname 'ddo133'; cellsize 1.5; imsize 1024; $ Some nearby galaxies might need 2048 imsize
uvwtfn ''; dotv -1; calcode '-cal';
robust 0.5;
ngauss 4;wgauss 0,15,45,135;
fgaus 2*0.45e-3 2*0.58e-3 2*0.59e-3 2*0.81e-3 $fgaus 2sigma in all fields
niter 1e6; $just to ensure we reach the Fgauss limits
nbox 1;
clbox 341.00 348.00 705.00 740.00 ;
imagrprm 0;
imagrprm(10) 1; $multiplier of max image size to set beam size
imagrprm(11) 0.2; $the alpha parameter, which steers MSCLEAN towards certain scale components

getn *.UVLSF

***Look at the maps, see if there are any indicatives of calibration problems or imaging problems.
***Monitor the AIPS_MSGRV for any warning messeages especiallly ones like : "SOMETHING IS GOING WRONG.
ABANDON CLEAN" or "Clean has begun to diverge. Stopping". The easiest way is after running IMAGR,
run a PRTMSG and write the messages in a text file.
***Limit your cleaning if your science project allows it to the channels with line emission. In this
sense worry if you see the above mentioned offending messages in line emission channels. Also it
is possible that IMAGR scoops in one field, shoots out the message, gets out of the major cycle,
restores components in all fields and by doing so also corrects the negativity of the problematic field.
In the message file, where you see IMAGR after having given the warning message, return to that same
field it means that MSCLEAN was able to correct itself. The big worry comes in when MSCLEAN stops
cleaning altogether, especially when that happens in a line emission channel.
***Look for instances where cleaning leaves behind a negative bowl, or when you find repeated offending
messages with no indication of MSCLEAN correcting itself.

Computing the noise levels for the natural weigthing setting:

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
cellsize 1.5; imsize 1024;
uvwtfn ''; dotv -1; calcode '-cal';
robust 0.5;
ngauss 4;wgauss 0,15,45,135;
fgaus 0; $ no fgauss levels are necessary as we are not cleaning
niter 0; $no cleaning, we just want to quantify the rms noise
nbox 1;
clbox 341.00 348.00 705.00 740.00; $enough to hold all the signal in every channel
$its size should have been decided at step 6C
bchan 30;echan 35; $select one or more line free channels
outn 'noiseNA';
imagrprm 0;
imagrprm(10) 1; $multiplier of max image size to set beam size
imagrprm(11) 0.2; $the alpha parameter, which steers MSCLEAN towards certain scale components
uvwtfn 'na'

----> The rms noise measured in a line free channel is:
Field 1(5asec resolution): 0.40 mJy
Field 2(15 asec resolution):0.55 mjy
Field 3(45 asec resolution):0.51 mJy
Field 4(135 asec resolution):0.71 mJy

Making a natural weighted data cube:

DEFAULT IMAGR
sources 'ddo133',''; docalib -1;doband -1;outseq 0;
outname 'ddo133NA'; cellsize 1.5; imsize 1024;
uvwtfn ''; dotv -1; calcode '-cal';
robust 0.5;
ngauss 4;wgauss 0,15,45,135;
fgaus 2.5*0.40e-3 2.5*0.55e-3 2.5*0.51e-3 2.5*0.71e-3 $fgaus 2sigma in all fields
niter 1e6; $just to ensure we reach the Fgauss limits
nbox 1;
clbox 341.00 348.00 705.00 740.00 ;
imagrprm 0;
imagrprm(10) 1; $multiplier of max image size to set beam size
imagrprm(11) 0.2; $the alpha parameter, which steers MSCLEAN towards certain scale components
uvwtfn 'NA'; $this will override the robust setting

getn *.UVLSF


8. Convolution and Blanking

8a. Convolution

DEFAULT CONVL
blc 0; trc 0; outname ''; opcode ''; bmaj 25; bmin 25
outclass 'CVL25'

getn *NA.ICL001

***We use the NAtural weighted cube to create the master blanking cube.
***Get the rms in the convolved cube:
-----> 0.44e-3


8b. Blanking

8b.1 Making contour plots to identify the true line from the noise.

DEFAULT KNTR
docont 1; dogrey -1;dovect -1; ny 3; ltype 6; clev 0.001;
levs 2.0, 2.5, 5, 10, 20, 40, 80 ; $the lowest level is at 2-2.5sigma;
docircle -1;
blc 341.00 348.00; $Use the same size as the window in IMAGR.
trc 705.00 740.00 ;

getn *NA.CVL25

To get all interesting channels into PL files:
for i=1 to 7;dotv -1; blc(3)= 25+(i-1)*9;trc(3)=24+i*9;go kntr;wait kntr; end

To print all created PL files
for i=1 to 7; plver =i; print i; go lwpla; wait lwpla; end


***You do KNTR first with the lowest contour at 2 sigma ; if this is 'too busy', run another
KNTR with the lowest contour at 2.5 sigma, or even 3 sigma. Once you have found the best
value for the lowest contour, you run the automatic blanking in b2 with that level and blank
everything below it. That way, the KNTR plots and the BLANKed cube will look absolutely identical.

8b.2 Blank the cube at 2 sigma

DEFAULT BLANK
opcode 'SELC'; dparm 1, 0, 10000, 0.0009, 0;
outclass 'CVL_BL'; trc 0; blc 0; bchan 0; echan 0;

getn *NA.CVL25

8b.3 Blank cube by hand - output is the master cube

DEFAULT BLANK
opcode 'TVCU'; doinvers -1; outclass 'master';
txinc 2; tyinc 2;

getn *NA.CVL_BL

8b.4 Use the master cube to blank the full resolution cube and the robust=0.5 cube

***It blanks the full resolution cube using the MASTER cube as a blanking model.

DEFAULT BLANK
opcode 'IN2C';outclass 'LMV';
DPARM 1,0,1000,-1000,0 ;

getn *NA.ICL001 $the full resolution cube, the one created at step 7b
get2n *.MASTER

DEFAULT BLANK
opcode 'IN2C';outclass 'LMV';
DPARM 1,0,1000,-1000,0;

getn *R.ICL001 $the full resolution cube, the one created at step 7B
get2n *.MASTER


9. ON THE ROBUST CUBE

9.1 Transposing the cube

DEFAULT TRANS
outclass ''; blc 0; trc 0; transcod '312';

getn *.LMV

9.2 Switching the header from frequency description to spectral-line velocity description

getn *. TRANS
ALTSWCH

9.3 Moment maps

DEFAULT XMOM
flux -10000; icut -10000; blc 0; trc 0;

getn *.TRANS


9.4 Primary Beam Corrections

***Corrects an image for the primary beam attenuation of the 25-meter antennas used at the VLA.
***Needs the FREQ axis rather than the velocity one.

DEFAULT PBCOR
doinvers -1; coord 0; bparm 0; outclass 'X0_PBC';

getn *.XMOM0
altsw

----->
altsw
getn *X0_PBC
altsw


9.5 Replacing blanks with 0

DEFAULT REMAG
pixval 0; blc 0; trc 0; outclass 'X0_P_R';

getn *.X0_PBC


10. ON THE NATURAL CUBE

10.1 Transposing the cube

DEFAULT TRANS
outclass ''; blc 0; trc 0; transcod '312';


10.2 Switching the header from frequency description to spectral-line velocity description

getn *. TRANS
ALTSWCH

10.3 Moment maps

DEFAULT XMOM
flux -10000; icut -10000; blc 0; trc 0;

getn *.TRANS


10.4 Primary Beam Corrections

***Corrects an image for the primary beam attenuation of the 25-meter antennas used at the VLA.
***Needs the FREQ axis rather than the velocity one.

DEFAULT PBCOR
doinvers -1; coord 0; bparm 0; outclass 'X0_PBC';

getn *XMOM0
altsw

----->
altsw
getn *X0_PBC
altsw


10.5 Replacing blanks with 0

DEFAULT REMAG
pixval 0; blc 0; trc 0; outclass 'X0_P_R';

getn *.X0_PBC


11. Convolutions

***If the beam size allows, it is better to produce the convolved cube from the
natural weighted cube, which has a better signal to noise, rather than the robust cube.


DEFAULT CONVL
bmaj 10; bmin 10; blc 0; trc 0; opcode '';
outna 'D133CVL10'; outclass ''; doblank 0; factor 0; outse 0;

getn *NA.ICL001


DEFAULT BLANK
opcode 'IN2C';outclass 'LMV';
DPARM 1,0,1000,-1000,0;

getn *.CONVL
get2n *.MASTER


ON THE CONVOLVED CUBE

11.1 Transposing the cube

DEFAULT TRANS
outclass ''; blc 0; trc 0; transcod '312'


11.2 Switching the header from frequency description to spectral-line velocity description

getn *. TRANS
ALTSWCH

11.3 Moment maps

DEFAULT XMOM
flux -10000; icut -10000; blc 0; trc 0;

getn *.TRANS


11.4 Primary Beam Corrections

***Corrects an image for the primary beam attenuation of the 25-meter antennas used at the VLA.
Needs FREQ axis rather than velocity.

DEFAULT PBCOR
doinvers -1; coord 0; bparm 0; outclass 'X0_PBC'

getn *.XMOM0
altsw

----->
altsw
getn *X0_PBC*
altsw


11.5 Replacing blanks with 0

DEFAULT REMAG
pixval 0; blc 0; trc 0; outclass 'X0_P_R';

getn *.X0_PBC