Skip to content

Commit

Permalink
Adding a method for calling the flat-fields from the pocs_shell.
Browse files Browse the repository at this point in the history
This will pass all `key=value` options directly to `Observatory.take_flat_fields`.

Dependent on panoptes#729
  • Loading branch information
wtgee committed Nov 23, 2018
1 parent 01afd6e commit 5df3e55
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bin/pocs_shell
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ from pocs.utils.images import fits as fits_utils
from pocs.utils.images import cr2 as cr2_utils
from pocs.utils.images import polar_alignment as polar_alignment_utils
from pocs.utils import listify
from pocs.utils import dither
from pocs.utils.database import PanDB
from pocs.utils.messaging import PanMessaging

Expand Down Expand Up @@ -471,6 +472,26 @@ Hardware names: {} (or all for all hardware)'''.format(
self.pocs.say("No longer listening to PAWS")
pass

def do_take_flat_fields(self, *arg):
"""Take flat fields."""
args, kwargs = parse_options(*arg)

if self.pocs is None:
print_warning('Please run `setup_pocs` before trying to run')
return

if self.pocs.observatory.mount.is_parked:
print_warning('Mount is parked. To unpark run `unpark`')
return False

try:
print_info('Starting flat fields')
self.pocs.observatory.take_flat_fields(*args, **kwargs)
except Exception as e:
print_warning('Problem taking flats: {}'.format(e))
finally:
print_info('Flat fields complete, slewing to home')
self.do_go_home()

##########################################################################
# Private Methods
Expand All @@ -480,6 +501,7 @@ Hardware names: {} (or all for all hardware)'''.format(
# Utility Methods
##########################################################################


def polar_rotation(pocs, exp_time=30, base_dir=None, **kwargs):
assert base_dir is not None, print_warning("base_dir cannot be empty")

Expand Down

0 comments on commit 5df3e55

Please sign in to comment.