diff --git a/modules/ancillary/de421.bsp b/modules/ancillary/de421.bsp new file mode 100644 index 0000000000000000000000000000000000000000..ed5b5830e54bbc09cf3ba4ade3c729a279029f06 Binary files /dev/null and b/modules/ancillary/de421.bsp differ diff --git a/modules/ancillary/geos_crs_H08_FD.pkl b/modules/ancillary/geos_crs_H08_FD.pkl new file mode 100644 index 0000000000000000000000000000000000000000..d1768834359c87518823b121ead99104da496af1 Binary files /dev/null and b/modules/ancillary/geos_crs_H08_FD.pkl differ diff --git a/modules/ancillary/geos_crs_goes16_CONUS.pkl b/modules/ancillary/geos_crs_goes16_CONUS.pkl new file mode 100644 index 0000000000000000000000000000000000000000..c941d6eb289fc841ff6d7a1c458fea71d07913c5 Binary files /dev/null and b/modules/ancillary/geos_crs_goes16_CONUS.pkl differ diff --git a/modules/ancillary/geos_crs_goes16_FD.pkl b/modules/ancillary/geos_crs_goes16_FD.pkl new file mode 100644 index 0000000000000000000000000000000000000000..db7959879996fb0b22535603780c81e2a8529b0f Binary files /dev/null and b/modules/ancillary/geos_crs_goes16_FD.pkl differ diff --git a/modules/ancillary/mean_std_lo_hi_l1b.pkl b/modules/ancillary/mean_std_lo_hi_l1b.pkl new file mode 100644 index 0000000000000000000000000000000000000000..e7a65307b67b171eb655fb76da6eb5f56e9994e8 Binary files /dev/null and b/modules/ancillary/mean_std_lo_hi_l1b.pkl differ diff --git a/modules/ancillary/mean_std_lo_hi_l2.pkl b/modules/ancillary/mean_std_lo_hi_l2.pkl new file mode 100644 index 0000000000000000000000000000000000000000..0d30a6c1d876cd2e69037f723f0b729a4c7ebb61 Binary files /dev/null and b/modules/ancillary/mean_std_lo_hi_l2.pkl differ diff --git a/modules/deeplearning/icing_cnn.py b/modules/deeplearning/icing_cnn.py index a5de2bfc75d8bd79d73c8beb6a19cd46392d5988..a014d4174695134b6183d586c1cb7d327fd83f87 100644 --- a/modules/deeplearning/icing_cnn.py +++ b/modules/deeplearning/icing_cnn.py @@ -1,5 +1,5 @@ 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() diff --git a/modules/util/setup.py b/modules/util/setup.py index d0ec810d6f4eba63ad5304d9815b328e21f7edda..c1245e917daafdef3319b70cf1fdd73c0c7b4e1e 100644 --- a/modules/util/setup.py +++ b/modules/util/setup.py @@ -1,8 +1,7 @@ # 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'} diff --git a/modules/util/util.py b/modules/util/util.py index fa2d4ce73f5af5bdd813a21128fba15d5d9eaeac..18047bf36b51e325dc3aadef4a992c2e33a28873 100644 --- a/modules/util/util.py +++ b/modules/util/util.py @@ -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()