Skip to content
Snippets Groups Projects
Commit b5543be6 authored by tomrink's avatar tomrink
Browse files

add option to, or not, copy from /arcdata to local

parent 66b95a0e
No related branches found
No related tags found
No related merge requests found
...@@ -740,6 +740,8 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa ...@@ -740,6 +740,8 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
return None, None, None, None return None, None, None, None
# copy from archive to local drive # copy from archive to local drive
t0 = datetime.datetime.now().timestamp()
local_path = fC
if COPY_GOES: if COPY_GOES:
local_path = goes_cache_dir + '/' + os.path.split(fC)[1] local_path = goes_cache_dir + '/' + os.path.split(fC)[1]
if not os.path.exists(local_path): if not os.path.exists(local_path):
...@@ -752,6 +754,8 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa ...@@ -752,6 +754,8 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
except Exception as exc: except Exception as exc:
print(exc) print(exc)
return None, None, None, None return None, None, None, None
t1 = datetime.datetime.now().timestamp()
print((t1-t0)*1000)
bt_or_refl = None bt_or_refl = None
if pug_l1b_c.bt_or_refl == 'bt': if pug_l1b_c.bt_or_refl == 'bt':
...@@ -761,6 +765,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa ...@@ -761,6 +765,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
if TRIPLET or CONV3D: if TRIPLET or CONV3D:
# copy from archive to local drive # copy from archive to local drive
local_path_l = fL
if COPY_GOES: if COPY_GOES:
local_path_l = goes_cache_dir + '/' + os.path.split(fL)[1] local_path_l = goes_cache_dir + '/' + os.path.split(fL)[1]
if not os.path.exists(local_path_l): if not os.path.exists(local_path_l):
...@@ -780,6 +785,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa ...@@ -780,6 +785,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
bt_or_refl_l = pug_l1b_l.refl bt_or_refl_l = pug_l1b_l.refl
# copy from archive to local drive # copy from archive to local drive
local_path_r = fR
if COPY_GOES: if COPY_GOES:
local_path_r = goes_cache_dir + '/' + os.path.split(fR)[1] local_path_r = goes_cache_dir + '/' + os.path.split(fR)[1]
if not os.path.exists(local_path_r): if not os.path.exists(local_path_r):
...@@ -798,6 +804,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa ...@@ -798,6 +804,7 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
elif pug_l1b_r.bt_or_refl == 'refl': elif pug_l1b_r.bt_or_refl == 'refl':
bt_or_refl_r = pug_l1b_r.refl bt_or_refl_r = pug_l1b_r.refl
t0 = datetime.datetime.now().timestamp()
if daynight != 'ANY': if daynight != 'ANY':
if step[ch_idx] == 1: if step[ch_idx] == 1:
if geoloc_2km is None: if geoloc_2km is None:
...@@ -881,6 +888,8 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa ...@@ -881,6 +888,8 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
if TRIPLET or CONV3D: if TRIPLET or CONV3D:
subprocess.call(['rm', local_path_l]) subprocess.call(['rm', local_path_l])
subprocess.call(['rm', local_path_r]) subprocess.call(['rm', local_path_r])
t1 = datetime.datetime.now().timestamp()
print((t1-t0)*1000)
return np.array(data), np.array(data_l), np.array(data_r), np.array(idxs) return np.array(data), np.array(data_l), np.array(data_r), np.array(idxs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment