awi-response / macs_processing

all elements (scripts, workflows, descriptions, ...) needed for processing macs images for publication
0 stars 0 forks source link

Speedup exif writing #55

Closed initze closed 6 months ago

initze commented 6 months ago

Problem

Tools

Experiment

NIR + RGB each 77 images from region 99

Original

def write_exif(outdir, tag, exifpath):
    s = f'{exifpath} -overwrite_original -Model="{tag}" {outdir}'
    print(s)
    os.system(s)
exiftool\exiftool.exe -overwrite_original -Model="RGB_TEST" exiftest\121502_RGB
CPU times: total: 0 ns
Wall time: 1min 13s

Potential fix

def write_exif_open(outdir, tag, exifpath):
    s = f'{exifpath} stay_open 1 -overwrite_original -Model="{tag}" {outdir}'
    print(s)
    os.system(s)
exiftool\exiftool.exe stay_open 1 -overwrite_original -Model="RGB_TEST" exiftest\121502_RGB
CPU times: total: 46.9 ms
Wall time: 41.5 s
initze commented 6 months ago

Runs

77 images each from NWC_ReindeerLagoon_20230712_15cm_99

Experiment 1

stay open

NIR

exiftool\exiftool.exe stay_open 1 -overwrite_original -Model="99683_NIR" exiftest\99683_NIR
CPU times: total: 15.6 ms
Wall time: 26.8 s

RGB

exiftool\exiftool.exe stay_open 1 -overwrite_original -Model="121502_RGB" exiftest\121502_RGB
CPU times: total: 0 ns
Wall time: 1min 49s

Standard

NIR

exiftool\exiftool.exe -overwrite_original -Model="99683_NIR" exiftest\99683_NIR
CPU times: total: 0 ns
Wall time: 14.8 s

RGB

exiftool\exiftool.exe -overwrite_original -Model="121502_RGB" exiftest\121502_RGB
CPU times: total: 31.2 ms
Wall time: 1min 52s
initze commented 6 months ago

No measurable impact