Esempio n. 1
0
 def getDomePosition(self):
     cur, task = self._position.getDomePosition()
     cur = str(getDegrees(cur))
     task = str(getDegrees(task))
     print(cur,task)
     pos = dict()
     pos['cur'] = cur.split(':')[0]+':'+cur.split(':')[1]
     pos['task'] = task.split(':')[0]+':'+task.split(':')[1]
     return pos
Esempio n. 2
0
 def _incrementDec(self, dec, speed, sign):
     dec = astronomy.getDegrees(dec)
     if speed == 1:
         dec = astronomy.getDegrees(dec + astronomy.DEC_SECOND * sign)
     if speed == 2:
         dec = astronomy.getDegrees(dec + astronomy.DEC_MINUTE * sign)
     if speed == 3:
         dec = astronomy.getDegrees(dec + astronomy.DEC_DEGREE * sign)
     if dec > astronomy.normDec(dec) or dec < astronomy.normDec(dec):
         dec = astronomy.normDec(dec)
     return str(dec)
Esempio n. 3
0
File: Log.py Progetto: ekitru/astro
 def readLog(self, starName=None, startDate=None, endDate=None):
     """ Read log, result can be filtered by star name or logging period """
     select = "SELECT l.`id`,l.`time`, s.`name`, s.`ra`,s.`dec`, m.`text`, l.`ra`, l.`dec`, l.`altitude`, l.`focus`, l.`temp_in`, l.`temp_out`, l.`status` FROM `log` l LEFT JOIN `star` s ON l.star_id=s.id LEFT JOIN `message` m ON l.msg_id=m.id"
     condition = self.conditionConstruct(starName, startDate, endDate)
     rows = self.selectAll(select, where=condition)
     list = []
     for row in rows:
         data = dict()
         data['id'] = row[0]
         data['time'] = time.ctime(int(row[1]))
         data['name'] = row[2]
         data['sRa'], data['sDec'] = astronomy.rad2str(row[3], row[4])
         data['msg'] = row[5]
         data['ra'], data['dec'] = astronomy.rad2str(row[6], row[7])
         data['alt'] = str(astronomy.getDegrees(row[8]))
         data['focus'] = row[9]
         data['temp_in'], data['temp_out'] = row[10], row[11]
         data['status'] = row[12]
         #print('get from DB', data)
         list.append(data)
     self._log = list
     return list