Python examples
Acquire a cross-shaped dither sequence
The complete source is included below.
python -m nextastro_obs_client.examples.dithered_sequence --ra 12.5 --dec -30 --target "Student field" --filter V --seconds 5 --offset 15 --count 2
Acquires a centre and four sky-offset positions. Each offset starts from the named target, avoiding cumulative tangent-plane drift. East/north are sky arcseconds, including at high declination. The example requests a return to the supplied target when it exits; existing cancellation/operator stop can prevent that return.
Student extension: Record offset metadata, align and combine the images in the student's analysis environment.
Python source
"""Expose at a sequence of sky offsets and return to the initial pointing."""
from nextastro_obs_client.examples._common import parser, target_arguments, point, execute, return_after
def run(obs, camera, args):
point(obs, args)
with return_after(lambda: point(obs, args)):
for east, north in [(0, 0), (args.offset, 0), (0, args.offset), (-args.offset, 0), (0, -args.offset)]:
# Offsets are incremental tangent moves; each new position starts at
# the named target so the requested pattern has a common sky origin.
if east or north:
point(obs, args)
obs.mount.offset(east_arcsec=east, north_arcsec=north)
for image in camera.expose(seconds=args.seconds, filter=args.filter, count=args.count, target_name=args.target):
print(east, north, image.path)
def main(argv=None):
p = parser("Dithered sequence")
target_arguments(p)
p.add_argument("--seconds", type=float, required=True)
p.add_argument("--offset", type=float, required=True, help="Sky arcseconds")
p.add_argument("--count", type=int, default=1, help="Frames per position")
return execute(p, run, argv)
if __name__ == "__main__":
main()
Shared argument and session helpers: Example support code.