-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix style and add opacity data (#34)
- Fix c++ and python style - Add stellar flux and absorption data read functions
- Loading branch information
Showing
53 changed files
with
1,235 additions
and
468 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# hitran par file | ||
*.par | ||
|
||
# datafile | ||
*.txt | ||
*.hit | ||
|
||
# data folder | ||
*/ | ||
|
||
# tmp files | ||
.* |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#! /bin/bash | ||
# | ||
# Download exogcm opacity data from Dropbox | ||
FILE="ck_data_01242024" | ||
DATA_DIR=$1/ | ||
|
||
# Dropbox link | ||
DROPBOX_LINK="https://www.dropbox.com/scl/fi/tt2vez9jadfcq3j0wdw8x/ck_data_01242024.tar.gz?rlkey=dv7tmqpfy2uvs0u5lt2wz3c4k&dl=0" | ||
|
||
# Read expected SHA256 from the file | ||
EXPECTED_SHA256=$(grep "$FILE" ${DATA_DIR}checksums.txt | awk '{print $1}') | ||
|
||
# Check if the SHA256 has been found | ||
if [ -z "$EXPECTED_SHA256" ]; then | ||
echo "Cannot find SHA256 for $FILE in ${DATA_DIR}checksums.txt" | ||
exit 1 | ||
fi | ||
|
||
# Check if the folder exists | ||
if [ -d "${DATA_DIR}$FILE" ]; then | ||
echo "$FILE exists. Checking SHA256..." | ||
|
||
# Check the operating system and calculate SHA256 of the existing file | ||
SHA256=$(checksumdir -a sha256 ${DATA_DIR}$FILE) | ||
|
||
# Compare the calculated SHA256 with the expected one | ||
if [ "$SHA256" == "$EXPECTED_SHA256" ]; then | ||
echo "SHA256 is correct. No need to download the file." | ||
else | ||
echo "SHA256 is not correct. Need to download the file..." | ||
fi | ||
else | ||
echo "$FILE does not exist. Need to download the file..." | ||
fi | ||
|
||
# Download and extract the file if it does not exist or its SHA256 is incorrect | ||
if [ ! -d "${DATA_DIR}$FILE" ] || [ "$SHA256" != "$EXPECTED_SHA256" ]; then | ||
wget -q --show-progress -O ${DATA_DIR}${FILE}.tar.gz $DROPBOX_LINK | ||
if tar -xzvf ${DATA_DIR}${FILE}.tar.gz -C ${DATA_DIR}; then | ||
echo "Successfully extracted ${FILE}.tar.gz" | ||
rm ${DATA_DIR}${FILE}.tar.gz | ||
echo "Removed ${FILE}.tar.gz" | ||
else | ||
echo "Failed to extract ${FILE}.tar.gz" | ||
exit 1 | ||
fi | ||
fi |
This file contains 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
This file contains 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
Oops, something went wrong.