#-------------CASA_simExample.py ---------------------------------# # A quick simulation using simobserve/analyze. For more ----------# # instruction on simobserve/analyze. See casaguides.nrao.edu -----# # or type help(simobserve)/help(simanalyze) in CASA --------------# #---------------------------------written-by-Adam Avison----------# #-----------------------------------------------------------------# #-To run this file type execfile('CASA_simExample.py') in casa----# #-ensure you are in the same directory as CASA_simExample.py------# #-and the example simInput.fits file -----------------------------# #-----------------------------------------------------------------# #-- task switches --# do_simobserve=True do_simanalyze=True #-------------------# name_project='CASA_sim' if(do_simobserve): default(simobserve) #clears any set simobserve parameters print ">>> sim observe underway!\n" project=name_project #This prefixes all your simdata files for the current simulation #---------------- Setup the Sky --------------------------------# # Here you input an image i.e a FITS file. You can then rescale # # the brightness, change the source sky position, redefine the # # pixel size, change the frequency and channel width. This acts # # as a FITS header alteration mechanism ------------------------# #---------------------------------------------------------------# skymodel='simInput.fits' #The input sky image you are using for simulation. inbright='' #rescale brightness indirection='J2000 10h00m00 -30d00m00' #change image center position inbright='0.5mJy/pixel'#rescale pixel brightest incell='0.1arcsec' #rescale pixel size incenter='345.0GHz' #set image central frequency to something in ALMA band 9 inwidth='1GHz' #set to max. width of an ALMA spectral window. #-------------- Setup Pointings --------------------------------# # Here you setup the observing parameters. i.e. integration time# # pointing center, map size, maptype (for mosaics) and pointing # # spacings (for mosaics) ---------------------------------------# #---------------------------------------------------------------# setpointings=True integration='10.24s' #integration time is the sampling time direction='J2000 10h00m00 -30d00m00' #left unset this defaults to the model image centre mapsize=['28arcsec','28arcsec'] #size of map to be created maptype='ALMA' #left as default pointingspacing='' #left as default #-------------- Setup observing parameters ---------------------# # These parameters define how the observations would be---------# # conducted, i.e. Antenna configuration, date of obs, HA, total # # on source time plus some calibration and single dish----------# # parameters I won't use here ----------------------------------# #---------------------------------------------------------------# antennalist='alma.out05.cfg' #uses one of the 28 inbuilt full ALMA array configs refdate='2014/10/13' #the date of this workshop hourangle='transit' #to observe source at transit totaltime='1800s' #30mins on source #---------------Thermal Noise----------------------------------# # Sets the level of corruption in your final image ------------# # simdata has two modes 'tsys-atm' and 'tsys-manual' the former# # uses an atmospheric model, the latter allows users to input # # the sky temperature maunally --------------------------------# thermalnoise='tsys-atm' #use the atmospheric model user_pwv=2.5 #precipitable water vapour in mm t_ground=260.0 #ambient temperature seed=12341 #random number seed simobserve() #execute simobserve print ">>> simobserve complete!\n" if(do_simanalyze): default(simanalyze) #clears any set simanalyze parameters print ">>> simanalyze underway!\n" #--------------Setup image output -----------------------------# # Convert your simuation measurement set to a CASA image. -----# # Here leaving most things as default is usually OK as you set # # most things up in skymodel ----------------------------------# #--------------------------------------------------------------# image=True project=name_project vis='default' #to use the simulation we're currently working on modelimage='' #Can enter a model of the region here or previous obs data imsize= 0 #to maintain model size cell='' #to leave as model value niter=1000 #number of CLEAN iterations threshold='0.5mJy' #the threshold at which to stop cleaning weighting='natural' #choose from natural, uniform or briggs. mask=[] #here you can define a clean box to clean components only in the region outertaper=[] #uv-taper the data stokes='I' #which Stokes parameter to image #---------------Analyze---------------------------------------# # If set to True you can select a number of output images to # # inspect you simulation, i.e. uv coverage, dirty beam, ------# # original model, synthesized (simulated) image etc. etc. ----# # They are selected using Boolean values (True or False) -----# #-------------------------------------------------------------# analyze=True # needs to be true to allow the following to be enabled showuv=True #show uv coverage showpsf=False #show dirty beam showmodel=True #show original model showclean=True #show simulated and CLEAN image showdifference=True #show difference between orignal an simulation showfidelity=True #show fidelity graphics='screen' #only send images to screen (and done save them to files) #-------------- And Finally -----------------------------------# simanalyze() #execute simanalyze print ">>> simanalyze complete!\n"