Beispiel #1
0
def add_program_arguments(parser: ArgParser, profile: str) -> None:
    """Add program arguments for all cameras.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
        profile: 'track' or 'align' to indicate which set of arguments to add.
    """
    camera_group = parser.add_argument_group(
        title='General Camera Options',
        description='Options that apply to all cameras',
    )
    camera_group.add_argument(
        '--camera-type',
        help='type of camera',
        default='zwo',
        choices=['zwo', 'webcam'],
    )
    camera_group.add_argument(
        '--camera-pixel-scale',
        help='camera pixel scale in arcseconds per pixel',
        required=True,
        type=float)
    webcam_group = parser.add_argument_group(
        title='Webcam Options',
        description='Options that apply when camera-type is set to "webcam"',
    )
    WebCam.add_program_arguments(webcam_group, profile)
    zwo_group = parser.add_argument_group(
        title='ZWO ASI Camera Options',
        description='Options that apply when camera-type is set to "zwo"',
    )
    ASICamera.add_program_arguments(zwo_group, profile)
Beispiel #2
0
def add_program_arguments(parser: ArgParser,
                          meridian_side_required=False) -> None:
    """Add program arguments for all mounts.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
        meridian_side_required: When True, the meridian-side command line argument will be set as
            required. When False the same argument is optional.
    """
    mount_group = parser.add_argument_group(
        title='Mount Options',
        description='Options that apply to telescope mounts',
    )
    mount_group.add_argument('--mount-type',
                             help='select mount type (nexstar or gemini)',
                             default='gemini')
    mount_group.add_argument(
        '--mount-path',
        help='serial device node or hostname for mount command interface',
        default='/dev/ttyACM0')
    parser.add_argument('--bypass-position-limits',
                        help='bypass mount axis position limits',
                        action='store_true')
    mount_group.add_argument(
        '--meridian-side',
        help='side of meridian for equatorial mounts to prefer',
        required=meridian_side_required,
        choices=tuple(m.name.lower() for m in MeridianSide),
    )
Beispiel #3
0
def add_program_arguments(
    parser: ArgParser,
    group_description:
    str = 'Setting all three of these options will override GPS',
) -> None:
    """Add program arguments pertaining to observer location.

    Arguments are added such that the location is obtained from a GPS receiver by default, but the
    user can override this by supplying the location at the command line.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
        group_description: The description for this argument group.
    """
    observer_group = parser.add_argument_group(
        title='Observer Location Options',
        description=group_description,
    )
    observer_group.add_argument(
        '--lat',
        help='latitude of observer (+N)',
        type=float,
    )
    observer_group.add_argument(
        '--lon',
        help='longitude of observer (+E)',
        type=float,
    )
    observer_group.add_argument('--elevation',
                                help='elevation of observer (m)',
                                type=float)
Beispiel #4
0
def add_program_arguments(parser: ArgParser) -> None:
    """Add program arguments relevant to laser pointers.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
    """
    laser_group = parser.add_argument_group(
        title='Laser Pointer Options',
        description='Options that apply to laser pointers',
    )
    laser_group.add_argument(
        '--laser-ftdi-serial',
        help='serial number of laser pointer FTDI device',
    )
Beispiel #5
0
def add_program_arguments(parser: ArgParser) -> None:
    """Add program arguments associated with this module.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
    """
    ntp_group = parser.add_argument_group(
        title='NTP Options',
        description='Options that apply to NTP time synchronization',
    )
    ntp_group.add_argument(
        '--check-time-sync',
        help=
        'confirm that system clock is synchronized to within 100 ms of GPS receiver',
        action='store_true',
    )
Beispiel #6
0
 def add_program_arguments(parser: ArgParser, profile: str) -> None:
     parser.add_argument('--webcam-dev',
                         help='webcam device node path',
                         default='/dev/video0')
     parser.add_argument('--webcam-exposure',
                         help='webcam exposure time (unspecified units)',
                         default=3200,
                         type=int)
     parser.add_argument(
         '--webcam-frame-dump-dir',
         help='directory to save webcam frames as jpeg files on disk',
     )
Beispiel #7
0
def add_program_arguments(parser: ArgParser) -> None:
    """Add program arguments relevant to the control system.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
    """
    stop_group = parser.add_argument_group(
        title='Stopping Condition Options',
        description='Options that determine when the control system stops',
    )
    stop_group.add_argument(
        '--stop-timeout',
        type=float,
        default=None,
        help=
        'stop after this many seconds if no other stopping condition occurs first',
    )
    stop_group.add_argument(
        '--stop-when-converged-angle',
        type=float,
        default=None,
        help='stop when mount is within this many degrees of the target',
    )
Beispiel #8
0
    def add_program_arguments(parser: ArgParser, profile: str) -> None:
        """Adds program arguments for ZWO ASI camera configuration.

        Args:
            parser: The instance of ArgParser to which this function will add arguments.
            profile: 'track' or 'align' to indicate which set of arguments to add.

        Raises:
            ValueError if profile is set to an invalid string.
        """
        if profile == 'align':
            parser.add_argument(
                '--zwo-exposure-time-align',
                help=
                'ZWO camera exposure time used during alignment in seconds',
                default=0.5,
                type=float)
            parser.add_argument('--zwo-gain-align',
                                help='ZWO camera gain used during alignment',
                                default=400,
                                type=int)
        elif profile == 'track':
            parser.add_argument(
                '--zwo-exposure-time',
                help='ZWO camera exposure time used during tracking in seconds',
                default=0.03,
                type=float)
            parser.add_argument('--zwo-gain',
                                help='ZWO camera gain used during tracking',
                                default=10,
                                type=int)
        else:
            ValueError('profile must be "track" or "align"')
        parser.add_argument('--zwo-binning',
                            help='ZWO camera binning',
                            default=4,
                            type=int)
        parser.add_argument(
            '--zwo-name',
            help=
            'ZWO camera name (use to select between multiple connected cameras)',
            type=str)
Beispiel #9
0
def add_program_arguments(parser: ArgParser) -> None:
    """Add program arguments relevant to targets.

    Args:
        parser: The instance of ArgParser to which this function will add arguments.
    """
    target_group = parser.add_argument_group(
        title='General Target Options',
        description='Options that apply to all targets',
    )

    target_group.add_argument(
        '--fuse',
        help='use sensor fusion of selected target with camera',
        action='store_true',
    )
    target_group.add_argument(
        '--fusion-gain',
        help='gain for sensor fusion',
        type=float,
        default=5e-2,
    )
    target_group.add_argument(
        '--spiral-search',
        help=
        'perform a spiral search until target is detected in camera (sensor fusion mode only)',
        action='store_true',
    )

    subparsers = parser.add_subparsers(title='target types',
                                       dest='target_type')
    subparsers.required = True

    parser_flightclub = subparsers.add_parser(
        'flightclub', help='Flightclub.io trajectory CSV file')
    parser_flightclub.add_argument('file', help='filename of CSV file')
    parser_flightclub.add_argument(
        'time_t0',
        help=
        'Launch T0 in UTC. Many natural language date formats are supported.',
        type=str,
    )

    parser_tle = subparsers.add_parser('tle', help='TLE file')
    parser_tle.add_argument(
        'file', help='filename of two-line element (TLE) target ephemeris')

    subparsers.add_parser('camera',
                          help='follows bright target detected in camera')
    cameras.add_program_arguments(parser, profile='track')

    parser_coord_eq = subparsers.add_parser('coord-eq',
                                            help='fixed equatorial coordinate')
    parser_coord_eq.add_argument('ra',
                                 help='right ascension [deg]',
                                 type=float)
    parser_coord_eq.add_argument('dec', help='declination [deg]', type=float)

    parser_coord_topo = subparsers.add_parser(
        'coord-topo', help='fixed topocentric coordinate')
    parser_coord_topo.add_argument('az', help='azimuth [deg]', type=float)
    parser_coord_topo.add_argument('alt', help='altitude [deg]', type=float)

    parser_star = subparsers.add_parser('star', help='named star')
    parser_star.add_argument('name', help='name of star')

    parser_solarsystem = subparsers.add_parser('solarsystem',
                                               help='named solar system body')
    parser_solarsystem.add_argument('name', help='name of planet or moon')

    subparsers.add_parser('overhead-pass', help='simulated overhead pass')