Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
readArray
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EAGLE
readArray
Commits
48f1fe1d
Commit
48f1fe1d
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Removed duplicated files
parent
dd9c1556
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example.py
+0
-70
0 additions, 70 deletions
example.py
profile.py
+0
-52
0 additions, 52 deletions
profile.py
with
0 additions
and
122 deletions
example.py
deleted
100644 → 0
+
0
−
70
View file @
dd9c1556
import
numpy
import
eagle
import
sys
import
os
sim
=
'
/cosma5/data/Eagle/ScienceRuns/Planck1/L0100N1504/PE/Z0p10_W1p00_E_3p0_0p3_ALPHA1p0e6_rhogas1_reposlim3p0soft_100mgas_cosma/data/
'
tag
=
'
028_z000p000
'
length_EA
=
eagle
.
readArray
(
"
FOF
"
,
sim
,
tag
,
"
FOF/GroupLength
"
)
#lengthType_EA = eagle.readArray("FOF", sim_EA, tag, "FOF/GroupLengthType")
offset_EA
=
eagle
.
readArray
(
"
FOF
"
,
sim
,
tag
,
"
FOF/GroupOffset
"
)
#print min(offset_EA), max(offset_EA)
offset_2
=
numpy
.
cumsum
(
length_EA
)
print
offset_2
offset_2
=
numpy
.
insert
(
offset_2
,
0
,
0
)
print
offset_2
#print min(offset_EA), max(offset_EA)
a
[
b
]
=
c
R_500
=
eagle
.
readArray
(
"
SUBFIND_GROUP
"
,
sim
,
tag
,
"
FOF/Group_R_Crit500
"
,
numThreads
=
64
)
R_2500
=
eagle
.
readArray
(
"
SUBFIND_GROUP
"
,
sim
,
tag
,
"
FOF/Group_R_Crit2500
"
,
numThreads
=
64
)
M_500
=
eagle
.
readArray
(
"
SUBFIND_GROUP
"
,
sim
,
tag
,
"
FOF/Group_M_Crit500
"
,
numThreads
=
64
)
*
1e10
ratio
=
R_500
/
R_2500
massBins
=
numpy
.
logspace
(
8.1
,
15.9
,
40
)
ratio_count
=
numpy
.
zeros
(
numpy
.
size
(
massBins
))
ratio_mean
=
numpy
.
zeros
(
numpy
.
size
(
massBins
))
ratio2_mean
=
numpy
.
zeros
(
numpy
.
size
(
massBins
))
for
i
in
range
(
numpy
.
size
(
R_500
)):
if
M_500
[
i
]
>
1e6
and
R_500
[
i
]
>
0.001
and
R_2500
[
i
]
>
0.001
:
bin
=
-
1
for
j
in
range
(
numpy
.
size
(
massBins
)
-
1
):
if
M_500
[
i
]
>
massBins
[
j
]
and
M_500
[
i
]
<
massBins
[
j
+
1
]:
bin
=
j
break
if
bin
!=
-
1
:
ratio_count
[
bin
]
=
ratio_count
[
bin
]
+
1
ratio_mean
[
bin
]
=
ratio_mean
[
bin
]
+
ratio
[
i
]
ratio2_mean
[
bin
]
=
ratio2_mean
[
bin
]
+
ratio
[
i
]
*
ratio
[
i
]
for
j
in
range
(
numpy
.
size
(
massBins
)):
if
ratio_count
[
j
]
!=
0
:
ratio_mean
[
j
]
=
ratio_mean
[
j
]
/
ratio_count
[
j
]
ratio2_mean
[
j
]
=
ratio2_mean
[
j
]
/
ratio_count
[
j
]
else
:
ratio_mean
[
j
]
=
0
ratio2_mean
[
j
]
=
0
ratio_sigma
=
numpy
.
sqrt
(
ratio2_mean
-
ratio_mean
*
ratio_mean
)
file
=
open
(
"
non_parametric_100_z0p0.dat
"
,
'
w
'
)
file
.
write
(
"
# M_500 mean sigma count
\n
"
)
for
j
in
range
(
numpy
.
size
(
massBins
)
-
1
):
file
.
write
(
"
%e %f %f %i
\n
"
%
(
10
**
(
0.5
*
(
numpy
.
log10
(
massBins
[
j
])
+
numpy
.
log10
(
massBins
[
j
+
1
]))),
ratio_mean
[
j
],
ratio_sigma
[
j
],
ratio_count
[
j
]))
file
.
close
()
This diff is collapsed.
Click to expand it.
profile.py
deleted
100644 → 0
+
0
−
52
View file @
dd9c1556
import
numpy
import
eagle
import
sys
import
os
sim
=
'
/cosma5/data/Eagle/ScienceRuns/Planck1/L0100N1504/PE/Z0p10_W1p00_E_3p0_0p3_ALPHA1p0e6_rhogas1_reposlim3p0soft_100mgas_cosma/data/
'
tag
=
'
028_z000p000
'
R_500
=
eagle
.
readArray
(
"
SUBFIND_GROUP
"
,
sim
,
tag
,
"
FOF/Group_R_Crit500
"
,
numThreads
=
64
)
R_2500
=
eagle
.
readArray
(
"
SUBFIND_GROUP
"
,
sim
,
tag
,
"
FOF/Group_R_Crit2500
"
,
numThreads
=
64
)
M_500
=
eagle
.
readArray
(
"
SUBFIND_GROUP
"
,
sim
,
tag
,
"
FOF/Group_M_Crit500
"
,
numThreads
=
64
)
*
1e10
ratio
=
R_500
/
R_2500
massBins
=
numpy
.
logspace
(
8.1
,
15.9
,
40
)
ratio_count
=
numpy
.
zeros
(
numpy
.
size
(
massBins
))
ratio_mean
=
numpy
.
zeros
(
numpy
.
size
(
massBins
))
ratio2_mean
=
numpy
.
zeros
(
numpy
.
size
(
massBins
))
for
i
in
range
(
numpy
.
size
(
R_500
)):
if
M_500
[
i
]
>
1e6
and
R_500
[
i
]
>
0.001
and
R_2500
[
i
]
>
0.001
:
bin
=
-
1
for
j
in
range
(
numpy
.
size
(
massBins
)
-
1
):
if
M_500
[
i
]
>
massBins
[
j
]
and
M_500
[
i
]
<
massBins
[
j
+
1
]:
bin
=
j
break
if
bin
!=
-
1
:
ratio_count
[
bin
]
=
ratio_count
[
bin
]
+
1
ratio_mean
[
bin
]
=
ratio_mean
[
bin
]
+
ratio
[
i
]
ratio2_mean
[
bin
]
=
ratio2_mean
[
bin
]
+
ratio
[
i
]
*
ratio
[
i
]
for
j
in
range
(
numpy
.
size
(
massBins
)):
if
ratio_count
[
j
]
!=
0
:
ratio_mean
[
j
]
=
ratio_mean
[
j
]
/
ratio_count
[
j
]
ratio2_mean
[
j
]
=
ratio2_mean
[
j
]
/
ratio_count
[
j
]
else
:
ratio_mean
[
j
]
=
0
ratio2_mean
[
j
]
=
0
ratio_sigma
=
numpy
.
sqrt
(
ratio2_mean
-
ratio_mean
*
ratio_mean
)
file
=
open
(
"
non_parametric_100_z0p0.dat
"
,
'
w
'
)
file
.
write
(
"
# M_500 mean sigma count
\n
"
)
for
j
in
range
(
numpy
.
size
(
massBins
)
-
1
):
file
.
write
(
"
%e %f %f %i
\n
"
%
(
10
**
(
0.5
*
(
numpy
.
log10
(
massBins
[
j
])
+
numpy
.
log10
(
massBins
[
j
+
1
]))),
ratio_mean
[
j
],
ratio_sigma
[
j
],
ratio_count
[
j
]))
file
.
close
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment