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

timeMinimumdouble precision

Returns the minimum time in the lightcone.

timeMaximumdouble precision

Returns the maximum time in the lightcone.

isInLightconelogical

Returns true if the provided node lies within the lightcone.

  • type(treeNode) node [inout]

  • logical atPresentEpoch (optional) [in]

  • double precision radiusBuffer (optional) [in]

replicationCountinteger(c_size_t)

Returns the number of times the given nodes appears in the lightcone .

  • type(treeNode) node [inout]

solidAngledouble precision

Returns the solid angle subtended by the lightcone (in units of steradians).

positiondouble precision(3)

Returns the position vector of a node (in units of Mpc) in the lightcone coordinate system. Components are Cartesian, in the order \((x,y,z)\).

  • type(treeNode) node [inout]

  • integer(c_size_t) instance [in]

velocitydouble precision(3)

Returns the velocity vector of a node (in units of km/s) in the lightcone coordinate system. Components are Cartesian, in the order \((v_\mathrm{x},v_\mathrm{y},v_\mathrm{z})\).

  • type(treeNode) node [inout]

  • integer(c_size_t) instance [in]

timeLightconeCrossingdouble 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) node [inout]

  • double precision timeStart [in]

  • double precision timeEnd [in]

  • double precision(:) timesCrossing (optional) [inout]

positionLightconeCrossingdouble precision(3)

Returns the position of the node at the time of lightcone crossing—which must have been previously identified via the timeLightconeCrossing method. Components are Cartesian, in the order \((x,y,z)\).

  • type(treeNode) node [inout]

velocityLightconeCrossingdouble precision(3)

Returns the velocity of the node at the time of lightcone crossing—which must have been previously identified via the timeLightconeCrossing method. Components are Cartesian, in the order \((v_\mathrm{x},v_\mathrm{y},v_\mathrm{z})\).

  • type(treeNode) node [inout]

geometryLightconeCylindrical

A lightcone geometry class which assumes a cylindrical “cone”, i.e. defined such that a point \((x,y,z)\) is in the survey if \(\sqrt{x^2+y^2} < r\), where \(r\) is the radius of the “cone”.

Methods

sampleNode

Determine if, and how many times, the given node appears in the “lightcone”, and choose positions for each instance.

  • type(treeNode) node [inout]

Parameters

  • [radiusCylinderComoving] (real) — The comoving radius of the cylinder to populate.

  • [radiusBufferComoving] (real; 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] (real; default -1.0d0) — The mass of the primary lens halo (or a negative value for no lens).

  • [redshiftLens] (real; default -1.0d0) — The redshift of the primary lens halo (or a negative value for no lens).

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)

geometryLightconeSquare

A lightcone geometry class which assumes a square field of view., i.e. defined such that a point \((x,y,z)\) is in the survey angular mask if \(|\hbox{atan2}(y,x)| < \psi/2\) and \(|\hbox{atan2}(z,x)| < \psi/2\) where \(\hbox{atan2}()\) is the quadrant-aware inverse tangent function, and \(\psi\) is the angular size of the field, we compute the solid angle of the lightcone as follows. Define a spherical coordinate system \((\theta,\phi)\) with the pole (\(\theta=0\)) aligned with the \(x\)-axis. The solid angle of the field is then

\[\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

\[\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

\[\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

\[\begin{split}\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],\end{split}\]

where \(a=\tan(\psi/2)\) and \(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 \(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 \(x\), \(y\), \(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\(=1\)), and in the two directions perpendicular to the lightcone (for X\(=2\) and 3). The redshift parameters must list the redshifts of available outputs.

Methods

positionAtOutputdouble precision(3)

Returns the position of a point, nodePosition (given in physical coordinates within the primary replicant volume), in comoving coordinates in the replicant volume in which it appears in the lightcone. If the point is not in the lightcone the returned position is set to the largest possible negative number in each coordinate. If the optional positionFound argument is given it will be set to true or false to indicate whether or not the point was found in the lightcone volume.

  • integer(c_size_t) output [in]

  • double precision(3) nodePosition [in]

  • integer(c_size_t) instance [in]

replicants

Performs various actions related to replicants of nodes appearing in lightcone output, depending on the value of the action argument: replicantActionCount returns in count the number of replicants in which the node appears in the lightcone; replicantActionAny returns true in isInLightcone if the given position appears in any replicant in the lightcone; replicantActionInstance returns in position the position in the instance\(^\mathrm{th}\) replicant in which this position appears in the lightcone.

  • integer(c_size_t) output [in]

  • double precision(3) nodePosition [in]

  • type(enumerationReplicantActionType) action [in]

  • integer(c_size_t) count (optional) [out]

  • logical isInLightcone (optional) [out]

  • double precision radiusBuffer (optional) [in]

  • integer(c_size_t) instance (optional) [in]

  • double precision(3) position (optional) [out]

periodicRangeinteger(3,2)

Computes the range of periodic replicants which could contribute to the lightcone in the given interval.

  • double precision distanceMinimum [in]

  • double precision distanceMaximum [in]

  • double precision radiusBuffer (optional) [in]

  • double precision(3) originBuffered (optional) [out]

  • double precision distanceMinimumBuffered (optional) [out]

  • double precision distanceMaximumBuffered (optional) [out]

nodePositionReplicantdouble precision(3)

Computes the comoving position of a node in the specified replicant.

  • type(treeNode) node [inout]

  • double precision time [in]

  • double precision(3) origin [in]

  • integer(3) replicant [in]

  • logical setTime (optional) [in]

  • logical report (optional) [in]

nodeVelocityReplicantdouble precision(3)

Computes the physical velocity of a node in the specified replicant.

  • type(treeNode) node [inout]

  • double precision time [in]

  • integer(3) replicant [in]

  • logical setTime (optional) [in]

replicantLightConeCrossinginteger(3)

Return the indices of the replicant for which the given node is crossing the lightcone.

  • type(treeNode) node [inout]

isInFieldOfViewlogical

Return true if the given position is in the field of view.

  • double precision(3) position [in]

Parameters

  • [nodeIndicesReport] (integer) — A list of node indices for which reporting should be performed.

  • [origin] (real) — 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] (real) — The first (radial) unit vector defining the lightcone geometry.

  • [unitVector2] (real) — The second (angular) unit vector defining the lightcone geometry.

  • [unitVector3] (real) — The third (angular) unit vector defining the lightcone geometry.

  • [lengthReplication] (real) — The length of the simulation box being used to construct the lightcone.

  • [lengthUnitsInSI] (real) — The units of the box length in the SI system.

  • [lengthHubbleExponent] (integer) — The exponent of the “little-\(h\)” parameter used in the definition of the box length.

  • [angularSize] (real) — The angular size (i.e. side length) of the square field of view of the lightcone (in units of degrees).

  • [timeEvolvesAlongLightcone] (boolean; 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.