Skip to content

Commit

Permalink
Merge pull request #130 from PaulHancock/condon_errs
Browse files Browse the repository at this point in the history
Fix issues with the way that "Condon errs" are calculated
  • Loading branch information
PaulHancock committed Jul 30, 2020
2 parents c85c0ae + 3983a20 commit df91ffd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion AegeanTools/__init__.py
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions AegeanTools/fitting.py
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion scripts/aegean
Expand Up @@ -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
Expand Down

0 comments on commit df91ffd

Please sign in to comment.