Skip to content

Commit

Permalink
Changed tropomiCache to satelliteCache, data_TROPOMI default storage …
Browse files Browse the repository at this point in the history
…to data_satellite, and added if statements to the TROPOMI download section to only download TROPOMI if it is a methane inversion
  • Loading branch information
Hannah Nesser committed Jun 28, 2024
1 parent 275295b commit 0013b7f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions run_imi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,28 +126,30 @@ export PYTHONPATH=${PYTHONPATH}:${InversionPath}

# Download TROPOMI data from AWS. You will be charged if your ec2 instance is not in the eu-central-1 region.
mkdir -p -v ${RunDirs}
tropomiCache=${RunDirs}/data_TROPOMI
if "$isAWS"; then
satelliteCache=${RunDirs}/data_satellite
if ("$isAWS" && [[ "$Species" == "CH4" ]]); then
{ # test if instance has access to TROPOMI bucket
stdout=`aws s3 ls s3://meeo-s5p`
} || { # catch
printf "\nError: Unable to connect to TROPOMI bucket. This is likely caused by misconfiguration of the ec2 instance iam role s3 permissions.\n"
printf "IMI $RunName Aborted.\n"
exit 1
}
mkdir -p -v $tropomiCache
mkdir -p -v $satelliteCache
printf "Downloading TROPOMI data from S3\n"
python src/utilities/download_TROPOMI.py $StartDate $EndDate $tropomiCache
python src/utilities/download_TROPOMI.py $StartDate $EndDate $satelliteCache
printf "\nFinished TROPOMI download\n"
elif ("$isAWS" && [[ "$Species" != "CO2" ]]); then
printf "Non methane species are not currently supported on AWS."
else
# use existing tropomi data and create a symlink to it
if [[ ! -L $tropomiCache ]]; then
ln -s $DataPathObs $tropomiCache
if [[ ! -L $satelliteCache ]]; then
ln -s $DataPathObs $satelliteCache
fi
fi

# Check to make sure there are no duplicate TROPOMI files (e.g., two files with the same orbit number but a different processor version)
python src/utilities/test_TROPOMI_dir.py $tropomiCache
python src/utilities/test_TROPOMI_dir.py $satelliteCache

##=======================================================================
## Run the setup script
Expand Down

0 comments on commit 0013b7f

Please sign in to comment.