Skip to content

Commit

Permalink
bugfix int type
Browse files Browse the repository at this point in the history
  • Loading branch information
jurjen93 committed Jul 15, 2021
1 parent 95b0fb4 commit 6bddb18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions make_movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
parser = argparse.ArgumentParser("Make movie from fits file.")
parser.add_argument('-d', '--downloading', type=int, help='Download your own data')
parser.add_argument('-csv', '--csvfile', help='Csv file with outliers with RA and DEC in degrees')
parser.add_argument('-fr', '--framerate', help='Frame rate of your video')
parser.add_argument('-fr', '--framerate', type=int, help='Frame rate of your video')
parser.add_argument('-fi', '--fits', type=str, help='Fits file to use')
args = parser.parse_args()

Expand Down Expand Up @@ -111,9 +111,13 @@ def isNaN(a):
pos_x = pos_x + ((-1)**(i+number_of_steps))*step_size_x
positions.append([pos_x, pos_y])

positions = [(p.ra.degree, p.dec.degree) for p in [Movie.wcs.pixel_to_world(position[0], position[1])
for position in positions
if not isNaN(Movie.image_data[position[0], position[1]])]]
try:
positions = [(p.ra.degree, p.dec.degree) for p in [Movie.wcs.pixel_to_world(position[0], position[1])
for position in positions
if not isNaN(Movie.image_data[position[0], position[1]])]]
except:
positions = [(p.ra.degree, p.dec.degree) for p in [Movie.wcs.pixel_to_world(position[0], position[1])
for position in positions]]

Movie.imsize = 2*abs(fits_header['CDELT1']*fits_header['CRPIX1']/number_of_steps)
Movie.zoom(N_frames=int(3*Movie.framerate), first_time=True)
Expand Down
1 change: 0 additions & 1 deletion video/scripts/moviemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def zoom(self, N_frames: int = None, first_time: bool=False, imsize_out: float =
:param imsize_out: Output image size.
:param full_im: start with full image (when first_time==True)
"""

if first_time:
begin_size = self.image_data.shape[0] * np.max(self.wcs.pixel_scale_matrix)
if not full_im:
Expand Down

0 comments on commit 6bddb18

Please sign in to comment.