Skip to content

Commit 7b2f1bc

Browse files
committed
FIX: Fixups after review.
1 parent 77b6f44 commit 7b2f1bc

File tree

2 files changed

+25
-26
lines changed

2 files changed

+25
-26
lines changed

trackpy/feature.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ def _refine(raw_image, image, radius, coords, max_iterations,
278278
allow_moves = True
279279
for iteration in range(max_iterations):
280280
off_center = cm_n - radius
281-
if walkthrough:
282-
logger.info('%f', off_center)
281+
logger.debug('off_center: %f', off_center)
283282
if np.all(np.abs(off_center) < GOOD_ENOUGH_THRESH):
284283
break # Accurate enough.
285284

@@ -361,33 +360,33 @@ def locate(raw_image, diameter, minmass=100., maxsize=None, separation=None,
361360
----------
362361
raw_image : array
363362
any N-dimensional image
364-
diameter : number or tuple
363+
diameter : odd integer or tuple of odd integers
365364
This may be a single number or a tuple giving the feature's
366365
extent in each dimension, useful when the dimensions do not have
367366
equal resolution (e.g. confocal microscopy). The tuple order is the
368367
same as the image shape, conventionally (z, y, x) or (y, x). The
369368
number(s) must be odd integers. When in doubt, round up.
370-
minmass : number
369+
minmass : float
371370
The minimum integrate brightness.
372371
Default is 100, but a good value is often much higher. This is a
373372
crucial parameter for elminating spurious features.
374-
maxsize : number
373+
maxsize : float
375374
maximum radius-of-gyration of brightness, default None
376-
separation : number
375+
separation : float or tuple
377376
Minimum separtion between features.
378377
Default is diameter + 1. May be a tuple, see diameter for details.
379-
noise_size : number
378+
noise_size : float or tuple
380379
Width of Gaussian blurring kernel, in pixels
381380
Default is 1. May be a tuple, see diameter for details.
382-
smoothing_size : number
381+
smoothing_size : float or tuple
383382
Size of boxcar smoothing, in pixels
384383
Default is diameter. May be a tuple, see diameter for details.
385-
threshold : number
384+
threshold : float
386385
Clip bandpass result below this value.
387386
Default, None, defers to default settings of the bandpass function.
388387
invert : boolean
389388
Set to True if features are darker than background. False by default.
390-
percentile : number
389+
percentile : float
391390
Features must have a peak brighter than pixels in this
392391
percentile. This helps eliminate spurious peaks.
393392
topn : integer
@@ -412,7 +411,7 @@ def locate(raw_image, diameter, minmass=100., maxsize=None, separation=None,
412411
based on their estimated mass and size before refining position.
413412
True by default for performance.
414413
filter_after : boolean
415-
Use final characterizations of mass and size to elminate spurious
414+
Use final characterizations of mass and size to eliminate spurious
416415
features. True by default.
417416
characterize : boolean
418417
Compute "extras": eccentricity, signal, ep. True by default.
@@ -618,35 +617,34 @@ def batch(frames, diameter, minmass=100, maxsize=None, separation=None,
618617
619618
Parameters
620619
----------
621-
raw_image : array
622-
any N-dimensional image
623-
diameter : number or tuple
620+
frames : list (or iterable) of images
621+
diameter : odd integer or tuple of odd integers
624622
This may be a single number or a tuple giving the feature's
625623
extent in each dimension, useful when the dimensions do not have
626624
equal resolution (e.g. confocal microscopy). The tuple order is the
627625
same as the image shape, conventionally (z, y, x) or (y, x). The
628626
number(s) must be odd integers. When in doubt, round up.
629-
minmass : number
627+
minmass : float
630628
The minimum integrate brightness.
631629
Default is 100, but a good value is often much higher. This is a
632630
crucial parameter for elminating spurious features.
633-
maxsize : number
631+
maxsize : float
634632
maximum radius-of-gyration of brightness, default None
635-
separation : number
633+
separation : float or tuple
636634
Minimum separtion between features.
637635
Default is diameter + 1. May be a tuple, see diameter for details.
638-
noise_size : number
636+
noise_size : float or tuple
639637
Width of Gaussian blurring kernel, in pixels
640638
Default is 1. May be a tuple, see diameter for details.
641-
smoothing_size : number
639+
smoothing_size : float or tuple
642640
Size of boxcar smoothing, in pixels
643641
Default is diameter. May be a tuple, see diameter for details.
644-
threshold : number
642+
threshold : float
645643
Clip bandpass result below this value.
646644
Default, None, defers to default settings of the bandpass function.
647645
invert : boolean
648646
Set to True if features are darker than background. False by default.
649-
percentile : number
647+
percentile : float
650648
Features must have a peak brighter than pixels in this
651649
percentile. This helps eliminate spurious peaks.
652650
topn : integer
@@ -671,7 +669,7 @@ def batch(frames, diameter, minmass=100, maxsize=None, separation=None,
671669
based on their estimated mass and size before refining position.
672670
True by default for performance.
673671
filter_after : boolean
674-
Use final characterizations of mass and size to elminate spurious
672+
Use final characterizations of mass and size to eliminate spurious
675673
features. True by default.
676674
characterize : boolean
677675
Compute "extras": eccentricity, signal, ep. True by default.
@@ -680,7 +678,7 @@ def batch(frames, diameter, minmass=100, maxsize=None, separation=None,
680678
If None, return all results as one big DataFrame. Otherwise, pass
681679
results from each frame, one at a time, to the put() method
682680
of whatever class is specified here.
683-
meta : filepath_or_obj
681+
meta : filepath or file object, optional
684682
If specified, information relevant to reproducing this batch is saved
685683
as a YAML file, a plain-text machine- and human-readable format.
686684
By default, this is None, and no file is saved.
@@ -720,10 +718,11 @@ def batch(frames, diameter, minmass=100, maxsize=None, separation=None,
720718

721719
if meta:
722720
if isinstance(meta, six.string_types):
723-
with open(filepath_or_obj, 'w') as file_obj:
721+
with open(meta, 'w') as file_obj:
724722
record_meta(meta_info, file_obj)
725723
else:
726-
record_meta(meta_info, file_obj)
724+
# Interpret meta to be a file handle.
725+
record_meta(meta_info, meta)
727726

728727
all_features = []
729728
for i, image in enumerate(frames):

trackpy/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def ignore_logging():
244244
"Reset to factory default logging configuration; remove trackpy's handler."
245245
trackpy.logger.removeHandler(default_handler)
246246
trackpy.logger.setLevel(logging.NOTSET)
247-
trackpy.logger.propagate = 1 # default implemented by the logging module
247+
trackpy.logger.propagate = True
248248

249249

250250
def quiet(suppress=True):

0 commit comments

Comments
 (0)