processing_library/image/operations.py
def create_image(npixel=512, cellsize=0.000015, polarisation_frame=PolarisationFrame("stokesI"),
                 frequency=numpy.array([1e8]), channel_bandwidth=numpy.array([1e6]),
                 phasecentre=None, nchan=None) -> Image:
    """Create an empty template image consistent with the inputs.

    :param npixel: Number of pixels
    :param polarisation_frame: Polarisation frame (default PolarisationFrame("stokesI"))
    :param cellsize: cellsize in radians
    :param frequency:
    :param channel_bandwidth: Channel width (Hz)
    :param phasecentre: phasecentre (SkyCoord)
    :return: Image

    """
    
    if phasecentre is None:
        phasecentre = SkyCoord(ra=+15.0 * u.deg, dec=-35.0 * u.deg, frame='icrs', equinox='J2000')
    
    if polarisation_frame is None:
        polarisation_frame = PolarisationFrame("stokesI")
    
    npol = polarisation_frame.npol
    if nchan is None:
        nchan = len(frequency)
        
    shape = [nchan, npol, npixel, npixel]
    w = WCS(naxis=4)
    # The negation in the longitude is needed by definition of RA, DEC
    w.wcs.cdelt = [-cellsize * 180.0 / numpy.pi, cellsize * 180.0 / numpy.pi, 1.0, channel_bandwidth[0]]
    w.wcs.crpix = [npixel // 2 + 1, npixel // 2 + 1, 1.0, 1.0]
    w.wcs.ctype = ["RA---SIN", "DEC--SIN", 'STOKES', 'FREQ']
    w.wcs.crval = [phasecentre.ra.deg, phasecentre.dec.deg, 1.0, frequency[0]]
    w.naxis = 4
    w.wcs.radesys = 'ICRS'
    w.wcs.equinox = 2000.0
    
    return create_image_from_array(numpy.zeros(shape), w, polarisation_frame=polarisation_frame)
Create an empty template image consistent with the inputs.

    :param npixel: Number of pixels
    :param polarisation_frame: Polarisation frame (default PolarisationFrame("stokesI"))
    :param cellsize: cellsize in radians
    :param frequency:
    :param channel_bandwidth: Channel width (Hz)
    :param phasecentre: phasecentre (SkyCoord)
    :return: Image

    
Create an empty template image consistent with the inputs.
Create an empty template image consistent with the inputs .
def create_image(npixel=512, cellsize=0.000015, polarisation_frame=PolarisationFrame("stokesI"),
                 frequency=numpy.array([1e8]), channel_bandwidth=numpy.array([1e6]),
                 phasecentre=None, nchan=None) -> Image:
    if phasecentre is None:
        phasecentre = SkyCoord(ra=+15.0 * u.deg, dec=-35.0 * u.deg, frame='icrs', equinox='J2000')
    if polarisation_frame is None:
        polarisation_frame = PolarisationFrame("stokesI")
    npol = polarisation_frame.npol
    if nchan is None:
        nchan = len(frequency)
    shape = [nchan, npol, npixel, npixel]
    w = WCS(naxis=4)
    w.wcs.cdelt = [-cellsize * 180.0 / numpy.pi, cellsize * 180.0 / numpy.pi, 1.0, channel_bandwidth[0]]
    w.wcs.crpix = [npixel // 2 + 1, npixel // 2 + 1, 1.0, 1.0]
    w.wcs.ctype = ["RA---SIN", "DEC--SIN", 'STOKES', 'FREQ']
    w.wcs.crval = [phasecentre.ra.deg, phasecentre.dec.deg, 1.0, frequency[0]]
    w.naxis = 4
    w.wcs.radesys = 'ICRS'
    w.wcs.equinox = 2000.0
    return create_image_from_array(numpy.zeros(shape), w, polarisation_frame=polarisation_frame)
def create_image ( npixel = 512 , cellsize = 0.000015 , polarisation_frame = PolarisationFrame ( "stokesI" ) , frequency = numpy . array ( [ 1e8 ] ) , channel_bandwidth = numpy . array ( [ 1e6 ] ) , phasecentre = None , nchan = None ) -> Image : if phasecentre is None : phasecentre = SkyCoord ( ra = + 15.0 * u . deg , dec = - 35.0 * u . deg , frame = 'icrs' , equinox = 'J2000' ) if polarisation_frame is None : polarisation_frame = PolarisationFrame ( "stokesI" ) npol = polarisation_frame . npol if nchan is None : nchan = len ( frequency ) shape = [ nchan , npol , npixel , npixel ] w = WCS ( naxis = 4 ) w . wcs . cdelt = [ - cellsize * 180.0 / numpy . pi , cellsize * 180.0 / numpy . pi , 1.0 , channel_bandwidth [ 0 ] ] w . wcs . crpix = [ npixel // 2 + 1 , npixel // 2 + 1 , 1.0 , 1.0 ] w . wcs . ctype = [ "RA---SIN" , "DEC--SIN" , 'STOKES' , 'FREQ' ] w . wcs . crval = [ phasecentre . ra . deg , phasecentre . dec . deg , 1.0 , frequency [ 0 ] ] w . naxis = 4 w . wcs . radesys = 'ICRS' w . wcs . equinox = 2000.0 return create_image_from_array ( numpy . zeros ( shape ) , w , polarisation_frame = polarisation_frame )
Create an empty template image consistent with the inputs.
Create an empty template image consistent with the inputs .
"""Create an empty template image consistent with the inputs.

    :param npixel: Number of pixels
    :param polarisation_frame: Polarisation frame (default PolarisationFrame("stokesI"))
    :param cellsize: cellsize in radians
    :param frequency:
    :param channel_bandwidth: Channel width (Hz)
    :param phasecentre: phasecentre (SkyCoord)
    :return: Image

    """ # The negation in the longitude is needed by definition of RA, DEC
None
npixel
Number of pixels
Number of pixels
cellsize
cellsize in radians
cellsize in radians
polarisation_frame
Polarisation frame (default PolarisationFrame("stokesI"))
Polarisation frame ( default PolarisationFrame ( " stokesI " ))
frequency
None
channel_bandwidth
Channel width (Hz)
Channel width ( Hz )
phasecentre
None
nchan