1st BIMA AIPS++ TUTORIAL WORKSHOP: THE MULTI-SCALE CLEAN ALGORITHM Friday April 13 3:30 pm - demonstration in classroom 4:00 pm - 5:30 pm - hands-on session in terminal room Lai Aip++ Users & Help Group - Lanie Dickel, Ray Plante, Dave Mehringer, Dave Fong, Anuj Sarma [Editor's Note: This document was used as a hard copy hand-out during a tutorial conducted at the University of Illinois Urbana-Champaign (UIUC) Astronomy department. See AIPS++ Note 245 for more information about this tutorial.] These notes are adapted from chapters of the BIMA Aips++ Cookbook - in preparation. Your comments are appreciated. (Tested against Version 1.5 build 284.) .......................................................................... OUTLINE OF SESSION GETTING STARTED Q.1 What do I need to do before starting this tutorial? Q.2 What Web resources are available re AIPS++? Q.3 How do I login and launch AIPS++? Q.3.1 What are these windows that appear when I start AIPS++? Q.4 How do I exit from AIPS++? Q.4.1 Something's gone wrong! How can I a force an exit? Q.5 How do I start the scripter? MY FIRST TOOL: ms Q.6 How do I import my visibility data from FITS into AIPS++? Q.6.1 How do I create a tool? Q.6.2 What is that wrench thingy? Q.6.3 How do I use a tool function? Q.6.4 How do I get help on a tool? Q.6.5 How do I get rid of a tool? Q.6.6 How do I do the same thing in Glish? Q.7 How do I import my visibility data from Miriad format into AIPS++? IMAGING WITH THE imager TOOL Q.8 What is the quickest way to make a dirty map? Q.8.1 What's a "function group?" Q.8.2 I'm not sure what imaging parameters to use (e.g. cellsize); is there any easy way to figure this out? Q.8.3 How do I make a "dirty beam"? Q.9 How do I look at my image? Q.9.1 How do I load an image into the Viewer? Q.9.2 How do I select a particular frame in a cube? Q.9.3 How do I zoom the image? Q.9.4 How do I fiddle the colors (i.e. adjust the mapping of colors to intensities)? Q.9.5 How do I change the color palette? Q.10 How do I measure image statistics like noise? Q.10.1 How do I restrict the statistics to a region? Q.11 How do I apply a weighting other than natural? Q.12 How do I run a basic Clark clean on my image? Q.12.1 How do I restart a clean? Q.12.2 Do I have to run the restor function to get my final restored image? Isn't the restored image from imager's clean good enough? Q.13 How do I do a multi-scale clean? .................................................................. ======================= GETTING STARTED ======================= ------------------------------------------------------------- | Q.1 What do I need to do before starting this tutorial? | ------------------------------------------------------------- If you signed up as a "data-provider", here is a check-list of things to do: 1. Prepare your work area on disk. It will help if you can prepare a work space on a disk that is directly mounted on the machine you are planning to use. We recommend that you free up space equal to at least 7 times the size of your original Miriad dataset (4 times, if you are starting with a FITS file). 2. Copy a default ".aipsrc" file to your home directory. To do this, type: cp /appl/aips++/msclean_tutorial/.aipsrc ~ 3. Convert your data to FITS. NOTE: this is different from what we told you at the last BIMA meeting. Because of some ongoing work on the Miriad filler and AIPS++, we plan to import your data from FITS. Remember, smaller datasets will be faster and easier to deal with in the limited time we have. Restrict your data to one or two calibrated tracks, a single field, with one spectral window. Use the Miriad tasks, uvcat and fits, to prepare your data. For example, suppose you have two tracks of BIMA data in which your strongest line is in window 5, stored in datasets called orion.c and orion.b. Here's how you might convert them to FITS: uvcat vis=orion.c,orion.b "select=win(5)" options=nowide out=orion.all fits in=orion.all op=uvout out=orion.fits 4. Re-familiarize yourself with your data. o recall which channels have the brightest emission. (Importing data into AIPS++ from FITS does not properly handle rest-frequencies; thus, you'll need to specify channels when imaging the data.) o If you have a hardcopy figure showing the image you made with MIRIAD, bring it along for comparison. o Bring any other notes (e.g. noise measurements) you might find helpful in analyzing the multi-scale clean results. That should put us at a good starting point. If you have any questions or would like some help getting prepared, feel free to contact us; one of us can come by to help you out. ------------------------------------------------------ | Q.2 What Web resources are available for AIPS++? | ------------------------------------------------------ For the curious... A Gentle Introduction to AIPS++ This is the online version of the AIPS++ Tutorials given during the BIMA meetings. You won't learn how to use AIPS++, but you'll get an idea of what it's like. (http://monet.astro.uiuc.edu/aips++/gentle/) A good first step... Processing BIMA Data with AIPS++ This contains the local information needed for setting up your account and gives pointers to other useful documentation. It can be reached from the LAI Web Site under "Software and Support" or directly via http://monet.astro.uiuc.edu/aips++/forBIMA/. These are the core documents for learning to use AIPS++. They are available from the AIPS++ home page (http://aips2.nrao.edu/). Getting Started in AIPS++ An introduction to using AIPS++ for the newcomer Getting Results with AIPS++ Tutorials and cookbooks on specific topics. A good example Chapter 2. on "Using the AIPS++ Viewer". AIPS++ User Reference Manual The document to go for details on how to use a specific tool or function. --------------------------------------------- | Q.3 How do I login and launch AIPS++? | --------------------------------------------- 1. Exit any web browser It is wise to remove any browser before running AIPS++, so that the color map of any viewer will not get screwed up. You may relaunch the browser again after AIPS++ is running. 2. Use ssh to log in to the machine you will be processing on. Tip: If you don't use ssh, you will have set your DISPLAY environment variable to the machine you are sitting in front of. 3. Load the AIPS++ environment by typing: source ~aips2mgr/blessed/aipsinit.csh Tip: You can put this in your .cshrc file to automatically load the environment each time you log in. 4. Start AIPS++ by typing: aips++ ------------------------------------------------------------------- | Q.3.1 What are these windows that appear when I start AIPS++? | ------------------------------------------------------------------- | This command does three things: | | | | o starts Glish (the command line interface) in the window you | | typed "aips++" into. | | | | o opens a Logger window where messages are displayed | | | | o opens the Tool Manager GUI, used for creating and using | | tools graphically. | ------------------------------------------------------------------- aips++ will take about a minute to completely finish starting; it is completely started when you get a "-" prompt in the command line interface (Glish window). ------------------------------------ | Q.4 How do I exit from AIPS++? | ------------------------------------ Like most things in AIPS++, there are two ways: o In the command line interface (Glish window), type after the "-" prompt: exit and hit return OR o From the Tool Manager GUI, select "File=>Exit AIPS++". Tip: In other words, pull down the File menu at the upper left corner of the Tool Manager, and select the red "Exit AIPS++" entry. A small window will pop up with "Exiting Aips++.. Are you sure?" To exit, click on the "Yes" button. If you do not answer or you click on "No", AIPS++ will not exit. ------------------------------------------------------------------- | Q.4.1 Something's gone wrong! How can I a force an exit? | ------------------------------------------------------------------- | If exiting normally does not work, you can always type a | | Control-c in the Glish window. Glish will ask you, | | "exit glish (y/n)?" Answer yes by typing "y". Save this | | technique for emergencies. | ------------------------------------------------------------------- ------------------------------------- | Q.5 How do I start the scripter? | ------------------------------------- The Tool Manager is just graphical front-end to Glish--that is, it types in the Glish commands for you. The scripter provides a way to record those commands to a file. This is a good time to start it. To start the scripter, select from the Tool Manager menu, "Options=>Copy commands to scripter". Tip: In other words, pull down the Options menu at the upper left corner of the Tool Manager, and select the first entry, "Copy commands to scripter". To display the scripter, select "Options=>Show scripter" ======================= MY FIRST TOOL: ms ======================= ------------------------------------------------------------------- | Q.6 How do I import my visibility data from FITS into AIPS++? | ------------------------------------------------------------------- Visibility data are stored in a general purpose dataset called a Measurement Set. Thus, to import uv-data into AIPS++ is convert it into a Measurement Set. We will use this process to demonstrate the basics of creating and using tools. 1. Create an ms tool via the fitstoms constructor. ----------------------------------- | Q.6.1 How do I create a tool? | ----------------------------------- The Tool Manager Window is used to create tools. Tools and global functions are organized first by "Packages" and then by "Modules", as illustrated by the graphical lists that make up the Tool Manager. The ms tool can be used to import data from FITS format. To create an ms tool: o select Packages=>general, Modules=>ms, Tools=> ms. Tip: In other words, under the Packages list, click on "general". This will cause all the modules in that package to appear in the Modules list. Next, under the Modules list, click on "ms"; this will display all the tools in the ms module under the Tools list. Finally, click on "ms" under the Tools list. hit "Create" (the green button below the Tools list). The Tool Manager will now morph into a GUI for constructing an ms tool. (We'll refer to these different interfaces within the Tool Manager as "views.") The list on the left shows 3 different constructor functions for creating an ms tool. o select "fitstoms" in the constructor list. The GUI will now morph again to show the parameters for this function on the right. o Enter the necessary constructor parameters: Constructor parameters ---------------------- toolname = myms (or whatever you would like to call the tool) msfile = cloud.ms (or whatever filename you would like to give to the new measurement set written to disk) fitsfile = /appl/aips++/msclean_tutorial/msctest.uv.fits (or name of your own FITS dataset) Tip: In other words, for each parameter listed above ("toolname", "msfile", and "fitsfile"), enter the appropriate value in the white field. You can use the defaults for all other parameters. Notice that some parameters ("readonly" and "lock") are menus you can select set values from. ------------------------------------------------------------------ | Q.6.1 What is that wrench thingy? | ------------------------------------------------------------------ | It's called the "spanner". (Don't ask me why.) When pressed, | | it provides a menu of items that provide extra help for | | setting and examining entries. This includes cut and paste, | | default values, and special context-specific gizmos. | | | | If you are loading in your own data from the current directory,| | try selecting "From catalog" from the spanner next to the | | "fitsfile" entry. Go ahead, try it. A window displaying a | | catalog of contents of your directory will appear. Now select | | your FITS file, then click on the "Send&dismiss" button (just | | above and to the right of the file list). The window will | | disappear, and you will see your selection inserted into the | | "fitsfile" parameter entry. | | | | The gizmos that appear in the spanner will differ depending on | | the type on parameter needed. For example, there are special | | windows for selecting antennas or spectral windows. It's a | | good idea to take a peek at that menu now and again to see | | what helpful goodies might be there. | ------------------------------------------------------------------ o Hit the "Create" button You'll see some messages appear in the logger as your dataset is opened. A progress meter may pop up, too. When the constructor is finished, the tool manager will morph again to show the tool function interface. Your data has now been converted to an AIPS++ measurement set. -------------------------------------------------------------------- | Q.6.3 How do I use a tool function? | -------------------------------------------------------------------- | Executing a tool function is just like executing a constructor. | | The left hand list shows the available functions for that tool; | | when you select a function, the parameters will appear on the | | right. After entering the parameters, just hit the "Go" button.| | | | Tip: If the parameter entry has a "Do Not Enter" icon to the | | right of it, you will not be able to enter anything into | | it. These represent output parameters--that is, a value | | will be filled in after the function is run. As an | | example, try running the ms tool's "summary" function, | | and see what happens to the "header" parameter. (Hint: | | also look at what gets written to the logger.) | -------------------------------------------------------------------- -------------------------------------------------------------------- | Q.6.4 How do I get help on a tool | -------------------------------------------------------------------- | From the GUI, there are generally three ways: | | | | o Tool tips: You may notice that when your mouse moves over | | certain buttons or text entries a small window may pop up | | giving a clue as to what the widget is for. | | | | Tip: If the tool tip message ends with "...", try clicking | | the right mouse button over the widget. A longer message| | will appear. | | | | o The Help Menu: Located in the upper right hand corner of most | | windows, this menu can display various kinds of helpful info. | | When you select "Reference Manual", AIPS++ will attempt to | | drive your Web browser to the on-line version of the Reference | | manual. Sometimes this menu will let you go directly to the | | relevent section of the manual. | | | | Tip: Depending on how you logged in, AIPS++ is sometimes | | unable to drive your browser. Fortunately, it will | | print the URL to the logger; you drive your browser | | yourself by just selecting and pasting the URL from | | there. | | | | o The "function help" button: Clicking this button will cause | | your browser to jump directly to the page in the Reference | | Manual that describes the current function. | -------------------------------------------------------------------- This might be a good time to explore those buttons along the top of the Tool Manager. Go ahead and press on them. When you are done, press the button labeled "ms:myms". 2. Shut down the ms tool. We're finished with the ms tool, so we can get rid of it. --------------------------------------- | Q.6.5 How do I get rid of a tool? | --------------------------------------- You can shut down a tool from its function view (where the functions appear in a list on the right; if you do not see this, press the "ms:myms" button along the top of the Tool Manager). Now press the "Done" button at the bottom, right hand corner of the window. The Tool Manager will morph back into its tool selection view. The "ms:myms" button is now gone. Note that the "Dismiss" button does not shut down the tool. It simply returns to the tool selection view. The "ms:myms" button would remain. ---------------------------------------------------------------------- | Q.6.6 How do I do the same thing in Glish? | ---------------------------------------------------------------------- | Just look at the scripter window. You'll see exactly what was | | run. | | | | Note that AIPS++ will usually write Glish commands to the | | scripter in their most verbose form. Here's a more compact form: | | | | include 'ms.g' | | myms := fitstoms("cloud.ms", "msctest.uv.fits") | | myms.done() | | | | Parameters left to their default values do not have to be | | included. Plus, if you give the parameter values in the order | | that they appear in the GUI (or the documentation), you don't | | have to give the parameter names. | ---------------------------------------------------------------------- -------------------------------------------------------------------- | Q.7 How do I import my visibility data from a Miriad visibility | | dataset into AIPS++? | -------------------------------------------------------------------- 1. Create a mirfiller tool: o select Packages=>bima, Modules=>mirfiller, Tools=>mirfiller. o run the mirfiller constructor with the following parameters: Constructor parameters ---------------------- toolname = myfiller mirfile = msctest.uv (or name of your own Miriad dataset) 2. create the output measurement set using the "fill" function and the following parameters: fill parameters ---------------------- msfile = cloud.ms (or whatever filename you want to give it) 3. Shut down the mirfiller tool by clicking the "Done" button. Here's how you would do the same thing in Glish: include 'mirfiller.g' myfiller := mirfiller('msctest.uv') myfiller.fill('cloud.ms') myfiller.done() ================================= IMAGING WITH THE imager TOOL ================================= ------------------------------------------------------- | Q.8 What is the quickest way to make a dirty map? | ------------------------------------------------------- Image formation and deconvolution are done using the imager tool. To create a dirty image use the following four functions: 1. constructor -- to create the imager tool. 2. setdata -- selects what data should be drawn from the measurement set to create the output image. 3. setimage -- sets the image formation parameters 4. makeimage -- creates the dirty image Now let's look at each step in detail. 1. Create an imager tool o From the Tool Manager, select Packages=>synthesis, Modules=>imager, Tools=>imager; hit the "Create" button. o Select the "imager" constructor, fill in the following parameters: Constructor parameters ---------------------- toolname = myimager filename = cloud.ms (or whatever your measurement set is called). Hit "Create". Tip: When you load a measurement set into imager for the first time, the constructor will take longer to finish. This is because imager must add some initial data used for imaging and deconvolution to the dataset. --------------------------------------- | Q.8.1 What's a "function group?" | --------------------------------------- A function group is a group of related functions that are part of the same tool. Some tools, like imager, have so many functions that they become hard to keep track of; in particular, the tool's function list in the tool manager gets extra long. To make it easier to find a particular function, the functions are divided into groups. The "Function group" widget is actually a menu that allows you to list the functions of the different groups seperately. The next function we need is part of the "setup" function group. Select "setup" from the function group menu, and the list will be updated to show 5 setup functions. Click on "setdata". 2. Run setdata to select the input data. This function controls which data from the input dataset will be available for imaging. In particular, one can set which spectral channels will be read. Note however, that selecting data here does not guarantee that it will be imaged, only what will be read in. How the input data is mapped to channels in the output image is controlled by the setimage function. By default, all data (from the first spectral window) will be selected; thus, in our case (where we only have one spectral window), it's not necessary to run this function. However, if you are only imaging a portion of the channels, it's helpful to set them here: it will make reading the input data faster. For the test dataset, we'll read in a range of channels from the middle of the spectral window: setdata parameters ---------------------- mode = channel (choose "channel" from the mode pull-down menu) nchan = 10 start = 58 step = 1 Note that "mstart" and "mstep", used for selecting channels by velocity, are ignored when mode="channel". Tip: channel number in AIPS++ is a bit different from that in Miriad. In a Miriad dataset, a single numbering system is used for all channels, regardless of spectral window (thus, there is only one channel number 1). In AIPS++, each window is numbered independently (thus, each window starts with channel 1). Hit "Go". 3. Set the imaging parameters using setimage. This function controls how the image will be constructed, including image size, cell size, image center, etc. For our test data, run setimage with following parameters: setimage parameters ---------------------- nx = 128 (image size) nx = 128 cellx = 1 (pixel size) celly = 1 stokes = I mode = channel (these set the channels that will appear nchan = 10 in the output image.) start = 58 step = 1 Hit "Go". ----------------------------------------------------------------------- | Q.8.2 I'm not sure what imaging parameters to use (e.g. cellsize); | | is there any easy way to figure this out? | ----------------------------------------------------------------------- | Yes, actually--using the advise function, which is found in the | | "helpers" function group. (So use the Function group pull down | | menu to select "helpers" and access the advise function.) | | | | Select the advise function and set the parameters: | | | | advise parameters | | ---------------------- | | takeadvice = False | | fieldofview = 2 arcmin (for BIMA 3mm band data) | | | | Hit "Go". | | | | Your data will be analyzed to determine good values for the image | | size, cell size, number of facets, and phasecenter. These will be | | filled in as output parameters. They will also be written to the | | logger, along with other useful information (e.g. uvrange). | | | | Tip: setting takeadvice=True will cause your imager tool to use | | the recommended values as if you set them yourself using | | setimage. Even if you take the advice, it's nevertheless | | important to run setimage before hand to set the output | | channels. | ----------------------------------------------------------------------- 4. Run makeimage to actually create the dirty image. o choose the makeimage function from the "image" function group. o enter the following parameters: setimage parameters ---------------------- type = corrected (the default) image = cloud.dim (the output image filename) Leave "compleximage" blank. o Hit "Go". ----------------------------------------------------------------------- | Q.8.3 How do I make a "dirty beam"? | ----------------------------------------------------------------------- | makeimage can make a dirty beam as well. Just choose "psf" (as in | | "point-spread function") instead of corrected. | ----------------------------------------------------------------------- ------------------------------------ | Q.9 How do I look at my image? | ------------------------------------ Image can be displayed using the viewer tool. --------------------------------------------------- | Q.9.1 How do I load an image into the Viewer? | --------------------------------------------------- We could create a viewer tool using the Tool Manager in the same way we created out imager and ms tools; however, AIPS++ provides several short-cuts for viewing images. Here are two: o If the Tool Manager still shows the makeimage parameters, pull down spanner menu (the widget with the wrench icon) to the right side of the 'image' input field. Select 'view'. This will load the image given in the field into an image viewer. o Bring up a catalog window. One way to do this is to type 'dc.gui()' at the Glish prompt. Select the image, cloud.dim, in the catalog list. (If you don't see the image name, try hitting the "Refresh" button.) Now click the "View" button, located near the top right corner of the catalog window. Your viewer will appear with the selected image loaded in. -------------------------------------------------------- | Q.9.2 How do I select a particular frame in a cube? | -------------------------------------------------------- If your image is a cube, then you can access different image channels in one of two ways: o Use the animation buttons to the right of the image display to step through the frames sequentially. The channel currently being displayed is shown just below these buttons in the widget with the white background. The number below that gives the total number of channels in the cube. o To jump to a specific channel, edit the number in the current channel widget (with the white background) and hit Return. ----------------------------------------------------------------------- | Q.9.3 How do I zoom the image? | ----------------------------------------------------------------------- | First, you need to create a box to zoom to. To do this: | | | | 1. Find the Zooming button near the top, left hand corner of the | | viewer window; it shows a magnifying glass with a '+' in it. | | Click it with the left mouse button. | | | | 2. Move the mouse to the upper left corner of your region of | | interest. Press and hold down the left mouse button and drag | | the mouse to the bottom right corner of the region. | | | | Now you are ready to zoom. Double-click inside the box to zoom to | | that region. | | | | Tip: to unzoom, hit the "Unzoom" button below the display area. | | | | Tip: Step 1 actually assigned the zooming function to the left | | mouse button. The 3 tiny boxes below the magnifying glass | | show the current assignment. If you had clicked with the | | right mouse button, the right-most box would be darkened, | | indicating that you should use the right mouse button to | | draw the box. | | | | Tip: Before double-clicking inside the box, you move the box | | around. Just click and hold the mouse button inside the box | | to grab it and drag it around. To resize it, "grab" one of | | the corners of the box. | ----------------------------------------------------------------------- ----------------------------------------------------------------------- | Q.9.4 How do I fiddle the colors (i.e. adjust the mapping of | | colors to intensities)? | ----------------------------------------------------------------------- | 1. Find the colormap fiddling button on the left-hand side of the | | viewer window; it's the one with the crossed arrows on it. | | Click it with the middle mouse button. | | | | 2. Move the cursor inside the image. With the middle mouse button | | held down, drag the cursor around to adjust the color | | distribution. | | | | Tip: This is often called "fiddling the transfer function". It | | controls the mapping of intensities to colors in the palette. | | The vertical direction controls the slope of that mapping, | | while the horizontal direction controls the intensity offset | ----------------------------------------------------------------------- ----------------------------------------------------------------------- | Q.9.5 How do I change the color palette? | ----------------------------------------------------------------------- | 1. Click the Adjust button near the bottom of the window. A new | | window for adjusting the display will appear. | | | | 2. In the "Basic Settings" panel, the last input item is "Colormap".| | To the right of it is a pull-down menu which gives you the | | possible palette choices. Select your favorite! | | | | Tip: Hitting the "Cancel" button at the bottom of the window will | | dismiss the Adjust window. | ----------------------------------------------------------------------- ----------------------------------------------------------------------- | Q.10 How do I measure image statistics like noise? | ----------------------------------------------------------------------- It's useful to know the random noise level in your image before cleaning. You can calculate this directly using the viewer via its Statistics panel. Before we try this, you might switch to an image channel that is signal free. For the test dataset, this is the first channel (see Q.9.2 above to switch channels.) Open the "Statistics" panel by clicking on the triangle icon next to the "Statistics" label. Click the "Plane" button to calculate the statistics for the currently displayed channel. The text fields, including "Rms", within the panel will be filled in. ----------------------------------------------------------------------- | Q.10.1 How do I restrict the statistics to a region? | ----------------------------------------------------------------------- | First you need to create a region. | | | | 1. Find the Rectangle region button on the left-hand side of the | | viewer window; it's the one with the 'R' inside a box. | | Click it with the right mouse button. | | | | 2. Move the mouse to the upper left corner of your region of | | interest. Press and hold down the right mouse button and drag | | the mouse to the bottom right corner of the region. | | | | 3. Double-click with the right mouse button to update the | | statistics based only on that region. | | | | Tip: See Q.9.3 above for tips on moving and resizing boxes. | ----------------------------------------------------------------------- ----------------------------------------------------------------------- | Q.11 How do I apply a weighting other than natural? | ----------------------------------------------------------------------- | The default weighting scheme is natural weighting (every visibility | | has the same weight, i.e. 1). To apply a different weighting, you | | must run the weight function before makeimage (or any deconvolution | | function) but after setimage. This function can be found in the | | "weighting" function group. | | | | The weight function actually writes the data directly into | | measurement set. Thus, if you set it once, it not necessary to run | | it again, even if your shut down the imager tool and start it up | | again. | ----------------------------------------------------------------------- -------------------------------------------------------- | Q.12 How do I run a basic Clark clean on my image? | -------------------------------------------------------- Unlike Miriad, where the invert task must be used to make a dirty map and beam prior to deconvolution, in AIPS++, you can CLEAN directly from your visibility data. (You may still want to see a dirty image first.) Tip: Often it's useful to try cleaning a single channel first to make sure the various parameters are set the way you really want them. With our demo dataset, we can rerun setimage, changing the following parameters: nchan = 1 start = 66 Now, To clean the data: 1. select the clean function from the "image" function group. 2. set up the parameters for clean. For the test dataset, use: clean parameters ---------------- algorithm = Clark niter = 1000 gain = 0.1 (default iteration loop gain) threshold = 0.5 (about 2.5 times sigma) displayprogress = True (see Tip below) model = cloud.clark.mod (name of output model image; like a Miriad model) image = cloud.clark.restored residual = cloud.clark.residual The rest can be left as defaults. 3. hit "Go" Tip: Setting displayprogress=True provides a nifty way to monitor how well the clean is doing. It will cause a PGPlotter window to appear that will plot as a function of iteration, the peak positive residual, the peak negative residual, and the total cleaned flux. ----------------------------------------------------------------------- | Q.12.1 How do I restart a clean? | ----------------------------------------------------------------------- | Just rerun clean; however, be sure to use the same name for the | | model. The model collected from the previous run will be subtracted| | from the data before continuing on. (see Degree) | ----------------------------------------------------------------------- ----------------------------------------------------------------------- | Q.12.2 Do I have to run the restor function to get my final | | restored image? Isn't the restored image from imager's | | clean good enough? | ----------------------------------------------------------------------- | Often the "restored" image from imager is good enough. It's fine | | for use if: | | o you are not interested in anything but the inner quarter | | (or the region you cleaned). | | | | The dirty flux was only subtracted from the clean regions of | | the image; thus you will notice the box boundaries in the | | restored image returned by clean. | | | | o the restored image is not the result of a restarted clean | | | | The restored image from clean will not contain the portion of | | model from the previous run. | | | | In contrast, the restored image returned by restore does not have | | these defects. restore will transform the model and save it to | | the measurement set, at which point it is subtracted from the data | | to create a fully correct residual image. The model image, | | convolved with a clean beam, is then added to this residual to get | | the restored image. | | | | To get the better restored image, run the restor function (in the | | with the "image" function group) with the following parameters: | | | | restor parameters | | ----------------- | | model = cloud.clark.model | | image = cloud.clark.restored | | residual = cloud.clark.residual | | | | This will replace the restored and residual images with more | | accurate versions. | ----------------------------------------------------------------------- ------------------------------------------- | Q.13 How do I do a multi-scale clean? | ------------------------------------------- Finally, we're here. Before we run anything, let's review how the multi-scale algorithm works. The goal of this algorithm is to create a model of the image not based on delta functions alone, as with traditional CLEAN algorithms, but on components of a variety of shapes and sizes. Currently, only a single shape is used: an inverted paraboloid. Here's how it works: o Multiple dirty beams are created by convolving the point spread function with paraboloids of a range of scale sizes. o In each iteration, components are searched for with each of the beams simultaneously. o The components for the different scale sizes are compared, the one that can remove the most flux is subtracted from the residual image. o The component subtracted from the residual is added to the model image as a paraboloid of the correct size. Tip: For a more detailed description, see the section on deconvolvers in the Reference manual. Just type at the Glish prompt: help('general.deconvolver.deconvolver.clean'); web() The parameters we set previously with setdata and setimage are still good for multi-scale cleaning, all we need to do now is run the following functions: 1. setscales 2. clean Now let's look at those in detail: 1. Set the scale sizes to use via the setscales function. Run setscales with the following parameters: setscales parameters ---------------------------- scalemethod = nscales nscales = 5 (the default) This will use 5 scales to be used with a power-law distribution between 0 pixels and the size of the largest imagable scale. Tip: You can exactly specify the scales to use by selecting scalemethod=uservector and then listing the exact sizes in the uservector parameter. 2. Run clean using the multi-scale algorithm. The clean parameters are the same as in Q.12, step 2, except you should change the algorithm and gain factor: algorithm = multiscale gain = 0.5 Tip: Because you can accurately model more extended flux with big paraboloids than delta functions, you can use a bigger gain factor, usually between 0.5 and 1. Tip: If you still have displayprogress=True, then you will see the cleaning statistics plotted for each scale simultaneously. Now try loading the restored image into a viewer and compare with your regular Clark-CLEANed image.