Exemplo n.º 1
0
    def obsres_from_oblock_id(self, obsid, configuration=None):
        este = self.ob_table[obsid]
        obsres = obsres_from_dict(este)

        this_drp = self.drps.query_by_name(obsres.instrument)
        tagger = None
        for mode in this_drp.modes:
            print(mode.key, obsres.mode)
            if mode.key == obsres.mode:
                tagger = mode.tagger
                break
        else:
            raise ValueError(
                'no mode for {0}.mode in instrument {0}.instrument'.format(
                    obsres))

        if tagger is None:
            master_tags = {}
        else:
            master_tags = tagger(obsres)

        obsres.tags = master_tags

        # Insert Instrument configuration
        if configuration:
            # override instrument configuration
            obsres.configuration = self.search_instrument_configuration(obsres.instrument, configuration)
        else:
            # Insert Instrument configuration
            obsres.configuration = this_drp.configuration_selector(obsres)

        return obsres
Exemplo n.º 2
0
    def obsres_from_oblock_id(self, obsid):
        este = self.ob_table[obsid]
        obsres = obsres_from_dict(este)

        this_drp = self.drps.query_by_name(obsres.instrument)
        tagger = None
        for mode in this_drp.modes:
            if mode.key == obsres.mode:
                tagger = mode.tagger
                break
        else:
            raise ValueError('no mode for %s in instrument %s' % (obsres.mode, obsres.instrument))

        if tagger is None:
            master_tags = {}
        else:
            master_tags = tagger(obsres)

        obsres.tags = master_tags
        return obsres