From 2daf0e35f7da6d7b9647f4f360ad667a73666b45 Mon Sep 17 00:00:00 2001 From: jurjen93 Date: Mon, 19 Jul 2021 20:44:13 +0200 Subject: [PATCH] bugfix --- make_movie.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/make_movie.py b/make_movie.py index 6a932d0..ac7d224 100755 --- a/make_movie.py +++ b/make_movie.py @@ -57,20 +57,20 @@ def isNaN(a): for n in range(len(df)-1):#stack multiple sources if n > 0: dist = distance([last_RA, last_DEC], [df['RA'].values[n], df['DEC'].values[n]]) - move_to_frames = int(4*dist*Movie.framerate) + move_to_frames = max(int(4*dist*Movie.framerate), 2) else: dist = distance([start_ra, start_dec], [df['RA'].values[n], df['DEC'].values[n]]) - move_to_frames = int(4*dist*Movie.framerate) + move_to_frames = max(int(4*dist*Movie.framerate), 2) Movie.move_to(N_frames=move_to_frames, ra=df['RA'].values[n], dec=df['DEC'].values[n]) - zoom_frames = int(0.1 * Movie.framerate * Movie.imsize / df['imsize'].values[n]) + zoom_frames = max(int(0.1 * Movie.framerate * Movie.imsize / df['imsize'].values[n]), 2) Movie.zoom(N_frames=zoom_frames, imsize_out=df['imsize'].values[n]) if ndf['imsize'].values[n]: im_out = max(df['imsize'].values[n+1]+0.3, 0.3) else: im_out = max(df['imsize'].values[n] + 0.3, 0.3) - Movie.zoom(N_frames=zoom_frames//5, imsize_out=im_out) + Movie.zoom(N_frames=max(zoom_frames//5, 1), imsize_out=im_out) last_RA, last_DEC = df['RA'].values[n], df['DEC'].values[n] - move_to_frames = move_to_frames = int(4*Movie.framerate * distance([start_ra, start_dec], [last_RA, last_DEC])) + move_to_frames = max(int(4*Movie.framerate * distance([start_ra, start_dec], [last_RA, last_DEC])), 2) Movie.move_to(N_frames=move_to_frames, ra=start_ra, dec=start_dec) Movie.zoom(N_frames=int(5*Movie.framerate), imsize_out=2) Movie.record() @@ -129,7 +129,7 @@ def isNaN(a): dist = distance([start_ra, start_dec], [position[0], position[1]]) else: dist = distance([position[0], position[1]], [positions[n-1][0], positions[n-1][1]]) - move_to_frames = int(4*dist*Movie.framerate) + move_to_frames = max(int(4*dist*Movie.framerate), 2) Movie.move_to(N_frames=move_to_frames, ra=position[0], dec=position[1]) Movie.zoom(N_frames=int(3*Movie.framerate), imsize_out=3) Movie.record() \ No newline at end of file