<jupyter_start><jupyter_text>Example of writing ToyModel image in HDF5 format<jupyter_code>import matplotlib.pylab as plt
from ctapipe.instrument import CameraGeometry
from ctapipe.image import toymodel
from ctapipe.image.geometry_converter import convert_geometry_hex1d_to_rect2d
import numpy as np
import h5py<jupyter_output><empty_output><jupyter_text>Now, let's create a fake Cherenkov image from a given `CameraGeometry` and fill it with some data:<jupyter_code># get the HESS demo camera geometry
geom = CameraGeometry.from_name("NectarCam")

# create a fake camera image to display:
model = toymodel.generate_2d_shower_model(centroid=(0.2, 0.0),
                                      width=0.05,
                                      length=0.15,
                                      psi='35d')

image, sig, bg = toymodel.make_toymodel_shower_image(geom, model.pdf, 
                                             intensity=1500,
                                             nsb_level_pe=5)
new_geom, image2d = convert_geometry_hex1d_to_rect2d(geom, image)
h5f = h5py.File('toymodel.h5', 'w')
image5f = h5f.create_dataset('imagen', data=image2d)
image5f.attrs['CLASS'] = 'IMAGE'
image5f.attrs['IMAGE_VERSION'] = '1.2'
image5f.attrs['IMAGE_MINMAXRANGE'] = [np.nanmin(image), np.nanmax(image)]
h5f.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0948469006721434, 'fraction_numerical': 0.027632561613144136, 'mean_word_length': 3.0483383685800605, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '261772', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 459, 'n_tokens_neox': 440, 'n_words': 91, 'path': 'examples/notebooks/HDF5 ToyModel Image.ipynb', 'repo_name': 'Mike7477/ctapipe', 'size': '1339'}