Skip to content

Commit

Permalink
add in script to make splits
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Dec 20, 2024
1 parent 3bc20d0 commit 41c02b8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spf/scripts/make_splits.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

splits=/mnt/md2/splits/
name=dec19
n=90 # 90% for train

ls /mnt/ssd/2d_wallarray_v2_data/*/*.zarr -d | shuf > ${splits}/${name}_full.txt
grep rx_circle ${splits}/${name}_full.txt > ${splits}/${name}_val.txt
grep -v rx_circle ${splits}/${name}_full.txt > ${splits}/${name}_notcircle.txt

total=$(wc -l < "${splits}/${name}_notcircle.txt")
cutoff=$(( (n * total) / 100 ))

head -n "$cutoff" "${splits}/${name}_notcircle.txt" > ${splits}/${name}_train.txt
tail -n $(( total - cutoff )) "${splits}/${name}_notcircle.txt" >> ${splits}/${name}_val.txt

# add in rover to validation
ls /mnt/ssd/rovers/merged/nov*.zarr -d >> ${splits}/${name}_train.txt
ls /mnt/ssd/rovers/merged/dec*.zarr -d >> ${splits}/${name}_val.txt

0 comments on commit 41c02b8

Please sign in to comment.