def __save_ifgs_dict_with_headers_and_epochs(dest_tifs, ifgs_dict, params, process_tifs): tmpdir = params[cf.TMPDIR] if not os.path.exists(tmpdir): shared.mkdir_p(tmpdir) preread_ifgs_file = Configuration.preread_ifgs(params) nifgs = len(dest_tifs) # add some extra information that's also useful later gt, md, wkt = shared.get_geotiff_header_info( process_tifs[0].tmp_sampled_path) epochlist = algorithm.get_epochs(ifgs_dict)[0] log.info('Found {} unique epochs in the {} interferogram network'.format( len(epochlist.dates), nifgs)) ifgs_dict['epochlist'] = epochlist ifgs_dict['gt'] = gt ifgs_dict['md'] = md ifgs_dict['wkt'] = wkt # dump ifgs_dict file for later use cp.dump(ifgs_dict, open(preread_ifgs_file, 'wb')) for k in ['gt', 'epochlist', 'md', 'wkt']: ifgs_dict.pop(k) return ifgs_dict
def __merge_setup(params): """ Convenience function for Merge set up steps """ # load previously saved preread_ifgs dict preread_ifgs_file = Configuration.preread_ifgs(params) ifgs_dict = pickle.load(open(preread_ifgs_file, 'rb')) ifgs = [v for v in ifgs_dict.values() if isinstance(v, shared.PrereadIfg)] shape = ifgs[0].shape tiles = Configuration.get_tiles(params) return shape, tiles, ifgs_dict
def stack_calc_wrapper(params): """ Wrapper for stacking on a set of tiles. """ log.info('Calculating rate map via stacking') if not Configuration.vcmt_path(params).exists(): raise FileNotFoundError( "VCMT is not found on disc. Have you run the 'correct' step?") params[C.PREREAD_IFGS] = cp.load( open(Configuration.preread_ifgs(params), 'rb')) params[C.VCMT] = np.load(Configuration.vcmt_path(params)) params[C.TILES] = Configuration.get_tiles(params) tiles_split(_stacking_for_tile, params) log.debug("Finished stacking calc!")
def timeseries_calc_wrapper(params): """ Wrapper for time series calculation on a set of tiles. """ if params[C.TIME_SERIES_METHOD] == 1: log.info('Calculating time series using Laplacian Smoothing method') elif params[C.TIME_SERIES_METHOD] == 2: log.info('Calculating time series using SVD method') if not Configuration.vcmt_path(params).exists(): raise FileNotFoundError("VCMT is not found on disc. Have you run the 'correct' step?") params[C.PREREAD_IFGS] = cp.load(open(Configuration.preread_ifgs(params), 'rb')) params[C.VCMT] = np.load(Configuration.vcmt_path(params)) params[C.TILES] = Configuration.get_tiles(params) tiles_split(__calc_time_series_for_tile, params) log.debug("Finished timeseries calc!")