Protoplanetary Disk Simulation (CASA 3.4)
- This guide is applicable to CASA version 3.4. For older versions of CASA see PPdisk_simdata_(CASA_3.3).
- To create a script of the Python code on this page see Extracting scripts from these tutorials.
Script with Explanation
Set simobserve as the current task and reset all parameters.
# In CASA default("simobserve")
Review the image coordinate system using task imhead.
# This reports image header parameters in the Log Messages window imhead("input50pc_672GHz.fits")
We now us the ia (image analysis) and qa (units and quantities) tools from the CASA Toolkit to find the image center. In comparison to tasks, tools are a more advanced way of manipulating data in CASA. You can learn more about tools using the tool reference manual.
When data are being manipulated with tools the data file must be explicitly opened and closed.
# In CASA ia.open("input50pc_672GHz.fits")
Next, get the right ascension and declination of the image center. We get the number of pixels along each axis using ia.shape. Then, we get the RA and Dec values for the center pixel using ia.toworld.
# In CASA axesLength = ia.shape() # Divide the first two elements of axesLength by 2. center_pixel = [ x / 2.0 for x in axesLength[:2] ] # Feed center_pixel to ia.toworld and and save the RA and Dec to ra_radians and dec_radians (ra_radians, dec_radians) = ia.toworld( center_pixel )['numeric'][:2] ia.close()
Use the qa tool to convert the image center from radians to sexagesimal coordinates.
ra_hms = qa.formxxx(str(ra_radians)+"rad",format='hms',prec=5) dec_dms = qa.formxxx(str(dec_radians)+"rad",format='dms',prec=5)
Brightness scale can be viewed with 'imstat' task
# Default parameters are adequate for this imstat("input50pc_672GHz.fits") # ... # 'max': array([ 6.52469971e-05]), # ... # that's 0.0652 mJy/pixel.
Let's call our project psim2
default("simobserve") # This defines the root prefix for any output files from simobserve project = "psim2"
We'll leave the sky model the way it is: simobserve will create psim2.skymodel CASA image since this model is a fits file, and most but not all of CASA routines can operate directly on fits
skymodel = "input50pc_672GHz.fits"
We need to decide where to point the telescope. The image is 2/3 arcsec in size, so we only need one pointing. We could put that in a text file ourself, or let simobserve create the ascii pointing file for us.
setpointings = True direction = "J2000 18h00m00.031s -22d59m59.6s" mapsize = "0.76arcsec"
The default pointingspacing is fine: we'll only fit one pointing in the small mapsize the default calculation maptype hexagonal is ok too since only one will fit anyway.
We do want to calculate visibilities in a measurement set: let's do a 20 min snapshot observation using the "out20" ALMA antenna configuration:
obsmode = "int" totaltime = "1200s"
Use appropriate antenna configurations based on desired angular resolution (configuration 20 - alma.out20.cfg in this case - is the largest "compact" configuration)
antennalist = "alma.out20.cfg" simobserve()
Deconvolve the visibilities back into an image
default ("simanalyze") project = "psim2" image = True # Prior image to use in clean modelimage = "input50pc_672GHz.fits" vis = project+".alma.out20.ms" imsize = [192, 192]
Specify number of iteration of cleaning task with proper threshold and weighting
niter = 10000 threshold = "1e-7Jy" weighting = "natural"
We'd like to calculate a difference and fidelity image, and see some diagnostics:
analyze = True
And see the array but not the UV coverage:
showuv = False showresidual = True showconvolved = True
Plot both to the screen and the png files with lots of messages:
graphics = "both" verbose = True overwrite = True
# This commands CASA to execute simanalyze simanalyze()
- Output results:
Last checked on CASA Version 3.4.0.