Skip to content

Commit

Permalink
syntax tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhenshaw committed Feb 19, 2024
1 parent cb4d8ff commit cb9599f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions astropy_helpers
Submodule astropy_helpers added at fd80be
2 changes: 1 addition & 1 deletion fil_finder/filfinder2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def create_mask(self, glob_thresh=None, adapt_thresh=None,
size_thresh : int, optional
This sets the lower threshold on the size of objects found in the
adaptive thresholding. If None, the value is set at
:math:`5\pi (0.1 \text(pc))^2` which is the area of the minimum dimensions
:math:`5\\pi (0.1 \text(pc))^2` which is the area of the minimum dimensions
expected for a filament. Any region smaller than this threshold may be
safely labeled as an artifact of the thresholding.
glob_thresh : float, optional
Expand Down
5 changes: 3 additions & 2 deletions fil_finder/io_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ def convert_bunit(bunit):
unit : `~astropy.unit.Unit`
Corresponding unit.
'''

import re

# special case: CASA (sometimes) makes non-FITS-compliant jy/beam headers
bunit_lower = re.sub("\s", "", bunit.lower())
bunit_lower = re.sub(r"\s", "", bunit.lower())
if bunit_lower == 'jy/beam':
unit = u.Jy / u.beam
else:
Expand Down
4 changes: 2 additions & 2 deletions fil_finder/width.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ def radial_profile(img, dist_transform_all, dist_transform_sep, offsets,
if bins is None:
nbins = int(np.sqrt(len(width_value)))
maxbin = np.max(width_distance)
if bintype is "log":
if bintype == "log":
# bins must start at 1 if logspaced
bins = np.logspace(0, np.log10(maxbin), nbins + 1)
elif bintype is "linear":
elif bintype == "linear":
bins = np.linspace(0, maxbin, nbins + 1)

whichbins = np.digitize(width_distance, bins)
Expand Down

0 comments on commit cb9599f

Please sign in to comment.