BackCalc

Calculate backgrounds for images for which

Space Telescope Science Institute

Synopsis

Calculate backgrounds for images for which the statistics have been gathered

Command Line Usage

usage: BackCalc.py [-all]   Field T01 ...

Description

Uset a variety of techingiques to try to find

the best backgrounds to subtract from the fileds to match backgrounds

The main output is a file field_tile_bbb.txt that contains the calculated values for the offsets.

Files (xxx) are also generated that show how good the the actual fits is.

Primary Routines

Notes:

Notes

History:

230609 ksl Coding begun

Version History

230609 ksl

Coding begun

Functions

create_inputs([infile, ximage])

Create the inputs needed to fit different backgrounds for a single filter and

diff_eval(xdelta, xback[, return_diff])

Given a table that contains the measured differences between

do_one_tile(field, tile)

Generate a set of backgrounds to be used for matching images

do_svd(xcross, bfile[, threshold, new, verbose])

The driving routine for a SVD fit of the backgrounds

monte(xdelta, files)

This simply evaluates differences in a prediction

plot_fit_results(field, tile[, summary_dir, zlim])

steer(argv)

This is just a steering routine

svdskyfit(xcross[, threshold, new, verbose])

Do a single value decomposition fit of the backgounds contained

xeval(xall)

xeval returns a metric that descibes now close we actually are to the

xpath(xdelta, files[, nstart])

Do a path search to find the offsets

Module Contents

BackCalc.create_inputs(infile='data/LMC_c45_T07_xxx.txt', ximage='N673')

Create the inputs needed to fit different backgrounds for a single filter and exposure time.

BackCalc.diff_eval(xdelta, xback, return_diff=False)

Given a table that contains the measured differences between the flux (xdelta) in different images, and another the table (xback) that gives the current version the backgrounds for the images, calculated the ‘effective chi*2’

Note that this is the only statistic we have access to for a real case, since we do not know what the actual offsets are.

The goodness of fit is returned

BackCalc.do_one_tile(field, tile)

Generate a set of backgrounds to be used for matching images in a tile based on differences in the fluxes in images..

BackCalc.do_svd(xcross, bfile, threshold=0.1, new=True, verbose=False)

The driving routine for a SVD fit of the backgrounds

BackCalc.monte(xdelta, files)

This simply evaluates differences in a prediction for the background.

BackCalc.plot_fit_results(field, tile, summary_dir='', zlim=20)
BackCalc.steer(argv)

This is just a steering routine

BackCalc.svdskyfit(xcross, threshold=0.1, new=True, verbose=True)

Do a single value decomposition fit of the backgounds contained in the table xcross

BackCalc.xeval(xall)

xeval returns a metric that descibes now close we actually are to the original offsets. Note that we do not have access to this information for real observations; it is only known here because we are using fake data.

BackCalc.xpath(xdelta, files, nstart=2)

Do a path search to find the offsets

where xdelta is a table containing the differeces beween measurments of the “background” in overlapping regions, and files is a table listing the files, and the offsets for the files. nstart is an index for the file that is used as the start of the search.

The routine returns the files table, with the offsets determined

What is returned depends on the order of the files in the xdelta table