Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to CASA and Basic Data Reduction Overview Steven T. Myers CASA Project Scientist (NRAO)

Similar presentations


Presentation on theme: "Introduction to CASA and Basic Data Reduction Overview Steven T. Myers CASA Project Scientist (NRAO)"— Presentation transcript:

1 Introduction to CASA and Basic Data Reduction Overview Steven T. Myers CASA Project Scientist (NRAO)

2 CASA Tutorial -- 7 October 2008 2 Beta Release Status CASA Status: in Beta Release since October 2007 roughly quarterly “patches” Current Release: Beta Release Patch 3 target release date October 15 general release register at my.nrao.edu, no password for download

3 CASA Tutorial -- 7 October 2008 3 Beta Disclaimer This really is a Beta Release! still missing functionality there are known failure modes will find new problems Improvements in upcoming patches move towards handling ALMA/EVLA “use cases” better handling of calibration

4 CASA Tutorial -- 7 October 2008 4 Curriculum schedule: ~1 hour orientation lecture + demo (this talk) hands-on data reduction with datasets: VLA Continuum Polarization (3C129) VLA Spectral Line (NGC2403) BIMA 3mm line mosaic (NGC4826) intended to be interactive if you need help - ask!

5 CASA Tutorial -- 7 October 2008 5 Starting CASA From your workstation (running RHEL): type ‘casapy-test’ at prompt this is the pre-release test version of Beta Patch 3 at AOC quit CASA using ‘exit’ brings up IPython shell plus casalogger GUI Other releases available for download not yet built for Patch 3...

6 CASA Tutorial -- 7 October 2008 6 Getting User Support First stop: Read the Manual! CASA Home: http://casa.nrao.eduhttp://casa.nrao.edu Cookbook, and “help” within CASA CASA Helpdesk & Support Cadres “Helpdesk” under my.nrao.edu submit Issues User Support Specialists (Gustaaf at AOC) will handle your Helpdesk ticket and interface with developers

7 CASA Tutorial -- 7 October 2008 7 Tutorial Contents I - Interface II - Tasks & Tools III - Data in CASA IV - Data Processing Workflow V - Example Use Cases

8 CASA Tutorial -- 7 October 2008 8 I - Interface Documentation IPython & Python Crashes & Recovery CASA help CASA task interface Functionality

9 CASA Tutorial -- 7 October 2008 9 CASA Documentation CASA Analysis cookbook (draft): http://casa.nrao.edu/Doc/Draft/Cookbook/casa_cookbook.pdf CASA User Reference Manual: http://casa.nrao.edu/docs/casaref/CasaRef.html Python: http://python.orghttp://python.org/doc (e.g., see Tutorial for novices) IPython: http://ipython.scipy.org/moin/Documentation matplotlib: http://matplotlib.sourceforge.nethttp://matplotlib.sourceforge.net/

10 CASA Tutorial -- 7 October 2008 10 CASA Interface IPython shell access autoparenthesis (autocall) command history session logging (ipython.log, casapy.log) numbered input/output history/searching Python see standard manuals, Cookbook Appendix D

11 CASA Tutorial -- 7 October 2008 11 Python Pointers to run a.py script: execfile(‘ ’) example: execfile(‘ngc5921_demo.py’) indentation matters! be careful when doing cut-and-paste to Python cut a few (4-6) lines at a time variables are global! tasknames are objects (not variables)

12 CASA Tutorial -- 7 October 2008 12 Crashes & Recovery Beta Release still has crash modes plotting in particular (plotxy and plotcal) can get a segmentation fault If in doubt, exit and restart casapy get rid of orphaned loggers you may have to use ps to find rogue casapy processes and kill them

13 CASA Tutorial -- 7 October 2008 13 Part II - Tasks & Tools overview of tasks and tools in CASA introduction to the task interface how to get help on tasks and tools how tools underly the tasks how to run tasks asynchronously

14 CASA Tutorial -- 7 October 2008 14 Tasks and tools in CASA Tasks - high-level functionality function call or parameter handling interface these are what you should use in tutorial Tools - complete functionality tool.method calls, used by tasks sometimes shown in tutorial scripts

15 CASA Tutorial -- 7 October 2008 Key Tasks Task list: may be different in test and release versions asap_init to load single-dish tasks and tools

16 CASA Tutorial -- 7 October 2008 16 Task Execution two ways to invoke: call from Python as functions with arguments taskname( arg1=val1, arg2=val2,... ) unspecified parameters will be defaulted (globals not used) use standard tasking interface use global variables for task parameters see Chapter 1.3 in Cookbook

17 CASA Tutorial -- 7 October 2008 17 Task Interface standard tasking interface use parameters set as global Python variables set = (e.g. vis = ‘ngc5921.demo.ms’ ) parameter manipulation commands using inp, default, saveinputs, tget execute or go ( e.g. clean() ) return values some tasks return Python dictionaries, e.g. myval=imval()

18 CASA Tutorial -- 7 October 2008 18 Task Interface examine task parameters with inp :

19 CASA Tutorial -- 7 October 2008 19 Expandable Parameters boldface parameter are expandable

20 CASA Tutorial -- 7 October 2008 20 Parameter Checking sanity checks of parameters in inp : erroneous values in red

21 CASA Tutorial -- 7 October 2008 21 Help on Tasks In-line help command:

22 CASA Tutorial -- 7 October 2008 22 Tools in CASA CASA Toolkit underneath tasks core AIPS++ code (mostly in C++) tools are functions call from casapy as. () default tool objects are pre-constructed e.g. imager (im), calibrater (cb), ms (ms), etc. (see toolhelp)

23 CASA Tutorial -- 7 October 2008 23 CASA Tool List list of default tools from toolhelp : tools described in the CASA User Reference Manual: http://casa.nrao.edu/docs/casaref/CasaRef.html

24 CASA Tutorial -- 7 October 2008 24 Asynchronous Tasks run tasks in background set parameter async=True runs as separate process use taskmanager tool (tm) to monitor (Cookbook Chapter 1.3.2) messages will appear in logger in the asynchronous order useful to avoid known problems (e.g. exportfits / importfits) cannot retrieve return values from async tasks

25 CASA Tutorial -- 7 October 2008 25 III - Data in CASA data in CASA are stored in tables interferometry data in Measurement Sets (MS) also tables for images and calibration tables formats and structures defined in CASA memos accessed through table and ms tools row and column structure is logical not physical

26 CASA Tutorial -- 7 October 2008 26 The Measurement Set the MS is a directory on disk the MAIN table in table.* files also contains sub-tables e.g. FIELD, SOURCE, ANTENNA, etc. sub-tables are sub-directories to copy must cp -rf to get contents WARNING: moving a MS can break cal-table dependencies

27 CASA Tutorial -- 7 October 2008 27 Example MS Example: ls ngc5921.usecase.ms ls ngc5921.usecase.ms/FIELD

28 CASA Tutorial -- 7 October 2008 28 MAIN Table Contents Example using task browsetable:

29 CASA Tutorial -- 7 October 2008 29 More MS Details often will refer to “rows” & “columns” rows = integrations in spectral windows columns = time, u, v, w, DATA, weights, etc. there are “scratch columns” created when needed - can bloat the MS but (usually) less space than scratch copy of MS! CORRECTED_DATA, MODEL_DATA, IMAGING_WEIGHTS

30 CASA Tutorial -- 7 October 2008 30 Data Selection standard MS selection syntax see Chapter 2.5 of CASA Cookbook syntax detailed in CASA Memo http://casa.nrao.edu/Memos/msselection/index.html

31 CASA Tutorial -- 7 October 2008 31 Selection Example standard selection parameters e.g. for task gaincal: field and spw common standard selections expandable selectdata with other selections as sub-parameters

32 CASA Tutorial -- 7 October 2008 32 Selection Syntax see Chapter 2.5 of Cookbook field - string with source name or field ID can use ‘*’ as wildcard, first checks for name, then ID example: field = ‘1331+305’ ; field = ‘3C*’ ; field = ‘0,1,4~5’ spw - string with specwindow ID plus channels use ‘:’ as separator of spw from optional channelization use ‘^’ as separator of channels from step/width example: spw = ‘0~2’ ; spw = ‘1:10~30’ ; spw = ‘2~5:5~54^5’

33 CASA Tutorial -- 7 October 2008 33 Selection Syntax see Chapter 2.5 of Cookbook antenna - string with antenna name or ID first check for name, then ID (beware VLA name 1-27, ID 0-26) example: antenna = ‘1~5,11’ ; antenna = ‘VA*’ timerange - string with date/time range specify ‘T0~T1’, missing parts of T1 default to T0, can give ‘T0+dT’ example: timerange = ‘2007/10/16/01:00:00~06:30:00’

34 CASA Tutorial -- 7 October 2008 34 IV - Reduction Philosophy data is imported into MS keep original DATA inviolate calibration is carried in cal-tables will discuss cal-table philosophy later imaging creates images from MS feed back model images for self-calibration

35 CASA Tutorial -- 7 October 2008 35 Data Philosophy Original data kept intact by default DATA (and WEIGHT) columns do not change in original MS user can use toolkit to mess with these also MS “scratch columns” are used used for adjusted data and model visibilities BETA: user must keep track ; Post-Beta: hide table and MS state

36 CASA Tutorial -- 7 October 2008 36 CASA Workflow Chart workflow: import examine / flag calibrate image analyze

37 CASA Tutorial -- 7 October 2008 37 Workflow Steps follow rough workflow path: import data (from UVFITS or archive formats) examine data and edit out bad visibilities calibrate data (through cal-tables) image data (various deconvolution methods) image and uv analysis (e.g. moments) data and image visualization (whenever needed)

38 CASA Tutorial -- 7 October 2008 38 Import Data see Chapter 2 of Cookbook task importuvfits UVFITS data (e.g. from AIPS) task importvla VLA “export” format (e.g. from archive) task importasdm ALMA data format (also EVLA eventually)

39 CASA Tutorial -- 7 October 2008 39 Data Examination see Chapter 3 of Cookbook task listobs list summary of MS task plotxy x-y line plots task browsetable (casabrowser outside casapy) Qt browser for tables (e.g. MS and images) casaviewer - view raster images of MS

40 CASA Tutorial -- 7 October 2008 40 Flagging see Chapter 3 of Cookbook task plotxy draw boxes around points and flag casaviewer ( task viewer ) draw boxes on raster and flag (modes similar to AIPS TVFLG) task flagdata - manual flagging, clipping, etc. task flagmanager - backup & restore flags

41 CASA Tutorial -- 7 October 2008 41 Task plotxy use plotxy for simple data plots & flagging before (left) and after (right) editing and calibration

42 CASA Tutorial -- 7 October 2008 42 Task plotxy interactive plotting and flagging averaging timebin, width (time & channel averaging) iteration iteration = ‘antenna’, ‘field’, ‘time’, ‘spw’ (or combinations) GUI controls buttons for MarkRegion, Flag, Unflag, Locate, Next, Quit plot options use subplot = yxn to set multi-panels (e.g. subplot=311) controls for fontsize, markersize, other options

43 CASA Tutorial -- 7 October 2008 43 Example inputs set up to plot amp vs. time

44 CASA Tutorial -- 7 October 2008 44 Editing Jupiter isolate blocks of bad data and remove single bad scan on Jupiter both spw, all antennas

45 CASA Tutorial -- 7 October 2008 45 MS viewing the casaviewer can handle MS (e.g. TVFLG)

46 CASA Tutorial -- 7 October 2008 46 Calibration see Chapter 4 of Cookbook prior calibration solving calibration table manipulation calibration table examination application to data

47 CASA Tutorial -- 7 October 2008 47 Calibration workflow: input dataset solving => tables incremental accumulation application

48 CASA Tutorial -- 7 October 2008 48 Calibration Tables calibration tables are exchanged between the calibration tasks:

49 CASA Tutorial -- 7 October 2008 49 Calibration Tasks prior calibration: setjy solvers: gaincal, bandpass, polcal, blcal, fringecal manipulation: plotcal, accum, smoothcal application: applycal, split other: uvcontsub, uvmodelfit

50 CASA Tutorial -- 7 October 2008 50 Parameterizations prior calibration: gaincurve: VLA-only for now opacity: single tau value (for now) gaincal: gaintype=’G’ (solution per solint time slot) gaintype=’GSPLINE’ bandpass: bandtype=’B’ (solution per channel) bandtype=’BPOLY’ No time-dependence yet

51 CASA Tutorial -- 7 October 2008 51 Calibration Processing setjy (or ft) specify a model image (for selfcal or resolved cals) smoothcal Mean, median smoothing of cal tables accum calibration re-sampling Incremental/cumulative calibration

52 CASA Tutorial -- 7 October 2008 52 Imaging see Chapter 5 of Cookbook task clean single-field cleaning, variety of algorithms mosaicing using uv-gridder (uv-plane mosaicing on single image) interactive and non-interactive operation task widefield - widefield imaging prototype w-projection and faceting task feather - combine single-dish and uvMS

53 CASA Tutorial -- 7 October 2008 53 Interactive CLEAN clean has interactive mode interactive=True uses the viewer can change cycles during cleaning draw boxes and polygon regions for masking

54 CASA Tutorial -- 7 October 2008 54 Cube Channelization When using mode=‘channel’ select spectral windows of the data, e.g. spw=‘0,1’ the width is then set in units of first data spw channel width

55 CASA Tutorial -- 7 October 2008 55 Imaging spectral cubes Other cube considerations... Averaging of data channel in imaging is always ‘mfs’ style…i.e gridded with different (u,v) If a mode=’velocity’ cube is chosen, then data will be gridded into LSRK bins If simple data averaging is needed split is recommended

56 CASA Tutorial -- 7 October 2008 56 Mosaicing in clean use imagermode=’mosaic’ deconvolution on “Sault” (constant noise) image User can set make PB corrected image at end primary beam coverage x Sky in image plane Convolution with aperture cross-correlation function in uv-domain Advantages of doing mosaicing in uv Faster apply correct beam transform for each baseline (e.g. different dish size, change of pb with frequency, beam errors etc.) Parameter “ ftmachine ” sets this Possibilities are ' ft ' or ' mosaic '

57 CASA Tutorial -- 7 October 2008 57 More clean Mosaicing parameters continued: mosweight : important/different for uniform and Brigg's weighting scheme. Use per field weighting if mosweight=True Cotton-Scwab major cycles imagermode=’csclean’ or ‘mosaic’ returns to residual visibilities at major cycles cyclefactor : controls major cycle depth larger => more major cycles (clean will take longer) to a lesser extent cyclespeedup (for a non- converging clean)

58 CASA Tutorial -- 7 October 2008 58 Image Display The viewer Cookbook Chapter 7

59 CASA Tutorial -- 7 October 2008 59 Image Analysis see Chapter 6 of Cookbook task imhead - get and change image header information task immoments - computes moment images of spectral cube task immath - combine images and do image math using Lattice Expression Language (LEL) also: Spectral Index, Linear Polarized Intensity and Angle task imstat - return statistics on regions of image task imval - return values for pixel or region of image task imfit - fit a 2D Gaussian to the image

60 CASA Tutorial -- 7 October 2008 60 Task immoments use viewer to look at NGC5921 moment images Overlay contours of moment 1 (velocity) on moment 0 (intensity)

61 CASA Tutorial -- 7 October 2008 61 V - Scripts & Data Tutorial Home Page http://casa.nrao.edu/Tutorial/20081007/ CASA Scripts & Data Page these are still Patch 2 versions http://casa.nrao.edu/casatraining.shtml

62 CASA Tutorial -- 7 October 2008 62 Tutorial Homepage http://casa.nrao.edu/Tutorial/20081007/

63 CASA Tutorial -- 7 October 2008 63 SummerSchool08 Data The VLA tutorials: 3C129 continuum data B and C configuration export data NGC2403 HI line data export data files AS649_* (VLA Archive files) Millimeter tutorial: NGC4826 BIMA line mosaic BIMA uvfits files

64 CASA Tutorial -- 7 October 2008 64 Example Use Cases NGC5921 VLA 1.4GHz spectral line simple regression data set and script ngc5921_demo.py Jupiter 6cm continuum interactive use case script jupiter6cm_demo.py also broken up by operations (flagging, calibration, imaging, pol)


Download ppt "Introduction to CASA and Basic Data Reduction Overview Steven T. Myers CASA Project Scientist (NRAO)"

Similar presentations


Ads by Google