Created
June 30, 2023 22:15
-
-
Save ashiklom/b1c6e9c832698b47c9daeea6df830262 to your computer and use it in GitHub Desktop.
Re-chunking GOES data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
source ~/.bash_functions | |
mod_py39 | |
conda activate vdp-common | |
FILES=$(find css-geo/GOES-16-ABI-L1B-FULLD/2022/203 -type f) | |
# Define directory where outptus will be saved | |
OUTDIR=GOES-16-ABI-L1B-FULLD-rc1000 | |
for infile in $FILES; do | |
echo "Processing $(basename $infile)" | |
# Define the output file by replacing the base directory of the input file | |
# with the output directory. | |
outfile=${infile/css-geo\/GOES-16-ABI-L1B-FULLD/$OUTDIR} | |
mkdir -p $(dirname $outfile) | |
if [ -f $outfile ]; then | |
echo "File exists. Skipping..." | |
continue | |
fi | |
# Re-chunk in the X and Y dimensions, setting both X and Y chunk sizes to 100 | |
ncks $infile \ | |
--chunk_dimension x,1000 \ | |
--chunk_dimension y,1000 \ | |
$outfile | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change
$outfile
to$outfile &
and addwait
at the very bottom of the file (outside the loop) to process these in parallel. But make sure you're on a compute node, not an interactive node!