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

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

parent 818c2433
No related branches found
No related tags found
No related merge requests found
......@@ -27,12 +27,15 @@ gfs_date_format = '%y%m%d'
h4_to_h5_path = home_dir + '/h4toh5convert'
data_dir = '/home/rink/data'
data_dir = '/scratch/long/rink'
converted_file_dir = data_dir + '/gfs_h5'
CACHE_GFS = True
goes_cache_dir = data_dir + '/goes16'
CACHE_GOES = True
COPY_GOES = True
if not COPY_GOES:
CACHE_GOES = False
fmt = '%Y%j%H'
......@@ -737,10 +740,11 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
return None, None, None, None
# copy from archive to local drive
local_path = goes_cache_dir + '/' + os.path.split(fC)[1]
if not os.path.exists(local_path):
subprocess.call(['cp', fC, goes_cache_dir])
subprocess.call(['chmod', 'u+w', local_path])
if COPY_GOES:
local_path = goes_cache_dir + '/' + os.path.split(fC)[1]
if not os.path.exists(local_path):
subprocess.call(['cp', fC, goes_cache_dir])
subprocess.call(['chmod', 'u+w', local_path])
# Navigation, convert to BT/REFL
try:
......@@ -757,10 +761,11 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
if TRIPLET or CONV3D:
# copy from archive to local drive
local_path_l = goes_cache_dir + '/' + os.path.split(fL)[1]
if not os.path.exists(local_path_l):
subprocess.call(['cp', fL, goes_cache_dir])
subprocess.call(['chmod', 'u+w', local_path_l])
if COPY_GOES:
local_path_l = goes_cache_dir + '/' + os.path.split(fL)[1]
if not os.path.exists(local_path_l):
subprocess.call(['cp', fL, goes_cache_dir])
subprocess.call(['chmod', 'u+w', local_path_l])
# Navigation, convert to BT/REFL
try:
......@@ -775,9 +780,10 @@ def get_images(lons, lats, timestamp, channel_list, half_width, step, do_norm=Fa
bt_or_refl_l = pug_l1b_l.refl
# copy from archive to local drive
local_path_r = goes_cache_dir + '/' + os.path.split(fR)[1]
if not os.path.exists(local_path_r):
subprocess.call(['cp', fR, goes_cache_dir])
if COPY_GOES:
local_path_r = goes_cache_dir + '/' + os.path.split(fR)[1]
if not os.path.exists(local_path_r):
subprocess.call(['cp', fR, goes_cache_dir])
subprocess.call(['chmod', 'u+w', local_path_r])
# Navigation, convert to BT/REFL
......
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