Simdata CASA 3.1: Difference between revisions
From CASA Guides
Jump to navigationJump to search
Created page with '<pre> mosaic simulation task: mosaic simulation task (prototype): This task simulates interfermetric observations (currently only ALMA can be done easily). New fu…' |
No edit summary |
||
Line 90: | Line 90: | ||
power. defaults to the first antenna on the list. | power. defaults to the first antenna on the list. | ||
------------------------------- | ------------------------------- | ||
thermalnoise -- add thermal noise | |||
* NOTE: both the interferometric and single-dish MS will be | |||
corrupted if they've been created above. | |||
* currently only knows correct temps for ALMA and EVLA receivers | |||
* this parameter takes two possible values: | |||
tsys-atm: J. Pardo's ATM library will be used to construct an | |||
atmospheric profile for the ALMA site and user_pwv. | |||
noise is calculated from the specified ground temperature, | |||
internally tabulated antenna spillover parameters, the sky brightness | |||
temperature returned by ATM, and internally tabulated receiver | |||
temperatures | |||
tsys-manual: instead of using the ATM model, specify the zenith | |||
sky brightness and opacity manually. Noise is added and then | |||
the visibility flux scale is referenced above the atmosphere. | |||
t_ground -- ground/spillover temperature in K | |||
user_pwv -- precipitable water vapor if constructing an atmospheric model | |||
t_sky -- atmospheric temperature in K [for tsys-manual] | |||
tau0 -- zenith opacity at observing frequency [for tsys-manual] | |||
* see casaguides.nrao.edu for more information on noise, | |||
in particular how to add a phase screen using the toolkit | |||
------------------------------- | |||
leakage -- add cross polarization corruption of this fractional magnitude | |||
------------------------------- | |||
image -- invert and deconvolve the measurement set(s) | |||
* NOTE: interactive clean or more parameters than the subset visible | |||
here are available by simply running the clean task directly, | |||
then returning to simdata to run "analyze" if desired. | |||
* NOTE: the channelization of the output image cube will be the | |||
same as that in the simulated Measurement Set. | |||
* if graphics selected, display the clean image and residual image | |||
* uses Cotton-Schwab clean for single fields and Mosaic gridding | |||
for multiple fields (with Clark PSF calculation in minor cycles). | |||
ms -- the simulated interferometric MS, or total-power one, or both | |||
modelimage -- prior (e.g. SD) image to be used in clean | |||
cell -- cell size e.g '10arcsec'. "" defaults to the skymodel cell | |||
imsize -- image size in spatial pixels (x,y) | |||
0 or -1 will use the model image size; example: imsize=[500,500] | |||
niter -- mumber of clean/deconvolution iterations, 0 for no cleaning | |||
threshold -- flux level to stop cleaning | |||
weighting -- weighting to apply to visibilities | |||
options: 'natural','uniform','briggs' (robust=0.5) | |||
outertaper -- apply additional uv outer taper of visibilities | |||
stokes -- Stokes parameters to image; 'I','IV','IQU','IQUV' | |||
------------------------------- | |||
analyze -- compute and display difference between model and output, | |||
fidelity, etc. | |||
* it is recommended to have graphics turned on for this subtask | |||
showarray -- like plotants | |||
showuv -- display uv coverage | |||
showpsf -- display synthesized (dirty) beam | |||
showmodel -- display sky model at original resolution | |||
showconvolved -- display sky model convolved with output beam | |||
showclean -- display the synthesized image | |||
showresidual -- display the clean residual image | |||
showdifference -- display difference image | |||
showfidelity -- display fidelity image | |||
------------------------------- | |||
How to specify a model image: | |||
------------------------------- | |||
* simdata requires a CASA or fits image. If you merely have a grid of | |||
numbers, you will need to write them out as fits or write a CASA script to | |||
read them in and use the ia tool to create an image and insert the data. | |||
* simdata does NOT require a coordinate system in the header. If the | |||
coordinate information is incomplete, missing, or you would like to | |||
override it, set "modifymodel=True". simdata will then assume that the | |||
axes of your input correspond to RA, Dec, and (optionally) frequency and | |||
(optionally) Stokes parameter. | |||
* If you have a proper Coordinate System, simdata will so its best to | |||
generate visibilities from that, and then create a synthesis image | |||
according to the specified user parameters. Regridding the | |||
spectral dimension may not have complete flexibility yet. | |||
* You can manipulate an image header with the "imhead" task, or you can | |||
delve deeper with the ia and cs tools. If you use the tools, you should | |||
be aware that a CoordinateSystem in CASA can exist independently of an | |||
Image. Once the CoordinateSystem is detached from the image, it is the | |||
users responsibility to do any manipulation e.g. axis reordering on | |||
both. Example: | |||
ia.open("myimage_filename") | |||
ia.summary() # see header as attached to the image | |||
csys=ia.coordsys() # detach the CoordinateSystem | |||
csys.summary() # examine it | |||
csys.setreferencepixel([100,100]) | |||
arr=ia.getchunk() # get the data from the Image | |||
ia.done() | |||
csys.reorder([0,2,1]) # reorder the CoordinateSystem | |||
------------------------------- | |||
How to specify a model image: | |||
------------------------------- | |||
* simdata requires a CASA or fits image. If you merely have a grid of | |||
numbers, you will need to write them out as fits or write a CASA script to | |||
read them in and use the ia tool to create an image and insert the data. | |||
* simdata does NOT require a coordinate system in the header. If the | |||
coordinate information is incomplete, missing, or you would like to | |||
override it, set "modifymodel=True". simdata will then assume that the | |||
axes of your input correspond to RA, Dec, and (optionally) frequency and | |||
(optionally) Stokes parameter. | |||
* If you have a proper Coordinate System, simdata will so its best to | |||
generate visibilities from that, and then create a synthesis image | |||
according to the specified user parameters. Regridding the | |||
spectral dimension may not have complete flexibility yet. | |||
* You can manipulate an image header with the "imhead" task, or you can | |||
delve deeper with the ia and cs tools. If you use the tools, you should | |||
be aware that a CoordinateSystem in CASA can exist independently of an | |||
Image. Once the CoordinateSystem is detached from the image, it is the | |||
users responsibility to do any manipulation e.g. axis reordering on | |||
both. Example: | |||
ia.open("myimage_filename") | |||
ia.summary() # see header as attached to the image | |||
csys=ia.coordsys() # detach the CoordinateSystem | |||
csys.summary() # examine it | |||
csys.setreferencepixel([100,100]) | |||
arr=ia.getchunk() # get the data from the Image | |||
ia.done() | |||
csys.reorder([0,2,1]) # reorder the CoordinateSystem | |||
arr=arr.reorder([0,2,1]) # reorder the data | |||
ia.fromshape(outfile="mynewimage_file",shape=[32,32,256],csys=csys.torecord(),overwrite=True) | |||
# make a new image, with the right shape and CoordinateSystem | |||
ia.putchunk(arr) # put the data into the new image. | |||
csys.done() | |||
ia.done() | |||
------------------------------- | |||
Output produced: | |||
------------------------------- | |||
Needs rewriting... | |||
</pre> | </pre> |
Revision as of 15:55, 20 May 2010
mosaic simulation task: mosaic simulation task (prototype): This task simulates interfermetric observations (currently only ALMA can be done easily). New functionality is actively being added, so if you have changed versions of CASA, check the inputs carefully. Please contact CASA experts with any questions, especially about features noted below as *experimental* ------------------------------- project -- root filename for all output files. ------------------------------- modifymodel -- change the coordinate system of the model sky image? * if graphics selected, display the rescaled model image skymodel -- if modifymodel=False, use this as the sky model. * if modifyimage=True, use this as the starting point, modify it write the output to a different image (default $project.skymodel) and use that new image as the sky model inbright -- peak brightness in Jy/pixel, or "" for unchanged * NOTE: "unchanged" will take the numerical values in your image and assume they are in Jy/pixel, even if it says some other unit in the header. indirection -- central direction, or "" for unchanged incell -- spatial pixel size, or "" for unchanged incenter -- frequency of center channel e.g. "89GHz", or "" for unchanged inwidth -- width of channels, or "" for unchanged - this should be a string representing a quantity with units e.g. "10MHz" * NOTE: only works reliably with frequencies, not velocities * NOTE: it is not possible to change the number of spectral planes of the sky model, only to relabel them with different frequencies That kind of regridding can be accomplished with the CASA toolkit. ------------------------------- setpointings -- calculate a map of pointings, or if false, provide ptgfile * if graphics selected, display the pointings shown on the model image ptgfile -- a text file specifying directions in the same format as the example, and optional integration times, e.g. #Epoch RA DEC TIME(optional) J2000 23h59m28.10 -019d52m12.35 10.0 * if the time column is not present in the file, it will use "integration" for all pointings. * NOTE: at this time the file should contain only science pointings: simdata will observe these, then optionally the calibrator, then the list of science pointings again, etc, until totaltime is used up. integration --- Time interval for each integration e.g '10s' * NOTE: to simulate a "scan" longer than one integration, use setpointings to generate a pointing file, and then edit the file to repeat each pointing several times before moving to the next point. direction -- mosaic center direction e.g 'J2000 19h00m00 -40d00m00' * can optionally be a list of pointings * otherwise simdata will pack mapsize according to maptype mapsize -- angular size of map * set to "" to span the model image maptype -- hexagonal or linear pointingspacing -- spacing in between beams e.g '1arcsec' ------------------------------- predict -- calculate visibilities from skymodel (which may have been modified above, (optionally) complist, and $ptgfile (which may have been generated above) * if graphics selected, display the array (like plotants), the uv coverage, the synthesized (dirty) beam, and ephemeris information refdate -- central time of simulated observation eg: '2012/05/21/22:05:00' * NOTE: observations are currently centered at the nearest transit * totaltime --- total time of observation e.g '7200s' antennalist -- ascii file containing antenna positions. each row has x y z coordinates and antenna diameter; header lines are required to specify the observatory name and coordinate system e.g. # observatory=ALMA # coordsys=UTM # datum=WGS84 # zone=19 * standard arrays are found in your CASA data repository, os.getenv("CASAPATH").split()[0]+"/data/alma/simmos/" * if "", will not not produce an interferometric MS * NEW: a string of the form "alma;0.5arcsec" will be parsed into a full 12m ALMA configuration. This only works for full ALMA and may fail to find the standard configuration files on some systems - see casaguides.nrao.edu caldirection -- *NEW* an unresolved calibrator can be observed interleaved with the science pointings. This feature is experimental, so please contact us with any questions. * The calibrator is implemented as a point source clean component with this direction and flux=calflux sdantlist -- antenna position file with antennas to be used for single dish or total power simulation * if "", will not produce a total power MS sdant -- the index of the antenna in the list to use for total power. defaults to the first antenna on the list. ------------------------------- thermalnoise -- add thermal noise * NOTE: both the interferometric and single-dish MS will be corrupted if they've been created above. * currently only knows correct temps for ALMA and EVLA receivers * this parameter takes two possible values: tsys-atm: J. Pardo's ATM library will be used to construct an atmospheric profile for the ALMA site and user_pwv. noise is calculated from the specified ground temperature, internally tabulated antenna spillover parameters, the sky brightness temperature returned by ATM, and internally tabulated receiver temperatures tsys-manual: instead of using the ATM model, specify the zenith sky brightness and opacity manually. Noise is added and then the visibility flux scale is referenced above the atmosphere. t_ground -- ground/spillover temperature in K user_pwv -- precipitable water vapor if constructing an atmospheric model t_sky -- atmospheric temperature in K [for tsys-manual] tau0 -- zenith opacity at observing frequency [for tsys-manual] * see casaguides.nrao.edu for more information on noise, in particular how to add a phase screen using the toolkit ------------------------------- leakage -- add cross polarization corruption of this fractional magnitude ------------------------------- image -- invert and deconvolve the measurement set(s) * NOTE: interactive clean or more parameters than the subset visible here are available by simply running the clean task directly, then returning to simdata to run "analyze" if desired. * NOTE: the channelization of the output image cube will be the same as that in the simulated Measurement Set. * if graphics selected, display the clean image and residual image * uses Cotton-Schwab clean for single fields and Mosaic gridding for multiple fields (with Clark PSF calculation in minor cycles). ms -- the simulated interferometric MS, or total-power one, or both modelimage -- prior (e.g. SD) image to be used in clean cell -- cell size e.g '10arcsec'. "" defaults to the skymodel cell imsize -- image size in spatial pixels (x,y) 0 or -1 will use the model image size; example: imsize=[500,500] niter -- mumber of clean/deconvolution iterations, 0 for no cleaning threshold -- flux level to stop cleaning weighting -- weighting to apply to visibilities options: 'natural','uniform','briggs' (robust=0.5) outertaper -- apply additional uv outer taper of visibilities stokes -- Stokes parameters to image; 'I','IV','IQU','IQUV' ------------------------------- analyze -- compute and display difference between model and output, fidelity, etc. * it is recommended to have graphics turned on for this subtask showarray -- like plotants showuv -- display uv coverage showpsf -- display synthesized (dirty) beam showmodel -- display sky model at original resolution showconvolved -- display sky model convolved with output beam showclean -- display the synthesized image showresidual -- display the clean residual image showdifference -- display difference image showfidelity -- display fidelity image ------------------------------- How to specify a model image: ------------------------------- * simdata requires a CASA or fits image. If you merely have a grid of numbers, you will need to write them out as fits or write a CASA script to read them in and use the ia tool to create an image and insert the data. * simdata does NOT require a coordinate system in the header. If the coordinate information is incomplete, missing, or you would like to override it, set "modifymodel=True". simdata will then assume that the axes of your input correspond to RA, Dec, and (optionally) frequency and (optionally) Stokes parameter. * If you have a proper Coordinate System, simdata will so its best to generate visibilities from that, and then create a synthesis image according to the specified user parameters. Regridding the spectral dimension may not have complete flexibility yet. * You can manipulate an image header with the "imhead" task, or you can delve deeper with the ia and cs tools. If you use the tools, you should be aware that a CoordinateSystem in CASA can exist independently of an Image. Once the CoordinateSystem is detached from the image, it is the users responsibility to do any manipulation e.g. axis reordering on both. Example: ia.open("myimage_filename") ia.summary() # see header as attached to the image csys=ia.coordsys() # detach the CoordinateSystem csys.summary() # examine it csys.setreferencepixel([100,100]) arr=ia.getchunk() # get the data from the Image ia.done() csys.reorder([0,2,1]) # reorder the CoordinateSystem ------------------------------- How to specify a model image: ------------------------------- * simdata requires a CASA or fits image. If you merely have a grid of numbers, you will need to write them out as fits or write a CASA script to read them in and use the ia tool to create an image and insert the data. * simdata does NOT require a coordinate system in the header. If the coordinate information is incomplete, missing, or you would like to override it, set "modifymodel=True". simdata will then assume that the axes of your input correspond to RA, Dec, and (optionally) frequency and (optionally) Stokes parameter. * If you have a proper Coordinate System, simdata will so its best to generate visibilities from that, and then create a synthesis image according to the specified user parameters. Regridding the spectral dimension may not have complete flexibility yet. * You can manipulate an image header with the "imhead" task, or you can delve deeper with the ia and cs tools. If you use the tools, you should be aware that a CoordinateSystem in CASA can exist independently of an Image. Once the CoordinateSystem is detached from the image, it is the users responsibility to do any manipulation e.g. axis reordering on both. Example: ia.open("myimage_filename") ia.summary() # see header as attached to the image csys=ia.coordsys() # detach the CoordinateSystem csys.summary() # examine it csys.setreferencepixel([100,100]) arr=ia.getchunk() # get the data from the Image ia.done() csys.reorder([0,2,1]) # reorder the CoordinateSystem arr=arr.reorder([0,2,1]) # reorder the data ia.fromshape(outfile="mynewimage_file",shape=[32,32,256],csys=csys.torecord(),overwrite=True) # make a new image, with the right shape and CoordinateSystem ia.putchunk(arr) # put the data into the new image. csys.done() ia.done() ------------------------------- Output produced: ------------------------------- Needs rewriting...