Beispiel #1
0
 def utilities_ustar_mpt_standard(self):
     # disable the Run/Current menu option
     self.actionRunCurrent.setDisabled(True)
     logger = logging.getLogger(name="pfp_log")
     nc_file_uri = pfp_io.get_filename_dialog(title="Choose a netCDF file",
                                              ext="*.nc")
     if not os.path.exists(nc_file_uri):
         logger.info(" CPD (MPT): no netCDF file chosen")
         return
     worker = pfp_threading.Worker(
         pfp_top_level.do_utilities_ustar_mpt_standard, self, nc_file_uri)
     self.threadpool.start(worker)
     return
Beispiel #2
0
 def utilities_climatology_custom(self):
     # run climatology from a control file
     worker = pfp_threading.Worker(
         pfp_top_level.do_utilities_climatology_custom, self)
     self.threadpool.start(worker)
     return
Beispiel #3
0
 def utilities_ustar_mpt_custom(self):
     worker = pfp_threading.Worker(
         pfp_top_level.do_utilities_ustar_mpt_custom, self)
     self.threadpool.start(worker)
     return
Beispiel #4
0
 def run_current(self):
     self.stop_flag = False
     # save the current tab index
     logger = logging.getLogger(name="pfp_log")
     tab_index_current = self.tabs.tab_index_current
     if tab_index_current == 0:
         msg = " No control file selected ..."
         logger.warning(msg)
         return
     # disable the Run/Current menu option
     self.actionRunCurrent.setDisabled(True)
     # get the updated control file data
     cfg = self.tabs.tab_dict[tab_index_current].get_data_from_model()
     # set the focus back to the log tab
     self.tabs.setCurrentIndex(0)
     # call the appropriate processing routine depending on the level
     self.tabs.tab_index_running = tab_index_current
     if cfg["level"] == "batch":
         # check the L1 control file to see if it is OK to run
         if not pfp_compliance.check_batch_controlfile(cfg): return
         # add stop to run menu
         self.menuRun.addAction(self.actionStopCurrent)
         self.actionStopCurrent.triggered.connect(self.stop_current)
         # get a worker thread
         worker = pfp_threading.Worker(pfp_top_level.do_run_batch, self)
         # start the worker
         self.threadpool.start(worker)
         # no threading
         #pfp_top_level.do_run_batch(self)
     elif cfg["level"] == "L1":
         # check the L1 control file to see if it is OK to run
         if pfp_compliance.check_l1_controlfile(cfg):
             pfp_top_level.do_run_l1(cfg)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "L2":
         pfp_top_level.do_run_l2(cfg)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "L3":
         pfp_top_level.do_run_l3(cfg)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "concatenate":
         pfp_top_level.do_file_concatenate(cfg)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "climatology":
         self.utilities_climatology_custom()
     elif cfg["level"] == "cpd_barr":
         self.utilities_ustar_cpd_barr_custom()
     elif cfg["level"] == "cpd_mchugh":
         self.utilities_ustar_cpd_mchugh_custom()
     elif cfg["level"] == "cpd_mcnew":
         self.utilities_ustar_cpd_mcnew_custom()
     elif cfg["level"] == "mpt":
         self.utilities_ustar_mpt_custom()
     elif cfg["level"] == "L4":
         pfp_top_level.do_run_l4(self)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "L5":
         if pfp_compliance.check_l5_controlfile(cfg):
             pfp_top_level.do_run_l5(self)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "L6":
         if not pfp_compliance.check_l6_controlfile(cfg):
             return
         pfp_top_level.do_run_l6(self)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "nc2csv_biomet":
         pfp_top_level.do_file_convert_nc2biomet(self, mode="custom")
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "nc2csv_ecostress":
         pfp_top_level.do_file_convert_nc2ecostress(self)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "nc2csv_fluxnet":
         pfp_top_level.do_file_convert_nc2fluxnet(self)
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "nc2csv_reddyproc":
         pfp_top_level.do_file_convert_nc2reddyproc(self, mode="custom")
         self.actionRunCurrent.setDisabled(False)
     elif cfg["level"] == "windrose":
         if pfp_compliance.check_windrose_controlfile(cfg):
             pfp_top_level.do_plot_windrose_custom(self)
         self.actionRunCurrent.setDisabled(False)
     else:
         logger.error("Level not implemented yet ...")
     return