-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added "helper" script to generate thumbnails for each collection
- Updated dependency versions
- Loading branch information
1 parent
a4cac15
commit ff9256b
Showing
2 changed files
with
409 additions
and
245 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
# HOW-TO Use | ||
# | ||
# 1. Create a directory in the tig root dir named "configs" | ||
# 2. Create directories under "configs" dir with the collection short name | ||
# 3. Copy this script to each short name dir | ||
# 4. Create a file called "vars.csv" in each short name dir and update specifically for that collection | ||
# 5. Download a "representative" granule for that collection short name and put it in each short name dir | ||
# 6. Update this script specifically for its collection short name (.e.g update input parameters) | ||
# 7. Change dir to the configs/<shortname> dir | ||
# 8. Run command "./generate_thumbnails.sh" to automatically generate the config, run tig, and open the thumbnails | ||
# 9. The collection <shortname>.cfg file will be saved in each short name dir | ||
# 10. Verify .cfg file and all thumbnails in each short name dir | ||
|
||
# Publish config files to forge-tig-configuration repo | ||
# | ||
# 1. Copy each short name .cfg file to the forge-tig-configuration repo under "config-files" | ||
# 2. Commit the new cfg files in forge-tig-configuration to a new branch named "feature/<name>" | ||
# 3. Open a PR in forge-tig-configuration for this new branch | ||
|
||
collection=$(basename "$(pwd)") | ||
|
||
echo Generating configuration for collection $collection... | ||
|
||
if [ -e "$collection.cfg" ]; then | ||
rm "$collection.cfg" | ||
echo "Removed existing $collection.cfg" | ||
fi | ||
|
||
if [ -d "images" ]; then | ||
rm -rf "images" | ||
echo "Removed existing 'images' directory" | ||
fi | ||
|
||
cd ../.. | ||
|
||
poetry run generate_hitide_config -g configs/$collection/*.nc -d $collection -i configs/$collection/vars.csv --latitude lat --longitude lon --time time --footprint-strategy periodic | ||
|
||
echo "Running tig to generate thumbnail images..." | ||
|
||
poetry run tig --input_file configs/$collection/*.nc --output_dir configs/$collection/images --config_file "$collection".cfg --palette_dir ../forge-tig-configuration/palettes | ||
|
||
mv "$collection".cfg configs/$collection | ||
|
||
cd configs/$collection | ||
open images/* |
Oops, something went wrong.