py21cmfast.HaloCatalog ====================== .. py:class:: py21cmfast.HaloCatalog Bases: :py:obj:`OutputStructZ` A class containing all fields related to halos. .. !! processed by numpydoc !! .. py:method:: __init_subclass__() :classmethod: Store subclasses for easy access. .. !! processed by numpydoc !! .. py:method:: compute(*, descendant_halos, ics, allow_already_computed = False) Compute the function. .. !! processed by numpydoc !! .. py:method:: dummy() :classmethod: Create a dummy instance with the given inputs. .. !! processed by numpydoc !! .. py:method:: ensure_arrays_computed(*arrays, load=False) Check if the given arrays are computed (not just initialized). .. !! processed by numpydoc !! .. py:method:: ensure_arrays_inited(*arrays, init=False) Check if the given arrays are initialized (or computed). .. !! processed by numpydoc !! .. py:method:: ensure_input_computed(input_box, load = False) Ensure all the inputs have been computed. .. !! processed by numpydoc !! .. py:method:: get(ary) If possible, load an array from disk, storing it and returning the underlying array. .. !! processed by numpydoc !! .. py:method:: get_full_size() Return the size of the object in bytes. This represents the size of the object if it is fully initialized/computed and all in memory. Equivalently, it is close to the file size on disk. .. !! processed by numpydoc !! .. py:method:: get_required_input_arrays(input_box) Return all input arrays required to compute this object. .. !! processed by numpydoc !! .. py:method:: initial(inputs) :classmethod: Create a dummy instance with the given inputs. .. !! processed by numpydoc !! .. py:method:: load_all() Load all possible arrays into memory. .. !! processed by numpydoc !! .. py:method:: new(inputs, redshift, buffer_size = None, **kw) :classmethod: Create a new PerturbedHaloCatalog instance with the given inputs. :Parameters: * **inputs** (*InputParameters*) -- The input parameters defining the output struct. * **redshift** (*float*) -- The redshift at which to compute fields. :Other Parameters: * **All other parameters are passed through to the :class:`PerturbedHaloCatalog`** * **constructor.** .. !! processed by numpydoc !! .. py:method:: prepare(flush = None, keep = None, force = False) Prepare the instance for being passed to another function. This will flush all arrays in "flush" from memory, and ensure all arrays in "keep" are in memory. At least one of these must be provided. By default, the complement of the given parameter is all flushed/kept. :Parameters: * **flush** -- Arrays to flush out of memory. Note that if no file is associated with this instance, these arrays will be lost forever. * **keep** -- Arrays to keep or load into memory. Note that if these do not already exist, they will be loaded from file (if the file exists). Only one of ``flush`` and ``keep`` should be specified. * **force** -- Whether to force flushing arrays even if no disk storage exists. .. !! processed by numpydoc !! .. py:method:: pull_from_backend() Sync the current state of the object with the underlying C-struct. This will pull any primitives calculated in the backend to the python object. Arrays are passed in as pointers, and do not need to be copied back. .. !! processed by numpydoc !! .. py:method:: purge(force=False) Flush all the boxes out of memory. :Parameters: **force** -- Whether to force the purge even if no disk storage exists. .. !! processed by numpydoc !! .. py:method:: push_to_backend() Push the current state of the object with the underlying C-struct. This will link any memory initialized by numpy in this object with the underlying C-struct, and also update the C struct with any values in the python object. .. !! processed by numpydoc !! .. py:method:: set(name, value) Set the value of an array. .. !! processed by numpydoc !! .. py:method:: summarize(indent = 0) Generate a string summary of the struct. .. !! processed by numpydoc !! .. py:attribute:: __slots__ :value: () .. py:property:: arrays :type: dict[str, py21cmfast.wrapper.arrays.Array] A dictionary of Array objects whose memory is shared between this object and the C backend. .. !! processed by numpydoc !! .. py:property:: astro_options :type: py21cmfast.wrapper.inputs.AstroOptions The AstroOptions object for this output struct. .. !! processed by numpydoc !! .. py:property:: astro_params :type: py21cmfast.wrapper.inputs.AstroParams The AstroParams object for this output struct. .. !! processed by numpydoc !! .. py:attribute:: buffer_size :type: int .. py:property:: cosmo_params :type: py21cmfast.wrapper.inputs.CosmoParams The CosmoParams object for this output struct. .. !! processed by numpydoc !! .. py:property:: cstruct :type: py21cmfast.wrapper.structs.StructWrapper The object pointing to the memory accessed by C-code for this struct. .. !! processed by numpydoc !! .. py:attribute:: desc_redshift :type: float | None .. py:attribute:: halo_coords .. py:attribute:: halo_masses .. py:attribute:: inputs :type: py21cmfast.wrapper.inputs.InputParameters .. py:property:: is_computed :type: bool Whether this instance has been computed at all. This is true either if the current instance has called :meth:`compute`, or if it has a current existing :attr:`path` pointing to stored data, or if such a path exists. Just because the instance has been computed does *not* mean that all relevant quantities are available -- some may have been purged from memory without writing. Use :meth:`has` to check whether certain arrays are available. .. !! processed by numpydoc !! .. py:property:: matter_options :type: py21cmfast.wrapper.inputs.MatterOptions The SimulationOptions object for this output struct. .. !! processed by numpydoc !! .. py:attribute:: n_halos :type: int .. py:property:: random_seed :type: int The random seed for this particular instance. .. !! processed by numpydoc !! .. py:attribute:: redshift :type: float .. py:attribute:: sfr_rng .. py:property:: simulation_options :type: py21cmfast.wrapper.inputs.SimulationOptions The SimulationOptions object for this output struct. .. !! processed by numpydoc !! .. py:attribute:: star_rng .. py:property:: struct :type: py21cmfast.wrapper.structs.StructWrapper The python-wrapped struct associated with this input object. .. !! processed by numpydoc !! .. py:attribute:: xray_rng