mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
a few bug fixes
This commit is contained in:
parent
e69ebea9e8
commit
701d061172
2 changed files with 12 additions and 13 deletions
|
@ -344,7 +344,8 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
|||
eigenVecs = np.zeros((3,3)),
|
||||
))
|
||||
|
||||
print "Read %d voids" % len(catalog.voids)
|
||||
catalog.numVoids = len(catalog.voids)
|
||||
print "Read %d voids" % catalog.numVoids
|
||||
|
||||
print "Loading barycenters..."
|
||||
iLine = 0
|
||||
|
@ -461,7 +462,7 @@ def getArray(objectList, attr):
|
|||
attrArr[:,idim] = np.fromiter((np.atleast_1d(getattr(v, attr))[idim] \
|
||||
for v in objectList), float )
|
||||
|
||||
if ndim == 1: attrArr = attArr[:,0]
|
||||
if ndim == 1: attrArr = attrArr[:,0]
|
||||
|
||||
return attrArr
|
||||
else:
|
||||
|
|
|
@ -190,21 +190,19 @@ def getHSWProfile(density, radius):
|
|||
},
|
||||
]
|
||||
|
||||
if not np.any(density == samples[:]['name']):
|
||||
print "Sample", density," not found! Use one of ", samples[:]['name']
|
||||
return -1
|
||||
mySample = next((item for item in samples if item['name'] == density), None)
|
||||
if mySample == None:
|
||||
print "Sample", density," not found! Use one of ", [item['name'] for item in samples]
|
||||
return
|
||||
|
||||
# interpolate the radii
|
||||
for sample in samples:
|
||||
if not density == sample['name']: continue
|
||||
|
||||
rsFunc = interp1d( sample['rv'], sample['rs'], kind='cubic' )
|
||||
dcFunc = interp1d( sample['rv'], sample['dc'], kind='cubic' )
|
||||
rsFunc = interp1d( mySample['rv'], mySample['rs'], kind='cubic' )
|
||||
dcFunc = interp1d( mySample['rv'], mySample['dc'], kind='cubic' )
|
||||
|
||||
rs = rsFunc(radius)
|
||||
dc = dcFunc(radius)
|
||||
rs = rsFunc(radius)
|
||||
dc = dcFunc(radius)
|
||||
|
||||
# return best-fits
|
||||
rVals = np.linspace(0.0, 3*radius, 100) / radius
|
||||
return (rs,dc), rVals, HSWProfile(rVals,rs,dc)
|
||||
return (rs,dc), rVals*radius, HSWProfile(rVals,rs,dc)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue