Beispiel #1
0
 def __call__(self, fpath: str):
     if os.path.isdir(fpath):
         if self.rhi_flag:
             path_string = "{}{}_{}_RHI_{:.0f}_{:.0f}_{}.png".format(
                 fpath,
                 self.data.site_code,
                 datetime.strptime(
                     self.data.scan_time,
                     "%Y-%m-%d %H:%M:%S").strftime("%Y%m%d%H%M%S"),
                 self.data.azimuth,
                 self.data.range,
                 self.dtype,
             )
         else:
             path_string = "{}_{}_VCS_{}N{}E_{}N{}E.png".format(
                 self.data.site_code,
                 datetime.strptime(
                     self.data.scan_time,
                     "%Y-%m-%d %H:%M:%S").strftime("%Y%m%d%H%M%S"),
                 self.data.start_lat,
                 self.data.start_lon,
                 self.data.end_lat,
                 self.data.end_lon,
             )
         save_path = os.path.join(fpath, path_string)
     else:
         save_path = fpath
     save(save_path)
Beispiel #2
0
 def _save(self, fpath: str):
     if not self.settings['path_customize']:
         if not fpath.endswith(os.path.sep):
             fpath += os.path.sep
         if self.settings['slice']:
             data = self.settings['slice']
             stp = data.geoinfo['stp']
             enp = data.geoinfo['enp']
             sec = '_{}N{}E_{}N{}E'.format(stp[1], stp[0], enp[1], enp[0])
         else:
             sec = ''
         path_string = '{}{}_{}_{:.1f}_{}_{}{}.png'.format(
             fpath, self.data.code,
             self.data.scantime.strftime('%Y%m%d%H%M%S'), self.data.elev,
             self.data.drange, self.data.dtype.upper(), sec)
     else:
         path_string = fpath
     save(path_string)
Beispiel #3
0
 def _save(self, fpath: str):
     if not self.settings["path_customize"]:
         if not fpath.endswith(os.path.sep):
             fpath += os.path.sep
         if self.settings["slice"]:
             data = self.settings["slice"]
             stp = data.geoinfo["stp"]
             enp = data.geoinfo["enp"]
             sec = "_{}N{}E_{}N{}E".format(stp[1], stp[0], enp[1], enp[0])
         else:
             sec = ""
         path_string = "{}{}_{}_{:.1f}_{}_{}{}.png".format(
             fpath,
             self.data.code,
             self.data.scantime.strftime("%Y%m%d%H%M%S"),
             self.data.elev,
             self.data.drange,
             self.data.dtype.upper(),
             sec,
         )
     else:
         path_string = fpath
     save(path_string)