Пример #1
0
    def test_find_none (self):

        landolt = Landolt()
        #landolt.useTarget(Position.fromRaDec("14:00:00","-22:00:00"),radius=45)
        landolt.constrainColumns({"Vmag":"<10"})

        assert_raises(AssertionError, landolt.find, limit=5)
Пример #2
0
    def test_find_none(self):

        landolt = Landolt()
        #landolt.useTarget(Position.fromRaDec("14:00:00","-22:00:00"),radius=45)
        landolt.constrainColumns({"Vmag": "<10"})

        assert_raises(AssertionError, landolt.find, limit=5)
Пример #3
0
    def checkPointing(self):
        """
        This method *chooses* a field to verify the telescope pointing.
        Then it does the pointing and verifies it.
        If unsuccesfull e-mail the operator for help
        isto em portugues eh chamado calagem

        Choice is based on some catalog (Landolt here)
        We choose the field closest to zenith
        """
        # find where the zenith is
        site = self.getManager().getProxy("/Site/0")
        lst = site.LST()
        lat = site["latitude"]
        coords = Position.fromRaDec(lst, lat)

        self.log.info(
            "Check pointing - Zenith coordinates: %f %f" % (lst, lat))

        tel = self.getTel()

        # use the Vizier catalogs to see what Landolt field is closest to
        # zenith
        self.log.debug("Calling landolt")
        fld = Landolt()
        fld.useTarget(coords, radius=45)
        obj = fld.find(limit=self["max_fields"])

        print "Objects returned from Landolt", obj
        # get ra, dec to call pointVerify
        ra = obj[self.currentField]["RA"]
        dec = obj[self.currentField]["DEC"]
        name = obj[self.currentField]["ID"]
        print "Current object ", ra, dec, name

        self.log.info("Chose %s %f %f" % (name, ra, dec))
        tel.slewToRaDec(Position.fromRaDec(ra, dec))
        try:
            self.pointVerify()
        except Exception, e:
            printException(e)
            raise CantSetScopeException(
                "Can't set scope on field %s %f %f we are in trouble, call for help" % 
                (name, ra, dec))
Пример #4
0
    def checkPointing(self):
        """
        This method *chooses* a field to verify the telescope pointing.
        Then it does the pointing and verifies it.
        If unsuccesfull e-mail the operator for help
        isto em portugues eh chamado calagem

        Choice is based on some catalog (Landolt here)
        We choose the field closest to zenith
        """
        # find where the zenith is
        site = self.getManager().getProxy("/Site/0")
        lst = site.LST()
        lat = site["latitude"]
        coords = Position.fromRaDec(lst, lat)

        self.log.info("Check pointing - Zenith coordinates: %f %f" %
                      (lst, lat))

        tel = self.getTel()

        # use the Vizier catalogs to see what Landolt field is closest to zenith
        self.log.debug("Calling landolt")
        fld = Landolt()
        fld.useTarget(coords, radius=45)
        obj = fld.find(limit=self["max_fields"])

        print "Objects returned from Landolt", obj
        # get ra, dec to call pointVerify
        ra = obj[self.currentField]["RA"]
        dec = obj[self.currentField]["DEC"]
        name = obj[self.currentField]["ID"]
        print "Current object ", ra, dec, name

        self.log.info("Chose %s %f %f" % (name, ra, dec))
        tel.slewToRaDec(Position.fromRaDec(ra, dec))
        try:
            self.pointVerify()
        except Exception, e:
            printException(e)
            raise CantSetScopeException(
                "Can't set scope on field %s %f %f we are in trouble, call for help"
                % (name, ra, dec))
Пример #5
0
    def test_find(self):

        landolt = Landolt()
        landolt.useTarget(Position.fromRaDec("14:00:00", "-22:00:00"),
                          radius=45)
        landolt.constrainColumns({"Vmag": "<10"})

        data = landolt.find(limit=5)

        for obj in data:
            for k, v in obj.items():
                print k, v
Пример #6
0
    def test_find (self):

        landolt = Landolt()
        landolt.useTarget(Position.fromRaDec("14:00:00","-22:00:00"),radius=45)
        landolt.constrainColumns({"Vmag":"<10"})

        data = landolt.find(limit=5)

        for obj in data:
            for k,v in obj.items():
                assert k
                assert v
                print k, v
Пример #7
0
    def __main__(self):

        tel = self.getManager().getProxy("/Telescope/0")
        cam = self.getManager().getProxy("/Camera/0")
        dome = self.getManager().getProxy("/Dome/0")
        autofocus = self.getManager().getProxy("/Autofocus/0")
        verify = self.getManager().getProxy("/PointVerify/0")

        landolt = Landolt()
        landolt.useTarget(Position.fromRaDec("00:38:00", "-22:00:00"),
                          radius=45)

        landolt.constrainColumns({"Vmag": "<11"})

        landolts = landolt.find(limit=3)

        for landolt in landolts:

            pos = Position.fromRaDec(landolt["RA"], landolt["DEC"])
            self.log.info("Slewing to %s" % pos)
            tel.slewToRaDec(pos)

            while (tel.isSlewing() or not dome.isSyncWithTel()):
                self.log.info("Waiting dome...")

            self.log.info("Doing autofocus on %s" % pos)
            fit = autofocus.focus(target=Target.CURRENT,
                                  mode=Mode.FIT,
                                  exptime=20,
                                  start=0,
                                  end=7000,
                                  step=1000)

            self.log.info("Verifyng pointing...")
            verify.pointVerify()

            cam.expose(exp_time=120,
                       shutter="OPEN",
                       frames=1,
                       filename="extincao-%s" %
                       landolt["ID"].replace(" ", "_"))