N-Body Simulation Data Importer¶
Class providing importers of particle data from N-body simulations—routines that read position, velocity, mass, and halo catalogues from simulation output files and return them as nBodyData objects for subsequent analysis. Implementations support a variety of N-body output formats (e.g.GADGET HDF5, plain text) and optionally detect whether the source file is HDF5-formatted (allowing new derived properties to be written back). The imported data serve as input for N-body operator chains that compute halo statistics or populate galaxies.
Default implementation: nbodyImporterGadgetHDF5
Methods¶
import→voidImport position and velocity data from the named N-body data file.
type(nBodyData), intent( out), allocatable, dimension(:) :: simulations
isHDF5→logicalReturn true if the imported data is from an HDF5 file (to which new data can be written).
nbodyImporterGadgetBinary¶
An importer for N-body simulation data in Gadget binary format, reading particle positions, velocities, and masses for a specified particle type. The input file is set by [fileName], with physical unit conversions specified by [unitMassInSI], [unitLengthInSI], and [unitVelocityInSI], and the particle type selected by [particleType].
Parameters
[fileName]— The name of the file to read.[label](defaultvar_str('primary')) — A label for the simulation[particleType]— The particle type to read from the Gadget binary file.[lengthSoftening]— The softening length.[unitMassInSI]— The mass unit expressed in the SI system.[unitLengthInSI]— The length unit expressed in the SI system.[unitVelocityInSI]— The velocity unit expressed in the SI system.[isCosmological]— Set to true if this is a cosmological simulation, false otherwise.[setParticleType](default.false.) — If true, particle type values will be set.
nbodyImporterGadgetHDF5¶
An importer for N-body simulation data in Gadget HDF5 format, reading particle positions, velocities, and masses for a selected particle type from a structured HDF5 file. The input file is set by [fileName], with physical unit conversions via [unitMassInSI], [unitLengthInSI], and [unitVelocityInSI], and particle type by [particleType].
(Default implementation)
Parameters
[fileName]— The name of the file to read.[label](defaultvar_str('primary')) — A label for the simulation[particleType]— The particle type to read from the Gadget HDF5 file.[lengthSoftening]— The softening length.[unitMassInSI]— The mass unit expressed in the SI system.[unitLengthInSI]— The length unit expressed in the SI system.[unitVelocityInSI]— The velocity unit expressed in the SI system.[isCosmological]— Set to true if this is a cosmological simulation, false otherwise.
nbodyImporterIRATE¶
An importer for N-body simulation data stored in IRATE (IRvine Astrophysical simulaTion structurE) HDF5 format, reading halo properties from a specified snapshot. The input file is set by [fileName], the snapshot to read by [snapshot], and an optional simulation label by [label].
Methods
readHalos— Read a snapshot from the IRATE format file.writeHalos— Write a snapshot to a IRATE format file.readSimulation— Read the requested properties of the simulation from an IRATE format file.writeSimulation— Write the requested properties of the simulation from an IRATE format file.copySimulation— Copy “SimulationProperties” group from one IRATE file to another.copyCosmology— Copy “Cosmology” group from one IRATE file to another.
Parameters
[fileName]— The name of the file to which data should be exported.[snapshot]— The snapshot index of the data.[redshift]— The redshift of the data.[fileName]— The name of the file to read.[snapshot]— The snapshot number to read.[label](defaultvar_str('primary')) — A label for the simulation.[properties]— Properties to read from the simulation.
nbodyImporterMerge¶
An N-body data importer which combines particle and halo data from multiple delegate importer objects into a single unified dataset, enabling analysis of combined simulation volumes or multi-component datasets. A simulation label is provided via [label], and any number of child importer objects can be specified in the linked list.
Parameters
[label](defaultvar_str('*')) — A label for the simulation
nbodyImporterMillenniumCSV¶
An importer for halo catalog data stored in comma-separated value (CSV) format as exported from the Millennium Simulation database, reading halo masses and positions at a specified redshift. The input file path is set by [fileName], the target redshift by [redshift], and a simulation label by [label].
Parameters
[fileName]— The name of the file to read.[label](defaultvar_str('primary')) — A label for the simulation.[redshift]— The redshift of the data.
nbodyImporterMultiple¶
An N-body data importer which sequentially invokes multiple child nbodyImporterClass objects and concatenates their results into a single simulation array, enabling data to be loaded from several independent sources in one pass.
nbodyImporterRandom¶
An N-body data importer which generates uniformly distributed random points within a user-specified cuboid volume, useful for testing operators or constructing random reference catalogs. The number of points is set by [countPoints], with the spatial extent of the cuboid controlled by [xRange], [yRange], and [zRange].
Parameters
[countPoints]— The number of random points to generate.[xRange]— The range within which to generate points in the \(x\)-direction.[yRange]— The range within which to generate points in the \(y\)-direction.[zRange]— The range within which to generate points in the \(z\)-direction.
nbodyImporterRockstar¶
An importer for dark matter halo catalog data in Rockstar halo finder output format, reading halo positions, velocities, masses, and other properties from ASCII text files. The input file is set by [fileName], with a simulation label by [label], and additional columns to import specified by [readColumns].
Parameters
[fileName]— The name of the file to read.[label](defaultvar_str('primary')) — A label for the simulation[readColumns]— A list of additional Rockstar column names (beyond the default set) to read and store as named properties on each halo.