.. _physics-geometryLightcone: Lightcone Geometries ==================== Class providing lightcone geometries---the spatial and temporal selection function that defines which galaxies from the simulation volume are observable by a survey. A lightcone selects objects whose simulated positions intersect the observer's past light cone, accounting for periodic box replication. Implementations provide the minimum and maximum comoving lookback time, test whether a node lies within the cone, compute the position and velocity at lightcone crossing, and return the solid angle of the survey. **Default implementation:** ``geometryLightconeNull`` Methods ------- ``timeMinimum`` → ``double precision`` Returns the minimum time in the lightcone. ``timeMaximum`` → ``double precision`` Returns the maximum time in the lightcone. ``isInLightcone`` → ``logical`` Returns true if the provided node lies within the lightcone. * ``type (treeNode), intent(inout) :: node`` * ``logical , intent(in ), optional :: atPresentEpoch`` * ``double precision , intent(in ), optional :: radiusBuffer`` ``replicationCount`` → ``integer(c_size_t)`` Returns the number of times the given nodes appears in the lightcone . * ``type (treeNode), intent(inout) :: node`` ``solidAngle`` → ``double precision`` Returns the solid angle subtended by the lightcone (in units of steradians). ``position`` → ``double precision, dimension(3)`` Returns the position vector of a ``node`` (in units of Mpc) in the lightcone coordinate system. * ``type (treeNode), intent(inout), target :: node`` * ``integer(c_size_t), intent(in ) :: instance`` ``velocity`` → ``double precision, dimension(3)`` Returns the velocity vector of a ``node`` (in units of km/s) in the lightcone coordinate system. * ``type (treeNode), intent(inout) :: node`` * ``integer(c_size_t), intent(in ) :: instance`` ``timeLightconeCrossing`` → ``double precision`` Returns the next time in the interval from the current node time to ``timeEnd`` at which any replicant of this node will cross the lightcone. If no crossing occurs during this interval a very large value is returned instead. * ``type (treeNode), intent(inout), target :: node`` * ``double precision , intent(in ) :: timeStart , timeEnd`` * ``double precision , intent(inout), dimension(:), allocatable, optional :: timesCrossing`` ``positionLightconeCrossing`` → ``double precision, dimension(3)`` Returns the position of the node at the time of lightcone crossing---which must have been previously identified via the ``timeLightconeCrossing`` method. * ``type(treeNode), intent(inout) :: node`` ``velocityLightconeCrossing`` → ``double precision, dimension(3)`` Returns the velocity of the node at the time of lightcone crossing---which must have been previously identified via the ``timeLightconeCrossing`` method. * ``type(treeNode), intent(inout) :: node`` .. _physics-geometryLightconeCylindrical: ``geometryLightconeCylindrical`` -------------------------------- A lightcone geometry class which assumes a cylindrical "cone", i.e. defined such that a point :math:`(x,y,z)` is in the survey if :math:`\sqrt{x^2+y^2} < r`, where :math:`r` is the radius of the "cone". **Methods** * ``sampleNode`` **Parameters** * ``[rBoundaries]`` (default ``[+0.0d0,+1.0d0]``) — A two-element array :math:`[r_\mathrm{min}, r_\mathrm{max}]` specifying the radial extent of the cylindrical computational domain, where :math:`r=0` is the cylinder axis. * ``[zBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[z_\mathrm{min}, z_\mathrm{max}]` specifying the vertical extent of the cylindrical computational domain along the symmetry axis. * ``[countCells]`` (default ``[3_c_size_t,3_c_size_t]``) — A two-element integer array specifying the number of grid cells along the :math:`r` and :math:`z` dimensions of the cylindrical computational domain, controlling the spatial resolution of the radiative transfer calculation. * ``[convergencePercentile]`` (default ``0.99d0``) — The percentile of cells (between 0 and 1) used in assessing convergence; only this fraction of cells must satisfy the convergence threshold, allowing outlier cells to be excluded. * ``[convergenceThreshold]`` (default ``2.0d0``) — The threshold value for the convergence measure; the domain is considered converged when the specified percentile of cells has a convergence metric below this value. * ``[convergenceRatioThreshold]`` (default ``1.1d0``) — The threshold for the ratio of the convergence criterion between successive iterations; convergence is accepted when this ratio falls below the threshold, indicating the solution is no longer changing significantly. * ``[rBoundaries]`` (default ``[0.0d0,1.0d0]``) — A two-element array :math:`[r_\mathrm{min}, r_\mathrm{max}]` specifying the radial extent of the cylindrical integration domain. * ``[zBoundaries]`` (default ``[-1.0d0,+1.0d0]``) — A two-element array :math:`[z_\mathrm{min}, z_\mathrm{max}]` specifying the vertical extent of the cylindrical integration domain along the symmetry axis. * ``[radiusCylinderComoving]`` — The comoving radius of the cylinder to populate. * ``[radiusBufferComoving]`` (default ``1.0d0``) — The comoving buffer radius to add around the cylinder. This is used to ensure that the sample within the cylinder is complete. * ``[massHaloLens]`` (default ``-1.0d0``) — The mass of the primary lens halo (or a negative value for no lens). * ``[redshiftLens]`` (default ``-1.0d0``) — The redshift of the primary lens halo (or a negative value for no lens). .. _physics-geometryLightconeNull: ``geometryLightconeNull`` ------------------------- A null implementation of the lightcone geometry class. The lightcone has zero solid angle/volume, so no galaxy ever lies within it. **(Default implementation)** **Parameters** * ``[dimensionless]`` (default ``.true.``) — If true the null profile is considered to be dimensionless. .. _physics-geometryLightconeSquare: ``geometryLightconeSquare`` --------------------------- A lightcone geometry class which assumes a square field of view., i.e. defined such that a point :math:`(x,y,z)` is in the survey angular mask if :math:`|\hbox{atan2}(y,x)| < \psi/2` and :math:`|\hbox{atan2}(z,x)| < \psi/2` where :math:`\hbox{atan2}()` is the quadrant-aware inverse tangent function, and :math:`\psi` is the angular size of the field, we compute the solid angle of the lightcone as follows. Define a spherical coordinate system :math:`(\theta,\phi)` with the pole (:math:`\theta=0`) aligned with the :math:`x`-axis. The solid angle of the field is then .. math:: \Omega = 2 \pi \int_0^{\psi/2} \sin\theta \mathrm{d}\theta + 8 \int_{\psi/2}^{\tan^{-1}(\sqrt{2}\tan(\psi/2))} \mathrm{d}\theta \sin\theta \int_{\cos^{-1}(\tan(\psi/2)/\tan\theta)}^{\pi/4} \mathrm{d}\phi, which is .. math:: \Omega = 2 \pi [1-\cos(\psi/2)] + 8 \int_{\psi/2}^{\tan^{-1}(\sqrt{2}\tan(\psi/2))} \mathrm{d}\theta \sin\theta \left[ {\pi\over 4} - \cos^{-1}\left({\tan(\psi/2)\over \tan\theta}\right)\right], or .. math:: \Omega = 2 \pi [1 - \cos(\tan^{-1}(\sqrt{2}\tan(\psi/2)))] - 8 \int_{\psi/2}^{\tan^{-1}(\sqrt{2}\tan(\psi/2))} \mathrm{d}\theta \sin\theta \cos^{-1}\left({\tan(\psi/2)\over \tan\theta}\right), The final integral can be evaluated (using Mathematica for example) to give .. math:: \Omega & = 2 \pi [3 - \cos(\tan^{-1}(\sqrt{2}\tan(\psi/2)))] - 8 \sin(x) \left( \sqrt{(a^2+1)\cos(2x)+a^2-1}(\log(a(\sqrt{2}\sqrt{2a^2\cos^2(x)+\cos(2x)-1} \right. \nonumber \\ & +2a))-\log(\sqrt{\cos(2x)-1}))\sqrt{\csc^2(x)(-((a^2+1)\cos(2x)+a^2-1))}-\cot(x)((a^2+1)\cos(2x)+a^2-1) \nonumber \\ & \left. \cos^{-1}(a \cot(x)) \right) / [(a^2+1)\cos(2x)+a^2-1], where :math:`a=\tan(\psi/2)` and :math:`x=\tan^{-1}[\sqrt{2}\tan (\psi/2)]`. Various sub-parameters specify the details of the lightcone geometry. The ``lengthReplication`` parameter should give the length of the simulation box (the box will be replicated to span the volume covered by the lightcone), with the ``lengthUnitsInSI`` parameter giving the length unit in SI units and ``lengthHubbleExponent`` giving the exponent of :math:`h` that appears in the length unit. The ``angularSize`` parameter of ``fieldOfView`` should gives the length of the side of the square field of view in degrees. The ``origin`` element must contain the :math:`x`, :math:`y`, :math:`z` coordinates of the origin of the lightcone within the simulation box, while the ``unitVectorX`` parameters must give unit vectors which point along the lightcone (for ``X``\ :math:`=1`), and in the two directions perpendicular to the lightcone (for ``X``\ :math:`=2` and 3). The ``redshift`` parameters must list the redshifts of available outputs. **Methods** * ``positionAtOutput`` * ``replicants`` * ``periodicRange`` * ``nodePositionReplicant`` * ``nodeVelocityReplicant`` * ``replicantLightConeCrossing`` * ``isInFieldOfView`` **Parameters** * ``[nodeIndicesReport]`` — A list of node indices for which reporting should be performed. * ``[origin]`` — The 3D Cartesian position vector (in Mpc) of the observer's location from which the square lightcone extends along the direction defined by the unit vectors. * ``[unitVector1]`` — The first (radial) unit vector defining the lightcone geometry. * ``[unitVector2]`` — The second (angular) unit vector defining the lightcone geometry. * ``[unitVector3]`` — The third (angular) unit vector defining the lightcone geometry. * ``[lengthReplication]`` — The length of the simulation box being used to construct the lightcone. * ``[lengthUnitsInSI]`` — The units of the box length in the SI system. * ``[lengthHubbleExponent]`` — The exponent of the "little-:math:`h`" parameter used in the definition of the box length. * ``[angularSize]`` — The angular size (i.e. side length) of the square field of view of the lightcone (in units of degrees). * ``[timeEvolvesAlongLightcone]`` (default ``.true.``) — If ``true``, cosmic time evolves along the lightcone as expected. Otherwise, time is fixed at the present epoch throughout the lightcone. This allows construction of lightcones with no evolution.