Skip to content
Snippets Groups Projects
Commit de05ae03 authored by David Rafferty's avatar David Rafferty
Browse files

Add limits

parent 2572c891
Branches
Tags
No related merge requests found
...@@ -258,9 +258,12 @@ def group(LSM, algorithm, targetFlux=None, weightBySize=False, numClusters=100, ...@@ -258,9 +258,12 @@ def group(LSM, algorithm, targetFlux=None, weightBySize=False, numClusters=100,
names = LSM.getPatchNames() names = LSM.getPatchNames()
fluxes = LSM.getColValues('I', aggregate='sum', units=units, applyBeam=applyBeam) fluxes = LSM.getColValues('I', aggregate='sum', units=units, applyBeam=applyBeam)
if weightBySize: if weightBySize:
sizes = LSM.getPatchSizes(weight=True, applyBeam=applyBeam) sizes = LSM.getPatchSizes(units='arcsec', weight=True, applyBeam=applyBeam)
sizes[sizes < 1.0] = 1.0
meanSize = np.mean(sizes) meanSize = np.mean(sizes)
weights = meanSize / sizes weights = meanSize / sizes
weights[weights > 2.0] = 2.0
weights[weights < 0.5] = 0.5
fluxes *= weights fluxes *= weights
for name, flux in zip(names, fluxes): for name, flux in zip(names, fluxes):
if flux >= targetFlux: if flux >= targetFlux:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment