Skip to content

Commit

Permalink
Merge branch 'master' of github.com:drphilmarshall/Pangloss
Browse files Browse the repository at this point in the history
  • Loading branch information
drphilmarshall committed Jun 29, 2015
2 parents 5bc41de + 5f62014 commit 644c628
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 20 deletions.
Binary file added doc/litter/KarpenkaEtal2013.pdf
Binary file not shown.
89 changes: 89 additions & 0 deletions doc/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -3280,3 +3280,92 @@ @ARTICLE{Jasche+Wandelt2013
galaxy density. Poisson likelihood for counts in cells, model is density in
voxels. Made possible by HMC sampling. Resolution ~ 6Mpc or so.}
}

@ARTICLE{KarpenkaEtal2013,
author = {{Karpenka}, N.~V. and {March}, M.~C. and {Feroz}, F. and {Hobson}, M.~P.
},
title = "{Bayesian constraints on dark matter halo properties using gravitationally lensed supernovae}",
journal = {\mnras},
archivePrefix = "arXiv",
eprint = {1207.3708},
keywords = {gravitational lensing: weak, methods: data analysis, methods: statistical, supernovae: general, galaxies: haloes},
year = 2013,
month = aug,
volume = 433,
pages = {2693-2705},
doi = {10.1093/mnras/sts700},
adsurl = {http://adsabs.harvard.edu/abs/2013MNRAS.433.2693K},
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
note = {Weak lensing of SN, modeled hierarchically with halos.
Halos are SIS, with velocity dispersion scaled with galaxy
luminosity according to Faber-Jackson relation. Relation
parameters are fitted, but zero scatter is assumed - so
model only has 4 parameters, not 4+many. The hierarachical
part refers to the SN analysis, not the halo modeling.
They carry out evidence testing of models with and without
lensing, finding that the evidence for lensing is driven
by the few most strongly lensed systems. In real (SNLS)
data they see only very marginal lensing signal in this
way. NFW models are discussed, shear data is not. Paper is
a response to claims by Jonsson et al and others that the
SNIa sample contains weak lensing signal.}
}

@ARTICLE{SmithEtal2014,
author = {{Smith}, M. and {Bacon}, D.~J. and {Nichol}, R.~C. and {Campbell}, H. and
{Clarkson}, C. and {Maartens}, R. and {D'Andrea}, C.~B. and
{Bassett}, B.~A. and {Cinabro}, D. and {Finley}, D.~A. and {Frieman}, J.~A. and
{Galbany}, L. and {Garnavich}, P.~M. and {Olmstead}, M.~D. and
{Schneider}, D.~P. and {Shapiro}, C. and {Sollerman}, J.},
title = "{The Effect of Weak Lensing on Distance Estimates from Supernovae}",
journal = {\apj},
archivePrefix = "arXiv",
eprint = {1307.2566},
primaryClass = "astro-ph.CO",
keywords = {cosmology: observations, distance scale, supernovae: general, surveys },
year = 2014,
month = jan,
volume = 780,
eid = {24},
pages = {24},
doi = {10.1088/0004-637X/780/1/24},
adsurl = {http://adsabs.harvard.edu/abs/2014ApJ...780...24S},
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
note = {Marginal detection of weak lensing in SDSS II and BOSS
SNe sample, via Hubble residual analysis. New parameter
gamma controls linear dependence of Hubble residuals on
kappa_gal, the convergence estimated from the number
counts of galaxies in bins.}
}

@ARTICLE{Schneider2014,
author = {{Schneider}, P.},
title = "{Generalized multi-plane gravitational lensing: time delays, recursive lens equation, and the mass-sheet transformation}",
journal = {ArXiv e-prints},
archivePrefix = "arXiv",
eprint = {1409.0015},
keywords = {Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Astrophysics of Galaxies},
year = 2014,
month = aug,
adsurl = {http://adsabs.harvard.edu/abs/2014arXiv1409.0015S},
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
note = {Intense theoretical paper laying out teh formalism for
general multi-plane lens time delays. A generalized
mass sheet transformation exists, but seems like it may
not be important in practice, due to its "curious"
nature. Peter writes: "This curious behavior of the MST
in multi-plane lensing may indeed offer a way to break
the corresponding degeneracy, at least in a statistical
way. As we discussed before, in the case of vanishing
perturbations between the main lens planes, the MST
corresponds to mass sheets of alternating sign from plane
to plane. Since such a mass sheet changes the slope of
the to-tal mass distribution, it means that this slope
change also alternates. If one now makes the perhaps
plausible assumption that the shape of the mean mass
profiles of lenses is the same, this alternating slope
change would violate the universality of the mean mass
profile. Thus, in multi-plane lensing, the mass-sheet
generacy may be more easily lifted than in the case of a
single lens plane only."}
}
22 changes: 11 additions & 11 deletions example/example.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Name : Value pair to be read into the parameters dictionary.
#
# This file is part of the Pangloss project, distributed under the
# GPL v2, by Tom Collett (IoA) and Phil Marshall (Oxford).
# Please cite: Collett et al 2013, arxiv/###
# GPL v2, by Tom Collett (IoA) and Phil Marshall (Oxford).
# Please cite: Collett et al 2013, http://arxiv.org/abs/1303.6564
#
# ======================================================================

Expand All @@ -20,7 +20,7 @@ ExperimentName: example
# Simulated data for calibration. One halo catalog per kappa map,
# environment variables and wildcards will be expanded:
CalibrationCatalogs: $PANGLOSS_DIR/calib/Millennium/catalog_example*.*
CalibrationKappamaps: $PANGLOSS_DIR/calib/Millennium/kappa*.fits
CalibrationKappamaps: $PANGLOSS_DIR/calib/Millennium/kappa*.fits

# Observed data:
ObservedCatalog: $PANGLOSS_DIR/example/example_catalog.txt
Expand Down Expand Up @@ -62,7 +62,7 @@ LightconeDepthBand: i
NCalibrationLightcones: 1000

# Destination directory for the calibration lightcones. This should be
# in your local workspace, because the lightcones will be specific to
# in your local workspace, because the lightcones will be specific to
# this experiment
CalibrationFolder: calib

Expand All @@ -80,12 +80,12 @@ MakeNewCalibrations : True

# We want the PDF Pr(kappah|D), in the form of a list of samples - or
# equivalently, realisations of the lightcone mass distribution:
NRealisations: 100
NRealisations: 100

# Reconstructing the calibration lines of sight is expensive. If we have already# done this for an !*!identical!*! experiment setup we needen't do it again.
ReconstructCalibrations : True

StellarMass2HaloMassRelation: Behroozi
StellarMass2HaloMassRelation: Behroozi
# No other options encoded so far...

# Halo mass function catalog for empirical Pr(Mh):
Expand All @@ -95,19 +95,19 @@ HMFfile: $PANGLOSS_DIR/calib/SHMR/HaloMassRedshiftCatalog.pickle
PhotozError: 0.1

# Assumed Mstar uncertainty:
PhotometricMstarError: 0.45 # dex
PhotometricMstarError: 0.45 # dex
SpectroscopicMstarError: 0.15 # dex


RayTracingScheme: sum
# The default ray-traced kappamap from Hilbert et al 2008 was made by
# The default ray-traced kappamap from Hilbert et al 2008 was made by
# simply summing the convergences on each lens plane. If you want a more
# complicated scheme for kappa_ext or mu_ext, you will need to change
# this. This is the correct scheme for weak lensing, but may need some
# modification if the system contains a strong lens

# How does the quality of data vary with radius and magnitude, for the
# real line of sight? This will allow the creation of an accurate
# How does the quality of data vary with radius and magnitude, for the
# real line of sight? This will allow the creation of an accurate
# calibration dataset:
PhotometricRadius: [1,2] # arcmin
PhotometricDepth: [26,26] # must pair with PhotometricRadius
Expand All @@ -122,7 +122,7 @@ SpectroscopicDepth: [24,23] # must pair with SpectroscopicRadius
# Calibrating
# --------------

# For a robust transformation between Pr(kappah|D) and Pr(kappa|D), we
# For a robust transformation between Pr(kappah|D) and Pr(kappa|D), we
# found we needed to go through a compression step, to reduce the
# influence of the poorly estimated high kappa halos. Pr(kappa|<kappah>)
# (where <> denotes the median) seems to work well.
Expand Down
49 changes: 40 additions & 9 deletions pangloss/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
Useful general functions to streamline file input and output.
COMMENTS
FUNCTIONS
writePickle(contents,filename):
readPickle(filename): returns contents of pickle
readCatalog(filename,config): returns table, given column names
in configuration config
rm(filename): silent file removal
BUGS
AUTHORS
This file is part of the Pangloss project, distributed under the
GPL v2, by Tom Collett (IoA) and Phil Marshall (Oxford).
GPL v2, by Tom Collett (IoA) and Phil Marshall (Oxford).
Please cite: Collett et al 2013, http://arxiv.org/abs/1303.6564
HISTORY
Expand All @@ -54,6 +54,37 @@ def readPickle(filename):

def readCatalog(filename,config):

# PJM: we need to switch to astropy tables...
# Here's how Richard McMahon uses them, admittedly when reading in FITS:

"""
here is an example; I like to write out the version number to help with debugging.
import astropy
print('astropy: ', astropy.version)
from astropy.table import Table
from astropy.io import fits
infile_OM10="/home/rgm/soft/OM10/OM10/data/qso_mock.fits"
print 'Read in with Astropy FITS table reader'
table=Table.read(infile_OM10)
table.pprint()
print 'Numer of rows: ', len(table)
print 'columns: ', table.columns
print 'colnames: ', table.colnames
print 'meta: ', table.meta
# see http://astropy.readthedocs.org/en/latest/table/modify_table.html
# to see how to add a column, e.g.
# to insert before the first table column, do:
table.add_column(aa, index=0)
table.write('new.fits')
"""

table = atpy.Table(filename, type='ascii')

try: table.rename_column(config.parameters['nRAName'],'nRA')
Expand All @@ -72,10 +103,10 @@ def readCatalog(filename,config):
except: pass
try: table.rename_column(config.parameters['ObsRedshiftName'],'z_obs')
except: pass
try:
try:
mag = table[config.parameters['MagName']]
table.add_column('mag',mag)
except:
except:
raise "Error in io.readCatalog: no mag column called "+config.parameters['MagName']

return table
Expand All @@ -89,5 +120,5 @@ def rm(filename):
except OSError:
pass
return

# ======================================================================

0 comments on commit 644c628

Please sign in to comment.