<jupyter_start><jupyter_text>Loading a mock map Here, we describe the script to load a mock map from the kappaTNG suite.  First, we load some modules.<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline 
ng = 1024  # number of grids
theta = 5.0  # opening angle in deg
fname = "sample_kappa.dat"

pix = theta/ng  # pixel size
theta = pix*np.arange(ng)


with open(fname, 'rb') as f:
    dummy = np.fromfile(f, dtype="int32", count=1)
    kappa = np.fromfile(f, dtype="float", count=ng*ng)
    dummy = np.fromfile(f, dtype="int32", count=1)

kappa = kappa.reshape((ng, ng))<jupyter_output><empty_output><jupyter_text>Now, the array `kappa` contains the convergence field. Let's plot it as the 2D color map.<jupyter_code>X, Y = np.meshgrid(theta, theta)

plt.pcolormesh(X, Y, kappa, vmin=-0.05, vmax=0.07, cmap="Blues")
cbar = plt.colorbar()
cbar.set_label(r'$\kappa$', fontsize=20)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup