Plotting is Back


In [1]:
%matplotlib inline

from massinference.plot import Limits
from massinference.map import KappaMap, ShearMap
import matplotlib.pyplot as plt

limits = Limits(1.8, 1.65, -2.0, -1.9)
plot_config = KappaMap.default().plot(limits=limits)
ShearMap.default().plot(plot_config=plot_config)


Out[1]:
<massinference.plot.PlotConfig at 0x12a9b4290>

Rearchitected MassInference Benchmarking

Benchmark

  • 36 square arcmin field
  • 10 source objects / arcmin
  • lightcnoe radius of 4 arcmins
  • no relevance filtering
  • no smooth kappas
  • 4 independent samples
  • no setup/io/etc, timer starts after objects initialized

Pangloss ... 214.165 seconds

MassInference ... 1.082 seconds

Numpy Performance Hacks


In [22]:
import numpy as np

x = np.random.rand(10**8)

%timeit -n 1 -r 1 np.isnan(x)
%timeit -n 1 -r 1 np.isnan(np.sum(x))


1 loop, best of 1: 1.54 s per loop
1 loop, best of 1: 64.1 ms per loop

In [29]:
%timeit -n 1 -r 1 np.sum(-x)
%timeit -n 1 -r 1 (-np.sum(x))


1 loop, best of 1: 6.02 s per loop
1 loop, best of 1: 1.51 s per loop