From 47f6f88d1ea67a9de7595e8d4d899edf31cae16d Mon Sep 17 00:00:00 2001 From: "P.M. Sutter" Date: Wed, 28 May 2014 18:43:43 -0400 Subject: [PATCH] changed doSubSampling variable name; made shifting of z-coord with redshift optional --- pipeline/datasets/example_simulation.py | 4 +++- python_tools/pipeline_source/defaults.py | 7 +++++-- python_tools/pipeline_source/prepareInputs.in.py | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pipeline/datasets/example_simulation.py b/pipeline/datasets/example_simulation.py index c6d8ac4..148e0a3 100644 --- a/pipeline/datasets/example_simulation.py +++ b/pipeline/datasets/example_simulation.py @@ -99,8 +99,10 @@ redshifts = ["0.0"] subSamples = [1.0, 0.5] # if True, do the subsampling in preparation (only for sdf and multidark) -doSubSampling = True +doSubSamplingInPrep = True +# shift the z-coord of sims with redshift +shiftSimZ = False ############################################################################### # Halos diff --git a/python_tools/pipeline_source/defaults.py b/python_tools/pipeline_source/defaults.py index 75488d2..eda2d35 100644 --- a/python_tools/pipeline_source/defaults.py +++ b/python_tools/pipeline_source/defaults.py @@ -98,11 +98,14 @@ numSubvolumes = 1 # prefix to give all outputs prefix = "mt_" +# shift the z-coord of sims with redshift +shiftSimZ = False + # list of desired subsamples - see subSamplingMode parameter subSamples = [1.0] -doSubSampling = True # do the subsampling in preparation script? - # if False, generateMock will do the subsampling +doSubSamplingInPrep = True # do the subsampling in preparation script? + # if False, generateMock will do the subsampling # if 'absolute', subSamples are given in particles per cubic Mpc/h # if 'relative', subSamples are given as a fraction of input particles diff --git a/python_tools/pipeline_source/prepareInputs.in.py b/python_tools/pipeline_source/prepareInputs.in.py index 389f522..0d0f0bf 100644 --- a/python_tools/pipeline_source/prepareInputs.in.py +++ b/python_tools/pipeline_source/prepareInputs.in.py @@ -296,8 +296,12 @@ dataSampleList.append(newSample) sliceMinMpc = sliceMin*LIGHT_SPEED/100. sliceMaxMpc = sliceMax*LIGHT_SPEED/100. else: - sliceMinMpc = zBoxMpc + iSlice*lbox/numSlices - sliceMaxMpc = zBoxMpc + (iSlice+1)*lbox/numSlices + if shiftSimZ: + sliceMinMpc = zBoxMpc + iSlice*lbox/numSlices + sliceMaxMpc = zBoxMpc + (iSlice+1)*lbox/numSlices + else: + sliceMinMpc = iSlice*lbox/numSlices + sliceMaxMpc = (iSlice+1)*lbox/numSlices sliceMin = np.interp(sliceMinMpc*100./LIGHT_SPEED, zVsDX, zVsDY) sliceMax = np.interp(sliceMaxMpc*100./LIGHT_SPEED, zVsDX, zVsDY)