fixed global data_array=None issue
@@ -30,8 +30,6 @@ from .cosmetics import frame_pad
from ..conf.utils_conf import pool_map, iterable
from ..var import frame_center, frame_filter_lowpass
-data_array = None # holds the (implicitly mem-shared) data array
-
def frame_rotate(array, angle, imlib='vip-fft', interpolation='lanczos4',
cxy=None, border_mode='constant', mask_val=np.nan,
@@ -322,10 +320,10 @@ def cube_derotate(array, angle_list, imlib='vip-fft', interpolation='lanczos4',
Whether to rotate the frames in the sequence in a multi-processing
fashion. Only useful if the cube is significantly large (frame size and
number of frames).
- mask_val: flt, opt
- See the documentation of the ``vip_hci.preproc.frame_rotate`` function.
border_mode : str, optional
See the documentation of the ``vip_hci.preproc.frame_rotate`` function.
+ mask_val: flt, opt
+ See the documentation of the ``vip_hci.preproc.frame_rotate`` function.
edge_blend : str, optional
See the documentation of the ``vip_hci.preproc.frame_rotate`` function.
interp_zeros : str, optional
@@ -356,22 +354,20 @@ def cube_derotate(array, angle_list, imlib='vip-fft', interpolation='lanczos4',
edge_blend=edge_blend,
interp_zeros=interp_zeros, ker=ker)
elif nproc > 1:
- global data_array
- data_array = array
- res = pool_map(nproc, _frame_rotate_mp, iterable(range(n_frames)),
- angle_list, imlib, interpolation, cxy, border_mode,
- mask_val, edge_blend, interp_zeros, ker)
+ res = pool_map(nproc, _frame_rotate_mp, iterable(array),
+ iterable(angle_list), imlib, interpolation, cxy,
+ border_mode, mask_val, edge_blend, interp_zeros, ker)
array_der = np.array(res)
return array_der
-def _frame_rotate_mp(num_fr, angle_list, imlib, interpolation, cxy,
- border_mode, mask_val, edge_blend, interp_zeros, ker):
- framerot = frame_rotate(data_array[num_fr], -angle_list[num_fr], imlib,
- interpolation, cxy, border_mode, mask_val,
- edge_blend, interp_zeros, ker)
+def _frame_rotate_mp(frame, angle, imlib, interpolation, cxy, border_mode,
+ mask_val, edge_blend, interp_zeros, ker):
+ framerot = frame_rotate(frame, angle, imlib, interpolation, cxy,
+ border_mode, mask_val, edge_blend, interp_zeros,
+ ker)
return framerot
