NextAstro logo NextAstroDocumentation Open Hub

Python examples

Acquire the original rotator calibration sequence

The complete source is included below.

python -m nextastro_obs_client.examples.rotator_flats

This is the original editable script: cool, step through named filters and mechanical angles, take flats, then darks and biases. Edit its temperature, filters, exposure times, angles and counts before running for your equipment. It has no argparse interface. Use the controller's mechanical frame; sky position angle is a separate operation.

Student extension: Move its experiment parameters into a JSON file and record flat uniformity against angle.

Python source

"""Acquire real rotator flats, darks and biases through an existing local OBS."""
from nextastro_obs_client import Observatory


def main():
    obs = Observatory()
    filters = {"Ha": 40, "OIII": 5, "SII": 60}
    with obs.session(name="Rotator flats", userid="student01"):
        obs.camera.cool_to(-50, tolerance=2)
        for filter_name, seconds in filters.items():
            obs.filterwheel.select(filter_name)
            for angle in range(0, 360, 15):
                obs.rotator.move_mechanical(angle)
                images = obs.camera.expose(seconds=seconds, frame_type="flat", count=3,
                    target_name=f"Rotator flats {angle} deg")
                for image in images:
                    print(image.path)
        obs.camera.expose(seconds=60, frame_type="dark", count=30)
        obs.camera.bias(count=30)


if __name__ == '__main__':
    main()

Shared argument and session helpers: Example support code.