:mod:`ocelot.adaptors.genesis4` =============================== .. py:module:: ocelot.adaptors.genesis4 Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ocelot.adaptors.genesis4.Namespace ocelot.adaptors.genesis4.Genesis4Input ocelot.adaptors.genesis4.Genesis4ParticlesDump ocelot.adaptors.genesis4.Genesis4Output Functions ~~~~~~~~~ .. autoapisummary:: ocelot.adaptors.genesis4.get_genesis4_launcher ocelot.adaptors.genesis4.run_genesis4 ocelot.adaptors.genesis4.read_gout4 ocelot.adaptors.genesis4.read_dfl4 ocelot.adaptors.genesis4.write_dfl4 ocelot.adaptors.genesis4.read_dpa4 ocelot.adaptors.genesis4.dpa42edist ocelot.adaptors.genesis4.read_dpa42parray ocelot.adaptors.genesis4.write_gen4_lat ocelot.adaptors.genesis4.write_edist_hdf5 ocelot.adaptors.genesis4.read_edist_hdf5 .. data:: h5py_avail :annotation: = True .. data:: _logger .. data:: _inputGen4Template :annotation: = $newrun aw0 = __AW0__ xkx = __XKX__ .. py:class:: Namespace .. py:class:: Genesis4Input Genesis input files storage object .. method:: input(self) .. py:class:: Genesis4ParticlesDump Genesis particle *.dpa files storage object Each particle record in z starts with the energy of all particles followed by the output of the particle phases, positions in x and y and the momenta in x and y. The momenta are normalized to mc .. method:: fileName(self) .. py:class:: Genesis4Output Genesis input files storage object .. method:: close(self) .. method:: filePath(self) :property: .. method:: fileName(self) .. method:: nZ(self) :property: .. method:: nSlices(self) :property: .. method:: lambdaref(self) :property: .. method:: phenref(self) :property: .. method:: I(self) :property: .. method:: beam_charge(self) :property: .. method:: rad_power(self) :property: .. method:: rad_energy(self) :property: .. method:: n_photons(self) :property: .. method:: t(self) :property: .. method:: rad_field(self, zi=None, loc='near') .. method:: calc_spec(self, zi=None, loc='near', npad=1, estimate_ph_sp_dens=1) .. method:: wig(self, z=np.inf) .. method:: close(self) .. function:: get_genesis4_launcher(launcher_program='genesis4', launcher_argument='') Returns MpiLauncher() object for given program .. function:: run_genesis4(inp, launcher, *args, **kwargs) Main function for executing Genesis code inp - GenesisInput() object with genesis input parameters launcher - MpiLauncher() object obtained via get_genesis_launcher() function .. function:: read_gout4(filePath) Reads Genesis1.3 v4 output file with the link to the hdf5 file as out.h5 to close the file, use out.h5.close() :param filePath: string, absolute path to .out file :returns: Genesis4Output .. function:: read_dfl4(filePath) Reads Genesis1.3 v4 radiation output file :param filePath: string, absolute path to .fld file :returns: RadiationField .. function:: write_dfl4(dfl: RadiationField, file_path='sample.dfl.h5') Writes ocelot.optics.wave.RadiationField object to Genesis1.3 v4 radiation file :param dfl: ocelot.optics.wave.RadiationField object :param file_path: path to .dfl file (file will be generate, or data will be rewritten) :return: .. function:: read_dpa4(filePath, start_slice=0, stop_slice=np.inf, estimate_npart=0) Reads Genesis1.3 v4 particle output file :param filePath: string, absolute path to .par file :returns: Genesis4ParticlesDump .. function:: dpa42edist(dpa, n_part=None, fill_gaps=False) Convert Genesis1.3 v4 particle output file to ocelot edist object :param dpa: GenesisParticlesDump :param n_part: desired approximate number of particles in edist :param fill_gaps: dublicates buckets into gaps :returns: GenesisElectronDist .. function:: read_dpa42parray(filePath, N_part=None, fill_gaps=True) .. function:: write_gen4_lat(lat, filePath, line_name='LINE', l=np.inf) .. function:: write_edist_hdf5(edist, filepath) .. function:: read_edist_hdf5(filepath, charge=None)