import grale.renderers as renderers import grale.feedback as feedback # Allowed string values are 'threads' and 'mpi' renderers.setDefaultMassRenderer("threads") # Allowed string values are 'threads', 'mpi' and 'opencl' # (but not all lens models have an OpenCL implementation available) renderers.setDefaultLensPlaneRenderer("threads") # Allowed string values are 'none', 'stdout' and 'notebook' feedback.setDefaultFeedback("notebook")
import grale.plotutil as plotutil import grale.renderers as renderers import grale.images as images import grale.feedback as feedback from grale.constants import * import matplotlib.pyplot as plt import numpy as np import pprint cosm = cosmology.Cosmology(0.7, 0.3, 0, 0.7) cosmology.setDefaultCosmology(cosm) D = cosm.getAngularDiameterDistance V = lambda x, y: np.array([x, y], dtype=np.double) plotutil.setDefaultAngularUnit(ANGLE_ARCSEC) feedback.setDefaultFeedback("none") zd1, zd2 = 0.5, 1.0 lens1 = lenses.CompositeLens(D(zd1), [ { "factor": 0.7, "x": 1.0 * ANGLE_ARCSEC, "y": -0.5 * ANGLE_ARCSEC, "angle": 0, "lens": lenses.PlummerLens(D(zd1), { "mass": 1e14 * MASS_SUN,
from example_lens_dl import * import grale.plotutil as plotutil import grale.renderers as renderers import grale.feedback as feedback import grale.cosmology as cosmology from grale.constants import * import matplotlib.pyplot as plt # Let's create an alias for this class LI = plotutil.LensInfo # Set defaults renderers.setDefaultMassRenderer("threads") renderers.setDefaultLensPlaneRenderer("threads") feedback.setDefaultFeedback("stdout") plotutil.setDefaultAngularUnit(ANGLE_ARCSEC) # For the generation of this model of CL0024, the # following cosmology and redshifts were used cosm = cosmology.Cosmology(0.71, 0.27, 0, 0.73) zd, zs = 0.395, 1.675 Ds = cosm.getAngularDiameterDistance(zs) Dds = cosm.getAngularDiameterDistance(zd, zs) # Inform the LensInfo object that we're interested in a region that's # 120" wide, with the specified angular diameter distances. lensInfo = LI(cl0024Model, size=120 * ANGLE_ARCSEC, Ds=Ds, Dds=Dds) try: # This is actually mainly for convenience in generating this # documentation: at the end of the file we'll save the LensInfo