mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
renamed 'generateMock' routines to 'prep' routines to accurately reflect what they do
This commit is contained in:
parent
b1962100a8
commit
50ad2d6d73
21 changed files with 69 additions and 89 deletions
26
.gitignore
vendored
26
.gitignore
vendored
|
@ -54,28 +54,12 @@ c_tools/mock/loaders/CMakeFiles/
|
|||
c_tools/mock/loaders/Makefile
|
||||
c_tools/mock/loaders/cmake_install.cmake
|
||||
c_tools/mock/loaders/libsimu_loaders.a
|
||||
c_tools/stacking/CMakeFiles/
|
||||
c_tools/stacking/Makefile
|
||||
c_tools/stacking/cmake_install.cmake
|
||||
c_tools/stacking/computeVelocityProfile
|
||||
c_tools/stacking/computeVelocityProfile_conf.c
|
||||
c_tools/stacking/computeVelocityProfile_conf.h
|
||||
c_tools/pruning/CMakeFiles/
|
||||
c_tools/pruning/Makefile
|
||||
c_tools/stacking/dumpVoidParticles.c
|
||||
c_tools/stacking/pruneVoids
|
||||
c_tools/stacking/pruneVoids_conf.c
|
||||
c_tools/stacking/pruneVoids_conf.h
|
||||
c_tools/stacking/stackDensityField
|
||||
c_tools/stacking/stackDensityField_conf.c
|
||||
c_tools/stacking/stackDensityField_conf.h
|
||||
c_tools/stacking/stackVelocityField
|
||||
c_tools/stacking/stackVelocityField_conf.c
|
||||
c_tools/stacking/stackVelocityField_conf.h
|
||||
c_tools/stacking/stackVoids
|
||||
c_tools/stacking/stackVoidsZero
|
||||
c_tools/stacking/stackVoidsZero_conf.c
|
||||
c_tools/stacking/stackVoidsZero_conf.h
|
||||
c_tools/stacking/stackVoids_conf.c
|
||||
c_tools/stacking/stackVoids_conf.h
|
||||
c_tools/pruning/pruneVoids
|
||||
c_tools/pruning/pruneVoids_conf.c
|
||||
c_tools/pruning/pruneVoids_conf.h
|
||||
c_tools/test/CMakeFiles/
|
||||
c_tools/test/Makefile
|
||||
c_tools/test/cmake_install.cmake
|
||||
|
|
|
@ -45,4 +45,4 @@ add_genopt(computeAverageDistortion_SRCS computeAverageDistortion.ggo computeAve
|
|||
#add_executable(computeAverageDistortion ${computeAverageDistortion_SRCS})
|
||||
#target_link_libraries(computeAverageDistortion ${ZOB_LIBS})
|
||||
|
||||
subdirs(libzobov mock pruning jozov2)
|
||||
subdirs(libzobov prep pruning jozov2)
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/loaders)
|
||||
|
||||
IF(SDF_SUPPORT)
|
||||
add_definitions(-DSDF_SUPPORT)
|
||||
ENDIF(SDF_SUPPORT)
|
||||
|
||||
SET(generateMock_SRCS generateMock.cpp )
|
||||
add_genopt(generateMock_SRCS generateMock.ggo generateMock_conf STRUCTNAME generateMock_info)
|
||||
add_executable(generateMock ${generateMock_SRCS})
|
||||
target_link_libraries(generateMock simu_loaders ${ZOB_LIBS} ${LIBSDF_LIBRARY} ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${DL_LIBRARY})
|
||||
|
||||
add_executable(generateTestMock generateTestMock.cpp)
|
||||
target_link_libraries(generateTestMock ${ZOB_LIBS})
|
||||
|
||||
|
||||
SET(generateFromCatalog_SRCS generateFromCatalog.cpp)
|
||||
add_genopt(generateFromCatalog_SRCS generateFromCatalog.ggo generateFromCatalog_conf STRUCTNAME generateFromCatalog_info)
|
||||
add_executable(generateFromCatalog ${generateFromCatalog_SRCS})
|
||||
target_link_libraries(generateFromCatalog ${ZOB_LIBS} ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${HEALPIX_LIBRARIES} ${DL_LIBRARY})
|
||||
|
||||
set_target_properties(generateFromCatalog PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||
|
||||
subdirs(loaders)
|
||||
|
||||
install(TARGETS generateMock generateTestMock generateFromCatalog DESTINATION ${VIDE_BIN})
|
||||
|
22
c_tools/prep/CMakeLists.txt
Normal file
22
c_tools/prep/CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/loaders)
|
||||
|
||||
IF(SDF_SUPPORT)
|
||||
add_definitions(-DSDF_SUPPORT)
|
||||
ENDIF(SDF_SUPPORT)
|
||||
|
||||
SET(prepSimulation_SRCS prepSimulation.cpp )
|
||||
add_genopt(prepSimulation_SRCS prepSimulation.ggo prepSimulation_conf STRUCTNAME prepSimulation_info)
|
||||
add_executable(prepSimulation ${prepSimulation_SRCS})
|
||||
target_link_libraries(prepSimulation simu_loaders ${ZOB_LIBS} ${LIBSDF_LIBRARY} ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${DL_LIBRARY})
|
||||
|
||||
SET(prepObservation_SRCS prepObservation.cpp)
|
||||
add_genopt(prepObservation_SRCS prepObservation.ggo prepObservation_conf STRUCTNAME prepObservation_info)
|
||||
add_executable(prepObservation ${prepObservation_SRCS})
|
||||
target_link_libraries(prepObservation ${ZOB_LIBS} ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_LIBRARIES} ${HEALPIX_LIBRARIES} ${DL_LIBRARY})
|
||||
|
||||
set_target_properties(prepObservation PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||
|
||||
subdirs(loaders)
|
||||
|
||||
install(TARGETS prepSimulation prepObservation DESTINATION ${VIDE_BIN})
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*+
|
||||
VIDE -- Void IDentification and Examination -- ./c_tools/mock/generateFromCatalog.cpp
|
||||
VIDE -- Void IDentification and Examination -- ./c_tools/mock/prepObservation.cpp
|
||||
Copyright (C) 2010-2014 Guilhem Lavaux
|
||||
Copyright (C) 2011-2014 P. M. Sutter
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
|||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "generateFromCatalog_conf.h"
|
||||
#include "prepObservation_conf.h"
|
||||
#include "contour_pixels.hpp"
|
||||
#include <netcdf>
|
||||
#include <CosmoTool/fortran.hpp>
|
||||
|
@ -121,7 +121,7 @@ void loadData(const string& fname, NYU_VData & data)
|
|||
}
|
||||
}
|
||||
|
||||
void generateGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
|
||||
void placeGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
|
||||
bool useComoving, double omegaM)
|
||||
{
|
||||
double d2r = M_PI/180;
|
||||
|
@ -223,7 +223,7 @@ void generateGalaxiesInCube(NYU_VData& data, ParticleData& output_data,
|
|||
gsl_interp_free(interp);
|
||||
}
|
||||
|
||||
void generateSurfaceMask(generateFromCatalog_info& args ,
|
||||
void generateSurfaceMask(prepObservation_info& args ,
|
||||
Healpix_Map<float>& mask,
|
||||
vector<int>& pixel_list,
|
||||
vector<int>& full_mask_list,
|
||||
|
@ -577,32 +577,32 @@ void saveForZobov(ParticleData& pdata, const string& fname, const string& paramn
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
generateFromCatalog_info args_info;
|
||||
generateFromCatalog_conf_params args_params;
|
||||
prepObservation_info args_info;
|
||||
prepObservation_conf_params args_params;
|
||||
|
||||
generateFromCatalog_conf_init(&args_info);
|
||||
generateFromCatalog_conf_params_init(&args_params);
|
||||
prepObservation_conf_init(&args_info);
|
||||
prepObservation_conf_params_init(&args_params);
|
||||
|
||||
args_params.check_required = 0;
|
||||
if (generateFromCatalog_conf_ext (argc, argv, &args_info, &args_params))
|
||||
if (prepObservation_conf_ext (argc, argv, &args_info, &args_params))
|
||||
return 1;
|
||||
|
||||
if (!args_info.configFile_given)
|
||||
{
|
||||
if (generateFromCatalog_conf_required (&args_info, GENERATEFROMCATALOG_CONF_PACKAGE))
|
||||
if (prepObservation_conf_required (&args_info, PREPOBSERVATION_CONF_PACKAGE))
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
args_params.check_required = 1;
|
||||
args_params.initialize = 0;
|
||||
if (generateFromCatalog_conf_config_file (args_info.configFile_arg,
|
||||
if (prepObservation_conf_config_file (args_info.configFile_arg,
|
||||
&args_info,
|
||||
&args_params))
|
||||
return 1;
|
||||
}
|
||||
|
||||
generateFromCatalog_conf_print_version();
|
||||
prepObservation_conf_print_version();
|
||||
|
||||
cout << "Loading data " << args_info.catalog_arg << "..." << endl;
|
||||
vector<NYU_Data> data;
|
||||
|
@ -628,7 +628,7 @@ int main(int argc, char **argv)
|
|||
// We compute a cube holding all the galaxies + the survey surface mask
|
||||
|
||||
cout << "Placing galaxies..." << endl;
|
||||
generateGalaxiesInCube(data, output_data, args_info.useComoving_flag,
|
||||
placeGalaxiesInCube(data, output_data, args_info.useComoving_flag,
|
||||
args_info.omegaM_arg);
|
||||
generateSurfaceMask(args_info, mask, pixel_list, full_mask_list,
|
||||
data, output_data,args_info.useComoving_flag,
|
|
@ -1,4 +1,4 @@
|
|||
package "generateFromCatalog"
|
||||
package "prepObservation"
|
||||
version "alpha"
|
||||
|
||||
option "configFile" - "Configuration filename" string optional
|
|
@ -1,5 +1,5 @@
|
|||
/*+
|
||||
VIDE -- Void IDentification and Examination -- ./c_tools/mock/generateMock.cpp
|
||||
VIDE -- Void IDentification and Examination -- ./c_tools/mock/prepSimulation.cpp
|
||||
Copyright (C) 2010-2014 Guilhem Lavaux
|
||||
Copyright (C) 2011-2014 P. M. Sutter
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
|||
#include <CosmoTool/interpolate.hpp>
|
||||
#include <CosmoTool/fortran.hpp>
|
||||
#include <CosmoTool/algo.hpp>
|
||||
#include "generateMock_conf.h"
|
||||
#include "prepSimulation_conf.h"
|
||||
#include "gslIntegrate.hpp"
|
||||
#include <netcdf>
|
||||
#include "simulation_loader.hpp"
|
||||
|
@ -267,7 +267,7 @@ void generateOutput(SimuData *data, int axis,
|
|||
|
||||
// This function prepares the list of targets for the specified snapshot. The target list is not
|
||||
// cleared. That way new particles can be appended if this is a multi-file snapshot.
|
||||
void selectBox(SimuData *simu, std::vector<long>& targets, generateMock_info& args_info, SimulationPreprocessor *preselect)
|
||||
void selectBox(SimuData *simu, std::vector<long>& targets, prepSimulation_info& args_info, SimulationPreprocessor *preselect)
|
||||
{
|
||||
double ranges[3][2] = {
|
||||
{ args_info.rangeX_min_arg, args_info.rangeX_max_arg },
|
||||
|
@ -331,7 +331,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
void createBox(SimuData *simu, vector<long>& targets, vector<long>& snapshot_split, SimuData *& boxed, generateMock_info& args_info)
|
||||
void createBox(SimuData *simu, vector<long>& targets, vector<long>& snapshot_split, SimuData *& boxed, prepSimulation_info& args_info)
|
||||
{
|
||||
double *ranges = new double[6];
|
||||
double *mul = new double[3];
|
||||
|
@ -424,7 +424,7 @@ void buildBox(SimuData *simu, long num_targets, long loaded,
|
|||
}
|
||||
}
|
||||
|
||||
void saveBox(SimuData *&boxed, const std::string& outbox, generateMock_info& args_info)
|
||||
void saveBox(SimuData *&boxed, const std::string& outbox, prepSimulation_info& args_info)
|
||||
{
|
||||
double *ranges = boxed->as<double>("ranges");
|
||||
NcFile f(outbox.c_str(), NcFile::replace);
|
||||
|
@ -479,7 +479,7 @@ void saveBox(SimuData *&boxed, const std::string& outbox, generateMock_info& arg
|
|||
v8.putVar({0}, {size_t(boxed->NumPart)}, velZ);
|
||||
}
|
||||
|
||||
void makeBoxFromParameter(SimuData *simu, SimuData* &boxed, generateMock_info& args_info)
|
||||
void makeBoxFromParameter(SimuData *simu, SimuData* &boxed, prepSimulation_info& args_info)
|
||||
{
|
||||
NcFile f(args_info.inputParameter_arg, NcFile::read);
|
||||
NcVar *v;
|
||||
|
@ -610,7 +610,7 @@ void makeBoxFromParameter(SimuData *simu, SimuData* &boxed, generateMock_info& a
|
|||
cout << "Num accepted here = " << pid_write << " / input = " << pid_read << endl;
|
||||
}
|
||||
|
||||
void makeBoxFromSimulation(SimulationLoader *loader, SimuData* &boxed, MetricFunctor metric, generateMock_info& args_info)
|
||||
void makeBoxFromSimulation(SimulationLoader *loader, SimuData* &boxed, MetricFunctor metric, prepSimulation_info& args_info)
|
||||
{
|
||||
vector<long> targets, split;
|
||||
long previous_target_num = 0;
|
||||
|
@ -647,34 +647,34 @@ void makeBoxFromSimulation(SimulationLoader *loader, SimuData* &boxed, MetricFun
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
generateMock_info args_info;
|
||||
generateMock_conf_params args_params;
|
||||
prepSimulation_info args_info;
|
||||
prepSimulation_conf_params args_params;
|
||||
SimuData *simu, *simuOut;
|
||||
SimulationLoader *loader;
|
||||
|
||||
generateMock_conf_init(&args_info);
|
||||
generateMock_conf_params_init(&args_params);
|
||||
prepSimulation_conf_init(&args_info);
|
||||
prepSimulation_conf_params_init(&args_params);
|
||||
|
||||
args_params.check_required = 0;
|
||||
if (generateMock_conf_ext (argc, argv, &args_info, &args_params))
|
||||
if (prepSimulation_conf_ext (argc, argv, &args_info, &args_params))
|
||||
return 1;
|
||||
|
||||
if (!args_info.configFile_given)
|
||||
{
|
||||
if (generateMock_conf_required (&args_info, GENERATEMOCK_CONF_PACKAGE))
|
||||
if (prepSimulation_conf_required (&args_info, PREPSIMULATION_CONF_PACKAGE))
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
args_params.check_required = 1;
|
||||
args_params.initialize = 0;
|
||||
if (generateMock_conf_config_file (args_info.configFile_arg,
|
||||
if (prepSimulation_conf_config_file (args_info.configFile_arg,
|
||||
&args_info,
|
||||
&args_params))
|
||||
return 1;
|
||||
}
|
||||
|
||||
generateMock_conf_print_version();
|
||||
prepSimulation_conf_print_version();
|
||||
|
||||
SimulationPreprocessor *preselector = new PreselectParticles(args_info.subsample_arg, args_info.subsample_seed_arg);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package "generateMock"
|
||||
package "prepSimulation"
|
||||
version "0"
|
||||
|
||||
option "configFile" - "Configuration file path" string optional
|
|
@ -46,9 +46,9 @@ ncFloat = 'f8' # Double precision
|
|||
LIGHT_SPEED = 299792.458
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
def launchGenerate(sample, binPath, workDir=None, inputDataDir=None,
|
||||
zobovDir=None, figDir=None, logFile=None, useComoving=False,
|
||||
continueRun=None,regenerate=False):
|
||||
def launchPrep(sample, binPath, workDir=None, inputDataDir=None,
|
||||
zobovDir=None, figDir=None, logFile=None, useComoving=False,
|
||||
continueRun=None,regenerate=False):
|
||||
|
||||
if sample.dataType == "observation":
|
||||
sampleName = sample.fullName
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#+
|
||||
|
||||
# Stage 1 : generate particles
|
||||
# Stage 1 : prepare particles for void finding
|
||||
# Stage 2 : find voids
|
||||
# Stage 3 : prune catalog
|
||||
|
||||
|
@ -89,14 +89,14 @@ for sample in dataSampleList:
|
|||
logFile = logDir+"/generate_"+sampleName+".out"
|
||||
|
||||
if sample.dataType == "observation":
|
||||
GENERATE_PATH = CTOOLS_PATH+"/generateFromCatalog"
|
||||
GENERATE_PATH = CTOOLS_PATH+"/prepObservation"
|
||||
else:
|
||||
GENERATE_PATH = CTOOLS_PATH+"/generateMock"
|
||||
GENERATE_PATH = CTOOLS_PATH+"/prepSimulation"
|
||||
|
||||
launchGenerate(sample, GENERATE_PATH, workDir=workDir,
|
||||
inputDataDir=inputDataDir, zobovDir=zobovDir,
|
||||
figDir=figDir, logFile=logFile, useComoving=sample.useComoving,
|
||||
continueRun=continueRun, regenerate=regenerateFlag)
|
||||
launchPrep(sample, GENERATE_PATH, workDir=workDir,
|
||||
inputDataDir=inputDataDir, zobovDir=zobovDir,
|
||||
figDir=figDir, logFile=logFile, useComoving=sample.useComoving,
|
||||
continueRun=continueRun, regenerate=regenerateFlag)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
if (startCatalogStage <= 2) and (endCatalogStage >= 2) and not sample.isCombo:
|
||||
|
@ -110,7 +110,7 @@ for sample in dataSampleList:
|
|||
# -------------------------------------------------------------------------
|
||||
if (startCatalogStage <= 3) and (endCatalogStage >= 3) and not sample.isCombo:
|
||||
|
||||
print(" Taking data portions", "...", end=' ')
|
||||
print(" Pruning void catalogs", "...", end=' ')
|
||||
sys.stdout.flush()
|
||||
|
||||
logFile = logDir+"/pruneVoids_"+sampleName+".out"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue