Skip to content

Commit

Permalink
Add config option to generate movie
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Apr 17, 2022
1 parent af3b8bb commit 5faedd8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
3 changes: 3 additions & 0 deletions compass/ocean/tests/drying_slope/drying_slope.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ nx = 6
# config options for visualizing drying slope ouptut
[drying_slope_viz]

# whether to generate movie
generate_movie = False

# frames per second for movies
frames_per_second = 30

Expand Down
24 changes: 13 additions & 11 deletions compass/ocean/tests/drying_slope/viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,22 @@ def run(self):
section = self.config['paths']
datapath = section.get('ocean_database_root')
section = self.config['drying_slope_viz']
frames_per_second = section.getint('frames_per_second')
movie_format = section.get('movie_format')
outFolder = 'movie'
if not os.path.exists(outFolder):
try:
os.makedirs(os.path.join(os.getcwd(), outFolder))
except OSError:
pass
generate_movie = section.getboolean('generate_movie')

self._plot_ssh_validation()
self._plot_ssh_time_series()
self._plot_ssh_validation_for_movie(outFolder=outFolder)
self._images_to_movies(framesPerSecond=frames_per_second,
outFolder=outFolder, extension=movie_format)
if generate_movie:
frames_per_second = section.getint('frames_per_second')
movie_format = section.get('movie_format')
outFolder = 'movie'
if not os.path.exists(outFolder):
try:
os.makedirs(os.path.join(os.getcwd(), outFolder))
except OSError:
pass
self._plot_ssh_validation_for_movie(outFolder=outFolder)
self._images_to_movies(framesPerSecond=frames_per_second,
outFolder=outFolder, extension=movie_format)

def _plot_ssh_time_series(self, outFolder='.'):
"""
Expand Down

0 comments on commit 5faedd8

Please sign in to comment.