Beispiel #1
0
def gamma_prepifg(base_unw_paths, params):
    """
    GAMMA prepifg which combines both conversion to geotiff and multi-looking
     and cropping.

    :param base_unw_paths: List of unwrapped interferograms
    :param params: Parameters dictionary corresponding to config file
    
    :return xxxx
    """
    # pylint: disable=expression-not-assigned
    log.info("Preparing GAMMA format interferograms")
    parallel = params[cf.PARALLEL]

    # dest_base_ifgs: location of geo_tif's
    if parallel:
        log.info("Running prepifg in parallel with {} "
                 "processes".format(params[cf.PROCESSES]))
        dest_base_ifgs = Parallel(n_jobs=params[cf.PROCESSES], verbose=50)(
            delayed(gamma_multiprocessing)(p, params) for p in base_unw_paths)
    else:
        log.info("Running prepifg in serial")
        dest_base_ifgs = [
            gamma_multiprocessing(b, params) for b in base_unw_paths
        ]

    ifgs = [prepifg.dem_or_ifg(p) for p in dest_base_ifgs]
    xlooks, ylooks, crop = cf.transform_params(params)
    user_exts = (params[cf.IFG_XFIRST], params[cf.IFG_YFIRST],
                 params[cf.IFG_XLAST], params[cf.IFG_YLAST])
    exts = prepifg.get_analysis_extent(crop,
                                       ifgs,
                                       xlooks,
                                       ylooks,
                                       user_exts=user_exts)
    thresh = params[cf.NO_DATA_AVERAGING_THRESHOLD]
    if parallel:
        Parallel(n_jobs=params[cf.PROCESSES], verbose=50)(
            delayed(prepifg.prepare_ifg)(p, xlooks, ylooks, exts, thresh, crop)
            for p in dest_base_ifgs)
    else:
        [
            prepifg.prepare_ifg(i, xlooks, ylooks, exts, thresh, crop)
            for i in dest_base_ifgs
        ]
Beispiel #2
0
 def run(self):
     with open(self.extents_file_name, 'rb') as ext_file:
         extents = pickle.load(ext_file)
     prepare_ifg(self.ifg.data_path, self.xlooks, self.ylooks, extents,
                 self.thresh, self.crop_opt)
     self.ifg.close()