# This is a simple task which converts an existing image into a point # source model image, then runs ft to fill the model data column in # the desired MS, if requested. import os from taskinit import * from ft_cli import ft_cli as ft def mkmodelimage(imagein = None, imageout = None, xcoord = None, ycoord = None, fluxval = None, doft = None, vis = None): # Print any logger messages as originating from mkmodelimage casalog.origin('mkmodelimage') # Copy the input image to the output image name os.system('cp -rp '+imagein+' '+imageout) # Use the image toolkit module to zero out the new image, and add # the desired value to the requested x, y coordinate ia.open(imageout) data=ia.getchunk() data[:, :, 0, 0] = data[:, :, 0, 0]*0 data[xcoord, ycoord, 0, 0] = fluxval ia.putchunk(data) ia.close() # This is a task call; one could do this with the toolkit as well if doft: ft(vis, model=imageout)