<filename>azcam_scripts/display_files.py
"""
Display a sequence of files interactively on ds9
"""

import os
import sys
import winsound

import azcam


def display_files():

    # loop through files
    QUIT = 0
    for root, topfolders, filenames in os.walk("."):

        if QUIT:
            break

        for filename in filenames:
            if not filename.endswith(".fits"):
                continue
            winsound.Beep(2000, 1)
            f = os.path.join(root, filename)
            print(f)

            azcam.db.display.display(f)
            azcam.db.display.zoom(0)

            print("Press Enter to continue, s to snap, q to quit")
            key = azcam.utils.check_keyboard(1)

            if key.lower() == "q":
                QUIT = 1
                break

            elif key == "s":
                azcam.db.display.save_image()

    return


if __name__ == "__main__":
    args = sys.argv[1:]
    display_files(*args)

<filename>azcam_scripts/display_files.py
"""
Display a sequence of files interactively on ds9
"""

import os
import sys
import winsound

import azcam


def display_files():

    # loop through files
    QUIT = 0
    for root, topfolders, filenames in os.walk("."):

        if QUIT:
            break

        for filename in filenames:
            if not filename.endswith(".fits"):
                continue
            winsound.Beep(2000, 1)
            f = os.path.join(root, filename)
            print(f)

            azcam.db.display.display(f)
            azcam.db.display.zoom(0)

            print("Press Enter to continue, s to snap, q to quit")
            key = azcam.utils.check_keyboard(1)

            if key.lower() == "q":
                QUIT = 1
                break

            elif key == "s":
                azcam.db.display.save_image()

    return


if __name__ == "__main__":
    args = sys.argv[1:]
    display_files(*args)

Display a sequence of files interactively on ds9 # loop through files