|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
calibrater.accumulate - Function
2.1.1 Accumulate incremental calibration solutions into a cumulative calibration
table
Description
This function enables cumulative calibration using calibrater. It is the
analog of the task “CLCAL” in classic AIPS.
The accumulate function is useful when:
- a calibration solution of a particular type already exists,
- an incremental calibration solution of the same type is desired (an incremental solution in this context means derived independently from, or determined with respect to, the first)
- the first calibration cannot be implicitly recovered in the course of obtaining the incremental solution
For example, a phase-only “G” self-calibration on a target source may be desired to tweak the full amplitude and phase “G” calibration already obtained from a calibrator. The initial calibration (from the calibrator) contains amplitude information, and so must be carried forward, yet the phase-only solution itself cannot (by definition) recover this information, as a full amplitude and phase self-calibration would. In this case, the initial solution must be applied while solving for the phase-only solution, then the two solutions combined to form a cumulative calibration embodying the net effect of both. In terms of the Measaurement Equation, the net calibration is the product of the initial and incremental solutions.
The analog of accumulate in classic AIPS is the use of CLCAL to combine a series of (incremental) SN calibration tables to form successive (cumulative) CL calibration tables.
Cumulative calibration tables also provide a means of generating carefully interpolated calibration, on variable user-defined timescales, that can be examined prior to application to the data with setapply and correct. The solutions for different fields and/or spectral windows can be interpolated in different ways, with all solutions stored in the same table.
The only difference between incremental and cumulative calibration tables is that incremental tables are generated directly from the data via solve or (in the near future) from other ancilliary data (e.g. weather information), and cumulative tables are generated from other cumulative and incremental tables via accumulate. In all other respects (internal format, application to data via setapply and correct, plotting with plotcal, etc.), they are the same, and therefore interchangable. Thus, accumulate and cumulative calibration tables need only be used when circumstances require it.
The accumulate function represents a generalization on the classic AIPS CLCAL model of cumulative calibration in that its application is not limited to accumulation of “G” solutions (SN/CL tables classic AIPS are the analog of “G” (and, implicitly, “T”) in aips++). In principle, any basic calibration type can be accumulated (onto itself), as long as the result of the accumulation (matrix product) is of the same type. This is true of all the basic types, except “D”. Accumulation is currently supported for “B”, “G”, and “T”, and, in future, “F” (ionospheric Faraday rotation), “J” (generic full-polarization calibration), fringe-fitting, and perhaps others. Accumulation of certain specialized types (e.g., “GSPLINE”, “TOPAC”, etc.) onto the basic types will be supported in the near future. The treatment of various calibration from ancilliary data (e.g., system temperatures, weather data, WVR, etc.), as they become available, will also make use of accumulate to achieve the net calibration.
Note that accumulation only makes sense if treatment of a uniquely incremental solution is required (as described above), or if a careful interpolation or sampling of a solution is desired. In all other cases, re-solving for the type in question will suffice to form the net calibration of that type. For example, the product of an existing “G” solution and an amplitude and phase “G” self-cal (solved with the existing solution applied), is equivalent to full amplitude and phase “G” selfcal (with no prior solution applied), as long as the timescale of this solution is at least as short as that of the existing solution.
Use of accumulate is straightforward:
The tablein parameter is used to specify the existing cumulative calibration table to which an incremental table is to be applied. Initially, no such table exists, and accumulate will generate one from scratch (on-the-fly), using the timescale (in seconds) specified by the parameter t. These nominal solutions will be unit-amplitude, zero-phase (i.e., unit matrix) calibration, ready to be adjusted by accumulation. When t is negative (the default), the table name specified in tablein must exist and will be used.
The incrtable parameter is used to specify the incremental table that should be applied to tablein. The calibration type of incrtable sets the type assumed in the operation, so tablein must be of the same type. If it is not, accumulate will exit with an error message. (Certain combinations of types and subtypes will be supported by accumulate in the future.)
The tableout parameter is used to specify the name of the output table to write. If un-specified (or “”), then tablein will be overwritten. Use this feature with care, since an error here will require building up the cumulative table from the most recent distinct version (if any).
The field parameter specifies those field names (standard selection syntax) in tablein to which the incremental solution should be applied. The solutions for other fields will be passed to tableout unaltered. If the cumulative table was created from scratch in this run of accumulate, then these solutions will be unit-amplitude, zero-phase, as described above.
The calfield parameter is used to specify the fields (standard selection syntax) to select from incrtable to use when applying to tablein. Together, use of field and calfield permit completely flexible combinations of calibration accumulation with respect to fields. Multiple runs of accumulate can be used to generate a single table with many combinations. In future, a “self” mode will be enabled that will simplify the accumulation of field-specific solutions.
The interp parameter is used to specify the interpolation type to use on the incremental solutions, as in setapply. The currently available interpolation types are “nearest”, “linear”, and “aipslin”. See the setapply URM documentation for more details.
The spwmap parameter enables accumulating solutions from differing spectral windows. See setapply for details on how spwmap works.
Pending improvements:
- Implement a “self” mode (independent of interpolation type), to simplify or eliminate use of the field and calfield parameters in some contexts (e.g., self-cal)
- More interpolation modes, e.g., “cubic”, and interpolation timescale (timerange to permit interpolation)
- Handle propogation (or not) of bad/flagged solutions
- Support of specialized types (e.g., TOPAC) onto the basic types
- Smoothing (probably a separate function)
Arguments
Inputs |
| ||
tablein |
| Input cumulative calibration table name
| |
| allowed: | string |
|
| Default: |
| |
incrtable |
| Input incremental calibration table name
| |
| allowed: | string |
|
| Default: |
| |
tableout |
| Output cumulative calibration table name. Default is
input table name.
| |
| allowed: | string |
|
| Default: |
|
|
field |
| List of fields (names) to update in input cumulative
table. Default is all. | |
| allowed: | any |
|
| Default: | variant
|
|
calfield |
| List of fields (names) in incremental table to use. Default
is use all.
| |
| allowed: | any |
|
| Default: | variant
|
|
interp |
| Interpolation mode to use on incremental solutions
| |
| allowed: | string |
|
| Default: | linear |
|
t |
| Cumulative table timescale when creating from scratch
| |
| allowed: | double |
|
| Default: | -1.0 |
|
spwmap |
| Spectral windows to apply
| |
| allowed: | intArray |
|
| Default: | -1 |
|
bool
Example
cb.open(’ap366.sim’);
# obtain G solutions from calibrator
cb.selectvis(msselect=’FIELD_ID IN [9,11]’);
cb.setsolve(type=’G’,table=’cal.G0’,t=300);
cb.solve()
# obtain proper flux density scale
cb.fluxscale (tablein=’cal.G0’, tableout=’cal.G1’,
reference=’1328+307’, transfer="0917+624");
# generate cumulative table for target source on 20s timescale
cb.accumulate(tablein=’’,incrtable=’cal.G1’,tableout=’cal.cG0’,
field=’0957+561’,calfield=’0917+624’,
interp=’linear’,t=20);
# apply this calibration to target
cb.selectvis(msselect=’FIELD_ID==10’);
cb.setapply(type=’G’,table=’cal.cG0’,interp=’linear’)
cb.correct();
# (image target with imager tool)
# phase-selfcal target on 60s timescale
cb.selectvis(msselect=’FIELD_ID==10’);
cb.setapply(type=’G’,table=’cal.cG0’,interp=’linear’)
cb.setsolve(type=’G’,table=’cal.G2’,t=60,phaseonly=T);
cb.solve();
# accumulate new solution onto existing one
cb.accumulate(tablein=’cal.cG0’,incrtable=’cal.G2’,tableout=’cal.cG1’,
field=’0957+561’,calfield=’0957+561’,
interp=’linear’);
# apply new cumulative solution to data
cb.setapply(type=’G’,table=’cal.cG1’,interp=’linear’)
cb.correct();
# (another round of imaging, etc.)
cb.close();
__________________________________________________________________
More information about CASA may be found at the
CASA web page
Copyright © 2016 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search