Skip to content

Commit

Permalink
Made a script to upload all search obs
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSwainston committed Nov 7, 2023
1 parent 405a4cf commit f730248
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions dev_scripts/generate_all_jsons_search.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e

for path in $(find /fred/oz005/search -type f -name "obs.header"); do
if [ $path == "/fred/oz005/search/J1630-4733/2019-03-15-04:20:04/2/1070/obs.header" ]; then
continue
fi
IFS="/"
# Split the path into an array
read -ra directories <<< "$path"
beam=${directories[-3]}
utc=${directories[-4]}
jname=${directories[-5]}
IFS=" "
if [ -e "${path%%obs.header}/meertime.json" ]; then
echo "Skipping $path"
else
echo "Making meetime.json for $path"
EXIT_CODE=0
generate_meerkat_json $path $beam -o ${path%%obs.header} || EXIT_CODE=$?
if [ "$EXIT_CODE" -ne 42 ]; then
if [ -e "meertime.json" ]; then
ingest_obs "${path%%obs.header}/meertime.json"
else
echo "meertime.json does not exist."
fi
fi
fi
done

0 comments on commit f730248

Please sign in to comment.