コード例 #1
0
    def goto(self, ra, dec, time):
        Lon = 72.82
        Lat = 18.96
        Alt = 0.01
        ra_rad = coords.hourStr_2_rad(ra)
        dec_rad = coords.degStr_2_rad(dec)
        Az, El = RADec2AzEl(
            float(ra_rad) * 180 / math.pi,
            float(dec_rad) * 180 / math.pi, Lat, Lon, Alt)

        Az, El = Az * math.pi / 180.0, El * math.pi / 180.0

        # logging.debug("(%s, %s, %s)" % (ra, dec, time))
        logging.debug("(%s, %s, %s)" % (Az, El, time))
        self.serial.write('goto')

        # print 'hey bhagawan!! ', coords.rad_2_radStr(Az), coords.rad_2_radStr(coords.hourStr_2_rad(ra))

        if (self.serial.readline().rstrip() == 'float'):
            # print 'kya fart hai'
            # self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(ra)) )
            # self.serial.write( coords.rad_2_radStr(coords.degStr_2_rad(dec)) )
            # self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(time)) )
            self.serial.write(coords.rad_2_radStr(Az))
            # print 'size of Az', len(coords.rad_2_radStr(Az))
            self.serial.write(coords.rad_2_radStr(El))
            # print 'size of El', len(coords.rad_2_radStr(El))
            self.serial.write(coords.rad_2_radStr(coords.hourStr_2_rad(time)))
            self.sread(wait=10)
コード例 #2
0
ファイル: ldevice.py プロジェクト: karthiv/Star-Buddy
 def move(self, ac, alt):
     logging.debug("(%s, %s)" % (ac, alt))
     self.serial.write('move')
     if(self.serial.readline().rstrip() == 'float'):
         self.serial.write( coords.rad_2_radStr(6.283185 - coords.degStr_2_rad(ac)) )
         self.serial.write( coords.rad_2_radStr(coords.degStr_2_rad(alt)) )
         self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(strftime("%Hh%Mm%Ss", localtime()))) )
         self.sread(wait=10)
コード例 #3
0
ファイル: ldevice.py プロジェクト: karthiv/Star-Buddy
 def goto(self, ra, dec, time):
     logging.debug("(%s, %s, %s)" % (ra, dec, time))
     self.serial.write('goto')
     if(self.serial.readline().rstrip() == 'float'):
         self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(ra)) )
         self.serial.write( coords.rad_2_radStr(coords.degStr_2_rad(dec)) )
         self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(time)) )
         self.sread(wait=10)
コード例 #4
0
 def setRef(self, id_ref, ra, dec, time):
     setf = {1: 'set1', 2: 'set2', 3: 'set3'}
     logging.debug(" %s(%s, %s, %s)" % (setf[id_ref], ra, dec, time))
     self.serial.write(setf[id_ref])
     if (self.serial.readline().rstrip() == 'float'):
         self.serial.write(coords.rad_2_radStr(coords.hourStr_2_rad(ra)))
         self.serial.write(coords.rad_2_radStr(coords.degStr_2_rad(dec)))
         self.serial.write(coords.rad_2_radStr(coords.hourStr_2_rad(time)))
         self.sread(wait=5)
コード例 #5
0
 def setRef(self, id_ref, ra, dec, time):
     setf = {1: 'set1', 2: 'set2', 3: 'set3'}
     logging.debug(" %s(%s, %s, %s)" % (setf[id_ref], ra, dec, time))
     self.serial.write(setf[id_ref])
     if(self.serial.readline().rstrip() == 'float'):
         self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(ra)) )
         self.serial.write( coords.rad_2_radStr(coords.degStr_2_rad(dec)) )
         self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(time)) )
         self.sread(wait=5)
コード例 #6
0
 def setTime(self, time):
     self.serial.write("time")
     if (self.serial.readline().rstrip() == 'float'):
         self.serial.write(coords.rad_2_radStr(coords.hourStr_2_rad(time)))
         self.sread()
コード例 #7
0
 def setTime(self, time):
     self.serial.write("time")
     if(self.serial.readline().rstrip() == 'float'):
         self.serial.write( coords.rad_2_radStr(coords.hourStr_2_rad(time)) )
         self.sread()