hif_checkproductsize

hif_checkproductsize(vis=None, maxcubesize=None, maxcubelimit=None, maxproductsize=None, maximsize=None, calcsb=None, parallel=None) Results[source]

Mitigate imaging product sizes to fit within specified thresholds.

Checks the predicted sizes of all imaging products and applies a mitigation cascade to keep them within the allowed limits. Default thresholds are maxcubesize=40 GB, maxcubelimit=60 GB, and maxproductsize=500 GB. Size estimates use 4 bytes/pixel; both the intensity image and primary beam image are counted.

The mitigation cascade (applied in order until sizes fall below the thresholds) is:

  • Step 1 (per spw exceeding maxcubesize):

    1. Channel binning: set nbin=2 if nchan == 3840 or in (1920, 960, 480) without prior online averaging.

    2. Primary beam level reduction: compute PB_mitigation = exp(ln(0.2) * maxcubesize / cubesize) (with padding correction and clamped to PB=0.7). Only for single-field targets; same mitigated FoV applies to all products.

    3. Cell size reduction: change pixels-per-beam from 5 to 3.25 (robust=+2) or 3.0 (otherwise).

    4. If still too large: stop with error.

  • Step 2 (if productsize > maxproductsize):

    1. Reduce the number of science targets until productsize < maxproductsize (representative target is always retained).

    2. If still too large, repeat Step 1 mitigations.

    3. If still too large: stop with error.

  • Step 3: If any cube > 0.5 x maxcubelimit, limit the number of large cubes cleaned to 1 (the spw containing the representative frequency is always retained).

  • Step 4: Limit the number of science targets to image to 30 (representative target always retained).

The casa_commands.log file contains the tclean commands that can be re-run without mitigation. The casa_pipescript.py file explicitly encodes the threshold values so they can be modified on a per-MOUS basis.

Parameters:
  • vis --

    The list of input MeasurementSets. Defaults to the list of MeasurementSets specified in hifa_importdata and hifv_importdata.

    Examples: 'ngc5921.ms', ['ngc5921a.ms', ngc5921b.ms', 'ngc5921c.ms']

  • maxcubesize --

    Maximum allowed cube size in gigabytes (mitigation goal)

    Default: -1 - automatic from performance parameters

  • maxcubelimit --

    Maximum allowed cube limit in gigabytes (mitigation failure limit)

    Default: -1 - automatic from performance parameters

  • maxproductsize --

    Maximum allowed product size in gigabytes (mitigation goal and failure limit)

    Default: -1 - automatic from performance parameters

  • maximsize --

    Maximum allowed image count size (mitigation goal and hard maximum). Parameter maximsize must be even and divisible by 2, 3, 5, 7 only. *Caution* maximsize is disabled by default and cannot be set at the same time as maxcubesize, maxcubelimit and maxproductsize.

    Default: -1 - disables mitigation for this parameter

  • calcsb -- Force (re-)calculation of sensitivities and beams

  • parallel --

    Use the CASA imager parallelization when possible.

    Options: 'automatic', 'true', 'false', True, False

    Default: 'automatic'

Notes

QA = 1.0 if no mitigation was necessary; 0.85 (blue) if mitigation was applied; 0.0 if mitigation was attempted but failed (error message appears at the top of the WebLog page).

Returns:

The results object for the pipeline task is returned.

Examples

  1. Check product sizes with internal defaults:

>>> hif_checkproductsize()
  1. Standard ALMA call with explicit thresholds:

>>> hif_checkproductsize(maxcubesize=40.0, maxcubelimit=60.0, maxproductsize=350.0)