mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
Merged in python3 (pull request #5)
Port to python3, large code cleanup * Fixed command line for cosmotool * Fix path * Dump command line is log file * Fix important typo * Modify paths for example * Fix path again * Use an explicit constructor * Change file to open (python 2->3) * python3 fix for xrange in periodic_kdtree.py * Fixed index for Np, numPart, numZones, numZonesTot, partID, zoneID in catalogUtil.py
This commit is contained in:
parent
8249256508
commit
affb56ff48
392 changed files with 4092 additions and 260938 deletions
|
@ -1,83 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#+
|
||||
# VIDE -- Void IDentification and Examination -- ./crossCompare/analysis/mergerTree.py
|
||||
# Copyright (C) 2010-2013 Guilhem Lavaux
|
||||
# Copyright (C) 2011-2013 P. M. Sutter
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#+
|
||||
__all__=['compareCatalogs',]
|
||||
|
||||
from void_python_tools.backend import *
|
||||
import imp
|
||||
import pickle
|
||||
import os
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import argparse
|
||||
|
||||
def compareCatalogs(baseCatalogDir, compareCatalogDir,
|
||||
outputDir="./", logDir="./",
|
||||
matchMethod="useID", dataPortion="central",
|
||||
strictMatch=True,
|
||||
overlapFrac=0.25,
|
||||
pathToCTools="../../../c_tools"):
|
||||
|
||||
# reports the overlap between two void catalogs
|
||||
# baseCatalogDir: directory of catalog 1
|
||||
# compareCatagDir: directory of catalog 2
|
||||
# outputDir: directory to place outputs
|
||||
# logDir: directory to place log files
|
||||
# matchMethod: "useID" to use unique IDs, "prox" to use overlap of Voronoi cells
|
||||
# dataPortion: "central" or "all"
|
||||
# strictMatch: if True, only attempt to match to trimmed catalog
|
||||
# overlapFrac: threshold fraction of Voronoi radius to count as matched
|
||||
# pathToCTools: path to location of VIDE c_tools directory
|
||||
|
||||
if not os.access(outputDir, os.F_OK):
|
||||
os.makedirs(outputDir)
|
||||
|
||||
if not os.access(logDir, os.F_OK):
|
||||
os.makedirs(logDir)
|
||||
|
||||
outFileName = outputDir + "/" + "voidOverlap" #+ ".dat"
|
||||
|
||||
with open(baseCatalogDir+"/sample_info.dat", 'rb') as input:
|
||||
baseSample = pickle.load(input)
|
||||
|
||||
with open(compareCatalogDir+"/sample_info.dat", 'rb') as input:
|
||||
sample = pickle.load(input)
|
||||
|
||||
print " Comparing", baseSample.fullName, "to", sample.fullName, "...",
|
||||
sys.stdout.flush()
|
||||
|
||||
sampleName = sample.fullName
|
||||
|
||||
binPath = pathToCTools+"/analysis/voidOverlap"
|
||||
logFile = logDir+"/compare_"+baseSample.fullName+"_"+sampleName+".out"
|
||||
stepOutputFileName = outFileName + "_" + baseSample.fullName + "_" + \
|
||||
sampleName + "_"
|
||||
|
||||
launchVoidOverlap(baseSample, sample, baseCatalogDir,
|
||||
compareCatalogDir, binPath,
|
||||
thisDataPortion=dataPortion, logFile=logFile,
|
||||
continueRun=False,
|
||||
outputFile=stepOutputFileName,
|
||||
matchMethod=matchMethod,
|
||||
overlapFrac=overlapFrac,
|
||||
strictMatch=strictMatch)
|
||||
|
||||
print " Done!"
|
||||
return
|
Loading…
Add table
Add a link
Reference in a new issue