mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-12 02:53:05 +00:00
removal of some cross-comparison scripts
This commit is contained in:
parent
4d6e653bda
commit
41e179da64
5 changed files with 0 additions and 495 deletions
|
@ -1,129 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#+
|
||||
# VIDE -- Void IDEntification pipeline -- ./pipeline/apAnalysis.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.
|
||||
#+
|
||||
|
||||
# takes a set of voids with given radii, and stacks and plots matches in
|
||||
# other catalogs
|
||||
|
||||
from void_python_tools.backend import *
|
||||
import imp
|
||||
import pickle
|
||||
import os
|
||||
import numpy as np
|
||||
import argparse
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
mergerNameBase = "mergerTree"
|
||||
|
||||
parser = argparse.ArgumentParser(description='Analyze.')
|
||||
parser.add_argument('--parm', dest='parm', default='datasetsToAnalyze.py', help='path to parameter file')
|
||||
args = parser.parse_args()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
filename = args.parm
|
||||
print " Loading parameters from", filename
|
||||
if not os.access(filename, os.F_OK):
|
||||
print " Cannot find parameter file %s!" % filename
|
||||
exit(-1)
|
||||
parms = imp.load_source("name", filename)
|
||||
globals().update(vars(parms))
|
||||
|
||||
if not os.access(dataDir, os.F_OK):
|
||||
os.makedirs(dataDir)
|
||||
|
||||
if not os.access(logDir, os.F_OK):
|
||||
os.makedirs(logDir)
|
||||
|
||||
mergerFileBase = dataDir + "/" + mergerNameBase
|
||||
|
||||
# get list of base voids
|
||||
with open(workDir+baseSampleDir+"/sample_info.dat", 'rb') as input:
|
||||
baseSample = pickle.load(input)
|
||||
baseSampleName = baseSample.fullName
|
||||
baseVoidList = np.loadtxt(workDir+baseSampleDir+"/untrimmed_centers_central_"+\
|
||||
baseSampleName+".out")
|
||||
|
||||
for stack in baseSample.stacks:
|
||||
print " Stack:", stack.rMin
|
||||
|
||||
accepted = (baseVoidList[:,4] > stack.rMin) & (baseVoidList[:,4] < stack.rMax)
|
||||
baseIDList = baseVoidList[:,7][accepted]
|
||||
|
||||
for (iSample, sampleDir) in enumerate(sampleDirList):
|
||||
with open(workDir+sampleDir+"/sample_info.dat", 'rb') as input:
|
||||
sample = pickle.load(input)
|
||||
|
||||
print " Working with", sample.fullName, "..."
|
||||
sys.stdout.flush()
|
||||
sampleName = sample.fullName
|
||||
|
||||
# get list of appropriate voids
|
||||
if sample.fullName == baseSample.fullName:
|
||||
idList = baseIDList
|
||||
else:
|
||||
matchList = np.loadtxt(mergerFileBase+"_"+baseSampleName+"_"+sampleName+\
|
||||
"_summary.out")
|
||||
idList = []
|
||||
for i,testID in enumerate(matchList[:,8]):
|
||||
if np.any(testID == baseIDList):
|
||||
idList.append(matchList[i,0])
|
||||
idList = np.array(idList)
|
||||
|
||||
idList = idList.astype(int)
|
||||
|
||||
print " Found", len(idList), "voids to work with"
|
||||
|
||||
voidBaseDir = workDir+"/"+sampleDir+"stacks"
|
||||
|
||||
runSuffix = getStackSuffix(stack.zMin, stack.zMax, stack.rMin,
|
||||
stack.rMax, dataPortion,
|
||||
customLine="selected")
|
||||
voidDir = voidBaseDir+"_"+runSuffix
|
||||
|
||||
if not os.access(voidDir,os.F_OK): os.makedirs(voidDir)
|
||||
|
||||
if len(idList) == 0:
|
||||
print " No voids here anyway, skipping..."
|
||||
continue
|
||||
|
||||
print " Stacking voids...",
|
||||
sys.stdout.flush()
|
||||
|
||||
STACK_PATH = CTOOLS_PATH+"/stacking/stackVoidsZero"
|
||||
|
||||
launchStack(sample, stack, STACK_PATH,
|
||||
thisDataPortion=dataPortion,
|
||||
logDir=logDir, voidDir=voidDir,
|
||||
zobovDir=workDir+"/"+sampleDir,
|
||||
freshStack=True, INCOHERENT=False,
|
||||
ranSeed=101010, summaryFile=None,
|
||||
continueRun=False,
|
||||
dataType=sample.dataType,
|
||||
idList=idList, rescaleOverride="")
|
||||
|
||||
print " Profiling stacks...",
|
||||
sys.stdout.flush()
|
||||
logFile = logDir+"/profile_"+sampleName+"_"+runSuffix+".out"
|
||||
launchProfile(sample, stack, voidDir=voidDir,
|
||||
logFile=logFile, continueRun=False)
|
||||
|
||||
print " Done!"
|
|
@ -1,44 +0,0 @@
|
|||
#+
|
||||
# VIDE -- Void IDEntification pipeline -- ./crossCompare/analysis/datasetsToAnalyze.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.
|
||||
#+
|
||||
#!/usr/bin/env python
|
||||
|
||||
|
||||
workDir = "/home/psutter2/workspace/Voids/"
|
||||
dataDir = "/home/psutter2/workspace/Voids/crossCompare/mergerTree/"
|
||||
|
||||
|
||||
CTOOLS_PATH = "../../c_tools/"
|
||||
|
||||
baseSampleDir = "mergertree512/mt_ss0.1/sample_md_ss0.1_z0.00_d00/"
|
||||
|
||||
sampleDirList = [
|
||||
"mergertree512/mt_ss1e-05/sample_md_ss1e-05_z0.00_d00/",
|
||||
#"mergertree512/mt_ss0.000175/sample_md_ss0.000175_z0.00_d00/",
|
||||
#"mergertree512/mt_ss0.0004/sample_md_ss0.0004_z0.00_d00/",
|
||||
#"mergertree512/mt_ss0.001/sample_md_ss0.001_z0.00_d00/",
|
||||
#"mergertree512/mt_ss0.002/sample_md_ss0.002_z0.00_d00/",
|
||||
"mergertree512/mt_ss0.01/sample_md_ss0.01_z0.00_d00/",
|
||||
"mergertree512/mt_hod_dr72dim2/sample_md_hod_dr72dim2_z0.00_d00/",
|
||||
"mergertree512/mt_hod_dr9mid/sample_md_hod_dr9mid_z0.00_d00/",
|
||||
"mergertree512/mt_halos_min1.2e+13/sample_md_halos_min1.2e+13_z0.00_d00/",
|
||||
]
|
||||
|
||||
dataPortion = "central"
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#+
|
||||
# VIDE -- Void IDEntification pipeline -- ./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.
|
||||
#+
|
||||
|
||||
from void_python_tools.backend import *
|
||||
from void_python_tools.plotting import *
|
||||
import imp
|
||||
import pickle
|
||||
import os
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import argparse
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
dataNameBase = "mergerTree"
|
||||
|
||||
parser = argparse.ArgumentParser(description='Analyze.')
|
||||
parser.add_argument('--parm', dest='parm', default='datasetsToAnalyze.py',
|
||||
help='path to parameter file')
|
||||
args = parser.parse_args()
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
filename = args.parm
|
||||
print " Loading parameters from", filename
|
||||
if not os.access(filename, os.F_OK):
|
||||
print " Cannot find parameter file %s!" % filename
|
||||
exit(-1)
|
||||
parms = imp.load_source("name", filename)
|
||||
globals().update(vars(parms))
|
||||
|
||||
if not os.access(dataDir, os.F_OK):
|
||||
os.makedirs(dataDir)
|
||||
|
||||
outFileName = dataDir + "/" + dataNameBase #+ ".dat"
|
||||
|
||||
with open(workDir+baseSampleDir+"/sample_info.dat", 'rb') as input:
|
||||
baseSample = pickle.load(input)
|
||||
|
||||
for (iSample, sampleDir) in enumerate(sampleDirList):
|
||||
|
||||
with open(workDir+sampleDir+"/sample_info.dat", 'rb') as input:
|
||||
sample = pickle.load(input)
|
||||
|
||||
print " Working with", sample.fullName, "...",
|
||||
sys.stdout.flush()
|
||||
|
||||
sampleName = sample.fullName
|
||||
|
||||
binPath = CTOOLS_PATH+"/analysis/voidOverlap"
|
||||
logFile = logDir+"/mergertree_"+baseSample.fullName+"_"+sampleName+".out"
|
||||
stepOutputFileName = outFileName + "_" + baseSample.fullName + "_" + \
|
||||
sampleName + "_"
|
||||
#stepOutputFileName = os.getcwd()+"/data/overlap_"
|
||||
|
||||
launchVoidOverlap(sample, baseSample, workDir+sampleDir,
|
||||
workDir+baseSampleDir, binPath,
|
||||
thisDataPortion="central", logFile=logFile,
|
||||
continueRun=False, workDir=workDir,
|
||||
outputFile=stepOutputFileName,
|
||||
matchMethod="useID")
|
||||
#matchMethod="prox")
|
||||
|
||||
# attach columns to summary file
|
||||
#if iSample == 1:
|
||||
# os.system("cp %s %s" % (stepOutputFileName, outFileName))
|
||||
#else:
|
||||
# outFile = open("temp.out", "w")
|
||||
# stepOutFile1 = open(outFileName, "r")
|
||||
# stepOutFile2 = open(stepOutputFileName, "r")
|
||||
#
|
||||
# for line1 in stepOutFile1:
|
||||
# line1 = line1.rstrip()
|
||||
# line2 = stepOutFile2.readline()
|
||||
# outFile.write(line1+" "+line2)
|
||||
#
|
||||
# os.system("cp %s %s" % ("temp.out", outFileName))
|
||||
# outFile.close()
|
||||
# stepOutFile1.close()
|
||||
# stepOutFile2.close()
|
||||
|
||||
#if os.access("mergerTree.log", os.F_OK): os.unlink("mergerTree.log")
|
||||
#if os.access("temp.out", os.F_OK): os.unlink("temp.out")
|
||||
#if os.access("thisStep.out", os.F_OK): os.unlink("thisStep.out")
|
||||
|
||||
print " Done!"
|
Loading…
Add table
Add a link
Reference in a new issue