autowisp.tests.test_detrending_exclusions module

Class Inheritance Diagram

Inheritance diagram of AllTemplatesTFA, ConfigurationError, Correction, EPDCorrection, LightCurveFile, SyntheticLightCurveTestCase, TestDetrendingExclusions, cycle

EPD and TFA fitting without the listed observations, but correcting them.

class autowisp.tests.test_detrending_exclusions.TestDetrendingExclusions(methodName='runTest')[source]

Bases: SyntheticLightCurveTestCase

Inheritance diagram of autowisp.tests.test_detrending_exclusions.TestDetrendingExclusions

EPD and TFA with an exclusion list on two-channel lightcurves.

Each lightcurve follows an exact model, except at the bad observations: the first channel of the early frames, where it follows another one. So a fit that leaves exactly those out has no residual beyond storage rounding, flattens the rest, and leaves at the bad observations exactly what was added to them. The same lightcurves corrected without the list are the control: the same check must fail for them.

The list also names the first channel of a frame the EPD filter does not select and the TFA target lacks, and an observation in no lightcurve. The second channel of every frame is never listed.

Every other listed observation names the photometry fit, aperture 0, and the rest name none, which applies to every photometry. Some good observations are listed too, under other photometries only, which must not leave them out of the fit of aperture 0.

Outlier rejection is off: it would otherwise discard some of the bad observations on its own, list or no list.

_assert_corrected_to_model(result, corrected, bad, extra)[source]

Check that the fit found the model the points that are not bad follow.

Parameters:
  • result (dict) – What the fit left in the lightcurve.

  • corrected (bool array) – The points the fit corrects.

  • bad (bool array) – The points that do not follow the model.

  • extra (array) – What was added to the model at each point.

_assert_deviates_from_model(result, corrected, bad, extra)[source]

Check that the fit missed the model the points that are not bad follow.

Every way _assert_corrected_to_model() checks for the model must show the miss, each on its own.

Parameters:

_assert_corrected_to_model(). (See)

_assert_recorded(result, corrected, excluded, rule)[source]

Check what the fit recorded about the points it left out.

Parameters:
  • result (dict) – What the fit left in the lightcurve.

  • corrected (bool array) – The points the fit corrects.

  • excluded (bool array) – The points expected to be left out.

  • rule (str) – The rule expected to be recorded.

classmethod _read_result(source_id, mode, variables, points_filter)[source]

Return what a fit left in a source’s lightcurve, and its statistics.

Parameters:
  • source_id (int) – The source whose lightcurve to read.

  • mode (str) – Either 'epd' or 'tfa'.

  • variables (dict) – The variables points_filter uses.

  • points_filter (str or None) – Selects the points the fit corrected. None if it corrected them all.

Returns:

The fit’s datasets by the tail of their pipeline key, and under 'statistics' the performance of the fit.

Return type:

dict

classmethod _run_epd(exclusions)[source]

Create the EPD lightcurve twice; correct one copy with the list.

classmethod _run_tfa(exclusions)[source]

Create the templates and two targets; correct one with the list.

classmethod setUpClass()[source]

Create the lightcurves and correct them with and without a list.

test_a_list_naming_no_photometry_is_refused()[source]

A last value that is not a photometry, or a value too many.

test_epd_ignores_excluded()[source]

EPD fits without the listed points its filter selects.

test_epd_without_list()[source]

Without a list EPD fits the bad points too, and misses the model.

test_tfa_ignores_excluded()[source]

TFA fits without the listed observations the target has.

test_tfa_without_list()[source]

Without a list TFA fits the bad points too, and misses the model.