Example #1
0
    def __init__(self, obs_site_config, idle_delay):
        """Initialize the class.

        Parameters
        ----------
        obs_site_config : :class:`.ObservingSite`
            The instance of the observing site configuration.
        idle_delay : float
            The delay time (seconds) to skip forward when no target is received.
        """
        self.targets_received = 0
        self.targets_missed = 0
        self.observation = None
        self.observatory_model = MainObservatory(obs_site_config)
        self.observatory_location = ObservatoryLocation(
            obs_site_config.latitude_rad, obs_site_config.longitude_rad,
            obs_site_config.height)
        self.observatory_state = None
        self.log = logging.getLogger("kernel.Sequencer")
        self.idle_delay = (idle_delay, "seconds")
        self.sky_model = AstronomicalSkyModel(self.observatory_location)
Example #2
0
    model.park()
    model.slew_altaz(0., np.radians(alt1), np.radians(az1), np.radians(rot1), model.current_state.filter)
    initial_slew_state = copy.deepcopy(model.current_state)

    model.slew_altaz(model.current_state.time, np.radians(alt2), np.radians(az2), np.radians(rot2),
                     model.current_state.filter)

    final_slew_state = copy.deepcopy(model.current_state)
    slew_time = final_slew_state.time - initial_slew_state.time

    return slew_time

# initialize opsim observatory
# Easy to just make an observatory and pull out the configured model
mo = MainObservatory(ObservingSite())
mo.configure(Observatory())
model = mo.model

# initialize alt-sched observatory
tel = Telescope()

numRand = 10000
randMax = np.radians(30)
deltaAlts = np.random.rand(numRand) * np.sqrt(randMax)
deltaAzes = np.random.rand(numRand) * np.sqrt(randMax)
opsim_slew_times = []
fast_slew_times = []
for deltaAlt, deltaAz in zip(deltaAlts, deltaAzes):
    # make altitude start at 45 degs so opsim doesn't complain
    # if we ask it to point at the ground
Example #3
0
 def setUp(self):
     self.truth_slew_time = 56.45919674628731
     logging.getLogger().setLevel(logging.WARN)
     self.observatory = MainObservatory(ObservingSite())