def field_factory(cls=None, **kwargs): """Create a field array """ #modules = ['obztak.field','obztak.maglites','obztak.bliss','obztak.maglites2'] modules = ['obztak.field'] + MODULES if cls is None: cls = get_survey() cls = FIELDS.get(cls, cls) return factory(cls, modules=modules, **kwargs)
def makePlot(date=None, name=None, figsize=(10.5, 8.5), dpi=80, s=50, center=None, airmass=True, moon=True, des=True, smash=False, maglites=None, bliss=None, galaxy=True): """ Create map in orthographic projection """ if date is None: date = ephem.now() if type(date) != ephem.Date: date = ephem.Date(date) survey = get_survey() if survey == 'maglites': if maglites is None: maglites = True if airmass is True: airmass = 2.0 if survey == 'bliss': if bliss is None: bliss = True if airmass is True: airmass = 1.4 if des: if airmass is True: airmass = 1.4 fig = plt.figure(name, figsize=figsize, dpi=dpi) plt.cla() proj_kwargs = dict() if center: proj_kwargs.update(lon_0=center[0], lat_0=center[1]) basemap = DECamOrtho(date=date, **proj_kwargs) observatory = basemap.observatory if des: basemap.draw_des() if smash: basemap.draw_smash(s=s) if maglites: basemap.draw_maglites() if bliss: basemap.draw_bliss() if airmass: airmass = 2.0 if isinstance(airmass, bool) else airmass basemap.draw_airmass(observatory, airmass) if moon: basemap.draw_moon(date) if galaxy: basemap.draw_galaxy() plt.title('%s UTC' % (datestring(date))) return fig, basemap
def tactician_factory(cls=None, **kwargs): """Create a tactician for a survey. Parameters: ----------- cls : The survey or tactician to create (default: $OBZTAK_SURVEY). Returns: -------- tac : The Tactician """ modules = ['obztak.tactician','obztak.maglites','obztak.bliss'] if cls is None: cls = get_survey() cls = TACTICIANS.get(cls,cls) return factory(cls, modules=modules, **kwargs)
def field_factory(cls=None, **kwargs): modules = ['obztak.field','obztak.maglites','obztak.bliss'] if cls is None: cls = get_survey() cls = FIELDS.get(cls,cls) return factory(cls, modules=modules, **kwargs)
def survey_factory(cls=None, **kwargs): modules = ['obztak.survey','obztak.maglites','obztak.bliss'] if cls is None: cls = get_survey() cls = SURVEYS.get(cls,cls) return factory(cls, modules=modules, **kwargs)
def scheduler_factory(cls=None, **kwargs): modules = ['obztak.scheduler','obztak.maglites','obztak.bliss'] if cls is None: cls = get_survey() cls = SCHEDULERS.get(cls,cls) return factory(cls, modules=modules, **kwargs)