Example #1
0
time_text = ax.text(A_RANGE[0] + 5, Z_RANGE[1], '', fontsize=18)
im = plt.imshow(data_matrix,
                cmap='gnuplot',
                norm=LogNorm(vmin=MIN_VALUE, vmax=MAX_VALUE))
ax.invert_yaxis()
ax.axis('off')
plt.xlabel("A", fontsize=16)
plt.ylabel("Z", fontsize=16)
plt.xlim(A_RANGE)
plt.ylim(Z_RANGE)
# plt.title(PROPERTY)
fig.colorbar(im, cax=fig.add_axes([0.91, 0.2, 0.03, 0.6]))

# iterate over data in the file
with pp.JSONReader(FILENAME) as output:

    def animate(timestamp):
        data_matrix[:, :] = 0.0
        for nuclide in timestamp.nuclides:
            z = pp.find_z(nuclide.element)
            a = nuclide.isotope
            value = getattr(nuclide, PROPERTY)
            if value > 0.0:
                data_matrix[z, a] = value
        im.set_array(data_matrix)
        time_text.set_text("{} s - activity={:.3e} Bq".format(
            timestamp.cooling_time + timestamp.irradiation_time,
            timestamp.total_activity))
        return [im, time_text]
Example #2
0
 def test_reader_json(self):
     with pp.JSONReader(self.filename_test91json) as o:
         self._assert_test91(o)