1414
1515import matplotlib .pyplot as plt
1616import numpy as np
17- import pandas as pd
1817
1918from derotation .analysis .blob_detection import BlobDetection
2019from derotation .analysis .fit_ellipse import (
@@ -40,8 +39,10 @@ def __init__(self, *args, **kwargs):
4039 """Initialize the IncrementalPipeline object."""
4140 super ().__init__ (* args , ** kwargs )
4241
43- self .small_rotations = 10
44- self .number_of_rotations = self .rot_deg // self .small_rotations
42+ self .degrees_per_small_rotation = 10
43+ self .number_of_rotations = (
44+ self .rot_deg // self .degrees_per_small_rotation
45+ )
4546
4647 def __call__ (self ):
4748 """Overwrite the ``__call__`` method from the parent class to derotate
@@ -60,8 +61,6 @@ def __call__(self):
6061 self .save (self .masked_image_volume )
6162 self .save_csv_with_derotation_data ()
6263
63- self .center_of_rotation = self .find_center_of_rotation ()
64-
6564 def create_signed_rotation_array (self ) -> np .ndarray :
6665 logging .info ("Creating signed rotation array..." )
6766 rotation_on = np .zeros (self .total_clock_time )
@@ -116,7 +115,9 @@ def adjust_rotation_increment(self) -> Tuple[np.ndarray, np.ndarray]:
116115 self .rot_blocks_idx ["end" ],
117116 )
118117 ]
119- new_increments = [self .small_rotations / t for t in ticks_per_rotation ]
118+ new_increments = [
119+ self .degrees_per_small_rotation / t for t in ticks_per_rotation
120+ ]
120121
121122 logging .info (f"New increment example: { new_increments [0 ]:.3f} " )
122123
@@ -257,34 +258,6 @@ def plot_rotation_speeds(self):
257258 # rotation pipeline
258259 pass
259260
260- def save_csv_with_derotation_data (self ):
261- """Saves a csv file with the rotation angles by line and frame,
262- and the rotation on signal.
263- It is saved in the saving folder specified in the config file.
264- """
265- df = pd .DataFrame (
266- columns = [
267- "frame" ,
268- "rotation_angle" ,
269- "clock" ,
270- ]
271- )
272-
273- df ["frame" ] = np .arange (self .num_frames )
274- df ["rotation_angle" ] = self .rot_deg_frame [: self .num_frames ]
275- df ["clock" ] = self .frame_start [: self .num_frames ]
276-
277- Path (self .config ["paths_write" ]["derotated_tiff_folder" ]).mkdir (
278- parents = True , exist_ok = True
279- )
280-
281- df .to_csv (
282- self .config ["paths_write" ]["derotated_tiff_folder" ]
283- + self .config ["paths_write" ]["saving_name" ]
284- + ".csv" ,
285- index = False ,
286- )
287-
288261 ### ------- Methods unique to IncrementalPipeline ----------------- ###
289262
290263 def find_center_of_rotation (self ) -> Tuple [int , int ]:
0 commit comments