Ejemplo n.º 1
0
from grale.cosmology import Cosmology
import grale.images as images
import numpy as np

# Write the RNG state, in case we want to reproduce the run exactly
# (note that the GRALE_DEBUG_SEED environment variable will need
# to be restored as well)
import random
print("RNG State:")
print(random.getstate())

V = lambda x, y: np.array([x, y], dtype=np.double)

renderers.setDefaultLensPlaneRenderer(
    "threads")  # threads, mpi, opencl, None or a Renderer object
renderers.setDefaultMassRenderer(
    "threads")  # threads, mpi, None, or a Renderer object
inversion.setDefaultInverter("threads")  # threads, mpi or an Inverter object
plotutil.setDefaultAngularUnit(ANGLE_ARCSEC)

z_lens = 0.45
iws = inversion.InversionWorkSpace(z_lens,
                                   150 * ANGLE_ARCSEC,
                                   cosmology=Cosmology(0.7, 1.0, 0, 0))

iws.addImageDataToList(images.ImagesData.load("images1pointgroups.imgdata"),
                       2.5, "extendedimages")
iws.addImageDataToList(images.ImagesData.load("null1.imgdata"), 2.5,
                       "extendednullgrid")
iws.addImageDataToList(images.ImagesData.load("images2.imgdata"), 1.5,
                       "extendedimages")
iws.addImageDataToList(images.ImagesData.load("null2.imgdata"), 1.5,
Ejemplo n.º 2
0
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")