示例#1
0
 def set_obsnight(self):
     night_id = self.ids.obsnight.text
     if night_id == '' or self.current_obsrun.runid == '' \
                     or night_id == 'Observation Date':
         return
     if night_id not in self.obsnight_list:
         self.obsnight_list.append(night_id)
         self.obsnight_buttons.append(Button(text = night_id, \
             size_hint_y = None, height = 30))
         self.current_obsnight = ird.ObsNight(date = night_id)
         #self.current_obsrun.addnight(self.current_obsnight)
         ird.add_to(self.current_obsrun, self.current_obsnight)
     else:
         #self.current_obsnight = self.current_obsrun.get_night(night_id)
         self.current_obsnight = ird.get_from(self.current_obsrun, night_id)
         self.ids.rawpath.text = self.current_obsnight.rawpath
         self.ids.outpath.text = self.current_obsnight.outpath
         self.ids.calpath.text = self.current_obsnight.calpath
         self.ids.fformat.text = self.current_obsnight.filestub
         self.set_filelist()
     #rdb = shelve.open(self.obsids[self.current_obsrun.runid])
     #rdb = JsonStore(self.obsids[self.current_obsrun.runid])
     for night in self.obsnight_list:
         #self.rdb[night] = ird.serialize(ird.get_from(self.current_obsrun, night))
         self.rdb[night] = {night:ird.get_from(self.current_obsrun, night)}
     #rdb.close()
     self.target_list = self.current_obsnight.targets.keys()
示例#2
0
 def save_target(self):
     self.current_target = self.current_target._replace(dither=[x.dithertype for x in self.file_list],
         notes=self.ids.tnotes.text)
     #just make sure everything is propagating correctly
     self.current_obsnight.targets[self.current_target.targid] = self.current_target
     self.current_obsrun.nights[self.current_obsnight.date] = self.current_obsnight
     #rdb = shelve.open(self.obsids[self.current_obsrun.runid])
     #rdb = JsonStore(self.obsids[self.current_obsrun.runid])
     for night in self.obsnight_list:
         #self.rdb[night] = ird.serialize(ird.get_from(self.current_obsrun, night))
         self.rdb[night] = ird.get_from(self.current_obsrun, night)
     #rdb.close()
     self.target_list = self.current_obsnight.targets.keys()
示例#3
0
 def save_night(self):
     tmp = self.current_obsrun.nights
     tmp[self.current_obsnight.date] = self.current_obsnight
     self.current_obsrun = self.current_obsrun._replace(nights=tmp)
     #tmp = ird.ObsNight(**self.current_obsnight._asdict())
     #self.current_obsrun.nights[tmp.date] = tmp
     #ird.add_to(self.current_obsrun, self.current_obsnight)
     #rdb = shelve.open(self.obsids[self.current_obsrun.runid])
     #rdb = JsonStore(self.obsids[self.current_obsrun.runid])
     for night in self.obsnight_list:
         #self.rdb[night] = ird.serialize(ird.get_from(self.current_obsrun, night))
         self.rdb[night] = {night:ird.get_from(self.current_obsrun, night)}
     self.rdb.store_sync()