<commit_before>#! /bin/bash

#Generate standardized stacks/products from a directory of vmap output

mkdir rename 

for j in vm vx vy
do
    echo $j
    mkdir rename/${j}
    #This isn't working, fn doesn't get assigned
    #parallel "fn=$(~/src/vmap/vmap/wv_cdate.py {}); ln -s ../{} rename/${j}/${fn}_${j}.tif" ::: 2*/2*${j}.tif
    for i in 2*/2*${j}.tif
    do 
        ln -sv ../../$i rename/${j}/$(~/src/vmap/vmap/wv_cdate.py $i)_${j}.tif
    done
done

cd rename

#Create median, stddev and count products
parallel "dem_mosaic --{2} -o {1} {1}/*{1}.tif" ::: vm vx vy ::: median stddev count

#Clip to RGI poylgons
parallel "clip_raster_by_shp.py -extent raster {}-tile-0-median.tif rgi" ::: vm vx vy

#Clip to rock surfaces
parallel "dem_mask.py {}-tile-0-median.tif" ::: vm vx vy

#Compute stats for rock surfaces
for i in *ref.tif ; do robust_stats.py $i > ${i%.*}_stats.txt ; done

#tar -hczvf khumbu_vel.tar.gz rename
<commit_msg>post_vmap: add make_stack.py command<commit_after>#! /bin/bash

#Generate standardized stacks/products from a directory of vmap output

mkdir rename 

for j in vm vx vy
do
    echo $j
    mkdir rename/${j}
    #This isn't working, fn doesn't get assigned
    #parallel "fn=$(~/src/vmap/vmap/wv_cdate.py {}); ln -s ../{} rename/${j}/${fn}_${j}.tif" ::: 2*/2*${j}.tif
    for i in 2*/2*${j}.tif
    do 
        ln -sv ../../$i rename/${j}/$(~/src/vmap/vmap/wv_cdate.py $i)_${j}.tif
    done
done

cd rename

#Create median, stddev and count products
parallel "dem_mosaic --{2} -o {1} {1}/*{1}.tif" ::: vm vx vy ::: median stddev count

#Clip to RGI poylgons
parallel "clip_raster_by_shp.py -extent raster {}-tile-0-median.tif rgi" ::: vm vx vy

#Clip to rock surfaces
parallel "dem_mask.py {}-tile-0-median.tif" ::: vm vx vy

#Compute stats for rock surfaces
for i in *ref.tif ; do robust_stats.py $i > ${i%.*}_stats.txt ; done

make_stack.py --med -outdir stack vm/*vm.tif

#tar -hczvf khumbu_vel.tar.gz rename

{'fraction_non_alphanumeric': 0.17478216299333674, 'fraction_numerical': 0.010251153254741158, 'mean_word_length': 3.1798715203426124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5586119', 'n_tokens_mistral': 829, 'n_tokens_neox': 765, 'n_words': 228}