workflows/arlexecute/skymodel/skymodel_arlexecute.py
def invert_skymodel_list_arlexecute_workflow(vis_list, skymodel_list, context, vis_slices=1, facets=1,
                                             gcfcf=None, docal=False, **kwargs):
    """Calibrate and invert from a skymodel, iterating over the skymodel

    The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
    parts are assembled. The mask if present, is multiplied in at the end.

    :param vis_list: List of Visibility data models
    :param skymodel_list: skymodel list
    :param vis_slices: Number of vis slices (w stack or timeslice)
    :param facets: Number of facets (per axis)
    :param context: Type of processing e.g. 2d, wstack, timeslice or facets
    :param gcfcg: tuple containing grid correction and convolution function
    :param docal: Apply calibration table in skymodel
    :param kwargs: Parameters for functions in components
    :return: List of (image, weight) tuples)
   """
    
    def ift_ical_sm(v, sm, g):
        assert isinstance(v, Visibility) or isinstance(v, BlockVisibility), v
        assert isinstance(sm, SkyModel), sm
        if g is not None:
            assert len(g) == 2, g
            assert isinstance(g[0], Image), g[0]
            assert isinstance(g[1], ConvolutionFunction), g[1]
        
        if docal and isinstance(sm.gaintable, GainTable):
            if isinstance(v, Visibility):
                bv = convert_visibility_to_blockvisibility(v)
                bv = apply_gaintable(bv, sm.gaintable)
                v = convert_blockvisibility_to_visibility(bv)
            else:
                v = apply_gaintable(v, sm.gaintable)
            
        result = invert_list_serial_workflow([v], [sm.image], context=context,
                                             vis_slices=vis_slices, facets=facets, gcfcf=[g],
                                             **kwargs)[0]
        if isinstance(sm.mask, Image):
            result[0].data *= sm.mask.data
        
        return result
    if gcfcf is None:
        return [arlexecute.execute(ift_ical_sm, nout=1)(vis_list[i], sm, None)
                for i, sm in enumerate(skymodel_list)]
    else:
        return [arlexecute.execute(ift_ical_sm, nout=1)(vis_list[i], sm, gcfcf[i])
                for i, sm in enumerate(skymodel_list)]
Calibrate and invert from a skymodel, iterating over the skymodel

    The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
    parts are assembled. The mask if present, is multiplied in at the end.

    :param vis_list: List of Visibility data models
    :param skymodel_list: skymodel list
    :param vis_slices: Number of vis slices (w stack or timeslice)
    :param facets: Number of facets (per axis)
    :param context: Type of processing e.g. 2d, wstack, timeslice or facets
    :param gcfcg: tuple containing grid correction and convolution function
    :param docal: Apply calibration table in skymodel
    :param kwargs: Parameters for functions in components
    :return: List of (image, weight) tuples)
   
Calibrate and invert from a skymodel, iterating over the skymodel
The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
parts are assembled. The mask if present, is multiplied in at the end.
Calibrate and invert from a skymodel iterating over the skymodel The visibility and image are scattered the visibility is predicted and calibrated on each part and then the parts are assembled . The mask if present is multiplied in at the end .
def invert_skymodel_list_arlexecute_workflow(vis_list, skymodel_list, context, vis_slices=1, facets=1,
                                             gcfcf=None, docal=False, **kwargs):
    def ift_ical_sm(v, sm, g):
        assert isinstance(v, Visibility) or isinstance(v, BlockVisibility), v
        assert isinstance(sm, SkyModel), sm
        if g is not None:
            assert len(g) == 2, g
            assert isinstance(g[0], Image), g[0]
            assert isinstance(g[1], ConvolutionFunction), g[1]
        if docal and isinstance(sm.gaintable, GainTable):
            if isinstance(v, Visibility):
                bv = convert_visibility_to_blockvisibility(v)
                bv = apply_gaintable(bv, sm.gaintable)
                v = convert_blockvisibility_to_visibility(bv)
            else:
                v = apply_gaintable(v, sm.gaintable)
        result = invert_list_serial_workflow([v], [sm.image], context=context,
                                             vis_slices=vis_slices, facets=facets, gcfcf=[g],
                                             **kwargs)[0]
        if isinstance(sm.mask, Image):
            result[0].data *= sm.mask.data
        return result
    if gcfcf is None:
        return [arlexecute.execute(ift_ical_sm, nout=1)(vis_list[i], sm, None)
                for i, sm in enumerate(skymodel_list)]
    else:
        return [arlexecute.execute(ift_ical_sm, nout=1)(vis_list[i], sm, gcfcf[i])
                for i, sm in enumerate(skymodel_list)]
def invert_skymodel_list_arlexecute_workflow ( vis_list , skymodel_list , context , vis_slices = 1 , facets = 1 , gcfcf = None , docal = False , ** kwargs ) : def ift_ical_sm ( v , sm , g ) : assert isinstance ( v , Visibility ) or isinstance ( v , BlockVisibility ) , v assert isinstance ( sm , SkyModel ) , sm if g is not None : assert len ( g ) == 2 , g assert isinstance ( g [ 0 ] , Image ) , g [ 0 ] assert isinstance ( g [ 1 ] , ConvolutionFunction ) , g [ 1 ] if docal and isinstance ( sm . gaintable , GainTable ) : if isinstance ( v , Visibility ) : bv = convert_visibility_to_blockvisibility ( v ) bv = apply_gaintable ( bv , sm . gaintable ) v = convert_blockvisibility_to_visibility ( bv ) else : v = apply_gaintable ( v , sm . gaintable ) result = invert_list_serial_workflow ( [ v ] , [ sm . image ] , context = context , vis_slices = vis_slices , facets = facets , gcfcf = [ g ] , ** kwargs ) [ 0 ] if isinstance ( sm . mask , Image ) : result [ 0 ] . data *= sm . mask . data return result if gcfcf is None : return [ arlexecute . execute ( ift_ical_sm , nout = 1 ) ( vis_list [ i ] , sm , None ) for i , sm in enumerate ( skymodel_list ) ] else : return [ arlexecute . execute ( ift_ical_sm , nout = 1 ) ( vis_list [ i ] , sm , gcfcf [ i ] ) for i , sm in enumerate ( skymodel_list ) ]
Calibrate and invert from a skymodel, iterating over the skymodel
The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
parts are assembled.
Calibrate and invert from a skymodel iterating over the skymodel The visibility and image are scattered the visibility is predicted and calibrated on each part and then the parts are assembled .
"""Calibrate and invert from a skymodel, iterating over the skymodel

    The visibility and image are scattered, the visibility is predicted and calibrated on each part, and then the
    parts are assembled. The mask if present, is multiplied in at the end.

    :param vis_list: List of Visibility data models
    :param skymodel_list: skymodel list
    :param vis_slices: Number of vis slices (w stack or timeslice)
    :param facets: Number of facets (per axis)
    :param context: Type of processing e.g. 2d, wstack, timeslice or facets
    :param gcfcg: tuple containing grid correction and convolution function
    :param docal: Apply calibration table in skymodel
    :param kwargs: Parameters for functions in components
    :return: List of (image, weight) tuples)
   """
List of (image, weight) tuples)
List of ( image weight ) tuples )
vis_list
List of Visibility data models
List of Visibility data models
skymodel_list
None
context
Type of processing e.g. 2d, wstack, timeslice or facets
Type of processing e . g . 2d wstack timeslice or facets
vis_slices
Number of vis slices (w stack or timeslice)
Number of vis slices ( w stack or timeslice )
facets
Number of facets (per axis)
Number of facets ( per axis )
gcfcf
docal
Apply calibration table in skymodel
Apply calibration table in skymodel
gcfcg
tuple containing grid correction and convolution function
tuple containing grid correction and convolution function
kwargs
Parameters for functions in components
Parameters for functions in components