opts=get_vis_opts( output_dir, [0.03, 0.10], [[sex_shift + groups[0], sex_shift + groups[1]]])) logging.info('Visualize sex diffs for 3, 5') for group in (3, 5): curves_processor.visualize_mean_difference( input_dir, opts=get_vis_opts(output_dir, [0.03, 0.10], [[group, females_shift + group]])) def compute_means(slm, output_dir, log_file, slm_handling, args): curves_processor = common.get_processor(output_dir, log_file, args.verbose) logging.info('Preprocess curves') curves_processor.preprocess_curves(slm, True) logging.info('Analyze variability') curves_processor.analyze_variability(output_dir, output_dir, slm_handling=slm_handling) def process(output_slm_dir, log_file, slm_handling, slm, args): means_output_dir = MEANS_OUTPUT_BY_SLM_DIR % (slm, slm_handling) compute_means(slm, output_slm_dir, log_file, slm_handling, args) generate_means_visualization(output_slm_dir, means_output_dir, log_file, args) common.process_lms_handling(DATA_BY_SLM_DIR, process, common.args())
SUBDIRS_PAIRS = [['eneolit males', 'eneolit females'], ['bronz males', 'bronz females'], ['latén males', 'latén females'], ['raný střed males', 'raný střed females'], ['vrchol střed males', 'vrchol střed females'], ['pachner males', 'pachner females'], ['angio males', 'angio females']] def get_processor(input_dir, output_dir, log_file, group_index, verbose=False): common.mkdir_if_not_exist(output_dir) if log_file and not verbose: sys.stdout = open(os.path.join(output_dir, log_file), 'w') return processcurves.CurvesProcessor(input_dir, SUBDIRS_PAIRS[group_index], None, output_dir) def analyze_sexual_dimorphism(output_dir, log_file, slm_handling, slm, args): for group_index in range(len(GROUP_DIR)): group_output_dir = os.path.join(output_dir, GROUP_DIR[group_index]) curves_processor = get_processor(DATAFOLDER, group_output_dir, log_file, group_index, args.verbose) curves_processor.preprocess_curves(slm, True) curves_processor.analyze_variability(group_output_dir, group_output_dir, slm_handling=slm_handling) common.process_lms_handling(SEXDIMORPHISM_OUTPUT_DIR_BY_SLM, analyze_sexual_dimorphism, common.args())
#!/usr/bin/python3 import os from projects.tibiacurve import common ALLOMETRY_OUTPUT_DIR_BY_SLM = os.path.join(common.TARGET_ROOT, common.RESULT_FOLDER, 'allometry/sm%02d_%s') def analyze_allometry_slm(output_dir, log_file, slm_handling, slm, args): curves_processor = common.get_processor(output_dir, log_file, args.verbose, False) curves_processor.preprocess_curves(slm, True) curves_processor.analyze_allometry(output_dir, output_dir, slm_handling=slm_handling) common.process_lms_handling(ALLOMETRY_OUTPUT_DIR_BY_SLM, analyze_allometry_slm, common.args())
#!/usr/bin/python3 import os from projects.tibiacurve import common VARIABILITY_OUTPUT_DIR_BY_SLM = os.path.join(common.TARGET_ROOT, common.RESULT_FOLDER, 'variability/sm%02d_%s') def analyze_variability_slm(output_dir, log_file, slm_handling, slm, args): curves_processor = common.get_processor(output_dir, log_file, args.verbose) curves_processor.preprocess_curves(slm, True) curves_processor.analyze_variability(output_dir, output_dir, slm_handling=slm_handling) curves_processor.analyze_allometry(output_dir, output_dir, slm_handling=slm_handling) common.process_lms_handling(VARIABILITY_OUTPUT_DIR_BY_SLM, analyze_variability_slm, common.args())