#!/bin/sh # Fetches the Alexandria phonon and electron-phonon release of 11 August 2025 (PBEsol, 3D): # 93 files, alexandria_ph_000.json.bz2 to alexandria_ph_092.json.bz2, 5.06 GB, CC BY 4.0. # Source: https://alexandria.icams.rub.de/data/pbesol_ph/3d/ # Cavignac et al., J. Phys. Mater. 9, 025014 (2026); Gao et al., Nat. Commun. 16, 8253 (2025). # Files land in data/alexandria_ph/, which is not tracked by git. Safe to re-run: finished # files are skipped and partial ones resumed. set -eu BASE=https://alexandria.icams.rub.de/data/pbesol_ph/3d DIR="$(cd "$(dirname "$0")/../data/alexandria_ph" && pwd)" if [ "${1:-}" = one ]; then f="alexandria_ph_$2.json.bz2" want=$(curl -sI "$BASE/$f" | tr -d '\r' | awk 'tolower($1)=="content-length:" {print $2}') have=0 [ -f "$DIR/$f" ] && have=$(wc -c < "$DIR/$f" | tr -d ' ') [ "$have" = "$want" ] && exit 0 curl -sS --fail --retry 5 --retry-delay 5 -C - -o "$DIR/$f" "$BASE/$f" || { echo "FAILED $f"; exit 0; } exit 0 fi seq -f "%03g" 0 92 | xargs -P 4 -n 1 "$0" one ls "$DIR" | wc -l du -sh "$DIR"