Skip to content

Commit

Permalink
specify lens type in los integration
Browse files Browse the repository at this point in the history
  • Loading branch information
apetri committed Nov 1, 2016
1 parent e56e482 commit 89d6c11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lenstools/pipeline/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def _init_commmon(self):
self.format = "fits"
self.plane_format = "fits"
self.plane_name_format = "snap{0}_potentialPlane{1}_normal{2}.{3}"
self.lens_type = "PotentialPlane"

self.map_resolution = 128
self.map_angle = 1.6 * u.deg
Expand Down Expand Up @@ -460,6 +461,11 @@ def _read_common(self,options,section):
self.plane_name_format = options.get(section,"plane_name_format")
except NoOptionError:
pass

try:
self.lens_type = options.get(section,"lens_type")
except NoOptionError:
pass

self.map_resolution = options.getint(section,"map_resolution")

Expand Down
9 changes: 7 additions & 2 deletions lenstools/scripts/raytracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from lenstools import ConvergenceMap,OmegaMap,ShearMap
from lenstools.catalog import Catalog,ShearCatalog

from lenstools.simulations.raytracing import RayTracer
from lenstools.simulations.raytracing import RayTracer,DensityPlane
from lenstools.pipeline.simulation import SimulationBatch
from lenstools.pipeline.settings import MapSettings,TelescopicMapSettings,CatalogSettings

Expand Down Expand Up @@ -544,7 +544,12 @@ def losIntegrate(pool,batch,settings,batch_id):
for rloc,r in enumerate(range(first_map_realization,last_map_realization)):

#Instantiate the RayTracer
tracer = RayTracer()
if settings.lens_type=="PotentialPlane":
tracer = RayTracer()
elif settings.lens_type=="DensityPlane":
tracer = RayTracer(lens_type=DensityPlane)
else:
raise ValueError("Lens type {0} not recognized!".format(settings.lens_type))

#Force garbage collection
gc.collect()
Expand Down

0 comments on commit 89d6c11

Please sign in to comment.