mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
made getArray more general; updated gitignore
This commit is contained in:
parent
76ea3567c8
commit
87445abfab
2 changed files with 16 additions and 1 deletions
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -4,6 +4,16 @@
|
||||||
.mydepend
|
.mydepend
|
||||||
./pipeline/miscTools/*.out
|
./pipeline/miscTools/*.out
|
||||||
|
|
||||||
|
c_tools/hod/hod
|
||||||
|
c_tools/zobov2/jozov2/jozov2
|
||||||
|
c_tools/zobov2/voz1b1/voz1b1_2
|
||||||
|
external/libsdf/Objfiles/
|
||||||
|
external/libsdf/apps/SDFcvt/SDFcvt.x86_64
|
||||||
|
pipeline/prepareInputs.py
|
||||||
|
zobov/jozov
|
||||||
|
zobov/voz1b1
|
||||||
|
zobov/vozinit
|
||||||
|
zobov/voztie
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles/
|
CMakeFiles/
|
||||||
Makefile
|
Makefile
|
||||||
|
|
|
@ -447,7 +447,12 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
||||||
def getArray(objectList, attr):
|
def getArray(objectList, attr):
|
||||||
|
|
||||||
if hasattr(objectList[0], attr):
|
if hasattr(objectList[0], attr):
|
||||||
return np.fromiter((getattr(v, attr) for v in objectList), float)
|
ndim = np.shape( np.atleast_1d( getattr(objectList[0], attr) ) )[0]
|
||||||
|
attrArr = np.zeros(( len(objectList), ndim ))
|
||||||
|
for idim in xrange(ndim):
|
||||||
|
attrArr[:,idim] = np.fromiter((np.atleast_1d(getattr(v, attr))[idim] \
|
||||||
|
for v in objectList), float )
|
||||||
|
return attrArr
|
||||||
else:
|
else:
|
||||||
print " Attribute", attr, "not found!"
|
print " Attribute", attr, "not found!"
|
||||||
return -1
|
return -1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue