class sza_histogram(): idl_routines = ['matrix_file__define', 'hist_l2_run_stats'] def __init__(self, recompile=False, **addl_args): from IDL_Util import IDL_Util self.idl_util = IDL_Util() self.idl_util.idl_routines = self.idl_routines self.idl_util.load_idl(recompile) def plot(self, set_dir, results_dir, verbose=False): logger = logging.getLogger('sza_histogram') plot_file = SZA_HIST_FILE_TMPL % results_dir summ_files = [] hist_list_types = [] for curr_type, curr_lists in HIST_SUMM_TYPES.items(): found_files = glob.glob(SUMM_FILE_TMPL % (results_dir, curr_type)) if len(found_files) > 0: hist_list_types += curr_lists for curr_filename in found_files: summ_files.append(curr_filename) if len(summ_files) == 0: logger.error( 'Could not find any summary files for histogram plot for set dir: %s' % set_dir) return list_files = [] for curr_type in hist_list_types: for found_file in glob.glob(LIST_FILE_TMPL % (results_dir, curr_type)): list_files.append(found_file) # This check causes unnecessary problems when both max_div and max_iter are not present # for exceeded_max #if len(list_files) != len(hist_list_types): # raise IOError('Could not find all list file types: %s in results dir: %s, found: %s' % (hist_list_types, results_dir, list_files)) brdf_map_file = BRDF_MAP_FILE_TMPL % set_dir if not os.path.exists(brdf_map_file): raise IOError('Could not find brdf map file: %s' % brdf_map_file) for put_name in [ 'list_files', 'summ_files', 'brdf_map_file', 'set_dir', 'plot_file' ]: eval(' self.idl_util.idl.put("{0}", {0}) '.format(put_name)) logger.info('Building SZA histogram plot') logger.info('summary files: %s' % summ_files) logger.info('list files: %s' % list_files) self.idl_util.idl.eval( 'hist_l2_run_stats, list_files, summ_files, brdf_map_file, set_dir, plot_file' )
def __init__(self, recompile=False, **addl_args): IDL_Util.__init__(self) # Load IDL interpreter self.setup_idl() if not recompile and os.path.exists(self.sav_filename): self.load_sav() else: self.compile_sav()
class sza_histogram(): idl_routines = ['matrix_file__define', 'hist_l2_run_stats'] def __init__(self, recompile=False, **addl_args): from IDL_Util import IDL_Util self.idl_util = IDL_Util() self.idl_util.idl_routines = self.idl_routines self.idl_util.load_idl(recompile) def plot(self, set_dir, results_dir, verbose=False): logger = logging.getLogger('sza_histogram') plot_file = SZA_HIST_FILE_TMPL % results_dir summ_files = [] hist_list_types = [] for curr_type, curr_lists in HIST_SUMM_TYPES.items(): found_files = glob.glob(SUMM_FILE_TMPL % (results_dir, curr_type)) if len(found_files) > 0: hist_list_types += curr_lists for curr_filename in found_files: summ_files.append(curr_filename) if len(summ_files) == 0: logger.error('Could not find any summary files for histogram plot for set dir: %s' % set_dir) return list_files = [] for curr_type in hist_list_types: for found_file in glob.glob(LIST_FILE_TMPL % (results_dir, curr_type)): list_files.append(found_file) # This check causes unnecessary problems when both max_div and max_iter are not present # for exceeded_max #if len(list_files) != len(hist_list_types): # raise IOError('Could not find all list file types: %s in results dir: %s, found: %s' % (hist_list_types, results_dir, list_files)) brdf_map_file = BRDF_MAP_FILE_TMPL % set_dir if not os.path.exists(brdf_map_file): raise IOError('Could not find brdf map file: %s' % brdf_map_file) for put_name in ['list_files', 'summ_files', 'brdf_map_file', 'set_dir', 'plot_file']: eval(' self.idl_util.idl.put("{0}", {0}) '.format(put_name)) logger.info('Building SZA histogram plot') logger.info('summary files: %s' % summ_files) logger.info('list files: %s' % list_files) self.idl_util.idl.eval('hist_l2_run_stats, list_files, summ_files, brdf_map_file, set_dir, plot_file')
class idl_vis_plot(): idl_routines = ['matrix_file__define', 'compile_dummies', 'plot_statevector_profiles'] def __init__(self, recompile=False, **addl_args): from IDL_Util import IDL_Util self.idl_util = IDL_Util() self.idl_util.idl_routines = self.idl_routines self.idl_util.load_idl(recompile) def plot_statevector_profiles(self, name_str, dir_name, plot_output_dir, overwrite=False): if (overwrite): idl_overwrite_bool = 1 else: idl_overwrite_bool = 0 self.idl_util.idl.plot_statevector_profiles(name_str, dir_name, plot_output_dir, idl_overwrite_bool)
class idl_vis_plot: idl_routines = ["matrix_file__define", "compile_dummies", "plot_statevector_profiles"] def __init__(self, recompile=False, **addl_args): from IDL_Util import IDL_Util self.idl_util = IDL_Util() self.idl_util.idl_routines = self.idl_routines self.idl_util.load_idl(recompile) def plot_statevector_profiles(self, name_str, dir_name, plot_output_dir, overwrite=False): if overwrite: idl_overwrite_bool = 1 else: idl_overwrite_bool = 0 self.idl_util.idl.plot_statevector_profiles(name_str, dir_name, plot_output_dir, idl_overwrite_bool)
def __init__(self, recompile=False, **addl_args): from IDL_Util import IDL_Util self.idl_util = IDL_Util() self.idl_util.idl_routines = self.idl_routines self.idl_util.load_idl(recompile)