#!/bin/sh
# Run manually to refresh 16WW load profiles after computation/style update.

# Run for selected months in one year.
YEAR=2026
MONTHS="01 02 03 04 05 06 07 08"

tmp="$HOME/tmp/load-profile"
destdirtop=img/PV/load-profile

if [ "" = "$tmp" ] || [ ! -d "$tmp" ]; then
    echo "ERROR: cannot file temp working dir $tmp" 1>&2
    exit 1;
fi

for m in $MONTHS;
    do
    destdir="$destdirtop/$YEAR$m"
    if [ "" = "$tmp" ] || [ ! -d "$tmp" ]; then
        echo "ERROR: cannot file destination dir $tmp" 1>&2
        exit 1;
    fi
    rm -f "$tmp/bucketed."*
    sh script/storesim/load_profile.sh -all "$YEAR$m"
    mv "$tmp/bucketed."* "$destdir"
    done
