mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
more general array-getting
This commit is contained in:
parent
1aaaeee224
commit
c59b393ed3
1 changed files with 3 additions and 3 deletions
|
@ -435,10 +435,10 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True):
|
|||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def getVoidArray(catalog, attr):
|
||||
def getArray(objectList, attr):
|
||||
|
||||
if hasattr(catalog.voids[0], attr):
|
||||
return np.fromiter((getattr(v, attr) for v in catalog.voids), float)
|
||||
if hasattr(objectList[0], attr):
|
||||
return np.fromiter((getattr(v, attr) for v in objectList), float)
|
||||
else:
|
||||
print " Attribute", attr, "not found!"
|
||||
return -1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue