Skip to content
Snippets Groups Projects
Commit 1a807a25 authored by David Rafferty's avatar David Rafferty
Browse files

Add additional images to output

parent 28187124
No related branches found
No related tags found
1 merge request!75Add additional images to output
...@@ -13,13 +13,17 @@ Calibrate ...@@ -13,13 +13,17 @@ Calibrate
This operation calibrates the data using the current sky model. The exact steps done during calibration depend on the strategy, but essentially there are two main parts: a phase-only (scalar) solve on short timescales (the "fast-phase" solve, which corrects for ionospheric errors) and a phase and amplitude (diagonal) solve on long time scales (the "slow-gain" solve, which corrects for beam errors). The slow-gain solve is divided into two parts: an optional amplitude-only solve that constrains all stations to have the same solutions and a phase plus amplitude solve (without the station constraint and usually with a longer solution interval). This calibration strategy is based on the LBA strategy of the `LiLF pipeline <https://linc.readthedocs.io/>`_, with the idea that the same strategy can be used for both HBA and LBA (similar to the way the calibrator pipeline works in LINC). Lastly, processing of the resulting solutions is done, including smoothing, renormalization, and the generation of a-term images (if 2-D screens are used). This operation calibrates the data using the current sky model. The exact steps done during calibration depend on the strategy, but essentially there are two main parts: a phase-only (scalar) solve on short timescales (the "fast-phase" solve, which corrects for ionospheric errors) and a phase and amplitude (diagonal) solve on long time scales (the "slow-gain" solve, which corrects for beam errors). The slow-gain solve is divided into two parts: an optional amplitude-only solve that constrains all stations to have the same solutions and a phase plus amplitude solve (without the station constraint and usually with a longer solution interval). This calibration strategy is based on the LBA strategy of the `LiLF pipeline <https://linc.readthedocs.io/>`_, with the idea that the same strategy can be used for both HBA and LBA (similar to the way the calibrator pipeline works in LINC). Lastly, processing of the resulting solutions is done, including smoothing, renormalization, and the generation of a-term images (if 2-D screens are used).
For calibration, Rapthor searches for bright, compact sources (or groups of sources) throughout the field to use as calibrator sources. A target (apparent) flux density is used to ensure that the calibrators are sufficiently bright (set by :term:`target_flux` in the processing strategy). Rapthor then tessellates the full sky model, using the calibrators as the facet centers. This method ensures that each facet has a bright calibrator source in it. Despite this designation of calibrators for the tesselation, all sources are used in the calibration (not just the bright sources). For calibration, Rapthor searches for bright, compact sources (or groups of sources) throughout the field to use as calibrator sources. A target (apparent) flux density is used to ensure that the calibrators are sufficiently bright (set by :term:`target_flux` in the processing strategy). Rapthor then tessellates the full sky model, using the calibrators as the facet centers. This method ensures that each calibration patch (or facet) has a bright calibrator source in it. Despite this designation of calibrators for the tesselation, all sources are used in the calibration (not just the bright sources).
When multiple nodes are available, this task is distributed. When multiple nodes are available, this task is distributed.
Primary products: Primary products:
* ``field-solutions.h5``, stored in ``solutions/calibrate_X``, where ``X`` is the cycle number - the calibration solution table containing both fast-phase and slow-gain solutions. * In ``skymodels/calibrate_X``, where ``X`` is the cycle number:
* ``*.png`` files, stored in ``plots/calibrate_X``, where ``X`` is the cycle number - plots of the calibration solutions. * ``calibration_skymodel.txt`` - the sky model used for calibration, grouped into calibration patches (one per facet/direction). If a sky model was supplied by the user, this model will be identical (but potentially with a different grouping of the sources). If the sky model results from the previous cycle of self calibration, this model will be the sum of models from the imaging sectors (see :ref:`image` for details).
* In ``solutions/calibrate_X``, where ``X`` is the cycle number:
* ``field-solutions.h5`` - the calibration solution table containing both fast-phase and slow-gain solutions.
* In ``plots/calibrate_X``, where ``X`` is the cycle number:
* ``*.png`` files - plots of the calibration solutions. Plots are typically made with one file per direction (calibration patch), per solution type (amplitude, phase, or scalar phase). For example, the file ``scalarphase_dir[Patch_127].png`` contains the scalar phase solutions (from the "fast-phase" solve) for patch 127. If the "slow-gain" solve was done, additional files should be present with the names ``phase_dir[Patch_127]_polXX.png`` and ``amplitude_dir[Patch_127]_polXX.png`` (and similarly for the YY polarization). If the optional amplitude-only slow-gain solve was done, the solutions are combined with the phase plus amplitude solve before plotting.
.. _predict: .. _predict:
...@@ -30,9 +34,13 @@ This operation predicts visibilities for subtraction. Sources that lie outside o ...@@ -30,9 +34,13 @@ This operation predicts visibilities for subtraction. Sources that lie outside o
When multiple nodes are available, this task is distributed. When multiple nodes are available, this task is distributed.
Primary products (in ``pipelines/predict_X``, where ``X`` is the cycle number): Primary products:
* Temporary measurement sets used for the subsequent image operation. * In ``skymodels/predict_X``, where ``X`` is the cycle number:
* ``outlier_*_predict_skymodel.txt`` - sky models used for outlier subtraction
* ``bright_source_*_predict_skymodel.txt`` - sky models used for bright-source subtraction
* ``sector_*_predict_skymodel.txt`` - sky models used when multiple imaging sectors are used
* In ``pipelines/predict_X``, where ``X`` is the cycle number:
* Temporary measurement sets used for subsequent operations.
.. _image: .. _image:
...@@ -45,17 +53,25 @@ Diagnostics for each image are written to the log. They include the following: ...@@ -45,17 +53,25 @@ Diagnostics for each image are written to the log. They include the following:
* The minimum and theoretical RMS noise. The minimum noise is derived from 2-D RMS maps generated by PyBDSF. The theoretical noise is calculated following `SKA Memo 113 <http://www.skatelescope.org/uploaded/59513_113_Memo_Nijboer.pdf>`_ and the `LOFAR Image Noise Calculator <https://support.astron.nl/ImageNoiseCalculator/sens.php>`_. The calculation takes into account the amount of flagged data but does not include the effects of elevation. * The minimum and theoretical RMS noise. The minimum noise is derived from 2-D RMS maps generated by PyBDSF. The theoretical noise is calculated following `SKA Memo 113 <http://www.skatelescope.org/uploaded/59513_113_Memo_Nijboer.pdf>`_ and the `LOFAR Image Noise Calculator <https://support.astron.nl/ImageNoiseCalculator/sens.php>`_. The calculation takes into account the amount of flagged data but does not include the effects of elevation.
* The median RMS noise. The median noise is derived from 2-D RMS maps generated by PyBDSF. This median noise, along with the dynamic range (see below) is used to determine whether selfcal has converged (using the :term:`convergence_ratio` and :term:`divergence_ratio` defined by the processing strategy). * The median RMS noise. The median noise is derived from 2-D RMS maps generated by PyBDSF. This median noise, along with the dynamic range (see below) is used to determine whether selfcal has converged (using the :term:`convergence_ratio` and :term:`divergence_ratio` defined by the processing strategy).
* The dynamic range, calculated as the maximum value in the image divided by the minimum RMS noise. This quantity gives an estimate of how well focused the brightest source in the image is and is used, along with the median noise (see above) to determine whether selfcal has converged (see ). * The dynamic range, calculated as the maximum value in the image divided by the minimum RMS noise. This quantity gives an estimate of how well focused the brightest source in the image is and is used, along with the median noise (see above) to determine whether selfcal has converged.
* The number of sources found by PyBDSF. * The number of sources found by PyBDSF.
* The reference (central) frequency of the image. * The reference (central) frequency of the image.
* The restoring beam size and position angle. * The restoring beam size and position angle.
* The fraction of unflagged data. * The fraction of unflagged data.
* An estimate of the LOFAR-to-TGSS flux ratio. This ratio gives an indication of the accuracy of the overall flux scale of the image. * An estimate of the LOFAR-to-TGSS flux ratio (calculated as the mean of the measured LOFAR flux densities divided by the TGSS flux densities, after sigma clipping). This ratio gives an indication of the accuracy of the overall flux scale of the image.
* Estimates of the LOFAR-to-TGSS RA and Dec offsets. These offsets give an indication of the accuracy of the astrometry. * Estimates of the LOFAR-to-TGSS RA and Dec offsets (calculated as the mean of the LOFAR values minus the TGSS values, after sigma clipping). These offsets give an indication of the accuracy of the astrometry.
When multiple nodes are available, it is possible to distribute the imaging over multiple nodes. This is done by running wsclean-mp instead of wsclean. Currently, Toil does not fully support openmpi. To remedy this, a wrapping script around wsclean-mp is used on the 'master' node. Because of this, imaging can only use the worker nodes, and the master node is idle. When multiple nodes are available, it is possible to distribute the imaging over multiple nodes. This is done by running wsclean-mp instead of wsclean. Currently, Toil does not fully support openmpi. To remedy this, a wrapping script around wsclean-mp is used on the 'master' node. Because of this, imaging can only use the worker nodes, and the master node is idle.
Subtracted sources are restored in the image pipeline (near the end, in a step named wsclean_restore). Subtracted sources are restored in the image pipeline (near the end, in a step named wsclean_restore).
Primary products (in ``images/image_X``, where ``X`` is the cycle number): Primary products:
* ``field-MFS-I-image.fits`` - the Stokes I image * In ``images/image_X``, where ``X`` is the cycle number:
* ``field-MFS-image.fits`` - the Stokes I image, uncorrected for the primary beam attenuation (i.e., the apparent-sky, "flat-noise" image)
* ``field-MFS-image-pb.fits`` - the Stokes I image, corrected for the primary beam attenuation (i.e., the true-sky image)
* ``field-MFS-residual.fits`` - the Stokes I residual image
* ``field-MFS-model.fits`` - the Stokes I model image
* In ``skymodels/image_X``, where ``X`` is the cycle number:
* ``bright_source_skymodel.txt`` - sky model used to restore bright sources after imaging (present only if bright sources were subtracted in the preceding predict operation).
* ``sector_Y.true_sky.txt``, where ``Y`` is the image sector number - the sky model (generated by WSClean) for the sector, with true-sky flux densities.
* ``sector_Y.apparent_sky.txt``, where ``Y`` is the image sector number - the sky model for the sector, with apparent-sky flux densities, generated from the true-sky one by attenuating it with the LOFAR primary beam.
...@@ -6,22 +6,22 @@ Output ...@@ -6,22 +6,22 @@ Output
Rapthor produces the following output inside the working directory: Rapthor produces the following output inside the working directory:
``logs/`` ``logs/``
Directory containing the log files. Directory containing the log files. The main log file for the run is called ``rapthor.log``. The detailed logs of each step of the processing can be found in the subdirectories.
``images/`` ``images/``
Directory containing the FITS images. Directory containing the FITS images. See :ref:`image` for a detailed description of the images.
``pipelines/`` ``pipelines/``
Directory containing intermediate files of each operation's pipeline. Directory containing intermediate files of each operation's pipeline. Once a run has finished successfully, this directory can be removed.
``regions/`` ``regions/``
Directory containing ds9 region files. Directory containing ds9 region files. These regions define the imaged areas and the facet layout (if used).
``skymodels/`` ``skymodels/``
Directory containing sky model files. Directory containing sky model files. See :ref:`calibrate` and :ref:`image` for a detailed description of the sky models.
``solutions/`` ``solutions/``
Directory containing the calibration solution h5parm files. Directory containing the calibration solution h5parm files. See :ref:`calibrate` for a detailed description of the solution files.
``plots/`` ``plots/``
Directory containing the PNG plots of the calibration solutions and images. Directory containing the PNG plots of the calibration solutions and images. See :ref:`calibrate` for a detailed description of the plots.
...@@ -208,7 +208,8 @@ class Image(Operation): ...@@ -208,7 +208,8 @@ class Image(Operation):
image_root = os.path.join(self.pipeline_working_dir, sector.name) image_root = os.path.join(self.pipeline_working_dir, sector.name)
sector.I_image_file_true_sky = image_root + '-MFS-image-pb.fits' sector.I_image_file_true_sky = image_root + '-MFS-image-pb.fits'
sector.I_image_file_apparent_sky = image_root + '-MFS-image.fits' sector.I_image_file_apparent_sky = image_root + '-MFS-image.fits'
sector.I_model_file_true_sky = image_root + '-MFS-model-pb.fits' sector.I_model_file_true_sky = image_root + '-MFS-model.fits'
sector.I_residual_file_apparent_sky = image_root + '-MFS-residual.fits'
# Check to see if a clean mask image was made (only made when at least one # Check to see if a clean mask image was made (only made when at least one
# island is found in the Stokes I image). The filename is defined # island is found in the Stokes I image). The filename is defined
...@@ -227,6 +228,13 @@ class Image(Operation): ...@@ -227,6 +228,13 @@ class Image(Operation):
# in the rapthor/scripts/filter_skymodel.py file) # in the rapthor/scripts/filter_skymodel.py file)
sector.image_skymodel_file_true_sky = image_root + '.true_sky.txt' sector.image_skymodel_file_true_sky = image_root + '.true_sky.txt'
sector.image_skymodel_file_apparent_sky = image_root + '.apparent_sky.txt' sector.image_skymodel_file_apparent_sky = image_root + '.apparent_sky.txt'
dst_dir = os.path.join(self.parset['dir_working'], 'skymodels', 'image_{}'.format(self.index))
misc.create_directory(dst_dir)
for src_filename in [sector.image_skymodel_file_true_sky, sector.image_skymodel_file_apparent_sky]:
dst_filename = os.path.join(dst_dir, os.path.basename(src_filename))
if os.path.exists(dst_filename):
os.remove(dst_filename)
shutil.copy(src_filename, dst_filename)
# The ds9 region file, if made # The ds9 region file, if made
if self.field.dde_method == 'facets': if self.field.dde_method == 'facets':
......
...@@ -17,6 +17,11 @@ class Mosaic(Operation): ...@@ -17,6 +17,11 @@ class Mosaic(Operation):
""" """
def __init__(self, field, index): def __init__(self, field, index):
super(Mosaic, self).__init__(field, name='mosaic', index=index) super(Mosaic, self).__init__(field, name='mosaic', index=index)
# For each image type we use a subworkflow, so we set the template filename
# for that here
self.subpipeline_parset_template = '{0}_type_pipeline.cwl'.format(self.rootname)
# Determine whether processing is needed # Determine whether processing is needed
self.skip_processing = len(self.field.imaging_sectors) < 2 self.skip_processing = len(self.field.imaging_sectors) < 2
...@@ -31,6 +36,7 @@ class Mosaic(Operation): ...@@ -31,6 +36,7 @@ class Mosaic(Operation):
else: else:
max_cores = self.field.parset['cluster_specific']['max_cores'] max_cores = self.field.parset['cluster_specific']['max_cores']
self.parset_parms = {'rapthor_pipeline_dir': self.rapthor_pipeline_dir, self.parset_parms = {'rapthor_pipeline_dir': self.rapthor_pipeline_dir,
'pipeline_working_dir': self.pipeline_working_dir,
'max_cores': max_cores, 'max_cores': max_cores,
'skip_processing': self.skip_processing, 'skip_processing': self.skip_processing,
'do_slowgain_solve': self.field.do_slowgain_solve} 'do_slowgain_solve': self.field.do_slowgain_solve}
...@@ -43,20 +49,34 @@ class Mosaic(Operation): ...@@ -43,20 +49,34 @@ class Mosaic(Operation):
sector_image_filename = [] sector_image_filename = []
sector_vertices_filename = [] sector_vertices_filename = []
regridded_image_filename = [] regridded_image_filename = []
template_image_filename = []
self.image_names = ['I_image_file_true_sky', 'I_image_file_apparent_sky',
'I_model_file_true_sky', 'I_residual_file_apparent_sky']
for image_name in self.image_names:
image_list = []
vertices_list = []
regridded_list = []
for sector in self.field.imaging_sectors: for sector in self.field.imaging_sectors:
sector_image_filename.append(CWLFile(sector.I_image_file_true_sky).to_json()) image_list.append(getattr(sector, image_name))
sector_vertices_filename.append(CWLFile(sector.vertices_file).to_json()) vertices_list.append(sector.vertices_file)
regridded_image_filename.append(os.path.basename(sector.I_image_file_true_sky) + '.regridded') regridded_list.append(os.path.basename(getattr(sector, image_name)) + '.regridded')
template_image_filename = self.name + '_template.fits' sector_image_filename.append(CWLFile(image_list).to_json())
sector_vertices_filename.append(CWLFile(vertices_list).to_json())
regridded_image_filename.append(regridded_list)
template_image_filename.append(self.name + '_template.fits')
self.mosaic_filename = []
if self.skip_processing: if self.skip_processing:
if len(self.field.imaging_sectors) > 0: if len(self.field.imaging_sectors) > 0:
# Use unprocessed file as mosaic file # Use unprocessed files as mosaic files
self.mosaic_filename = self.field.imaging_sectors[0].I_image_file_true_sky for image_name in self.image_names:
self.mosaic_filename.append(getattr(self.field.imaging_sectors[0], image_name))
else: else:
self.mosaic_filename = None self.mosaic_filename.append(None)
else: else:
self.mosaic_filename = self.name + '-MFS-I-image.fits' for image_name in self.image_names:
suffix = getattr(self.field.imaging_sectors[0], image_name).split('MFS')[-1]
self.mosaic_filename.append('{0}-MFS{1}'.format(self.name, suffix))
self.input_parms = {'skip_processing': self.skip_processing, self.input_parms = {'skip_processing': self.skip_processing,
'sector_image_filename': sector_image_filename, 'sector_image_filename': sector_image_filename,
...@@ -69,22 +89,23 @@ class Mosaic(Operation): ...@@ -69,22 +89,23 @@ class Mosaic(Operation):
""" """
Finalize this operation Finalize this operation
""" """
if self.mosaic_filename is None: for i, image_name in enumerate(self.image_names):
return if self.mosaic_filename[i] is None:
continue
# Save the FITS image and model # Copy the image to the images directory
dst_dir = os.path.join(self.field.parset['dir_working'], 'images', dst_dir = os.path.join(self.field.parset['dir_working'], 'images',
'image_{}'.format(self.index)) 'image_{}'.format(self.index))
misc.create_directory(dst_dir) misc.create_directory(dst_dir)
suffix = getattr(self.field.imaging_sectors[0], image_name).split('MFS')[-1]
field_image_filename = os.path.join(dst_dir, 'field-MFS{}'.format(suffix))
if image_name == 'I_image_file_true_sky':
# Save the Stokes I true-sky image filename as an attribute of the field
# object for later use
self.field.field_image_filename_prev = self.field.field_image_filename self.field.field_image_filename_prev = self.field.field_image_filename
self.field.field_image_filename = os.path.join(dst_dir, 'field-MFS-I-image.fits') self.field.field_image_filename = field_image_filename
shutil.copy(os.path.join(self.pipeline_working_dir, self.mosaic_filename), shutil.copy(os.path.join(self.pipeline_working_dir, self.mosaic_filename[i]),
self.field.field_image_filename) field_image_filename)
# TODO: make mosaic of model + QUV?
# self.field_model_filename = os.path.join(dst_dir, 'field-MFS-I-model.fits')
# TODO: clean up template+regridded images
# Finally call finalize() in the parent class # Finally call finalize() in the parent class
super().finalize() super().finalize()
...@@ -336,6 +336,8 @@ outputs: ...@@ -336,6 +336,8 @@ outputs:
- image/image_nonpb_name - image/image_nonpb_name
- image/image_pb_name - image/image_pb_name
{% endif %} {% endif %}
- image/residual_name
- image/model_name
- image/skymodel_nonpb - image/skymodel_nonpb
- image/skymodel_pb - image/skymodel_pb
type: File[] type: File[]
...@@ -548,6 +550,8 @@ steps: ...@@ -548,6 +550,8 @@ steps:
out: out:
- id: image_nonpb_name - id: image_nonpb_name
- id: image_pb_name - id: image_pb_name
- id: residual_name
- id: model_name
- id: skymodel_nonpb - id: skymodel_nonpb
- id: skymodel_pb - id: skymodel_pb
......
...@@ -9,8 +9,10 @@ doc: | ...@@ -9,8 +9,10 @@ doc: |
# start not skip_processing # start not skip_processing
requirements: requirements:
MultipleInputFeatureRequirement: {}
ScatterFeatureRequirement: {} ScatterFeatureRequirement: {}
StepInputExpressionRequirement: {} StepInputExpressionRequirement: {}
SubworkflowFeatureRequirement: {}
{% if max_cores is not none %} {% if max_cores is not none %}
hints: hints:
...@@ -23,32 +25,44 @@ inputs: ...@@ -23,32 +25,44 @@ inputs:
- id: sector_image_filename - id: sector_image_filename
label: Filenames of images label: Filenames of images
doc: | doc: |
The filenames of the sector FITS images (length = n_sectors). The filenames of the sector FITS images (length = n_sectors * n_img_types).
type: File[] type:
type: array
items:
type: array
items: File
- id: sector_vertices_filename - id: sector_vertices_filename
label: Filenames of vertices files label: Filenames of vertices files
doc: | doc: |
The filenames of the sector vertices files (length = n_sectors). The filenames of the sector vertices files (length = n_sectors * n_img_types).
type: File[] type:
type: array
items:
type: array
items: File
- id: template_image_filename - id: template_image_filename
label: Filename of template image label: Filename of template image
doc: | doc: |
The filename of the temporary mosaic template image (length = 1). The filename of the temporary mosaic template image (length = n_img_types).
type: string type: string[]
- id: regridded_image_filename - id: regridded_image_filename
label: Filenames of images label: Filenames of images
doc: | doc: |
The filenames of the regridded sector images (length = n_sectors). The filenames of the regridded sector images (length = n_sectors * n_img_types).
type: string[] type:
type: array
items:
type: array
items: string
- id: mosaic_filename - id: mosaic_filename
label: Filename of mosiac image label: Filename of mosiac image
doc: | doc: |
The filename of the final mosaic image (length = 1). The filename of the final mosaic image (length = n_img_types).
type: string type: string[]
- id: skip_processing - id: skip_processing
label: Flag to skip processing label: Flag to skip processing
...@@ -59,65 +73,32 @@ inputs: ...@@ -59,65 +73,32 @@ inputs:
outputs: outputs:
- id: mosaic_image - id: mosaic_image
outputSource: outputSource:
- make_mosaic/mosaic_image - mosaic_by_type/mosaic_image
type: File type: File[]
steps: steps:
- id: make_mosaic_template - id: mosaic_by_type
label: Make mosaic template label: Mosiac an image type
doc: | doc: |
This step makes a temporary template FITS image that is used This step is a subpipeline that performs the processing for each image
in the regrid_image and make_mosaic steps. type.
run: {{ rapthor_pipeline_dir }}/steps/make_mosaic_template.cwl run: {{ pipeline_working_dir }}/subpipeline_parset.cwl
in: in:
- id: input_image_list - id: sector_image_filename
source: sector_image_filename source: sector_image_filename
- id: vertices_file_list - id: sector_vertices_filename
source: sector_vertices_filename source: sector_vertices_filename
- id: output_image - id: template_image_filename
source: template_image_filename source: template_image_filename
- id: skip - id: regridded_image_filename
source: skip_processing
out:
- id: template_image
- id: regrid_image
label: Regrid image
doc: |
This step regrids FITS images to the grid of the template FITS
image made in the make_mosaic_template step.
run: {{ rapthor_pipeline_dir }}/steps/regrid_image.cwl
in:
- id: input_image
source: sector_image_filename
- id: template_image
source: make_mosaic_template/template_image
- id: vertices_file
source: sector_vertices_filename
- id: output_image
source: regridded_image_filename source: regridded_image_filename
- id: skip - id: mosaic_filename
source: skip_processing
scatter: [input_image, vertices_file, output_image]
scatterMethod: dotproduct
out:
- id: regridded_image
- id: make_mosaic
label: Make mosaic
doc: |
This step makes the final mosaic FITS image from the regridded
sector images.
run: {{ rapthor_pipeline_dir }}/steps/make_mosaic.cwl
in:
- id: input_image_list
source: regrid_image/regridded_image
- id: template_image
source: make_mosaic_template/template_image
- id: output_image
source: mosaic_filename source: mosaic_filename
- id: skip - id: skip_processing
source: skip_processing source: skip_processing
scatter: [sector_image_filename, sector_vertices_filename, template_image_filename,
regridded_image_filename, mosaic_filename]
scatterMethod: dotproduct
out: out:
- id: mosaic_image - id: mosaic_image
......
cwlVersion: v1.2
class: Workflow
label: Rapthor mosaicking subpipeline
doc: |
This subworkflow performs the mosaicking of a single type of image made with the
imaging pipeline. If only a single image was made, processing is (mostly) skipped.
requirements:
ScatterFeatureRequirement: {}
StepInputExpressionRequirement: {}
{% if max_cores is not none %}
hints:
ResourceRequirement:
coresMin: {{ max_cores }}
coresMax: {{ max_cores }}
{% endif %}
inputs:
- id: sector_image_filename
label: Filenames of images
doc: |
The filenames of the sector FITS images (length = n_sectors).
type: File[]
- id: sector_vertices_filename
label: Filenames of vertices files
doc: |
The filenames of the sector vertices files (length = n_sectors).
type: File[]
- id: template_image_filename
label: Filename of template image
doc: |
The filename of the temporary mosaic template image (length = 1).
type: string
- id: regridded_image_filename
label: Filenames of images
doc: |
The filenames of the regridded sector images (length = n_sectors).
type: string[]
- id: mosaic_filename
label: Filename of mosiac image
doc: |
The filename of the final mosaic image (length = 1).
type: string
- id: skip_processing
label: Flag to skip processing
doc: |
The flag that sets whether processing is skipped or not (length = 1).
type: boolean
outputs:
- id: mosaic_image
outputSource:
- make_mosaic/mosaic_image
type: File
steps:
- id: make_mosaic_template
label: Make mosaic template
doc: |
This step makes a temporary template FITS image that is used
in the regrid_image and make_mosaic steps.
run: {{ rapthor_pipeline_dir }}/steps/make_mosaic_template.cwl
in:
- id: input_image_list
source: sector_image_filename
- id: vertices_file_list
source: sector_vertices_filename
- id: output_image
source: template_image_filename
- id: skip
source: skip_processing
out:
- id: template_image
- id: regrid_image
label: Regrid image
doc: |
This step regrids FITS images to the grid of the template FITS
image made in the make_mosaic_template step.
run: {{ rapthor_pipeline_dir }}/steps/regrid_image.cwl
in:
- id: input_image
source: sector_image_filename
- id: template_image
source: make_mosaic_template/template_image
- id: vertices_file
source: sector_vertices_filename
- id: output_image
source: regridded_image_filename
- id: skip
source: skip_processing
scatter: [input_image, vertices_file, output_image]
scatterMethod: dotproduct
out:
- id: regridded_image
- id: make_mosaic
label: Make mosaic
doc: |
This step makes the final mosaic FITS image from the regridded
sector images.
run: {{ rapthor_pipeline_dir }}/steps/make_mosaic.cwl
in:
- id: input_image_list
source: regrid_image/regridded_image
- id: template_image
source: make_mosaic_template/template_image
- id: output_image
source: mosaic_filename
- id: skip
source: skip_processing
out:
- id: mosaic_image
...@@ -162,6 +162,14 @@ outputs: ...@@ -162,6 +162,14 @@ outputs:
type: File type: File
outputBinding: outputBinding:
glob: $(inputs.name)-MFS-image-pb.fits glob: $(inputs.name)-MFS-image-pb.fits
- id: residual_name
type: File
outputBinding:
glob: $(inputs.name)-MFS-residual.fits
- id: model_name
type: File
outputBinding:
glob: $(inputs.name)-MFS-model.fits
- id: skymodel_nonpb - id: skymodel_nonpb
type: File type: File
outputBinding: outputBinding:
......
...@@ -127,6 +127,14 @@ outputs: ...@@ -127,6 +127,14 @@ outputs:
type: File type: File
outputBinding: outputBinding:
glob: $(inputs.name)-MFS-image-pb.fits glob: $(inputs.name)-MFS-image-pb.fits
- id: residual_name
type: File
outputBinding:
glob: $(inputs.name)-MFS-residual.fits
- id: model_name
type: File
outputBinding:
glob: $(inputs.name)-MFS-model.fits
- id: skymodel_nonpb - id: skymodel_nonpb
type: File type: File
outputBinding: outputBinding:
......
...@@ -219,6 +219,22 @@ outputs: ...@@ -219,6 +219,22 @@ outputs:
type: File type: File
outputBinding: outputBinding:
glob: $(inputs.name)-MFS-image-pb.fits glob: $(inputs.name)-MFS-image-pb.fits
- id: residual_name
label: Output residual image
doc: |
The filename of the output residual image. The value is constructed from
the input parameter "name"
type: File
outputBinding:
glob: $(inputs.name)-MFS-residual.fits
- id: model_name
label: Output model image
doc: |
The filename of the output model image. The value is constructed from the
input parameter "name"
type: File
outputBinding:
glob: $(inputs.name)-MFS-model.fits
- id: skymodel_nonpb - id: skymodel_nonpb
label: Output non-PB-corrected sky model label: Output non-PB-corrected sky model
doc: | doc: |
......
...@@ -169,6 +169,14 @@ outputs: ...@@ -169,6 +169,14 @@ outputs:
type: File type: File
outputBinding: outputBinding:
glob: $(inputs.name)-MFS-image-pb.fits glob: $(inputs.name)-MFS-image-pb.fits
- id: residual_name
type: File
outputBinding:
glob: $(inputs.name)-MFS-residual.fits
- id: model_name
type: File
outputBinding:
glob: $(inputs.name)-MFS-model.fits
- id: skymodel_nonpb - id: skymodel_nonpb
type: File type: File
outputBinding: outputBinding:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment