autowisp.tests.test_photref_binding module

Class Inheritance Diagram

Inheritance diagram of Camera, CameraChannel, CameraType, DataReductionFile, DiagnosticType, Image, ImageDiagnostics, ImageMasterSelection, ImageProcessingManager, ImageType, MasterFile, MasterType, Namespace, Observer, ObservingSession, PhotrefBindingProject, Step, Target, Telescope, TelescopeType, TestConditionBinding, TestSeparationBinding, datetime

Tests for binding images pending magnitude fitting to a photometric ref.

The engine records, in ImageMasterSelection, which single photometric reference every image/channel fit_magnitudes sees is fit against. With a finite max_photref_separation it picks the reference by separation; with an unlimited one the condition expressions select it, as for any other master, and that choice is recorded too. Either way the row must agree with the reference magfit is actually given, since everything grouping images by reference reads it rather than re-deciding.

These drive the manager the way _prepare_processing does – evaluating each image’s expressions from its raw header, then binding – on a throwaway project holding one two-channel camera and a single reference registered in channel R only.

class autowisp.tests.test_photref_binding.PhotrefBindingProject(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_photref_binding.PhotrefBindingProject

A project with one registered single photref, holding no tests itself.

Each test gets a fresh manager, as _evaluated_expressions caches the master chosen for each image when it is first evaluated, and starts with no bindings.

static _add_diagnostics(db_session, image_id, channel, values)[source]

Record the given {name: value} astrometry diagnostics.

classmethod _add_photref(db_session, session_id)[source]

Register the single photref: a DR file of image ref, in R.

classmethod _add_raw_image(db_session, name, session_id, exposure)[source]

Write a raw frame, add its image to the database, return the id.

classmethod _add_session(db_session)[source]

Add the equipment and the observing session, return its id.

classmethod _config_overwrites()[source]

Return the configuration defaults the project is created with.

classmethod _fill_database()[source]

Add the session, the reference and the pending images.

classmethod _raw_fname(name)[source]

Return the raw frame filename of the image with the given name.

all_pending()[source]

Return every (image name, channel) pending, sorted.

bind_in_advance(name, channel)[source]

Bind the named image/channel to the reference before magfit.

bind_pending(db_session)[source]

Bind every pending image in both channels, as magfit preparation.

Returns:

The (image name, channel) entries handed on to fit_magnitudes, sorted.

Return type:

[(str, str)]

bindings(db_session)[source]

Return {(image name, channel): MasterFile ID} of every binding.

The reference’s own image is never pending, so is never bound.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

class autowisp.tests.test_photref_binding.TestConditionBinding(methodName='runTest')[source]

Bases: PhotrefBindingProject

Inheritance diagram of autowisp.tests.test_photref_binding.TestConditionBinding

An unlimited max_photref_separation: the conditions choose.

test_an_image_bound_in_advance_is_kept()[source]

A binding the conditions would not make stands, and is used.

test_the_binding_is_what_magfit_is_given()[source]

Each row names the master its batch is configured with.

test_the_selected_photref_is_recorded()[source]

Every image is handed on, those the conditions select are bound.

Distance no longer matters, so the far image is bound too. Channel G and the 60 s image have no photref, so are not bound, but are handed on all the same: dropping them is left to the batch configuration, as for any missing master.

class autowisp.tests.test_photref_binding.TestSeparationBinding(methodName='runTest')[source]

Bases: PhotrefBindingProject

Inheritance diagram of autowisp.tests.test_photref_binding.TestSeparationBinding

A finite max_photref_separation: bound by distance to the photref.

test_an_image_bound_in_advance_is_kept()[source]

A binding made in the BUI stands, however far the image is.

test_only_images_near_the_photref_are_bound()[source]

Only the near image is fit against the photref.

The far one is out of range, the 60 s one does not match the photref’s conditions, and channel G has no photref at all.