diff --git a/ugali/analysis/results.py b/ugali/analysis/results.py index 99877d6..1f4425e 100644 --- a/ugali/analysis/results.py +++ b/ugali/analysis/results.py @@ -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': @@ -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 diff --git a/ugali/utils/stats.py b/ugali/utils/stats.py index 505530a..d66f5e2 100644 --- a/ugali/utils/stats.py +++ b/ugali/utils/stats.py @@ -318,7 +318,14 @@ def supplement(self,coordsys='gal'): names = ['position_angle_gal','position_angle_cel'] arrs = [pa_gal,pa_cel] out = recfuncs.append_fields(out,names,arrs,**kwargs).view(Samples) - + + if ('extension' in out.names) and ('ellipticity' in out.names): + ext = out.extension + ellipticity = out.ellipticity + rext = ext * np.sqrt(1-ellipticity) + + out = recfuncs.append_fields(out,['extension_radial'], [rext]).view(Samples) + return out def get(self, names=None, burn=None, clip=None):