From 4c28ff9b0a4f9c21072f0c64238f87df7b7a6d35 Mon Sep 17 00:00:00 2001 From: aso Date: Sun, 19 Oct 2025 18:44:52 +0200 Subject: [PATCH] moved persistence --- .../utils/create_camera_update_statements_download.sh | 2 +- .../utils/create_camera_update_statements_process.sh | 8 ++++---- data_handler/utils/filter_osc.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data_handler/utils/create_camera_update_statements_download.sh b/data_handler/utils/create_camera_update_statements_download.sh index b55ad3b..3da7c3e 100644 --- a/data_handler/utils/create_camera_update_statements_download.sh +++ b/data_handler/utils/create_camera_update_statements_download.sh @@ -28,5 +28,5 @@ cat seq_list.txt | xargs -n1 -P10 -I{} bash -c ' path=$(echo "$f" | sed -E "s#(...)(...)(...)#\1/\2/\3#") url="${REPLICATE_URL}/${path}.osc.gz" echo "Downloading $url" - curl -sL "$url" -o "${seqnum}.osc.gz" && gunzip "${seqnum}.osc.gz" && python filter_osc.py ${seqnum} && rm ${seqnum}.osc + curl -sL "$url" -o /migrations/"${seqnum}.osc.gz" && gunzip /migrations/"${seqnum}.osc.gz" && python filter_osc.py ${seqnum} && rm /migrations/${seqnum}.osc ' _ {} diff --git a/data_handler/utils/create_camera_update_statements_process.sh b/data_handler/utils/create_camera_update_statements_process.sh index 4744dff..3997e99 100644 --- a/data_handler/utils/create_camera_update_statements_process.sh +++ b/data_handler/utils/create_camera_update_statements_process.sh @@ -50,21 +50,21 @@ curSeqNum=$lastSeqNum curSeqNum=$(( $curSeqNum + 1 )) while [ $curSeqNum -lt $newSeqNum ] do - if [ -e "${curSeqNum}_filtered.osc" ] + if [ -e /migrations/"${curSeqNum}_filtered.osc" ] then rm "change_file.osc" - cp ${curSeqNum}_filtered.osc change_file.osc + cp /migrations/${curSeqNum}_filtered.osc change_file.osc php create_camera_update_statements.php $curSeqNum - rm ${curSeqNum}_filtered.osc + rm /migrations/${curSeqNum}_filtered.osc curSeqNum=$(( $curSeqNum + 1 )) else path=$(echo "$(printf "%09d" "$curSeqNum")" | sed -E "s#(...)(...)(...)#\1/\2/\3#") url="${REPLICATE_URL}/${path}.osc.gz" echo $url - curl -sL "$url" -o "$curSeqNum.osc.gz" && gunzip "$curSeqNum.osc.gz" && python filter_osc.py ${curSeqNum} && rm ${curSeqNum}.osc + curl -sL "$url" -o /migrations/"$curSeqNum.osc.gz" && gunzip /migrations/"$curSeqNum.osc.gz" && python filter_osc.py ${curSeqNum} && rm /migrations/${curSeqNum}.osc fi done diff --git a/data_handler/utils/filter_osc.py b/data_handler/utils/filter_osc.py index 0baea64..8d8bcec 100644 --- a/data_handler/utils/filter_osc.py +++ b/data_handler/utils/filter_osc.py @@ -9,8 +9,8 @@ def open_maybe_gzip(filename, mode="rb"): return open(filename, mode) def process_file(number): - input_file = f"{number}.osc" - filtered_file = f"{number}_filtered.osc" + input_file = f"/migrations/{number}.osc" + filtered_file = f"/migrations/{number}_filtered.osc" deleted_file = f"/migrations/{number}_deleted.osc" # --- open input and outputs ---