diff --git a/AegeanTools/__init__.py b/AegeanTools/__init__.py index ae8de367..a14b6d52 100755 --- a/AegeanTools/__init__.py +++ b/AegeanTools/__init__.py @@ -11,7 +11,7 @@ """ __author__ = 'Paul Hancock' __version__ = '2.2.2' -__date__ = '2020-06-19' +__date__ = '2020-07-23' __citation__ = """ % If your work makes use of AegeanTools please cite the following papers as appropriate: diff --git a/AegeanTools/fitting.py b/AegeanTools/fitting.py index 4e695626..cfbb0250 100644 --- a/AegeanTools/fitting.py +++ b/AegeanTools/fitting.py @@ -871,16 +871,15 @@ def condon_errors(source, theta_n, psf=None): if psf is not None: beam = psf.get_beam(source.ra, source.dec) if beam is not None: - theta_n = np.hypot(beam.a, beam.b) - print(beam, theta_n) + theta_n = np.sqrt(beam.a * beam.b) if theta_n is None: source.err_a = source.err_b = source.err_peak_flux = source.err_pa = source.err_int_flux = 0.0 return smoothing = major * minor / (theta_n ** 2) - factor1 = (1 + (major / theta_n)) - factor2 = (1 + (minor / theta_n)) + factor1 = (1 + (theta_n/ major)**2) + factor2 = (1 + (theta_n/ minor)**2) snr = source.peak_flux / source.local_rms # calculation of rho2 depends on the parameter being used so we lambda this into a function rho2 = lambda x: smoothing / 4 * factor1 ** alphas[x][0] * factor2 ** alphas[x][1] * snr ** 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 71ed8f44..ef24e642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ v 2.2.2 Aegean - Fixed a bug that could cause a crash if the psf map had nan values - Fixed a bug that caused island contours to just be boxes. +- Fixed an error in the calculation of condon errors. MIMAS - added new functionality, `--mask2mim`, which will convert a fits file into a region file. diff --git a/scripts/aegean b/scripts/aegean index 6359e02a..deea8774 100755 --- a/scripts/aegean +++ b/scripts/aegean @@ -387,7 +387,7 @@ if __name__ == "__main__": # theta_N is the FWHM of the smoothing kernel (the noise correlation) # which in this case is the same as the synthesized beam FWHM if options.beam: - theta_n = np.hypot(options.beam[0], options.beam[1]) + theta_n = np.sqrt(options.beam.a * options.beam.b) psf = None else: psf = sf.global_data.psfhelper