Module: fake_data_creator#

A class for creating fake data sets.

The FakeDataSet class allows the user to create fake data sets for testing, including generating images with random noise and adding artificial objects. The fake data can be saved to files or used directly.

class kbmod.fake_data.fake_data_creator.FakeDataSet(width, height, times, noise_level=2.0, psf_val=0.5, psfs=None, use_seed=False)[source]#

This class creates fake data sets for testing and demo notebooks.

Methods

get_work_unit([config])

Create a WorkUnit from the fake data.

insert_object(trj)

Insert a fake object given the trajectory.

insert_random_object(flux)

Create a fake object and insert it into the image.

save_fake_data_to_work_unit(filename[, config])

Create the fake data in a WorkUnit file.

set_wcs(new_wcs)

Set a new fake WCS to be used for this data.

get_work_unit(config=None)[source]#

Create a WorkUnit from the fake data.

Parameters:
filenamestr

The name of the resulting WorkUnit file.

configSearchConfiguration, optional

The configuration parameters to use. If None then uses default values.

insert_object(trj)[source]#

Insert a fake object given the trajectory.

Parameters:
trjTrajectory

The trajectory of the fake object to insert.

insert_random_object(flux)[source]#

Create a fake object and insert it into the image.

Parameters:
fluxfloat

The flux of the object.

Returns:
tTrajectory

The trajectory of the inserted object.

save_fake_data_to_work_unit(filename, config=None)[source]#

Create the fake data in a WorkUnit file.

Parameters:
filenamestr

The name of the resulting WorkUnit file.

configSearchConfiguration, optional

The configuration parameters to use. If None then uses default values.

set_wcs(new_wcs)[source]#

Set a new fake WCS to be used for this data.

Parameters:
new_wcsastropy.wcs.WCS

The WCS to use.

kbmod.fake_data.fake_data_creator.create_fake_times(num_times, t0=0.0, obs_per_day=1, intra_night_gap=0.01, inter_night_gap=1)[source]#

Create a list of times based on a cluster of obs_per_day observations each night spaced out intra_night_gap within a night and inter_night_gap data between observing nights.

Parameters:
num_timesint

The number of time steps (number of images).

t0float

The time stamp of the first observation [default=0.0]

obs_per_dayint

The number of observations on the same night [default=1]

intra_night_gapfloat

The time (in days) between observations in the same night [default=0.01]

inter_night_gapint

The number of days between observing runs [default=1]

Returns:
result_timeslist

A list of num_times floats indicating the different time stamps.

kbmod.fake_data.fake_data_creator.image_stack_add_fake_object(stack, x, y, vx, vy, flux)[source]#

Insert a fake object given the trajectory.

Parameters:
stackImageStackPy

The image stack to modify.

xint

The x-coordinate of the object at the first time (in pixels).

yint

The y-coordinate of the object at the first time (in pixels).

vxfloat

The x-velocity of the object (in pixels per day).

vyfloat

The y-velocity of the object (in pixels per day).

fluxfloat

The flux of the object.

kbmod.fake_data.fake_data_creator.make_fake_image_stack(height, width, times, noise_level=2.0, psf_val=0.5, psfs=None, rng=None)[source]#

Create a fake ImageStackPy for testing.

Parameters:
widthint

The width of the images in pixels.

heightint

The height of the images in pixels.

timeslist

A list of time stamps.

noise_levelfloat

The level of the background noise. Default: 2.0

psf_valfloat

The value of the default PSF. Used if individual psfs are not specified. Default: 0.5

psfslist of numpy.ndarray, optional

A list of PSF kernels. If none, Gaussian PSFs from with std=psf_val are used.

rngnp.random.Generator

The random number generator to use. If None creates a new random generator. Default: None