enbid-ananke 0.3.0__cp310-cp310-manylinux_2_39_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- .cpython-310-x86_64-linux-gnu.so +0 -0
- enbid_ananke/Enbid-2.0/.DS_Store +0 -0
- enbid_ananke/Enbid-2.0/COPYING +341 -0
- enbid_ananke/Enbid-2.0/COPYRIGHT +18 -0
- enbid_ananke/Enbid-2.0/Documentation/enbid.pdf +0 -0
- enbid_ananke/Enbid-2.0/Documentation/users-guide.pdf +0 -0
- enbid_ananke/Enbid-2.0/Documentation/users-guide.tex +679 -0
- enbid_ananke/Enbid-2.0/Documentation/users-guide.tex.flc +4 -0
- enbid_ananke/Enbid-2.0/Enbid +0 -0
- enbid_ananke/Enbid-2.0/Examples/hernquist1_small/snapshot_ici +0 -0
- enbid_ananke/Enbid-2.0/Examples/hernquist1_small/snapshot_ici_typelist +2 -0
- enbid_ananke/Enbid-2.0/Examples/uniform_6d_box_4/snapshot_ici +0 -0
- enbid_ananke/Enbid-2.0/Examples/uniform_6d_box_4/snapshot_ici_3d.ascii +10000 -0
- enbid_ananke/Enbid-2.0/Examples/uniform_6d_box_4/snapshot_ici_6d.ascii +10000 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile1 +37 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile2 +37 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile3 +37 -0
- enbid_ananke/Enbid-2.0/parameterfiles/myparameterfile4 +37 -0
- enbid_ananke/Enbid-2.0/periodic_lengths.txt +5 -0
- enbid_ananke/Enbid-2.0/src/Makefile +43 -0
- enbid_ananke/Enbid-2.0/src/allocate.cpp +47 -0
- enbid_ananke/Enbid-2.0/src/allocate.o +0 -0
- enbid_ananke/Enbid-2.0/src/allvars.cpp +62 -0
- enbid_ananke/Enbid-2.0/src/allvars.h +263 -0
- enbid_ananke/Enbid-2.0/src/allvars.o +0 -0
- enbid_ananke/Enbid-2.0/src/begrun.cpp +361 -0
- enbid_ananke/Enbid-2.0/src/begrun.o +0 -0
- enbid_ananke/Enbid-2.0/src/density_nd.cpp +130 -0
- enbid_ananke/Enbid-2.0/src/density_nd.o +0 -0
- enbid_ananke/Enbid-2.0/src/functions.cpp +256 -0
- enbid_ananke/Enbid-2.0/src/functions.h +20 -0
- enbid_ananke/Enbid-2.0/src/functions.o +0 -0
- enbid_ananke/Enbid-2.0/src/init.cpp +299 -0
- enbid_ananke/Enbid-2.0/src/init.o +0 -0
- enbid_ananke/Enbid-2.0/src/io.cpp +255 -0
- enbid_ananke/Enbid-2.0/src/io.o +0 -0
- enbid_ananke/Enbid-2.0/src/main.cpp +108 -0
- enbid_ananke/Enbid-2.0/src/main.o +0 -0
- enbid_ananke/Enbid-2.0/src/ngb_search.cpp +2315 -0
- enbid_ananke/Enbid-2.0/src/ngb_search.h +35 -0
- enbid_ananke/Enbid-2.0/src/ngb_search.o +0 -0
- enbid_ananke/Enbid-2.0/src/nr.cpp +186 -0
- enbid_ananke/Enbid-2.0/src/nr.h +13 -0
- enbid_ananke/Enbid-2.0/src/nr.o +0 -0
- enbid_ananke/Enbid-2.0/src/proto.h +22 -0
- enbid_ananke/Enbid-2.0/src/read_ic.cpp +434 -0
- enbid_ananke/Enbid-2.0/src/read_ic.o +0 -0
- enbid_ananke/Enbid-2.0/src/tree.cpp +973 -0
- enbid_ananke/Enbid-2.0/src/tree.h +34 -0
- enbid_ananke/Enbid-2.0/src/tree.o +0 -0
- enbid_ananke/Enbid-2.0/src/tree_search.cpp +597 -0
- enbid_ananke/Enbid-2.0/src/tree_search.o +0 -0
- enbid_ananke/__init__.py +318 -0
- enbid_ananke/__license__/LICENSE +339 -0
- enbid_ananke/__license__/__init__.py +9 -0
- enbid_ananke/__metadata__.py +160 -0
- enbid_ananke/_builtin_utils.py +62 -0
- enbid_ananke/_constants.py +56 -0
- enbid_ananke/_defaults.py +36 -0
- enbid_ananke/_name.py +10 -0
- enbid_ananke/_templates.py +71 -0
- enbid_ananke/_version.py +21 -0
- enbid_ananke/utils.py +11 -0
- enbid_ananke-0.3.0.dist-info/METADATA +44 -0
- enbid_ananke-0.3.0.dist-info/RECORD +68 -0
- enbid_ananke-0.3.0.dist-info/WHEEL +5 -0
- enbid_ananke-0.3.0.dist-info/licenses/LICENSE +339 -0
- enbid_ananke-0.3.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,679 @@
|
|
1
|
+
\documentclass{article}
|
2
|
+
\title{User's Guide for EnBiD}
|
3
|
+
\author{Sanjib Sharma \thanks{E-mail:sanjib.sharma@gmail.com}}
|
4
|
+
\begin{document}
|
5
|
+
\maketitle
|
6
|
+
|
7
|
+
\tableofcontents
|
8
|
+
\section{Introduction} \label{sec:intro}
|
9
|
+
EnBiD ({\bf En}tropy Based {\bf Bi}nary {\bf D}ecomposition) is a code
|
10
|
+
for calculation of densities from a discrete set of data points
|
11
|
+
distributed in a multi-dimensional space. The code is completely
|
12
|
+
metric free. The most important feature of EnBiD is its ability
|
13
|
+
to determine the appropriate metric at each point in space.
|
14
|
+
It is based upon the
|
15
|
+
idea of binary space partioning tree (kd-tree). The algorithm EnBiD
|
16
|
+
was inspired by an earlier algorithm dubbed FiEstAS
|
17
|
+
developed by Ascasibar \& Binney 2005 ,MNRAS,356,872.
|
18
|
+
The main feature of EnBiD is its unique node splitting
|
19
|
+
criterion, which is based on {\it Shannon Entropy} and helps
|
20
|
+
to extract maximum information from the data.
|
21
|
+
After the spatial decomposition has been done the code
|
22
|
+
offers a variety of methods for obtaining smoothed estimates of density.
|
23
|
+
The code determines the appropriate metric at each point in space
|
24
|
+
from the shape of the leaf nodes which are generated by the spatial decomposition.
|
25
|
+
The main method of density estimation is the kernel based density
|
26
|
+
estimation. Spherical kernels as well as kernels of the product form can be
|
27
|
+
used. In addition a variety of different kernel functions can also be used.
|
28
|
+
FiEstAS style smoothing as originally proposed by Ascasibar \& Binney 2005
|
29
|
+
can also be done. The algorithm and its test results are described in the
|
30
|
+
paper astroph/0507550. The code is distributed under the GNU general
|
31
|
+
public license.
|
32
|
+
|
33
|
+
This guide provides the technical details which
|
34
|
+
will help others to use the code.
|
35
|
+
Some routines in this code are derived from the code GADGET
|
36
|
+
which is a code for cosmological N-Body/SPH simulations,
|
37
|
+
developed by Springel,Yoshida \& White 2001, New Astronomy,6,51,
|
38
|
+
The algorithm for nearest neighbor search is based
|
39
|
+
on the algorithm of code SMOOTH
|
40
|
+
\newline
|
41
|
+
http://www-hpcc.astro.washington.edu/tools/smooth.html
|
42
|
+
|
43
|
+
\section{Compilation}
|
44
|
+
The code is written in C++. Unpacking the code
|
45
|
+
using \newline{\bf tar -zxvf Enbid-2.0.tar.gz} \newline generates a
|
46
|
+
directory \verb$Enbid-2.0$. The \verb$src$ directory
|
47
|
+
contains \verb$.cpp$ and \verb$.h$ files
|
48
|
+
along with a \verb$Makefile$. Typing {\bf make} in the \verb$src$
|
49
|
+
directory should compile the code on most Unix and linux based systems.
|
50
|
+
Below are listed some options from the \verb$Makefile$
|
51
|
+
which need to be specified during compilation time.
|
52
|
+
\begin{verbatim}
|
53
|
+
OPT1 = -DWARN # to put print statements for debugging
|
54
|
+
OPT2 = -DDIM3 # For doing calculations in 3 dimensions
|
55
|
+
OPT2 = -DDIM6 # For doing calculations in 6 dimensions
|
56
|
+
OPT2 = -DDIMO # For other spaces
|
57
|
+
OPT3 = -DMEDIAN #enables optimizations for faster kernel smoothing
|
58
|
+
OPT4 = -DPERIODIC #enables periodic boundary conditions
|
59
|
+
\end{verbatim}
|
60
|
+
Option \verb$WARN$ should normally be kept enabled. In case of a problem
|
61
|
+
it makes the code print a warning and diverts it into an interactive mode
|
62
|
+
asking the user for an input. To run it in an un-interrupted fashion
|
63
|
+
this option should be disabled.
|
64
|
+
The number of dimensions need to be specified during the compilation. $3$ and
|
65
|
+
$6$ dimensional spaces can be invoked by selecting the appropriate
|
66
|
+
\verb$OPT2$. For other spaces one
|
67
|
+
has to use option \verb$DIMO$ and then alter the variable
|
68
|
+
\verb$#define ND$ in file \verb$allvars.h$. When \verb$OPT3$ is
|
69
|
+
enabled special optimizations are enabled which work with the median
|
70
|
+
splitting criterion, this speeds up the neighbor search by about $10\%$ .
|
71
|
+
Periodic boundary conditions are enabled by option \verb$OPT4$.
|
72
|
+
Any change in the options in Makefile should generally be followed by
|
73
|
+
a {\bf make clean} procedure before compiling it again.
|
74
|
+
|
75
|
+
Compiling the code generates the executable file \verb$enbid$
|
76
|
+
in the directory \verb$Enbid-2.0$ which can be run from command line along with a parameterfile. \newline
|
77
|
+
{\bf ./enbid parameterfile}\newline
|
78
|
+
|
79
|
+
\section{Parameters}
|
80
|
+
The main method for calculating densities is the
|
81
|
+
tree based scheme followed by Kernel smoothing.
|
82
|
+
Other than this FiEstAS based smoothing option
|
83
|
+
is also available. The parameter file
|
84
|
+
helps the user to choose the available options and also
|
85
|
+
provides various parameters to fine tune the efficiency
|
86
|
+
and accuracy of the code.
|
87
|
+
A short description of these parameters is provided below.
|
88
|
+
\begin{verbatim}
|
89
|
+
InitCondFile Examples/hernquist1_small/snapshot_ici
|
90
|
+
\end{verbatim}
|
91
|
+
This is the name of the input file which provides
|
92
|
+
the data for density calculation.
|
93
|
+
|
94
|
+
|
95
|
+
\begin{verbatim}
|
96
|
+
SnapshotFileBase _ph
|
97
|
+
\end{verbatim}
|
98
|
+
The output file name is derived from the input file name
|
99
|
+
by adding the above base name and a suffix \verb$.est$. For the above
|
100
|
+
choice of parameters the file generated is
|
101
|
+
{\bf snapshot\_ici\_ph.est}.
|
102
|
+
|
103
|
+
\begin{verbatim}
|
104
|
+
ICFormat 1
|
105
|
+
\end{verbatim}
|
106
|
+
For a value of 1 the code reads files in
|
107
|
+
GADGET format. For a value of 0 it can read
|
108
|
+
data written in ASCII format.
|
109
|
+
Files of other formats can be made to read in
|
110
|
+
by writing ones own reading routine. A template
|
111
|
+
function is provided for this. This can be invoked
|
112
|
+
by setting the above parameter to 2.
|
113
|
+
|
114
|
+
|
115
|
+
\begin{verbatim}
|
116
|
+
SpatialScale 1
|
117
|
+
\end{verbatim}
|
118
|
+
This parameter is used to define global scaling
|
119
|
+
relations between various co-ordinates.
|
120
|
+
This choice is useful when one wants to use
|
121
|
+
normal SPH (isotropic kernels and non-adaptive metric)
|
122
|
+
otherwise the parameter should be set to $1$.
|
123
|
+
For \verb$SpatialScale$ $=0$ the scaling is done
|
124
|
+
based on the global co-variance of the data.
|
125
|
+
If $\sigma_i=\sqrt{<x_i^2>}$ is the standard deviation of the
|
126
|
+
$i$th co-ordinate then the code performs the following transformation
|
127
|
+
$x_i \rightarrow x_i/\sigma_i$.
|
128
|
+
For phase space density calculations (i.e. number of dimensions $d=6$),
|
129
|
+
if \verb$SpatialScale$ $> 0$, the co-ordinates of real space
|
130
|
+
(dimensions $1,2$ and $3$) are scaled globally with
|
131
|
+
respect to velocity space (dimensions $4,5$ and $6$) by the following
|
132
|
+
transformation, for $i=1$ to $3$ $x_i \rightarrow x_i/$SpatialScale.
|
133
|
+
|
134
|
+
\begin{verbatim}
|
135
|
+
PartBoundary 7
|
136
|
+
\end{verbatim}
|
137
|
+
During tree generation if the number of particles in a node is
|
138
|
+
greater than or equal to the above parameter
|
139
|
+
a boundary correction is applied to its surfaces.
|
140
|
+
Optimum choice of this paramater is $d+1$, $d$ being the dimensionality
|
141
|
+
of space under consideration.
|
142
|
+
If the densities are found to be underestimated then lower it or vice versa.
|
143
|
+
If the value is too small this can give rise to Poisson errors, so
|
144
|
+
irrespective of the number of dimensions a minimum value of $7$
|
145
|
+
should be used.
|
146
|
+
When the system is known to have
|
147
|
+
well defined rectangular boundaries e.g.
|
148
|
+
systems with periodic boundary conditions,
|
149
|
+
the boundary correction can be switched
|
150
|
+
off by setting this parameter to zero. Read option
|
151
|
+
\verb$PeriodicBoundaryOn$ for more details.
|
152
|
+
If this parameter has value $1$ boundary correction is
|
153
|
+
applied to the leaf nodes only (as done originally in FiEstAS).
|
154
|
+
|
155
|
+
\begin{verbatim}
|
156
|
+
NodeSplittingCriterion 1
|
157
|
+
\end{verbatim}
|
158
|
+
This parameter is used to alter the node splitting
|
159
|
+
criteria used to generate the tree.
|
160
|
+
For a value of $1$ \emph{Shannon Entropy} is evaluated
|
161
|
+
in each dimension and the dimension with lowest entropy
|
162
|
+
is chosen to be split. Setting this parameter to $0$
|
163
|
+
disables entropy based node splitting criterion and
|
164
|
+
splits each dimension alternately.
|
165
|
+
|
166
|
+
\begin{verbatim}
|
167
|
+
CubicCells 0
|
168
|
+
\end{verbatim}
|
169
|
+
When this parameter has a value
|
170
|
+
of 1 the \newline
|
171
|
+
\verb$NodeSplittingCriteria$ is used to
|
172
|
+
select the subspace (real or velocity) to be split rather than the
|
173
|
+
dimension.
|
174
|
+
Then from this subspace the axis having maximum
|
175
|
+
variance ($<x_i^2>-<x_i>^2$) is selected to be split.
|
176
|
+
For systems whose subspaces are known to be Euclidean this
|
177
|
+
gives better results. It results in cubic cells in
|
178
|
+
each sub-space. This option only works for 3 and 6 dimensional spaces.
|
179
|
+
|
180
|
+
|
181
|
+
\begin{verbatim}
|
182
|
+
MedianSplittingOn 0
|
183
|
+
\end{verbatim}
|
184
|
+
Ideally the position of splitting should be close to
|
185
|
+
the median of the data points so that there are equal
|
186
|
+
number of data points on both sides of the split.
|
187
|
+
For building the tree it is computationally more efficient
|
188
|
+
to instead choose the splitting position close
|
189
|
+
to the mean of the data points.
|
190
|
+
When the code is compiled with the \verb$-DMEDIAN$ flag
|
191
|
+
setting this parameter to 1 results in faster kernel density estimates.
|
192
|
+
|
193
|
+
\begin{verbatim}
|
194
|
+
TypeOfSmoothing 3
|
195
|
+
\end{verbatim}
|
196
|
+
This parameter helps to select various different smoothing options.
|
197
|
+
For a value of zero no smoothing is done
|
198
|
+
this is useful to get fast estimates of
|
199
|
+
density but at the price of a large dispersion.
|
200
|
+
For a value of $1$ FiEstAS style smoothing is done,
|
201
|
+
for $2$ normal spherical Kernel based scheme is used (having
|
202
|
+
isotropic metric same scale in all dimensions) and
|
203
|
+
for $3$ spherical Kernel based scheme with an appropriate
|
204
|
+
adaptive metric (estimated by the size and the shape of the
|
205
|
+
leaf node containing the data point) is used.
|
206
|
+
For a value of $4$ and $5$ the kernel used is of product form with
|
207
|
+
the metric being isotropic for the former and adaptive for the later.
|
208
|
+
For FiEstAS style smoothing particles of a given type should not
|
209
|
+
have multiple masses.
|
210
|
+
|
211
|
+
\begin{verbatim}
|
212
|
+
DesNumNgb 40
|
213
|
+
\end{verbatim}
|
214
|
+
This gives the number of smoothing neighbors
|
215
|
+
that are used for density calculation.
|
216
|
+
For FiEstAS style smoothing optimum range of this
|
217
|
+
parameter is $2$ to $10$. For SPH smoothing the optimum
|
218
|
+
choice depends upon the number of dimensions.
|
219
|
+
For a Hernquist sphere in 6 dimensions
|
220
|
+
\verb$DesNumNgb=40$ was found to give smoothing
|
221
|
+
equivalent to FiEstAS smoothing with \verb$DesNumNgb=2$.
|
222
|
+
|
223
|
+
|
224
|
+
\begin{verbatim}
|
225
|
+
VolCorr 1
|
226
|
+
\end{verbatim}
|
227
|
+
During smoothing if the smoothing
|
228
|
+
box extends outside the boundary of the system
|
229
|
+
density might be underestimated. Setting this parameter
|
230
|
+
to 1 enables this correction for both Kernel and FiEstAS
|
231
|
+
smoothing.
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
\begin{verbatim}
|
236
|
+
TypeOfKernel 3
|
237
|
+
\end{verbatim}
|
238
|
+
For Kernel based smoothing
|
239
|
+
three different types of kernels
|
240
|
+
can be used. For a value of $0$
|
241
|
+
the B-Spline kernel is used,
|
242
|
+
for $1$ top hat kernel is used, for $2$ Bi-weight kernel
|
243
|
+
is used and for $3$ Epanechnikov kernel is used.
|
244
|
+
For $4$ cloud in cell (CIC) type of linear kernel is
|
245
|
+
used and for $5$ triangular shaped cloud (TSC) type
|
246
|
+
of kernel is used.
|
247
|
+
In our tests Epanechnikov kernel was found to give
|
248
|
+
best results.
|
249
|
+
|
250
|
+
|
251
|
+
\begin{verbatim}
|
252
|
+
KernelBiasCorrection 1
|
253
|
+
\end{verbatim}
|
254
|
+
Normal Kernel based schemes have significant bias in
|
255
|
+
their estimated densities for irregularly
|
256
|
+
distributed data. This bias arises when the densities are calculated
|
257
|
+
at the location of the data points and can be eliminated by suitably
|
258
|
+
displacing the central data point within the smoothing volume.
|
259
|
+
This is enabled by setting the parameter to 1. For regularly spaced
|
260
|
+
data (e.g. glass or lattice like systems) this option should be
|
261
|
+
disabled by setting the value to 0.
|
262
|
+
|
263
|
+
|
264
|
+
\begin{verbatim}
|
265
|
+
AnisotropicKernel 0
|
266
|
+
\end{verbatim}
|
267
|
+
This enables the use of Anisotropic kernels which
|
268
|
+
can have both shear and rotation.
|
269
|
+
The kernel instead of being spherical is
|
270
|
+
now an rotated ellipsoid in general.
|
271
|
+
The local co-variance matrix of the data is used to
|
272
|
+
determine the orientation and the smoothing
|
273
|
+
lengths of the kernel. For this option the \verb$TypeOfSmoothing$
|
274
|
+
should be either 2 or 3 (i.e spherical kernel smoothing).
|
275
|
+
|
276
|
+
\begin{verbatim}
|
277
|
+
Anisotropy 0
|
278
|
+
\end{verbatim}
|
279
|
+
Depending upon the anisotropy of the
|
280
|
+
problem, density estimation with
|
281
|
+
anisotropic kernels can be
|
282
|
+
computationally very intensive. The
|
283
|
+
parameter \verb$Anisotropy$ can be used to
|
284
|
+
set the minimum allowable minor to major axis ratio of the
|
285
|
+
kernel smoothing lengths. Maximum
|
286
|
+
accuracy is achieved by setting the
|
287
|
+
value to zero while a value of $1$
|
288
|
+
corresponds to an isotropic kernel.
|
289
|
+
|
290
|
+
\begin{verbatim}
|
291
|
+
DesNumNgbA 100
|
292
|
+
\end{verbatim}
|
293
|
+
This is the number of neighbors used for
|
294
|
+
estimation of the co-varaince matrix, which is
|
295
|
+
in turn used for calculating the anisotropic kernel.
|
296
|
+
Its value should be between $100-200$. Setting this value
|
297
|
+
to less than 100, results in poor estimation of the
|
298
|
+
co-variance matrix.
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
\begin{verbatim}
|
304
|
+
TypeListOn 0
|
305
|
+
\end{verbatim}
|
306
|
+
It is possible to specify multiple species (types) of particles in the same initial
|
307
|
+
condition file. Each particle type is treated independently for the purpose
|
308
|
+
of density estimation and separate tree is constructed for each of them.
|
309
|
+
For Gadget format initial condition files the number of particle types is limited
|
310
|
+
to $6$. To overcome this limitation and to offer more flexibility the parameter
|
311
|
+
\verb$TypeListOn$ can be enabled by setting it to $1$. This overrides
|
312
|
+
the type of particles specified in the initial condition file.
|
313
|
+
If this parameter is set to 1 a typelist file in ascii text, with the name \verb$InitCondFile$ + suffix
|
314
|
+
\verb$_typelist$, should be provided.
|
315
|
+
If a total of $N$ particles are divided into $l$ independent groups of different types
|
316
|
+
having particles $n_1$, $n_2$ ... $n_l$ respectively such that $\sum n_i=N$, then
|
317
|
+
they can be read in by specifying this list in an ascii format in the typelist file as follows
|
318
|
+
\newline
|
319
|
+
\newline
|
320
|
+
$n_1 n_2 ... n_l $
|
321
|
+
\newline
|
322
|
+
|
323
|
+
\begin{verbatim}
|
324
|
+
PeriodicBoundaryOn 0
|
325
|
+
\end{verbatim}
|
326
|
+
Periodic boundary conditions can be enabled for Kernel based smoothing
|
327
|
+
by setting this parameter to $1$ and compiling the code with option \verb$-DPERIODIC$.
|
328
|
+
Periodicity of each dimension can be set independently.
|
329
|
+
A file \verb$periodic_lenghts.txt$ should be provided in the current
|
330
|
+
working directory, which contains the periodic lengths $l_i$, for each of the dimensions.
|
331
|
+
Boundary correction to the tree nodes as specified by parameter \verb$PartBound$
|
332
|
+
are not applied in the dimensions that are periodic.
|
333
|
+
If $l_i$ is set to zero the code automatically determines the appropriate
|
334
|
+
periodic length from the range of the particles in that dimension ($l \sim (x_{max}-x_{min})$).
|
335
|
+
If it is set to less than zero then that dimension is not considered periodic. In the code
|
336
|
+
this is achieved by setting $l \sim10 (x_{max}-x_{min})$) and enabling
|
337
|
+
\verb$PartBound$ for that dimension. Periodic support is as such not available
|
338
|
+
for FiEstAS smoothing, enabling periodic boundaries in this case
|
339
|
+
only effects the tesselation process (i.e boundary correction to the tree nodes).
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
|
344
|
+
\section{Input}
|
345
|
+
The data can be read from either an ASCII file, GADGET format file
|
346
|
+
or a user defined file format these can be invoked by setting the
|
347
|
+
parameter \verb$ICFormat$ to 0 , 1 and 2 respectively.
|
348
|
+
For GADGET format files the code can
|
349
|
+
read both little and big endian format binary files.
|
350
|
+
The endianness of the output file is the same as that of input file.
|
351
|
+
|
352
|
+
\subsection{ASCII input file format}
|
353
|
+
In ASCII format the co-ordinates of the data points are arranged in rows
|
354
|
+
as follows.
|
355
|
+
\newline
|
356
|
+
$x_1 y_1 z_1 $ \newline
|
357
|
+
$x_2 y_2 z_2 $ \newline
|
358
|
+
........so on \newline
|
359
|
+
|
360
|
+
\subsection{User defined file format}
|
361
|
+
The user can read in files of his own format by writing his own
|
362
|
+
reading routine. A template function \verb$ void read_ic2(char *fname)$
|
363
|
+
in file \verb$read_ic.cpp$ is provided for this.
|
364
|
+
The user should read his data and assign the co-ordinates to
|
365
|
+
a predefined structure.
|
366
|
+
Make the following changes in the function \verb$read_ic2$
|
367
|
+
\begin{verbatim}
|
368
|
+
/* SPECIFY TOTAL NUMBER OF PARTICLES*/
|
369
|
+
NumPart= specify total number of particles;
|
370
|
+
|
371
|
+
/* leave this unchanged */
|
372
|
+
//-------------------------------------
|
373
|
+
All.MaxPart = NumPart;
|
374
|
+
for(i=0;i<6;i++)
|
375
|
+
{
|
376
|
+
header1.npart[i]=0;
|
377
|
+
header1.npart[i]=0;
|
378
|
+
header1.mass[i]=0;
|
379
|
+
}
|
380
|
+
header1.npart[1]=NumPart;
|
381
|
+
header1.npartTotal[1]=NumPart;
|
382
|
+
allocate_memory();
|
383
|
+
//-------------------------------------
|
384
|
+
|
385
|
+
/* READ THE DATA HERE AND ASSIGN IT TO P[i].Pos */
|
386
|
+
for(i=1; i<=NumPart; i++)
|
387
|
+
for(k=0;k<ND;k++)
|
388
|
+
P[i].Pos[k]=assign positions;
|
389
|
+
for(i=1; i<=NumPart; i++)
|
390
|
+
P[i].Mass=assign mass or set it to 1;
|
391
|
+
\end{verbatim}
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
\subsection{GADGET input file format}
|
396
|
+
In a GADGET format file the data is written in binary mode and consists
|
397
|
+
of a header followed by the main data containing position
|
398
|
+
,velocities and id's of particles.
|
399
|
+
The data fields are
|
400
|
+
separated by block-size fields so that it can be read in with
|
401
|
+
unformatted fortran format. A description of these fields is given below.
|
402
|
+
Read statements in fortran would be as follows.
|
403
|
+
\begin{verbatim}
|
404
|
+
read (1) npart,massarr,a,redshift,flag1,flag2,nall,unused
|
405
|
+
read (1) pos
|
406
|
+
read (1) vel
|
407
|
+
read (1) id
|
408
|
+
read (1) masses
|
409
|
+
\end{verbatim}
|
410
|
+
The code can handle multiple species of particles and calculates the density
|
411
|
+
of each specie separately, but for a given specie all the particles must have
|
412
|
+
same mass or else the results might be erroneous.
|
413
|
+
For 6 dimensional phase space density estimation,
|
414
|
+
each particle has $6$ co-ordinates, the position of the particle
|
415
|
+
constitutes the first three co-ordinates and the three velocity
|
416
|
+
components are assigned co-ordinate numbers $4,5$ and $6$.
|
417
|
+
\newpage
|
418
|
+
\begin{table}[here]
|
419
|
+
\caption{Header}
|
420
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
421
|
+
\hline
|
422
|
+
\hline
|
423
|
+
Variable & Type & Bytes & Description\\
|
424
|
+
\hline
|
425
|
+
npart(6) & int & $4\times6$ & Array specifying number of particles of various types\\
|
426
|
+
massarr(6) & double & $8\times6$ & mass of different types of particles\\
|
427
|
+
a & double & 4 & Time or expansion factor\\
|
428
|
+
redshift & double & 4 & Redshift\\
|
429
|
+
flag1 & int & 4 & unused here \\
|
430
|
+
flag2 & int & 4 & unused here \\
|
431
|
+
nall(6) & int & $4\times6$ & Number of particles of each type, same as npart(6) here\\
|
432
|
+
flag3 & int & 4 & unused here \\
|
433
|
+
numfiles & int & 4 & number of files holding the data \\
|
434
|
+
boxsize & double & 4 & size of periodic box\\
|
435
|
+
omega-0 & double & 4 & Cosmological parameter specifying matter density \\
|
436
|
+
omega-l & double & 4 & Cosmological parameter specifying vacuum energy density\\
|
437
|
+
hubble-param & double & 4 & Hubble parameter \\
|
438
|
+
unused & & & used to fill the header to a total size of 256 bytes \\
|
439
|
+
\hline
|
440
|
+
\end{tabular}
|
441
|
+
%\end{table}
|
442
|
+
%\begin{table}[here]
|
443
|
+
\caption{Particle Positions}
|
444
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
445
|
+
\hline
|
446
|
+
\hline
|
447
|
+
Variable & Type & Bytes & Description\\
|
448
|
+
\hline
|
449
|
+
Pos(3,N) & float & $4 \times 3 \times N$ & position of particles\\
|
450
|
+
\hline
|
451
|
+
\end{tabular}
|
452
|
+
%\end{table}
|
453
|
+
%\begin{table}[here]
|
454
|
+
\caption{Particle Velocities}
|
455
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
456
|
+
\hline
|
457
|
+
\hline
|
458
|
+
Variable & Type & Bytes & Description\\
|
459
|
+
\hline
|
460
|
+
Vel(3,N) & float & $4 \times 3 \times N$ & velocities of particles\\
|
461
|
+
\hline
|
462
|
+
\end{tabular}
|
463
|
+
\end{table}
|
464
|
+
\newpage
|
465
|
+
\begin{table}[here]
|
466
|
+
\caption{Particle ID's}
|
467
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
468
|
+
\hline
|
469
|
+
\hline
|
470
|
+
Variable & Type & Bytes & Description\\
|
471
|
+
\hline
|
472
|
+
id(N) & int & $4 \times N$ & id of particles used to uniquely identify
|
473
|
+
them in case the order is not same among different files. \\
|
474
|
+
\hline
|
475
|
+
\end{tabular}
|
476
|
+
%\end{table}
|
477
|
+
%\begin{table}[h]
|
478
|
+
\caption{Particle Masses}
|
479
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
480
|
+
\hline
|
481
|
+
\hline
|
482
|
+
Variable & Type & Bytes & Description\\
|
483
|
+
\hline
|
484
|
+
mass(N) & int & $4 \times N$ & mass of those particles types which
|
485
|
+
have zero entries in massarr.\\
|
486
|
+
\hline
|
487
|
+
\end{tabular}
|
488
|
+
\end{table}
|
489
|
+
|
490
|
+
|
491
|
+
\section{Output}
|
492
|
+
The output file contains a list of densities at the location
|
493
|
+
of the data points (particles). The order is same as that
|
494
|
+
specified in the input file. For \verb$ICFormat=1$ ,
|
495
|
+
if the mass of the particles is specified the output
|
496
|
+
density is mass density.
|
497
|
+
For \verb$ICFormat=0$ mass of each particle is assumed
|
498
|
+
to be unity so the density evaluated by the code
|
499
|
+
is the number density instead of mass density.
|
500
|
+
The output in this case is written in ASCII format.
|
501
|
+
One can also specify ones own output format a template function
|
502
|
+
\verb$void savepositions_ioformat2(int )$ is provided for this in file
|
503
|
+
\verb$io.cpp$.
|
504
|
+
|
505
|
+
\setcounter{table}{0}
|
506
|
+
\subsection{EnBiD output file format}
|
507
|
+
For \verb$ICFormat=1$ the output is written in
|
508
|
+
a binary file with a GADGET format header and a list of densities.
|
509
|
+
Some extra flags are added in the header which might be useful for
|
510
|
+
reading the output densities. The data fields are
|
511
|
+
separated by block-size fields. A description of these fields
|
512
|
+
is given below. Read statements in fortran
|
513
|
+
would be as follows.
|
514
|
+
\begin{verbatim}
|
515
|
+
read (1) npart,massarr,a,redshift,flag1,flag2,nall,unused1
|
516
|
+
,flag-dim,flag-density,unused
|
517
|
+
read (1) density
|
518
|
+
\end{verbatim}
|
519
|
+
\newpage
|
520
|
+
\begin{table}[here]
|
521
|
+
\caption{Header}
|
522
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
523
|
+
\hline
|
524
|
+
\hline
|
525
|
+
Variable & Type & Bytes & Description\\
|
526
|
+
\hline
|
527
|
+
npart(6) & int & $4\times6$ & Array specifying number of particles of various types\\
|
528
|
+
massarr(6) & double & $8\times6$ & mass of different types of particles\\
|
529
|
+
a & double & 4 & Time or expansion factor\\
|
530
|
+
redshift & double & 4 & Redshift\\
|
531
|
+
flag1 & int & 4 & unused here \\
|
532
|
+
flag2 & int & 4 & unused here \\
|
533
|
+
nall(6) & int & $4\times6$ & Number of particles of each type, same as npart(6) here\\
|
534
|
+
flag3 & int & 4 & unused here \\
|
535
|
+
numfiles & int & 4 & number of files holding the data \\
|
536
|
+
boxsize & double & 4 & size of periodic box\\
|
537
|
+
omega-0 & double & 4 & Cosmological parameter specifying matter density \\
|
538
|
+
omega-l & double & 4 & Cosmological parameter specifying vacuum energy density\\
|
539
|
+
hubble-param & double & 4 & Hubble parameter \\
|
540
|
+
\hline
|
541
|
+
\textsf{flag-id} & int & 4 & unused here\\
|
542
|
+
\textsf{flag-dim} & int & 4 & number of dimensions used for density calculations \\
|
543
|
+
\textsf{flag-density} & int & 4 & indicates that it is a \verb$.est$
|
544
|
+
file containing densities and not a GADGET format file\\
|
545
|
+
\hline
|
546
|
+
unused & & & used to fill the header to a total size of 256 bytes \\
|
547
|
+
\hline
|
548
|
+
\end{tabular}
|
549
|
+
%\end{table}
|
550
|
+
%\begin{table}[h]
|
551
|
+
\caption{Particle Density}
|
552
|
+
\begin{tabular}{|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{6cm}|}
|
553
|
+
\hline
|
554
|
+
\hline
|
555
|
+
Variable & Type & Bytes & Description\\
|
556
|
+
\hline
|
557
|
+
Density(N) & float & $4 \times N$ & Calculated Density of particles \\
|
558
|
+
\hline
|
559
|
+
\end{tabular}
|
560
|
+
\end{table}
|
561
|
+
|
562
|
+
|
563
|
+
\section{Examples}
|
564
|
+
Two example data files are provided in the
|
565
|
+
directory \verb$Examples$. The file \newline
|
566
|
+
\verb$snapshot_ici$ in
|
567
|
+
directory \verb$uniform_6d_box_4$ is a GADGET format data
|
568
|
+
of $10^4$ particles distributed uniformly in a cubic box of
|
569
|
+
length $100$ units in both real and velocity space.
|
570
|
+
The file \verb$snapshot_ici.ascii$ is the corresponding ASCII
|
571
|
+
format file. The directory \verb$hernquist1_small$ contains
|
572
|
+
the data for a Hernquist sphere modelled with $10^4$ particles.
|
573
|
+
|
574
|
+
\section{General usage tips}
|
575
|
+
The main method of density estimation is the kernel based
|
576
|
+
method along with adaptive metric which is shown as option $3$
|
577
|
+
below, but the code also offers various other options for calculating densities.
|
578
|
+
More accurate estimates require more CPU time.
|
579
|
+
Below we list four main options in increasing order of accuracy
|
580
|
+
and CPU time. Parameterfiles for these can be found in the directory
|
581
|
+
parameterfile.
|
582
|
+
\begin{enumerate}
|
583
|
+
\item {\bf Unsmoothed estimate:} \newline
|
584
|
+
For fast crude estimates of any general data use
|
585
|
+
\begin{verbatim}
|
586
|
+
NodeSplittingCriterion=1
|
587
|
+
CubicCells= either 1 or 0 % 1 for symmetric systems 0 for general
|
588
|
+
TypeOfSmoothing=0
|
589
|
+
\end{verbatim}
|
590
|
+
\item {\bf FiEstAS smoothing:} \newline
|
591
|
+
For smooth densities with FiEstAS
|
592
|
+
style smoothing
|
593
|
+
\begin{verbatim}
|
594
|
+
TypeOfSmoothing=1
|
595
|
+
DesNumNgb=2-10
|
596
|
+
All.VolCorr=1
|
597
|
+
\end{verbatim}
|
598
|
+
\item {\bf Kernel smoothing with adaptive metric:} \newline
|
599
|
+
For kernel smoothed estimates set
|
600
|
+
\begin{verbatim}
|
601
|
+
TypeOfSmoothing=3
|
602
|
+
TypeOfKernel=3
|
603
|
+
KernelBiasCorrection=1
|
604
|
+
DesNumNgb=10-50
|
605
|
+
All.VolCorr=1
|
606
|
+
\end{verbatim}
|
607
|
+
\item {\bf Anisotropic kernel smoothing:} \newline
|
608
|
+
If one has more time one can also
|
609
|
+
use Anisotropic kernels with
|
610
|
+
\begin{verbatim}
|
611
|
+
TypeOfSmoothing= 3 or 2 % more faster with 2 but less accurate
|
612
|
+
AnisotropicKernel=1
|
613
|
+
Anisotropy=0
|
614
|
+
DesNumNgbA=100-200
|
615
|
+
\end{verbatim}
|
616
|
+
\end{enumerate}
|
617
|
+
\newpage
|
618
|
+
The table below gives the CPU time in seconds required on an AMD 1666.7 MHz
|
619
|
+
processor for calculating the density of a data
|
620
|
+
of 1 million particles modelled as a Hernquist sphere.
|
621
|
+
\begin{table}[here]
|
622
|
+
\begin{center}
|
623
|
+
\caption{Cpu Time}
|
624
|
+
\begin{tabular}{|p{6.0cm}|p{2.5cm}|p{2.5cm}|}
|
625
|
+
\hline
|
626
|
+
Type of Estimate & 6 Dimensions \\
|
627
|
+
\hline
|
628
|
+
\hline
|
629
|
+
Unsmoothed & 10-24 s \\
|
630
|
+
Fiestas smoothing & 356 s \\
|
631
|
+
Kernel smoothing with adaptive metric & 863 s \\
|
632
|
+
\hline
|
633
|
+
\end{tabular}
|
634
|
+
\end{center}
|
635
|
+
\end{table}
|
636
|
+
|
637
|
+
|
638
|
+
\begin{itemize}
|
639
|
+
\item For a hernquist sphere options 3 and 4
|
640
|
+
were found to give nearly same results.
|
641
|
+
This is because the anisotropy has already been corrected by means
|
642
|
+
of an adaptive metric.
|
643
|
+
\item For real and phase space density calculation of
|
644
|
+
systems with special symmetries e.g. spherical
|
645
|
+
systems use \verb$CubicCells=1$. Hernquist sphere and galactic halos
|
646
|
+
fall into this category.
|
647
|
+
\item For kernel smoothing on regularly spaced
|
648
|
+
data e.g. a lattice like system disable the parameter
|
649
|
+
\verb$KernelBiasCorrection$ by setting it to $0$.
|
650
|
+
\item
|
651
|
+
For FiEstAS smoothing all the particles of a given type must have same mass.
|
652
|
+
For other types of density estimation multiple mass support is available
|
653
|
+
but the density estimates are most accurate if the particles have same mass
|
654
|
+
or if at least their distribution in space is smooth.
|
655
|
+
\item The code has mostly been tested in 3 and 6 dimensions
|
656
|
+
and on systems having spherical symmetry in real and velocity sub-spaces.
|
657
|
+
For other situations it will be useful to first test the accuracy and
|
658
|
+
efficiency of the code by experimenting with the
|
659
|
+
parameters and options provided here.
|
660
|
+
\item Although the code can support arbitrary number of dimensions
|
661
|
+
but for kernel based smoothing, for dimensions greater than 20,
|
662
|
+
one needs to specify appropriate normalization constants of the kernel
|
663
|
+
in routine \newline\verb$set_sph_kernel$ (file \verb$begrun.cpp$).
|
664
|
+
For other schemes there is no restriction.
|
665
|
+
\item For FiEstAS smoothing of systems with periodic boundary conditions or well defined
|
666
|
+
rectangular boundaries use \verb$VolCorr=1$ to avoid under-estimation of densities
|
667
|
+
in boundary regions. Periodic support is as such not available
|
668
|
+
for FiEstAS smoothing, enabling periodic boundaries in this case
|
669
|
+
only effects the tesselation process (i.e boundary correction to the tree nodes).
|
670
|
+
\item
|
671
|
+
The mean splitting criterion gives better results as compared to median criterion,
|
672
|
+
for systems having substructures. But if one does not want to use adaptive metric
|
673
|
+
and instead wants to use isotropic kernels (i.e \verb$TypeOfSmoothing=2$ or $4$)
|
674
|
+
the code can be compiled with \verb$-DMEDIAN$
|
675
|
+
and used with \verb$MedianSplittingOn=1$, this results in faster density estimates.
|
676
|
+
\end{itemize}
|
677
|
+
|
678
|
+
|
679
|
+
\end{document}
|