mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
catalog loading routine now also includes edge flag and particle adjancy info
This commit is contained in:
parent
1a678eda5d
commit
ad752f21e8
1 changed files with 27 additions and 7 deletions
|
@ -435,12 +435,24 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
|||
y = partData[i][1],
|
||||
z = partData[i][2],
|
||||
volume = 0,
|
||||
adjs = 0,
|
||||
ra = extraData[i][0],
|
||||
dec = extraData[i][1],
|
||||
redshift = extraData[i][2],
|
||||
uniqueID = extraData[i][3]))
|
||||
uniqueID = extraData[i][3],
|
||||
edgeFlag = 0))
|
||||
|
||||
|
||||
if isObservationData:
|
||||
print(" Loading edge flags...")
|
||||
edgeFlagFile = sampleDir+"/galaxy_edge_flags.txt"
|
||||
if os.path.isfile(edgeFlagFile):
|
||||
edgeFlags = np.genfromtxt(edgeFlagFile, dtype=np.int32, skip_header=1)
|
||||
for iEdge in range(len(edgeFlags)):
|
||||
catalog.part[iEdge].edgeFlag = edgeFlags[iEdge]
|
||||
else:
|
||||
print(" Edge file not found!")
|
||||
|
||||
print(" Loading volumes...")
|
||||
if sample.hasWeightedVolumes:
|
||||
volFile = sampleDir+"/vol_weighted_"+sample.fullName+".dat"
|
||||
|
@ -452,6 +464,14 @@ def loadVoidCatalog(sampleDir, dataPortion="central", loadParticles=True,
|
|||
for ivol in range(len(vols)):
|
||||
catalog.part[ivol].volume = vols[ivol] / volNorm
|
||||
|
||||
print(" Loading adjacencies...")
|
||||
adjFile = sampleDir+"adj_"+sample.fullName+".dat"
|
||||
with open(adjFile, mode="rb") as File:
|
||||
numPart = np.fromfile(adjFile, dtype=np.int32,count=1)[0]
|
||||
for p in range(numPart):
|
||||
numAdjs = np.fromfile(File, dtype=np.int32,count=1)[0]
|
||||
catalog.part[p].adjs = np.fromfile(File, dtype=np.int32, count=numAdjs)
|
||||
|
||||
print(" Loading zone-void membership info...")
|
||||
zoneFile = sampleDir+"/voidZone_"+sample.fullName+".dat"
|
||||
catalog.void2Zones = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue