Several RegriddedFrames created from ReducedScienceFrames (see HOW-TO Create a RegriddedFrame or HOW-TO Create a ReducedScienceFrame respectively) can be coadded to form a deeper image with a substantial reduction of chip defects and divisions (a CoaddedRegriddedFrame).

NOTE: At this time, the CoaddTask does not allow frames from multiple instruments to be coadded. It should be possible to do this provided all the RegriddedFrames were regridded to the same grid target (R.A., DEC., and pixel scale [1]), but this operation is currently not supported.

## DPU Method¶

At the moment, the CoaddTask is a purely serial operation which takes place on only one node of the DPU. Some possible reasons to use the DPU for this task are because the machines on the DPU are much faster than the local machine, or because no local machine is available.

awe> dpu.run('Coadd', d='2000-01-01', i='WFI', f='#843', o='Science1_?-*')


• i (instrument, mandatory): string
• f (filter, mandatory): string
• d (date): string of the form CCYY-MM-DD
• o (object): string or “regular expression”
• C (commit): integer=0..1 (optional, default=0)

This example shows how to run the DPU CoaddTask using date, filter, and object information. This allows one to process all data for a given object on a specific day taken in a certain filter, for all CCDs of the mosaic.

The options can be used in any order and can be omitted (except ‘i’), but the likelihood of locating required data depends on relaying a minimum of information as shown in the examples.

## Non-DPU Method¶

This task can also be performed on a per chip basis. The CoaddTask is the main part of the recipe \$AWEPIPE/astro/recipes/Coadd.py. This is most basic front-end for creating CoaddedRegriddedFrames in AWE. An examples of the syntax for the CoaddTask is given below:

awe> task = CoaddTask(instrument='WFI', date='2000-01-01', chip='ccd50',
...                  filter='#843', object='Science1_?-*')


• instrument, mandatory: string
• filter, mandatory: string
• date: string of the form CCYY-MM-DD
• chip: string
• object: string or “regular expression”
• commit: integer=0..1 (optional, default=0)

This example shows how to run the CoaddTask using date, chip, filter, and object information. This allows one to process all data for a given object on a specific day taken in a certain filter, and only one CCD of the mosaic.

The options can be used in any order and can be omitted, but the likelihood of locating required data depends on relaying a minimum of information as shown in the examples.

The algorithm behind the coaddition is described via the coaddition of two RegriddedFrames which have the (object)name reg1 and reg2. The value $$f_{out}$$ of a pixel in the resulting CoaddedRegriddedFrame (which we give object name coad) is computed as follows:

$f_{out}=\Sigma_i(w_i*FLXSCALE_i*f_i) / \Sigma_i(w_i),$

where

• the summation is over the RegriddedFrames
• $$FLXSCALE_i$$=value of FLXSCALE attribute of each input RegriddedFrame (i.e., reg1.FLXSCALE)
• $$w_i=weight_i/FLXSCALE_i^2$$ where $$weight_i$$ is the value of the pixel in the associated weightframe (i.e., reg1.weight)
• the $$f_i$$ is the pixel value in the regridded frame

The value $$w_{out}$$ of the pixel in the resulting weight frame associated with the coad (i.e., coad.weight) is computed as:

$w_{out}=\Sigma_i(w_i)$

The pixel units of the CoaddedRegriddedFrame are fluxes relative to the flux corresponding to magnitude=0. In other words, the magnitude $$m$$ corresponding to a pixel value $$f_0$$ is:

$m= -2.5log_{10} f_0 .$

The relation between pixel units in CoaddedRegriddedFrame and the RegriddedFrames from which it was derived is as follows. For a RegriddedFrame object named $$reg$$ we have:

$reg.FLXSCALE==10.0^{-0.4 \times reg.ZEROPNT}$

At magnitude=0 pixels will have counts $$counts_{reg}(mag=0)$$ in the RegriddedFrame:

$counts_{reg}(mag=0)==10^{0.4 \times reg.ZEROPNT}=1/reg.FLXSCALE$

(Note that reg.ZEROPNT is exposure-time specific, therefore counts instead of countrate.) Suppose one makes a CoaddedRegriddedFrame from this single RegriddedFrame $$reg$$. In this case the relation between the counts $$count_{reg}$$ in the RegriddedFrame and pixel value $$v_{coad}$$ in the CoaddedRegriddedFrame is made to be:

$v_{coad}=counts_{reg}*reg.FLXSCALE$

Suppose you know the physical flux density of the magnitude=0 object to be $$f_0$$ Jy. The physical flux corresponding to $$v_{coad}$$ is then:

$f_{coad}{\rm (Jy)}=f_0*v_{coad}$

For example, in the AB magnitude system $$f_0==3631$$ Jy and hence:

$f_{coad}{\rm (Jy)}=3631*v_{coad}$

If ones make a CoaddedRegriddedFrame out of multiple overlapping RegriddedFrames the resulting flux is the weighted average of the input RegriddedFrames fluxes (see Section Coadd algorithm).

 [1] The default pixel scale is 0.200 ‘’/pixel