Exemplo n.º 1
0
def _gamma_multiprocessing(unw_path, params):
    """
    Multiprocessing wrapper for GAMMA full-res geotiff conversion
    """
    dem_hdr_path = params[cf.DEM_HEADER_FILE]
    slc_dir = params[cf.SLC_DIR]
    header_paths = get_header_paths(unw_path, slc_dir=slc_dir)
    combined_headers = gamma.manage_headers(dem_hdr_path, header_paths)
    dest = output_tiff_filename(unw_path, params[cf.OUT_DIR])

    if os.path.basename(unw_path).split('.')[1] == (
            params[cf.APS_INCIDENCE_EXT] or params[cf.APS_ELEVATION_EXT]):
        # TODO: implement incidence class here
        combined_headers['FILE_TYPE'] = 'Incidence'

    # Create full-res geotiff if not already on disk
    if not os.path.exists(dest):
        write_geotiff(combined_headers,
                      unw_path,
                      dest,
                      nodata=params[cf.NO_DATA_VALUE])
    else:
        log.info("Full-res geotiff already exists")

    return dest
Exemplo n.º 2
0
def gamma_multiprocessing(unw_path, params):
    """
    Gamma multiprocessing wrapper for geotif conversion.

    :param unw_path: Wnwrapped interferogram path
    :param params: Parameters dictionary corresponding to config file
    
    :return xxxx
    """
    dem_hdr_path = params[cf.DEM_HEADER_FILE]
    slc_dir = params[cf.SLC_DIR]
    mkdir_p(params[cf.OUT_DIR])
    header_paths = gamma_task.get_header_paths(unw_path, slc_dir=slc_dir)
    combined_headers = gamma.manage_headers(dem_hdr_path, header_paths)

    dest = output_tiff_filename(unw_path, params[cf.OUT_DIR])
    if os.path.basename(unw_path).split('.')[1] == \
            (params[cf.APS_INCIDENCE_EXT] or params[cf.APS_ELEVATION_EXT]):
        # TODO: implement incidence class here
        combined_headers['FILE_TYPE'] = 'Incidence'

    write_geotiff(combined_headers,
                  unw_path,
                  dest,
                  nodata=params[cf.NO_DATA_VALUE])
    return dest
Exemplo n.º 3
0
 def output(self):
     """
     Overload of :py:meth:`luigi.Task.output`.
     """
     self.out_file = output_tiff_filename(self.input_file, self.out_dir)
     return [luigi.LocalTarget(self.out_file)]