user input

parent 8280178e
#!/bin/sh #!/bin/sh
#Convert L1C Products to L2A using L2A_Process #Convert L1C Products to L2A using L2A_Process
INPUTDIR=$1 #Top directory with a L1C Subirectory INPUTDIR=$1 #Top directory with a L1C Subirectory
JOBS=${2:-1} OUTPUTDIR=$2
if [ "$#" -le 1 ]; then JOBS=${3:-1}
echo "Usage " $0 " <Directory with a L1C Subirectory> [jobs]" if [ "$#" -le 2 ]; then
echo "Usage " $0 " <L1C Directory> <L2A Directory> [jobs]"
exit exit
fi fi
cd $INPUTDIR/L1C #cd $INPUTDIR
if [ ! -d ../L2A ]; then if [ ! -d $OUTPUTDIR ]; then
mkdir ../L2A mkdir $OUTPUTDIR
fi fi
cd $INPUTDIR/L2A cd $OUTPUTDIR
ls ../L1C/*.zip | parallel --jobs $JOBS L1CToL2A.sh ls $INPUTDIR*.zip | parallel --jobs $JOBS echo
#L1CToL2A.sh
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#Convert L1C Products to L2A using L2A_Process #Convert L1C Products to L2A using L2A_Process
filename=$1 #L1C Filename filename=$1 #L1C Filename
Z1=$(echo $(echo $filename | cut -d "_" -f1) | cut -d "/" -f3) Z1=$(echo $(echo $filename | cut -d "_" -f1) | cut -d "/" -f3)
Z2=$(echo $filename | cut -d "_" -f3,4,5,6,7 | cut -d "." -f1) Z2=$(echo $filename | cut -d "_" -f3,4,5,6,7 | cut -d "." -f1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment