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

add ancillary dir for ancillary files

parent 9ceafb6e
No related branches found
No related tags found
No related merge requests found
File added
File added
File added
File added
File added
File added
import tensorflow as tf
from util.setup import logdir, modeldir, cachepath, now
from util.setup import logdir, modeldir, cachepath, now, ancillary_path
from util.util import homedir, EarlyStop, normalize, make_for_full_domain_predict
from util.geos_nav import get_navigation
......@@ -39,12 +39,12 @@ NOISE_STDDEV = 0.01
img_width = 16
mean_std_dct = {}
mean_std_file = homedir+'mean_std_lo_hi_l2.pkl'
mean_std_file = ancillary_path+'mean_std_lo_hi_l2.pkl'
f = open(mean_std_file, 'rb')
mean_std_dct_l2 = pickle.load(f)
f.close()
mean_std_file = homedir+'mean_std_lo_hi_l1b.pkl'
mean_std_file = ancillary_path+'mean_std_lo_hi_l1b.pkl'
f = open(mean_std_file, 'rb')
mean_std_dct_l1b = pickle.load(f)
f.close()
......
......
# To support both python 2 and python 3
from __future__ import division, print_function, unicode_literals
# Common imports
import numpy as np
import os
from pathlib import Path
......@@ -28,4 +27,12 @@ root_cachedir = home_dir+'/cache'
cachepath = "{}/run-{}".format(root_cachedir, now)
cachepath = cachepath+'.pkl'
try:
user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
python_path = user_paths[0] + os.sep
ancillary_path = python_path + 'ancillary' + os.sep
except KeyError:
print('** PYTHONPATH must be defined! *')
python_path = None
gpu_devices = {0: '/device:GPU:0', 1: '/device:GPU:1', 2: '/device:GPU:2'}
......@@ -9,6 +9,7 @@ from collections import namedtuple
import os
import h5py
import pickle
from util.setup import ancillary_path
LatLonTuple = namedtuple('LatLonTuple', ['lat', 'lon'])
......@@ -368,15 +369,15 @@ def normalize(data, param, mean_std_dict, add_noise=False, noise_scale=1.0, seed
return data
f = open(homedir+'geos_crs_goes16_FD.pkl', 'rb')
f = open(ancillary_path+'geos_crs_goes16_FD.pkl', 'rb')
geos_goes16_fd = pickle.load(f)
f.close()
f = open(homedir+'geos_crs_goes16_CONUS.pkl', 'rb')
f = open(ancillary_path+'geos_crs_goes16_CONUS.pkl', 'rb')
geos_goes16_conus = pickle.load(f)
f.close()
f = open(homedir+'geos_crs_H08_FD.pkl', 'rb')
f = open(ancillary_path+'geos_crs_H08_FD.pkl', 'rb')
geos_h08_fd = pickle.load(f)
f.close()
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment