elif len(objects) > 1: print 'Error. Found multiple matching objects for %s.' % name else: num_targets += 1 target = Target(objects[0]['name'], objects[0]['RA'], objects[0]['DEC']) stacks = [] for i in range(0, count): for filter in filters: filter = filter.strip() # skip the darks for now if filter.lower() != 'dark': stacks.append( Stack(float(exposure), filter, int(binning), 1)) observations.append( Observation(observatory, target, Sequence(stacks, 1), min_obs_alt, user)) print 'Successfully identified %d of %d targets.' % (num_targets, len(inputs)) telescope.slackdebug('Starting observerizer...') # add observations scheduler.addObservations(observations) # loop through the observations next_observation = scheduler.whatsNext() # for obs in observations: # print obs.toString()
target_json = observation_json['target'] sequence_json = observation_json['sequences']['main'] stacks_json = sequence_json['stacks'] # build target target = Target.from_name( target_json['name'], observatory, target_json['type'], target_json.get('ra_offset'), target_json.get('dec_offset')) logger.debug(target.toString().replace('\n', '; ')) # build image stacks stacks = [] for stack_json in stacks_json: stack = Stack(float(stack_json['exposure']), stack_json['filters'], int( stack_json['binning']), int(stack_json['count']), stack_json['do_pinpoint'] if 'do_pinpoint' in stack_json else True) logger.debug(stack.toString().replace('\n', '; ')) stacks.append(stack) # build sequence sequence = Sequence(stacks, int( sequence_json['repeat']), sequence_json['do_pinpoint'] if 'do_pinpoint' in sequence_json else True) logger.debug(sequence.toString().replace('\n', '; ')) # build main observations asteroid_main_observation = Observation( observatory, target, sequence, min_obs_alt, user) # get min, max, and max alt obs times asteroid_main_observation.getTimes() logger.debug(asteroid_main_observation.toString().replace('\n', '; ')) # build calibration asteroid/star observations sequence_json = observation_json['sequences']['calibration'] stacks_json = sequence_json['stacks'] # build image stacks stacks = [] for stack_json in stacks_json: stack = Stack(float(stack_json['exposure']), stack_json['filters'], int(
else: if len(objects) > 1: logger.error('Found multiple matching objects for %s.' % name) logger.error('Will take the first in the list (%s).' % name) num_targets += 1 target = Target(objects[0]['name'], objects[0] ['RA'], objects[0]['DEC']) stacks = [] for filter in filters: filter = filter.strip() # skip the darks for now if filter.lower() != 'dark': stacks.append(Stack(float(exposure), filter, int(binning), int(count))) observations.append(Observation(observatory, target, Sequence(stacks, 1), min_obs_alt, user)) logger.info('Successfully identified %d of %d targets.' % ( num_targets, len(inputs))) telescope.slackdebug('Starting observerizer...') # add observations scheduler.addObservations(observations) # loop through the observations next_observation = scheduler.whatsNext() # for obs in observations: # print obs.toString()
target_json = observation_json['target'] sequence_json = observation_json['sequences']['main'] stacks_json = sequence_json['stacks'] # build target target = Target.from_name(target_json['name'], observatory, target_json['type']) logger.debug(target.toString().replace('\n', '; ')) # build image stacks stacks = [] for stack_json in stacks_json: stack = Stack(float(stack_json['exposure']), stack_json['filters'], int(stack_json['binning']), int(stack_json['count'])) logger.debug(stack.toString().replace('\n', '; ')) stacks.append(stack) # build sequence sequence = Sequence(stacks, int(sequence_json['repeat'])) logger.debug(sequence.toString().replace('\n', '; ')) # build main observation star_main_observation = Observation(observatory, target, sequence, min_obs_alt, user) # get min, max, and max alt obs times star_main_observation.getTimes() logger.debug(star_main_observation.toString().replace('\n', '; ')) # start observations telescope.slackdebug('Starting aavso...') # wait for sun to set telescope.checkSun(True) # wait for target to be available
##5358 (1992 QH) ##define the target #target = Target('5358', '07 38 46.48', '+36 07 12.2') ##build image stack #stack = Stack(120, 'clear', 2, 1) ##build image (stack) sequence #sequence = Sequence([stack], Sequence.CONTINUOUS) ##minimum altitude to observe this target #min_obs_alt = 30.0 ##add this observations to the list #observations.append(Observation(observatory, target, sequence, min_obs_alt, user)) min_obs_alt = 30.0 target = Target('maxgoldberg.M104', '12 39 59.299', '-11 37 21.000') stack = Stack(240, 'clear', 2, 1) sequence = Sequence([stack], 1) observations.append(Observation(observatory, target, sequence, min_obs_alt, user)) target = Target('maxgoldberg.M104', '12 39 59.299', '-11 37 21.000') stack = Stack(300, 'clear', 2, 1) sequence = Sequence([stack], 1) observations.append(Observation(observatory, target, sequence, min_obs_alt, user)) target = Target('shelstrom.M104', '12 39 59.299', '-11 37 21.000') sequence = Sequence([Stack(60, 'clear', 2, 2), Stack(40, 'r-band', 2, 2), Stack(60, 'g-band', 2, 2)], 1) observations.append(Observation(observatory, target, sequence, min_obs_alt, user)) target = Target('rich.oddjob.Jupiter', '17 29 06', '-22 37 07') stack = Stack(0.1, 'z-band', 2, 1) sequence = Sequence([stack], 1) observations.append(Observation(observatory, target, sequence, min_obs_alt, user))
# #build image stack # stack = Stack(120, 'clear', 2, 1) # #build image (stack) sequence # sequence = Sequence([stack], Sequence.CONTINUOUS) # #minimum altitude to observe this target # min_obs_alt = 30.0 # #add this observations to the list # observations.append(Observation(observatory, target, sequence, min_obs_alt, user)) #5358 (1992 QH) #define the target target = Target('5358', '07 38 46.48', '+36 07 12.2') #build image stack stack = Stack(120, 'clear', 2, 1) #build image (stack) sequence sequence = Sequence([stack], Sequence.CONTINUOUS) #minimum altitude to observe this target min_obs_alt = 30.0 #add this observations to the list observations.append(Observation(observatory, target, sequence, min_obs_alt, user)) #PN K 3-63 #define the target target = Target('PN K 3-63', '21 39 11.976', '+55 46 03.94') #build image stack stack = Stack(120, 'r-band', 2, 5) #build image (stack) sequence sequence = Sequence([stack], 1) #minimum altitude to observe this target min_obs_alt = 30.0 #add this observations to the list
# initialize array covering a range of focus positions pass1_array = [ 4650, 4675, 4700, 4725, 4750, 4775, 4800, 4825, 4850, 4875, 4900, 4925, 4950, 4975, 5000 ] pass1_array_focus = np.zeros((len(pass1_array), 2)) # read in reference stars from file with open(ref_stars_fname) as f: ref_stars = f.readlines() ref_stars = [x.strip() for x in ref_stars if not x.startswith('#')] # create a list of observations from the reference stars stack = Stack(exposure, filter, binning, 1) stacks = [stack] sequence = Sequence(stacks, 1) for ref_star in ref_stars: ref_star_data = ref_star.split() name = ref_star_data[0] ra = ref_star_data[1] dec = ref_star_data[2] target = Target(name, ra, dec) observations.append( Observation(observatory, target, sequence, min_obs_alt, user)) telescope.slackdebug('Starting hocusfocus...') # wait for sun to set telescope.checkSun(True) # find the best target (currently highest in the sky)