mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
temporarily putting mock particles for debugging purposes
This commit is contained in:
parent
4c6ec4ba82
commit
069c148303
1 changed files with 14 additions and 5 deletions
|
@ -100,7 +100,13 @@ def loadPart(sampleDir):
|
|||
uniqueID = np.fromfile(File, dtype=np.int64,count=Np)
|
||||
chk = np.fromfile(File, dtype=np.int32,count=1)
|
||||
|
||||
## TEST - outputting of mock particles is temporary for debugging
|
||||
mockPart = []
|
||||
if isObservation == 1:
|
||||
mockPartx = x[maskIndex+1:Np]
|
||||
mockParty = y[maskIndex+1:Np]
|
||||
mockPartz = z[maskIndex+1:Np]
|
||||
|
||||
x = x[0:maskIndex]# * 100/300000
|
||||
y = y[0:maskIndex]# * 100/300000
|
||||
z = z[0:maskIndex]# * 100/300000
|
||||
|
@ -110,8 +116,8 @@ def loadPart(sampleDir):
|
|||
uniqueID = uniqueID[0:maskIndex]
|
||||
|
||||
partData = np.column_stack((x,y,z))
|
||||
|
||||
extraData = np.column_stack((RA,Dec,redshift,uniqueID))
|
||||
mockPart = np.column_stack((mockPartx, mockParty, mockPartz))
|
||||
|
||||
boxLen = mul
|
||||
|
||||
|
@ -138,7 +144,7 @@ def loadPart(sampleDir):
|
|||
|
||||
isObservationData = isObservation == 1
|
||||
|
||||
return partData, boxLen, volNorm, isObservationData, ranges, extraData
|
||||
return partData, boxLen, volNorm, isObservationData, ranges, extraData, mockPart
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def getVolNorm(sampleDir):
|
||||
|
@ -434,10 +440,11 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
|||
|
||||
if loadParticles:
|
||||
print("Loading all particles...")
|
||||
partData, boxLen, volNorm, isObservationData, ranges, extraData = loadPart(sampleDir)
|
||||
partData, boxLen, volNorm, isObservationData, ranges, extraData, mockPart = loadPart(sampleDir)
|
||||
numPartTot = len(partData)
|
||||
catalog.numPartTot = numPartTot
|
||||
catalog.partPos = partData
|
||||
catalog.mockPart = mockPart
|
||||
catalog.part = []
|
||||
for i in range(len(partData)):
|
||||
catalog.part.append(Bunch(x = partData[i][0],
|
||||
|
@ -540,8 +547,10 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
|||
print(" Matching particles to voids...")
|
||||
for void in catalog.voids:
|
||||
voidID = void.voidID
|
||||
for zoneID in catalog.void2Zones[voidID].zoneIDs:
|
||||
for partID in catalog.zones2Parts[zoneID].partIDs:
|
||||
for iZ in range(catalog.void2Zones[voidID].numZones):
|
||||
zoneID = catalog.void2Zones[voidID].zoneIDs[iZ]
|
||||
for p in range(catalog.zones2Parts[zoneID].numPart):
|
||||
partID = catalog.zones2Parts[zoneID].partIDs[p]
|
||||
catalog.part[partID].voidID = voidID
|
||||
|
||||
print("Done loading catalog.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue