Ejemplo n.º 1
0
img_left = args.input + "/" + id + "_left.bin"
if not os.path.exists(img_left):
    logger.error("Left image %s not found" % img_left)
    sys.exit(1)

img_right = args.input + "/" + id + "_right.bin"
if not os.path.exists(img_right):
    logger.error("Left image %s not found" % img_right)
    sys.exit(1)

logger.debug("Processing raw image data")
left_shape = bin2tiff.get_image_shape(metadata, 'left')
right_shape = bin2tiff.get_image_shape(metadata, 'right')
left_gps_bounds = geojson_to_tuples(
    metadata['spatial_metadata']['left']['bounding_box'])
right_gps_bounds = geojson_to_tuples(
    metadata['spatial_metadata']['right']['bounding_box'])
left_image = bin2tiff.process_image(left_shape, img_left, None)
right_image = bin2tiff.process_image(right_shape, img_right, None)

logger.debug("Creating output directories")
sensors = Sensors(base=args.output, station="ua-mac", sensor="rgb_geotiff")
left_tiff = sensors.create_sensor_path(timestamp, opts=['left'])
right_tiff = sensors.create_sensor_path(timestamp, opts=['right'])

logger.debug("Generating geotiffs")
# TODO: Extractor Info is None here, which isn't good
create_geotiff(left_image, left_gps_bounds, left_tiff, None, False, None,
               metadata)
create_geotiff(right_image, right_gps_bounds, right_tiff, None, False, None,
               metadata)
Ejemplo n.º 2
0
    vrt_map[scan_program].append(path)
 
 
#
# Loop over each of the scan programs and generate:
#   * List of input files (txt)
#   * VRT from txt
#   * Mosaic TIF image from VRT
#   * PNG from TIF for grins
#
for scan_program in vrt_map.keys():
    logger.info("Processing scan program %s" % scan_program)
    
    logger.debug("Creating output directories")
    sensors = Sensors(base=output_dir, station="ua-mac", sensor="fullfield")
    out_tif_full = sensors.create_sensor_path(timestamp, opts=["rgb_geotiff", scan_program])
    out_tif_thumb = out_tif_full.replace(".tif", "_thumb.tif")
    out_vrt = out_tif_full.replace(".tif", ".vrt")
    out_png = out_tif_full.replace(".tif", ".png")
    out_txt = out_tif_full.replace(".tif", ".txt")
    out_dir = os.path.dirname(out_vrt)

    # Create a text file with the tiff names for this scan program
    with open(out_txt, "w") as tifftxt:
        for file in sorted(vrt_map[scan_program]):
            tifftxt.write("%s\n" % file)    

    # Create VRT
    full_day_to_tiles.createVrtPermanent(".", out_txt, out_vrt)
    
    # Create fullfield image at specified scale