Fetch sample results for Copalis Beach example1#
From the GeoClaw Tsunami Tutorial
The directory $GTT/CopalisBeach/example1
contains some example simulations of tsunamis inundating the coastal region
around Copalis Beach, WA.
This notebook downloads some sample results that are discussed in Sample results for example1 so that they are available without running the GeoClaw code, which takes some time to run.
These sample results are also needed for building the Jupyter book on Github for rendering Sample results for example1.
import os
#GTT = os.environ['GTT'] # doesn't work for Github build
GTT = os.path.abspath('../..')
print('GTT path is ',GTT)
GTT path is /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT
try:
# This should work with v5.13.1, why doesn't in on Github??
from clawpack.clawutil.util import fullpath_import
GTT_tools = fullpath_import(f'{GTT}/common_code/GTT_tools.py')
except:
print('importing clawpack.clawutil.util failed')
import clawpack
print(f'clawpack version: {clawpack.__version__}')
import sys
sys.path.insert(0,f'{GTT}/common_code')
import GTT_tools
importing clawpack.clawutil.util failed
clawpack version: 5.13.1
setting GTT = /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT
GTT_tools.fetch('CopalisBeach/example1/sample_results', force=True, verbose=True)
extraction_path = /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT/CopalisBeach/example1
new_file_fullpath = /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT/CopalisBeach/example1/sample_results
Removing /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT/CopalisBeach/example1/sample_results
Extracted /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT/CopalisBeach/example1/sample_results
Data is cached at: /tmp/tmpgm4qko_t/clawpack/geoclaw/GTT_data/CopalisBeach/example1/sample_results.zip
Directory now exists: /home/runner/work/geoclaw_tsunami_tutorial/geoclaw_tsunami_tutorial/GTT/CopalisBeach/example1/sample_results
# for debugging:
if 0:
print('cwd = ', os.getcwd())
print('\nlistdir = ', os.listdir())
print('\nGTT_cache contains: ',os.listdir('../../../GTT_cache'))