bugfix awrams.py

desktop
esea_info 3 years ago
parent 8b7b923492
commit 8b1669ad23
  1. 36
      awrams.py

@ -518,12 +518,12 @@ class AWRAMS(object):
self.getAvg( self.intensity_before_avg )
# 波长插值 self.res esky lsky lw
self.__do_sensor_dict_interpo()
# 获得输出目录路径 self.ymdhms
# 获得输出文件名 self.ymdhms
self.get_ymdhms()
# get Lw Rs
self.getLwRs()
# 设置保存路径 self.output_path
self.get_save_csv_path()
self.get_output_path(1)
# 保存 data info
self.saveOnefileForLskyEskyLwaterLwRS()
# 通知ui
@ -554,7 +554,7 @@ class AWRAMS(object):
# + str(self.info_dict['hour']) + '_' \
# + str(self.info_dict['minute']) + '_' \
# + str(self.info_dict['second'])
self.output_path = self.output_path.joinpath( self.ymdhms )
# self.output_path = self.output_path.joinpath( self.ymdhms )
log.debug(f"current_measure_time: {self.current_measure_time}", __name__, "dealOneMeasurement")
# 读取buf
self.hhb.readFile2Buf(fpath)
@ -566,10 +566,12 @@ class AWRAMS(object):
self.getAvg( self.intensity_before_avg )
# 波长插值 self.res esky lsky lw
self.__do_sensor_dict_interpo()
# 获得输出目录路径 self.ymdhms
# 获得输出文件名 self.ymdhms
self.get_ymdhms()
# get Lw Rs
self.getLwRs()
# 设置保存路径 self.output_path SD卡
self.get_output_path(0)
# 保存 data info
self.saveOnefileForLskyEskyLwaterLwRS()
# 通知ui
@ -583,24 +585,14 @@ class AWRAMS(object):
+ f"{self.info_dict['hour']:02d}" + '_' \
+ f"{self.info_dict['minute']:02d}" + '_' \
+ f"{self.info_dict['second']:02d}"
# self.output_path = self.output_path.joinpath( self.ymdhms )
# print(self.output_path)
# time.sleep(30)save_csv_path
def get_save_csv_path(self, ):
if self.mode == 0:
def get_output_path(self, mode=0):
if mode == 0:
self.mydir.setBaseDir(DATA_DIR)
else:
self.mydir.setBaseDir(SERVER_DIR)
dir_tuple = ( "output", str(self.info_dict['year']),str(self.info_dict['month']),str(self.info_dict['day']))
self.mydir.setDir( dir_tuple)
self.mydir.newDirIfNot()
self.mydir.newFileIfNot( self.ymdhms+SAVE_EXT_NAME)
self.output_path = self.mydir.current_filepath
# self.output_path = self.output_path.joinpath( self.ymdhms )
# print(self.output_path)
# time.sleep(30)
# dir_tuple = ( "output", "20"+str(self.info_dict['year']),str(self.info_dict['month']),str(self.info_dict['day']))
self.output_path = self.mydir.current_dir.joinpath("output")
def decode_sensor_buf(self,) :
@ -661,10 +653,10 @@ class AWRAMS(object):
def saveOnefileForLskyEskyLwaterLwRS(self, ) -> bool:
log.info(f" ", __name__, "saveOnefileForLskyEskyLwaterLwRS")
year = "20"+ f"{self.info_dict['year']:02d}"
month = f"{self.info_dict['month']:02d}"
day = f"{self.info_dict['day']:02d}"
save_path = OUTPUT_DIR.joinpath(year,month,day)
year = "20"+ f"{self.info_dict['year']:02d}"
month = f"{self.info_dict['month']:02d}"
day = f"{self.info_dict['day']:02d}"
save_path = self.output_path.joinpath(year,month,day)
self.mydir.setBaseDir(save_path) #基路径
self.mydir.newDirIfNot()
self.mydir.newFileIfNot(self.ymdhms + SAVE_EXT_NAME)

Loading…
Cancel
Save