Skip to content

Commit

Permalink
Update results.py to use new extension_radial field of samples to com…
Browse files Browse the repository at this point in the history
…pute extension_radial estimate

Part 2 of an improvement to use the full posterior of the extension and ellipticity to derive extension_radial samples, then compute summary statistics on extension_radial.
  • Loading branch information
willcerny authored Apr 16, 2024
1 parent 65bf152 commit 0a76a7e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ugali/analysis/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def get_results(self,**kwargs):
results['dec'] = self.estimate('dec',**kwargs)
results['glon'] = self.estimate('glon',**kwargs)
results['glat'] = self.estimate('glat',**kwargs)
results['extension_radial'] = self.estimate('extension_radial', **kwargs)

except KeyError:
logger.warn("Didn't find 'ra' or 'dec' in Samples...")
if self.coordsys == 'gal':
Expand Down Expand Up @@ -216,9 +218,9 @@ def get_results(self,**kwargs):

# Radially symmetric extension (correct for ellipticity).
ell,ell_err = estimate['ellipticity']
rext,rext_err = ext*np.sqrt(1-ell),np.array(ext_err)*np.sqrt(1-ell)
rext,rext_err = results['extension_radial'] #ext*np.sqrt(1-ell),np.array(ext_err)*np.sqrt(1-ell)
rext_sigma = np.nan_to_num(np.array(rext_err) - rext)
results['extension_radial'] = ugali.utils.stats.interval(rext,rext_err[0],rext_err[1])
#results['extension_radial'] = ugali.utils.stats.interval(rext,rext_err[0],rext_err[1]) # now obsolete
results['extension_radial_arcmin'] = ugali.utils.stats.interval(60*rext,60*rext_err[0],60*rext_err[1])

# Bayes factor for ellipticity
Expand Down

0 comments on commit 0a76a7e

Please sign in to comment.