/* This code is auto-generated by the script tools/i3_build_options.py. There is no point in changing it. Adding new parameters is easy - just modify the top of that script. Adding new functions is a little more involved. */ #include "tools/i3_options.h" #include "i3_logging.h" void i3_options_destroy(i3_options * options){ free(options); } i3_options * i3_options_default(){ i3_options * options = malloc(sizeof(i3_options)); i3_options_set_defaults(options); return options; } int i3_options_read(i3_options * options, char * filename){ char line[i3_options_max_line_length]; FILE * option_file = fopen(filename,"r"); if (!option_file) I3_FATAL("Unable to load options file.",1); char parameter_name[i3_options_max_line_length]; char parameter_value[i3_options_max_line_length]; char * p; int invalid; int status=0; while(1){ p=fgets(line,i3_options_max_line_length,option_file); if (p==NULL) break; invalid = i3_options_split_parts(line, parameter_name, parameter_value); if (!invalid) status|=i3_options_handle_name_value(options, parameter_name,parameter_value); } return status; } void i3_options_read_command_line(i3_options * options, int argc, int start, char *argv[]){ char parameter_name[i3_options_max_line_length]; char parameter_value[i3_options_max_line_length]; char line[i3_options_max_line_length]; for (int i=start;imodel_name,"sersics"); options->noise_sigma = 1.0; strcpy(options->image_mask,""); options->background_subtract = true; options->rescale_stamp = true; options->verbosity = 0; options->save_images = false; options->save_output = false; strcpy(options->output_directory,"."); strcpy(options->output_filename,"im3shape_output.txt"); options->airy_psf = false; options->psf_truncation_pixels = 40.0; /* * Optimizer Options */ options->use_computed_start = true; options->minimizer_tolerance = 1e-09; options->levmar_eps1 = -1; options->levmar_eps2 = 1e-20; options->levmar_eps3 = -1; options->levmar_eps4 = 1e-07; options->levmar_eps5 = -1; options->levmar_tau = 1e-10; options->levmar_LM_INIT_MU = 1e-08; options->minimizer_max_iterations = 500; /* * Image Options */ options->stamp_size = 32; options->upsampling = 5; options->central_pixel_upsampling = true; options->n_central_pixel_upsampling = 9; options->n_central_pixels_to_upsample = 5; options->padding = 2; options->sersics_disc_truncation = 0.0; options->sersics_bulge_truncation = 0.0; /* * Options for model sersics */ options->sersics_x0_start = 20.0; options->sersics_y0_start = 20.0; options->sersics_e1_start = 0.0; options->sersics_e2_start = 0.0; options->sersics_radius_start = 2.7; options->sersics_radius_ratio_start = 1.0; options->sersics_bulge_A_start = 0.5; options->sersics_disc_A_start = 0.5; options->sersics_bulge_index_start = 4.0; options->sersics_disc_index_start = 1.0; options->sersics_delta_e_bulge_start = 0.0; options->sersics_delta_theta_bulge_start = 0.0; options->sersics_x0_width = 0.1; options->sersics_y0_width = 0.1; options->sersics_e1_width = 0.1; options->sersics_e2_width = 0.2; options->sersics_radius_width = 0.1; options->sersics_radius_ratio_width = 0.1; options->sersics_bulge_A_width = 0.3; options->sersics_disc_A_width = 0.2; options->sersics_bulge_index_width = 0.2; options->sersics_disc_index_width = 0.2; options->sersics_delta_e_bulge_width = 0.1; options->sersics_delta_theta_bulge_width = 0.1; options->sersics_x0_min = -20.0; options->sersics_y0_min = -20.0; options->sersics_e1_min = -0.95; options->sersics_e2_min = -0.95; options->sersics_radius_min = 0.1; options->sersics_radius_ratio_min = 0.001; options->sersics_bulge_A_min = 0.0; options->sersics_disc_A_min = 0.0; options->sersics_bulge_index_min = 0.5; options->sersics_disc_index_min = 0.5; options->sersics_delta_e_bulge_min = -0.5; options->sersics_delta_theta_bulge_min = -3.141593; options->sersics_x0_max = 60.0; options->sersics_y0_max = 60.0; options->sersics_e1_max = 0.95; options->sersics_e2_max = 0.95; options->sersics_radius_max = 50.0; options->sersics_radius_ratio_max = 1000; options->sersics_bulge_A_max = 10000.0; options->sersics_disc_A_max = 10000.0; options->sersics_bulge_index_max = 5.0; options->sersics_disc_index_max = 5.0; options->sersics_delta_e_bulge_max = 0.5; options->sersics_delta_theta_bulge_max = 3.141593; options->sersics_x0_fixed = false; options->sersics_y0_fixed = false; options->sersics_e1_fixed = false; options->sersics_e2_fixed = false; options->sersics_radius_fixed = false; options->sersics_radius_ratio_fixed = true; options->sersics_bulge_A_fixed = false; options->sersics_disc_A_fixed = false; options->sersics_bulge_index_fixed = true; options->sersics_disc_index_fixed = true; options->sersics_delta_e_bulge_fixed = true; options->sersics_delta_theta_bulge_fixed = true; /* * Options for model logsersics */ options->logsersics_x0_start = 20.0; options->logsersics_y0_start = 20.0; options->logsersics_e1_start = 0.0; options->logsersics_e2_start = 0.0; options->logsersics_radius_start = 2.7; options->logsersics_radius_ratio_start = 1.0; options->logsersics_bulge_A_start = -0.693; options->logsersics_disc_A_start = -0.693; options->logsersics_bulge_index_start = 4.0; options->logsersics_disc_index_start = 1.0; options->logsersics_delta_e_bulge_start = 0.0; options->logsersics_delta_theta_bulge_start = 0.0; options->logsersics_x0_width = 0.1; options->logsersics_y0_width = 0.1; options->logsersics_e1_width = 0.1; options->logsersics_e2_width = 0.2; options->logsersics_radius_width = 0.1; options->logsersics_radius_ratio_width = 0.1; options->logsersics_bulge_A_width = 0.3; options->logsersics_disc_A_width = 0.2; options->logsersics_bulge_index_width = 0.2; options->logsersics_disc_index_width = 0.2; options->logsersics_delta_e_bulge_width = 0.1; options->logsersics_delta_theta_bulge_width = 0.1; options->logsersics_x0_min = -20.0; options->logsersics_y0_min = -20.0; options->logsersics_e1_min = -0.95; options->logsersics_e2_min = -0.95; options->logsersics_radius_min = 0.1; options->logsersics_radius_ratio_min = 0.001; options->logsersics_bulge_A_min = -6.0; options->logsersics_disc_A_min = -6.0; options->logsersics_bulge_index_min = 2.0; options->logsersics_disc_index_min = 0.5; options->logsersics_delta_e_bulge_min = -0.5; options->logsersics_delta_theta_bulge_min = -3.141593; options->logsersics_x0_max = 60.0; options->logsersics_y0_max = 60.0; options->logsersics_e1_max = 0.95; options->logsersics_e2_max = 0.95; options->logsersics_radius_max = 50.0; options->logsersics_radius_ratio_max = 1000; options->logsersics_bulge_A_max = 2.0; options->logsersics_disc_A_max = 2.0; options->logsersics_bulge_index_max = 5.0; options->logsersics_disc_index_max = 2.0; options->logsersics_delta_e_bulge_max = 0.5; options->logsersics_delta_theta_bulge_max = 3.141593; options->logsersics_x0_fixed = false; options->logsersics_y0_fixed = false; options->logsersics_e1_fixed = false; options->logsersics_e2_fixed = false; options->logsersics_radius_fixed = false; options->logsersics_radius_ratio_fixed = true; options->logsersics_bulge_A_fixed = false; options->logsersics_disc_A_fixed = false; options->logsersics_bulge_index_fixed = true; options->logsersics_disc_index_fixed = true; options->logsersics_delta_e_bulge_fixed = true; options->logsersics_delta_theta_bulge_fixed = true; /* * Options for model quadratic_test */ options->quadratic_test_x1_start = 0.0; options->quadratic_test_x2_start = 0.0; options->quadratic_test_x3_start = 0.0; options->quadratic_test_x4_start = 0.0; { float tmp_value[3] = {0.2, 0.2, 0.2}; memcpy(options->quadratic_test_x5_start,tmp_value,sizeof(options->quadratic_test_x5_start));} options->quadratic_test_x1_width = 0.1; options->quadratic_test_x2_width = 0.1; options->quadratic_test_x3_width = 0.1; options->quadratic_test_x4_width = 0.1; { float tmp_value[3] = {0.2, 0.2, 0.2}; memcpy(options->quadratic_test_x5_width,tmp_value,sizeof(options->quadratic_test_x5_width));} options->quadratic_test_x1_min = 0.0; options->quadratic_test_x2_min = 0.0; options->quadratic_test_x3_min = 0.0; options->quadratic_test_x4_min = 0.0; { float tmp_value[3] = {-1.0, -1.0, -1.0}; memcpy(options->quadratic_test_x5_min,tmp_value,sizeof(options->quadratic_test_x5_min));} options->quadratic_test_x1_max = 1.0; options->quadratic_test_x2_max = 1.0; options->quadratic_test_x3_max = 1.0; options->quadratic_test_x4_max = 1.0; { float tmp_value[3] = {1.0, 1.0, 1.0}; memcpy(options->quadratic_test_x5_max,tmp_value,sizeof(options->quadratic_test_x5_max));} options->quadratic_test_x1_fixed = false; options->quadratic_test_x2_fixed = false; options->quadratic_test_x3_fixed = false; options->quadratic_test_x4_fixed = false; options->quadratic_test_x5_fixed = false; /* * Options for model multisersics */ options->multisersics_ra_as_start = 0.0; options->multisersics_dec_as_start = 0.0; options->multisersics_e1_start = 0.0; options->multisersics_e2_start = 0.0; options->multisersics_radius_start = 2.7; options->multisersics_radius_ratio_start = 1.0; options->multisersics_bulge_A_start = 0.5; options->multisersics_disc_A_start = 0.5; options->multisersics_bulge_index_start = 4.0; options->multisersics_disc_index_start = 1.0; options->multisersics_ra_as_width = 0.1; options->multisersics_dec_as_width = 0.1; options->multisersics_e1_width = 0.1; options->multisersics_e2_width = 0.2; options->multisersics_radius_width = 0.1; options->multisersics_radius_ratio_width = 0.1; options->multisersics_bulge_A_width = 0.3; options->multisersics_disc_A_width = 0.2; options->multisersics_bulge_index_width = 0.2; options->multisersics_disc_index_width = 0.2; options->multisersics_ra_as_min = -20.0; options->multisersics_dec_as_min = -20.0; options->multisersics_e1_min = -0.95; options->multisersics_e2_min = -0.95; options->multisersics_radius_min = 0.1; options->multisersics_radius_ratio_min = 0.001; options->multisersics_bulge_A_min = 0.0; options->multisersics_disc_A_min = 0.0; options->multisersics_bulge_index_min = 0.5; options->multisersics_disc_index_min = 0.5; options->multisersics_ra_as_max = 20.0; options->multisersics_dec_as_max = 20.0; options->multisersics_e1_max = 0.95; options->multisersics_e2_max = 0.95; options->multisersics_radius_max = 50.0; options->multisersics_radius_ratio_max = 1000; options->multisersics_bulge_A_max = 10000.0; options->multisersics_disc_A_max = 10000.0; options->multisersics_bulge_index_max = 5.0; options->multisersics_disc_index_max = 5.0; options->multisersics_ra_as_fixed = false; options->multisersics_dec_as_fixed = false; options->multisersics_e1_fixed = false; options->multisersics_e2_fixed = false; options->multisersics_radius_fixed = false; options->multisersics_radius_ratio_fixed = true; options->multisersics_bulge_A_fixed = false; options->multisersics_disc_A_fixed = false; options->multisersics_bulge_index_fixed = true; options->multisersics_disc_index_fixed = true; /* * Options for model multixray */ options->multixray_alpha_arcsec_start = 0.0; options->multixray_delta_arcsec_start = 0.0; options->multixray_e1_start = 0.0; options->multixray_e2_start = 0.0; options->multixray_rc_start = 2.0; options->multixray_A_start = 1.0; options->multixray_beta_start = 0.666666666667; { float tmp_value[30] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; memcpy(options->multixray_background_start,tmp_value,sizeof(options->multixray_background_start));} options->multixray_alpha_arcsec_width = 0.1; options->multixray_delta_arcsec_width = 0.1; options->multixray_e1_width = 0.1; options->multixray_e2_width = 0.2; options->multixray_rc_width = 0.1; options->multixray_A_width = 0.3; options->multixray_beta_width = 0.3; { float tmp_value[30] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1}; memcpy(options->multixray_background_width,tmp_value,sizeof(options->multixray_background_width));} options->multixray_alpha_arcsec_min = -20.0; options->multixray_delta_arcsec_min = -20.0; options->multixray_e1_min = -0.95; options->multixray_e2_min = -0.95; options->multixray_rc_min = 0.1; options->multixray_A_min = 0.0; options->multixray_beta_min = 0.166666666667; { float tmp_value[30] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; memcpy(options->multixray_background_min,tmp_value,sizeof(options->multixray_background_min));} options->multixray_alpha_arcsec_max = 60.0; options->multixray_delta_arcsec_max = 60.0; options->multixray_e1_max = 0.95; options->multixray_e2_max = 0.95; options->multixray_rc_max = 50; options->multixray_A_max = 10.0; options->multixray_beta_max = 3.0; { float tmp_value[30] = {10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0}; memcpy(options->multixray_background_max,tmp_value,sizeof(options->multixray_background_max));} options->multixray_alpha_arcsec_fixed = false; options->multixray_delta_arcsec_fixed = false; options->multixray_e1_fixed = false; options->multixray_e2_fixed = false; options->multixray_rc_fixed = false; options->multixray_A_fixed = false; options->multixray_beta_fixed = false; options->multixray_background_fixed = true; /* * Advanced Options - THESE ARE EXPERIMENTAL - USE AT OWN RISK */ options->do_mcmc = false; options->minimizer_loops = 1; options->save_sersics = false; strcpy(options->psf_input,"moffat_catalog"); options->perform_pixel_integration = true; options->use_segmentation_mask = false; strcpy(options->segmentation_mask_filename,""); options->use_hankel_transform = false; options->sersics_beermat_amplitudes_positive = false; strcpy(options->sersic_lookup_file,"/home/jaz/im3shape-grid/im3shape/data/HankelSersic_table.fits"); options->levmar_use_analytic_gradients = false; options->levmar_check_analytic_gradients = false; options->image_generator_resolution_high = false; options->minimizer_verbosity = 0; options->minimizer_method = 0; options->poisson_errors = false; options->timeit = false; options->circularize_mask = false; /* * MCMC Options - EXPERIMENTAL */ options->number_samples = 20000; options->burn_length = 100; options->tuning_phase = 100; options->scaling = 2.4; options->do_rotation = true; options->mcmc_tune_covmat = true; options->max_annealing_temperature = 2.0; options->annealing_one_point = 0.5; options->adaptive_metropolis_interval = 100; options->climbing_only = false; strcpy(options->mcmc_filename_base,""); options->use_mcmc_mean = false; options->use_mcmc_sample = false; options->print_mcmc_samples = false; /* * MEDS Options - Probably DES only */ options->starting_params_only = false; options->rescale_weight = false; options->uberseg = true; options->use_image_flags = true; options->reject_outliers = true; strcpy(options->replace_psf_path,""); strcpy(options->psfex_rerun_version,""); options->database_output = false; } void i3_options_fprintf(i3_options * options, FILE * outfile){ fprintf(outfile,"# Basic Options\n"); fprintf(outfile,"model_name = %s\n",options->model_name); fprintf(outfile,"noise_sigma = %f\n",options->noise_sigma); fprintf(outfile,"image_mask = %s\n",options->image_mask); fprintf(outfile,"background_subtract = %d\n",options->background_subtract); fprintf(outfile,"rescale_stamp = %d\n",options->rescale_stamp); fprintf(outfile,"verbosity = %d\n",options->verbosity); fprintf(outfile,"save_images = %d\n",options->save_images); fprintf(outfile,"save_output = %d\n",options->save_output); fprintf(outfile,"output_directory = %s\n",options->output_directory); fprintf(outfile,"output_filename = %s\n",options->output_filename); fprintf(outfile,"airy_psf = %d\n",options->airy_psf); fprintf(outfile,"psf_truncation_pixels = %f\n",options->psf_truncation_pixels); fprintf(outfile,"\n"); fprintf(outfile,"# Optimizer Options\n"); fprintf(outfile,"use_computed_start = %d\n",options->use_computed_start); fprintf(outfile,"minimizer_tolerance = %f\n",options->minimizer_tolerance); fprintf(outfile,"levmar_eps1 = %f\n",options->levmar_eps1); fprintf(outfile,"levmar_eps2 = %f\n",options->levmar_eps2); fprintf(outfile,"levmar_eps3 = %f\n",options->levmar_eps3); fprintf(outfile,"levmar_eps4 = %f\n",options->levmar_eps4); fprintf(outfile,"levmar_eps5 = %f\n",options->levmar_eps5); fprintf(outfile,"levmar_tau = %f\n",options->levmar_tau); fprintf(outfile,"levmar_LM_INIT_MU = %f\n",options->levmar_LM_INIT_MU); fprintf(outfile,"minimizer_max_iterations = %d\n",options->minimizer_max_iterations); fprintf(outfile,"\n"); fprintf(outfile,"# Image Options\n"); fprintf(outfile,"stamp_size = %d\n",options->stamp_size); fprintf(outfile,"upsampling = %d\n",options->upsampling); fprintf(outfile,"central_pixel_upsampling = %d\n",options->central_pixel_upsampling); fprintf(outfile,"n_central_pixel_upsampling = %d\n",options->n_central_pixel_upsampling); fprintf(outfile,"n_central_pixels_to_upsample = %d\n",options->n_central_pixels_to_upsample); fprintf(outfile,"padding = %d\n",options->padding); fprintf(outfile,"sersics_disc_truncation = %f\n",options->sersics_disc_truncation); fprintf(outfile,"sersics_bulge_truncation = %f\n",options->sersics_bulge_truncation); fprintf(outfile,"\n"); fprintf(outfile,"# Options for model sersics\n"); fprintf(outfile,"sersics_x0_start = %f\n",options->sersics_x0_start); fprintf(outfile,"sersics_y0_start = %f\n",options->sersics_y0_start); fprintf(outfile,"sersics_e1_start = %f\n",options->sersics_e1_start); fprintf(outfile,"sersics_e2_start = %f\n",options->sersics_e2_start); fprintf(outfile,"sersics_radius_start = %f\n",options->sersics_radius_start); fprintf(outfile,"sersics_radius_ratio_start = %f\n",options->sersics_radius_ratio_start); fprintf(outfile,"sersics_bulge_A_start = %f\n",options->sersics_bulge_A_start); fprintf(outfile,"sersics_disc_A_start = %f\n",options->sersics_disc_A_start); fprintf(outfile,"sersics_bulge_index_start = %f\n",options->sersics_bulge_index_start); fprintf(outfile,"sersics_disc_index_start = %f\n",options->sersics_disc_index_start); fprintf(outfile,"sersics_delta_e_bulge_start = %f\n",options->sersics_delta_e_bulge_start); fprintf(outfile,"sersics_delta_theta_bulge_start = %f\n",options->sersics_delta_theta_bulge_start); fprintf(outfile,"sersics_x0_width = %f\n",options->sersics_x0_width); fprintf(outfile,"sersics_y0_width = %f\n",options->sersics_y0_width); fprintf(outfile,"sersics_e1_width = %f\n",options->sersics_e1_width); fprintf(outfile,"sersics_e2_width = %f\n",options->sersics_e2_width); fprintf(outfile,"sersics_radius_width = %f\n",options->sersics_radius_width); fprintf(outfile,"sersics_radius_ratio_width = %f\n",options->sersics_radius_ratio_width); fprintf(outfile,"sersics_bulge_A_width = %f\n",options->sersics_bulge_A_width); fprintf(outfile,"sersics_disc_A_width = %f\n",options->sersics_disc_A_width); fprintf(outfile,"sersics_bulge_index_width = %f\n",options->sersics_bulge_index_width); fprintf(outfile,"sersics_disc_index_width = %f\n",options->sersics_disc_index_width); fprintf(outfile,"sersics_delta_e_bulge_width = %f\n",options->sersics_delta_e_bulge_width); fprintf(outfile,"sersics_delta_theta_bulge_width = %f\n",options->sersics_delta_theta_bulge_width); fprintf(outfile,"sersics_x0_min = %f\n",options->sersics_x0_min); fprintf(outfile,"sersics_y0_min = %f\n",options->sersics_y0_min); fprintf(outfile,"sersics_e1_min = %f\n",options->sersics_e1_min); fprintf(outfile,"sersics_e2_min = %f\n",options->sersics_e2_min); fprintf(outfile,"sersics_radius_min = %f\n",options->sersics_radius_min); fprintf(outfile,"sersics_radius_ratio_min = %f\n",options->sersics_radius_ratio_min); fprintf(outfile,"sersics_bulge_A_min = %f\n",options->sersics_bulge_A_min); fprintf(outfile,"sersics_disc_A_min = %f\n",options->sersics_disc_A_min); fprintf(outfile,"sersics_bulge_index_min = %f\n",options->sersics_bulge_index_min); fprintf(outfile,"sersics_disc_index_min = %f\n",options->sersics_disc_index_min); fprintf(outfile,"sersics_delta_e_bulge_min = %f\n",options->sersics_delta_e_bulge_min); fprintf(outfile,"sersics_delta_theta_bulge_min = %f\n",options->sersics_delta_theta_bulge_min); fprintf(outfile,"sersics_x0_max = %f\n",options->sersics_x0_max); fprintf(outfile,"sersics_y0_max = %f\n",options->sersics_y0_max); fprintf(outfile,"sersics_e1_max = %f\n",options->sersics_e1_max); fprintf(outfile,"sersics_e2_max = %f\n",options->sersics_e2_max); fprintf(outfile,"sersics_radius_max = %f\n",options->sersics_radius_max); fprintf(outfile,"sersics_radius_ratio_max = %f\n",options->sersics_radius_ratio_max); fprintf(outfile,"sersics_bulge_A_max = %f\n",options->sersics_bulge_A_max); fprintf(outfile,"sersics_disc_A_max = %f\n",options->sersics_disc_A_max); fprintf(outfile,"sersics_bulge_index_max = %f\n",options->sersics_bulge_index_max); fprintf(outfile,"sersics_disc_index_max = %f\n",options->sersics_disc_index_max); fprintf(outfile,"sersics_delta_e_bulge_max = %f\n",options->sersics_delta_e_bulge_max); fprintf(outfile,"sersics_delta_theta_bulge_max = %f\n",options->sersics_delta_theta_bulge_max); fprintf(outfile,"sersics_x0_fixed = %d\n",options->sersics_x0_fixed); fprintf(outfile,"sersics_y0_fixed = %d\n",options->sersics_y0_fixed); fprintf(outfile,"sersics_e1_fixed = %d\n",options->sersics_e1_fixed); fprintf(outfile,"sersics_e2_fixed = %d\n",options->sersics_e2_fixed); fprintf(outfile,"sersics_radius_fixed = %d\n",options->sersics_radius_fixed); fprintf(outfile,"sersics_radius_ratio_fixed = %d\n",options->sersics_radius_ratio_fixed); fprintf(outfile,"sersics_bulge_A_fixed = %d\n",options->sersics_bulge_A_fixed); fprintf(outfile,"sersics_disc_A_fixed = %d\n",options->sersics_disc_A_fixed); fprintf(outfile,"sersics_bulge_index_fixed = %d\n",options->sersics_bulge_index_fixed); fprintf(outfile,"sersics_disc_index_fixed = %d\n",options->sersics_disc_index_fixed); fprintf(outfile,"sersics_delta_e_bulge_fixed = %d\n",options->sersics_delta_e_bulge_fixed); fprintf(outfile,"sersics_delta_theta_bulge_fixed = %d\n",options->sersics_delta_theta_bulge_fixed); fprintf(outfile,"\n"); fprintf(outfile,"# Options for model logsersics\n"); fprintf(outfile,"logsersics_x0_start = %f\n",options->logsersics_x0_start); fprintf(outfile,"logsersics_y0_start = %f\n",options->logsersics_y0_start); fprintf(outfile,"logsersics_e1_start = %f\n",options->logsersics_e1_start); fprintf(outfile,"logsersics_e2_start = %f\n",options->logsersics_e2_start); fprintf(outfile,"logsersics_radius_start = %f\n",options->logsersics_radius_start); fprintf(outfile,"logsersics_radius_ratio_start = %f\n",options->logsersics_radius_ratio_start); fprintf(outfile,"logsersics_bulge_A_start = %f\n",options->logsersics_bulge_A_start); fprintf(outfile,"logsersics_disc_A_start = %f\n",options->logsersics_disc_A_start); fprintf(outfile,"logsersics_bulge_index_start = %f\n",options->logsersics_bulge_index_start); fprintf(outfile,"logsersics_disc_index_start = %f\n",options->logsersics_disc_index_start); fprintf(outfile,"logsersics_delta_e_bulge_start = %f\n",options->logsersics_delta_e_bulge_start); fprintf(outfile,"logsersics_delta_theta_bulge_start = %f\n",options->logsersics_delta_theta_bulge_start); fprintf(outfile,"logsersics_x0_width = %f\n",options->logsersics_x0_width); fprintf(outfile,"logsersics_y0_width = %f\n",options->logsersics_y0_width); fprintf(outfile,"logsersics_e1_width = %f\n",options->logsersics_e1_width); fprintf(outfile,"logsersics_e2_width = %f\n",options->logsersics_e2_width); fprintf(outfile,"logsersics_radius_width = %f\n",options->logsersics_radius_width); fprintf(outfile,"logsersics_radius_ratio_width = %f\n",options->logsersics_radius_ratio_width); fprintf(outfile,"logsersics_bulge_A_width = %f\n",options->logsersics_bulge_A_width); fprintf(outfile,"logsersics_disc_A_width = %f\n",options->logsersics_disc_A_width); fprintf(outfile,"logsersics_bulge_index_width = %f\n",options->logsersics_bulge_index_width); fprintf(outfile,"logsersics_disc_index_width = %f\n",options->logsersics_disc_index_width); fprintf(outfile,"logsersics_delta_e_bulge_width = %f\n",options->logsersics_delta_e_bulge_width); fprintf(outfile,"logsersics_delta_theta_bulge_width = %f\n",options->logsersics_delta_theta_bulge_width); fprintf(outfile,"logsersics_x0_min = %f\n",options->logsersics_x0_min); fprintf(outfile,"logsersics_y0_min = %f\n",options->logsersics_y0_min); fprintf(outfile,"logsersics_e1_min = %f\n",options->logsersics_e1_min); fprintf(outfile,"logsersics_e2_min = %f\n",options->logsersics_e2_min); fprintf(outfile,"logsersics_radius_min = %f\n",options->logsersics_radius_min); fprintf(outfile,"logsersics_radius_ratio_min = %f\n",options->logsersics_radius_ratio_min); fprintf(outfile,"logsersics_bulge_A_min = %f\n",options->logsersics_bulge_A_min); fprintf(outfile,"logsersics_disc_A_min = %f\n",options->logsersics_disc_A_min); fprintf(outfile,"logsersics_bulge_index_min = %f\n",options->logsersics_bulge_index_min); fprintf(outfile,"logsersics_disc_index_min = %f\n",options->logsersics_disc_index_min); fprintf(outfile,"logsersics_delta_e_bulge_min = %f\n",options->logsersics_delta_e_bulge_min); fprintf(outfile,"logsersics_delta_theta_bulge_min = %f\n",options->logsersics_delta_theta_bulge_min); fprintf(outfile,"logsersics_x0_max = %f\n",options->logsersics_x0_max); fprintf(outfile,"logsersics_y0_max = %f\n",options->logsersics_y0_max); fprintf(outfile,"logsersics_e1_max = %f\n",options->logsersics_e1_max); fprintf(outfile,"logsersics_e2_max = %f\n",options->logsersics_e2_max); fprintf(outfile,"logsersics_radius_max = %f\n",options->logsersics_radius_max); fprintf(outfile,"logsersics_radius_ratio_max = %f\n",options->logsersics_radius_ratio_max); fprintf(outfile,"logsersics_bulge_A_max = %f\n",options->logsersics_bulge_A_max); fprintf(outfile,"logsersics_disc_A_max = %f\n",options->logsersics_disc_A_max); fprintf(outfile,"logsersics_bulge_index_max = %f\n",options->logsersics_bulge_index_max); fprintf(outfile,"logsersics_disc_index_max = %f\n",options->logsersics_disc_index_max); fprintf(outfile,"logsersics_delta_e_bulge_max = %f\n",options->logsersics_delta_e_bulge_max); fprintf(outfile,"logsersics_delta_theta_bulge_max = %f\n",options->logsersics_delta_theta_bulge_max); fprintf(outfile,"logsersics_x0_fixed = %d\n",options->logsersics_x0_fixed); fprintf(outfile,"logsersics_y0_fixed = %d\n",options->logsersics_y0_fixed); fprintf(outfile,"logsersics_e1_fixed = %d\n",options->logsersics_e1_fixed); fprintf(outfile,"logsersics_e2_fixed = %d\n",options->logsersics_e2_fixed); fprintf(outfile,"logsersics_radius_fixed = %d\n",options->logsersics_radius_fixed); fprintf(outfile,"logsersics_radius_ratio_fixed = %d\n",options->logsersics_radius_ratio_fixed); fprintf(outfile,"logsersics_bulge_A_fixed = %d\n",options->logsersics_bulge_A_fixed); fprintf(outfile,"logsersics_disc_A_fixed = %d\n",options->logsersics_disc_A_fixed); fprintf(outfile,"logsersics_bulge_index_fixed = %d\n",options->logsersics_bulge_index_fixed); fprintf(outfile,"logsersics_disc_index_fixed = %d\n",options->logsersics_disc_index_fixed); fprintf(outfile,"logsersics_delta_e_bulge_fixed = %d\n",options->logsersics_delta_e_bulge_fixed); fprintf(outfile,"logsersics_delta_theta_bulge_fixed = %d\n",options->logsersics_delta_theta_bulge_fixed); fprintf(outfile,"\n"); fprintf(outfile,"# Options for model quadratic_test\n"); fprintf(outfile,"quadratic_test_x1_start = %f\n",options->quadratic_test_x1_start); fprintf(outfile,"quadratic_test_x2_start = %f\n",options->quadratic_test_x2_start); fprintf(outfile,"quadratic_test_x3_start = %f\n",options->quadratic_test_x3_start); fprintf(outfile,"quadratic_test_x4_start = %f\n",options->quadratic_test_x4_start); fprintf(outfile,"quadratic_test_x5_start = %f, %f, %f\n", options->quadratic_test_x5_start[0], options->quadratic_test_x5_start[1], options->quadratic_test_x5_start[2]); fprintf(outfile,"quadratic_test_x1_width = %f\n",options->quadratic_test_x1_width); fprintf(outfile,"quadratic_test_x2_width = %f\n",options->quadratic_test_x2_width); fprintf(outfile,"quadratic_test_x3_width = %f\n",options->quadratic_test_x3_width); fprintf(outfile,"quadratic_test_x4_width = %f\n",options->quadratic_test_x4_width); fprintf(outfile,"quadratic_test_x5_width = %f, %f, %f\n", options->quadratic_test_x5_width[0], options->quadratic_test_x5_width[1], options->quadratic_test_x5_width[2]); fprintf(outfile,"quadratic_test_x1_min = %f\n",options->quadratic_test_x1_min); fprintf(outfile,"quadratic_test_x2_min = %f\n",options->quadratic_test_x2_min); fprintf(outfile,"quadratic_test_x3_min = %f\n",options->quadratic_test_x3_min); fprintf(outfile,"quadratic_test_x4_min = %f\n",options->quadratic_test_x4_min); fprintf(outfile,"quadratic_test_x5_min = %f, %f, %f\n", options->quadratic_test_x5_min[0], options->quadratic_test_x5_min[1], options->quadratic_test_x5_min[2]); fprintf(outfile,"quadratic_test_x1_max = %f\n",options->quadratic_test_x1_max); fprintf(outfile,"quadratic_test_x2_max = %f\n",options->quadratic_test_x2_max); fprintf(outfile,"quadratic_test_x3_max = %f\n",options->quadratic_test_x3_max); fprintf(outfile,"quadratic_test_x4_max = %f\n",options->quadratic_test_x4_max); fprintf(outfile,"quadratic_test_x5_max = %f, %f, %f\n", options->quadratic_test_x5_max[0], options->quadratic_test_x5_max[1], options->quadratic_test_x5_max[2]); fprintf(outfile,"quadratic_test_x1_fixed = %d\n",options->quadratic_test_x1_fixed); fprintf(outfile,"quadratic_test_x2_fixed = %d\n",options->quadratic_test_x2_fixed); fprintf(outfile,"quadratic_test_x3_fixed = %d\n",options->quadratic_test_x3_fixed); fprintf(outfile,"quadratic_test_x4_fixed = %d\n",options->quadratic_test_x4_fixed); fprintf(outfile,"quadratic_test_x5_fixed = %d\n",options->quadratic_test_x5_fixed); fprintf(outfile,"\n"); fprintf(outfile,"# Options for model multisersics\n"); fprintf(outfile,"multisersics_ra_as_start = %f\n",options->multisersics_ra_as_start); fprintf(outfile,"multisersics_dec_as_start = %f\n",options->multisersics_dec_as_start); fprintf(outfile,"multisersics_e1_start = %f\n",options->multisersics_e1_start); fprintf(outfile,"multisersics_e2_start = %f\n",options->multisersics_e2_start); fprintf(outfile,"multisersics_radius_start = %f\n",options->multisersics_radius_start); fprintf(outfile,"multisersics_radius_ratio_start = %f\n",options->multisersics_radius_ratio_start); fprintf(outfile,"multisersics_bulge_A_start = %f\n",options->multisersics_bulge_A_start); fprintf(outfile,"multisersics_disc_A_start = %f\n",options->multisersics_disc_A_start); fprintf(outfile,"multisersics_bulge_index_start = %f\n",options->multisersics_bulge_index_start); fprintf(outfile,"multisersics_disc_index_start = %f\n",options->multisersics_disc_index_start); fprintf(outfile,"multisersics_ra_as_width = %f\n",options->multisersics_ra_as_width); fprintf(outfile,"multisersics_dec_as_width = %f\n",options->multisersics_dec_as_width); fprintf(outfile,"multisersics_e1_width = %f\n",options->multisersics_e1_width); fprintf(outfile,"multisersics_e2_width = %f\n",options->multisersics_e2_width); fprintf(outfile,"multisersics_radius_width = %f\n",options->multisersics_radius_width); fprintf(outfile,"multisersics_radius_ratio_width = %f\n",options->multisersics_radius_ratio_width); fprintf(outfile,"multisersics_bulge_A_width = %f\n",options->multisersics_bulge_A_width); fprintf(outfile,"multisersics_disc_A_width = %f\n",options->multisersics_disc_A_width); fprintf(outfile,"multisersics_bulge_index_width = %f\n",options->multisersics_bulge_index_width); fprintf(outfile,"multisersics_disc_index_width = %f\n",options->multisersics_disc_index_width); fprintf(outfile,"multisersics_ra_as_min = %f\n",options->multisersics_ra_as_min); fprintf(outfile,"multisersics_dec_as_min = %f\n",options->multisersics_dec_as_min); fprintf(outfile,"multisersics_e1_min = %f\n",options->multisersics_e1_min); fprintf(outfile,"multisersics_e2_min = %f\n",options->multisersics_e2_min); fprintf(outfile,"multisersics_radius_min = %f\n",options->multisersics_radius_min); fprintf(outfile,"multisersics_radius_ratio_min = %f\n",options->multisersics_radius_ratio_min); fprintf(outfile,"multisersics_bulge_A_min = %f\n",options->multisersics_bulge_A_min); fprintf(outfile,"multisersics_disc_A_min = %f\n",options->multisersics_disc_A_min); fprintf(outfile,"multisersics_bulge_index_min = %f\n",options->multisersics_bulge_index_min); fprintf(outfile,"multisersics_disc_index_min = %f\n",options->multisersics_disc_index_min); fprintf(outfile,"multisersics_ra_as_max = %f\n",options->multisersics_ra_as_max); fprintf(outfile,"multisersics_dec_as_max = %f\n",options->multisersics_dec_as_max); fprintf(outfile,"multisersics_e1_max = %f\n",options->multisersics_e1_max); fprintf(outfile,"multisersics_e2_max = %f\n",options->multisersics_e2_max); fprintf(outfile,"multisersics_radius_max = %f\n",options->multisersics_radius_max); fprintf(outfile,"multisersics_radius_ratio_max = %f\n",options->multisersics_radius_ratio_max); fprintf(outfile,"multisersics_bulge_A_max = %f\n",options->multisersics_bulge_A_max); fprintf(outfile,"multisersics_disc_A_max = %f\n",options->multisersics_disc_A_max); fprintf(outfile,"multisersics_bulge_index_max = %f\n",options->multisersics_bulge_index_max); fprintf(outfile,"multisersics_disc_index_max = %f\n",options->multisersics_disc_index_max); fprintf(outfile,"multisersics_ra_as_fixed = %d\n",options->multisersics_ra_as_fixed); fprintf(outfile,"multisersics_dec_as_fixed = %d\n",options->multisersics_dec_as_fixed); fprintf(outfile,"multisersics_e1_fixed = %d\n",options->multisersics_e1_fixed); fprintf(outfile,"multisersics_e2_fixed = %d\n",options->multisersics_e2_fixed); fprintf(outfile,"multisersics_radius_fixed = %d\n",options->multisersics_radius_fixed); fprintf(outfile,"multisersics_radius_ratio_fixed = %d\n",options->multisersics_radius_ratio_fixed); fprintf(outfile,"multisersics_bulge_A_fixed = %d\n",options->multisersics_bulge_A_fixed); fprintf(outfile,"multisersics_disc_A_fixed = %d\n",options->multisersics_disc_A_fixed); fprintf(outfile,"multisersics_bulge_index_fixed = %d\n",options->multisersics_bulge_index_fixed); fprintf(outfile,"multisersics_disc_index_fixed = %d\n",options->multisersics_disc_index_fixed); fprintf(outfile,"\n"); fprintf(outfile,"# Options for model multixray\n"); fprintf(outfile,"multixray_alpha_arcsec_start = %f\n",options->multixray_alpha_arcsec_start); fprintf(outfile,"multixray_delta_arcsec_start = %f\n",options->multixray_delta_arcsec_start); fprintf(outfile,"multixray_e1_start = %f\n",options->multixray_e1_start); fprintf(outfile,"multixray_e2_start = %f\n",options->multixray_e2_start); fprintf(outfile,"multixray_rc_start = %f\n",options->multixray_rc_start); fprintf(outfile,"multixray_A_start = %f\n",options->multixray_A_start); fprintf(outfile,"multixray_beta_start = %f\n",options->multixray_beta_start); fprintf(outfile,"multixray_background_start = %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", options->multixray_background_start[0], options->multixray_background_start[1], options->multixray_background_start[2], options->multixray_background_start[3], options->multixray_background_start[4], options->multixray_background_start[5], options->multixray_background_start[6], options->multixray_background_start[7], options->multixray_background_start[8], options->multixray_background_start[9], options->multixray_background_start[10], options->multixray_background_start[11], options->multixray_background_start[12], options->multixray_background_start[13], options->multixray_background_start[14], options->multixray_background_start[15], options->multixray_background_start[16], options->multixray_background_start[17], options->multixray_background_start[18], options->multixray_background_start[19], options->multixray_background_start[20], options->multixray_background_start[21], options->multixray_background_start[22], options->multixray_background_start[23], options->multixray_background_start[24], options->multixray_background_start[25], options->multixray_background_start[26], options->multixray_background_start[27], options->multixray_background_start[28], options->multixray_background_start[29]); fprintf(outfile,"multixray_alpha_arcsec_width = %f\n",options->multixray_alpha_arcsec_width); fprintf(outfile,"multixray_delta_arcsec_width = %f\n",options->multixray_delta_arcsec_width); fprintf(outfile,"multixray_e1_width = %f\n",options->multixray_e1_width); fprintf(outfile,"multixray_e2_width = %f\n",options->multixray_e2_width); fprintf(outfile,"multixray_rc_width = %f\n",options->multixray_rc_width); fprintf(outfile,"multixray_A_width = %f\n",options->multixray_A_width); fprintf(outfile,"multixray_beta_width = %f\n",options->multixray_beta_width); fprintf(outfile,"multixray_background_width = %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", options->multixray_background_width[0], options->multixray_background_width[1], options->multixray_background_width[2], options->multixray_background_width[3], options->multixray_background_width[4], options->multixray_background_width[5], options->multixray_background_width[6], options->multixray_background_width[7], options->multixray_background_width[8], options->multixray_background_width[9], options->multixray_background_width[10], options->multixray_background_width[11], options->multixray_background_width[12], options->multixray_background_width[13], options->multixray_background_width[14], options->multixray_background_width[15], options->multixray_background_width[16], options->multixray_background_width[17], options->multixray_background_width[18], options->multixray_background_width[19], options->multixray_background_width[20], options->multixray_background_width[21], options->multixray_background_width[22], options->multixray_background_width[23], options->multixray_background_width[24], options->multixray_background_width[25], options->multixray_background_width[26], options->multixray_background_width[27], options->multixray_background_width[28], options->multixray_background_width[29]); fprintf(outfile,"multixray_alpha_arcsec_min = %f\n",options->multixray_alpha_arcsec_min); fprintf(outfile,"multixray_delta_arcsec_min = %f\n",options->multixray_delta_arcsec_min); fprintf(outfile,"multixray_e1_min = %f\n",options->multixray_e1_min); fprintf(outfile,"multixray_e2_min = %f\n",options->multixray_e2_min); fprintf(outfile,"multixray_rc_min = %f\n",options->multixray_rc_min); fprintf(outfile,"multixray_A_min = %f\n",options->multixray_A_min); fprintf(outfile,"multixray_beta_min = %f\n",options->multixray_beta_min); fprintf(outfile,"multixray_background_min = %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", options->multixray_background_min[0], options->multixray_background_min[1], options->multixray_background_min[2], options->multixray_background_min[3], options->multixray_background_min[4], options->multixray_background_min[5], options->multixray_background_min[6], options->multixray_background_min[7], options->multixray_background_min[8], options->multixray_background_min[9], options->multixray_background_min[10], options->multixray_background_min[11], options->multixray_background_min[12], options->multixray_background_min[13], options->multixray_background_min[14], options->multixray_background_min[15], options->multixray_background_min[16], options->multixray_background_min[17], options->multixray_background_min[18], options->multixray_background_min[19], options->multixray_background_min[20], options->multixray_background_min[21], options->multixray_background_min[22], options->multixray_background_min[23], options->multixray_background_min[24], options->multixray_background_min[25], options->multixray_background_min[26], options->multixray_background_min[27], options->multixray_background_min[28], options->multixray_background_min[29]); fprintf(outfile,"multixray_alpha_arcsec_max = %f\n",options->multixray_alpha_arcsec_max); fprintf(outfile,"multixray_delta_arcsec_max = %f\n",options->multixray_delta_arcsec_max); fprintf(outfile,"multixray_e1_max = %f\n",options->multixray_e1_max); fprintf(outfile,"multixray_e2_max = %f\n",options->multixray_e2_max); fprintf(outfile,"multixray_rc_max = %f\n",options->multixray_rc_max); fprintf(outfile,"multixray_A_max = %f\n",options->multixray_A_max); fprintf(outfile,"multixray_beta_max = %f\n",options->multixray_beta_max); fprintf(outfile,"multixray_background_max = %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", options->multixray_background_max[0], options->multixray_background_max[1], options->multixray_background_max[2], options->multixray_background_max[3], options->multixray_background_max[4], options->multixray_background_max[5], options->multixray_background_max[6], options->multixray_background_max[7], options->multixray_background_max[8], options->multixray_background_max[9], options->multixray_background_max[10], options->multixray_background_max[11], options->multixray_background_max[12], options->multixray_background_max[13], options->multixray_background_max[14], options->multixray_background_max[15], options->multixray_background_max[16], options->multixray_background_max[17], options->multixray_background_max[18], options->multixray_background_max[19], options->multixray_background_max[20], options->multixray_background_max[21], options->multixray_background_max[22], options->multixray_background_max[23], options->multixray_background_max[24], options->multixray_background_max[25], options->multixray_background_max[26], options->multixray_background_max[27], options->multixray_background_max[28], options->multixray_background_max[29]); fprintf(outfile,"multixray_alpha_arcsec_fixed = %d\n",options->multixray_alpha_arcsec_fixed); fprintf(outfile,"multixray_delta_arcsec_fixed = %d\n",options->multixray_delta_arcsec_fixed); fprintf(outfile,"multixray_e1_fixed = %d\n",options->multixray_e1_fixed); fprintf(outfile,"multixray_e2_fixed = %d\n",options->multixray_e2_fixed); fprintf(outfile,"multixray_rc_fixed = %d\n",options->multixray_rc_fixed); fprintf(outfile,"multixray_A_fixed = %d\n",options->multixray_A_fixed); fprintf(outfile,"multixray_beta_fixed = %d\n",options->multixray_beta_fixed); fprintf(outfile,"multixray_background_fixed = %d\n",options->multixray_background_fixed); fprintf(outfile,"\n"); fprintf(outfile,"# Advanced Options - THESE ARE EXPERIMENTAL - USE AT OWN RISK\n"); fprintf(outfile,"do_mcmc = %d\n",options->do_mcmc); fprintf(outfile,"minimizer_loops = %d\n",options->minimizer_loops); fprintf(outfile,"save_sersics = %d\n",options->save_sersics); fprintf(outfile,"psf_input = %s\n",options->psf_input); fprintf(outfile,"perform_pixel_integration = %d\n",options->perform_pixel_integration); fprintf(outfile,"use_segmentation_mask = %d\n",options->use_segmentation_mask); fprintf(outfile,"segmentation_mask_filename = %s\n",options->segmentation_mask_filename); fprintf(outfile,"use_hankel_transform = %d\n",options->use_hankel_transform); fprintf(outfile,"sersics_beermat_amplitudes_positive = %d\n",options->sersics_beermat_amplitudes_positive); fprintf(outfile,"sersic_lookup_file = %s\n",options->sersic_lookup_file); fprintf(outfile,"levmar_use_analytic_gradients = %d\n",options->levmar_use_analytic_gradients); fprintf(outfile,"levmar_check_analytic_gradients = %d\n",options->levmar_check_analytic_gradients); fprintf(outfile,"image_generator_resolution_high = %d\n",options->image_generator_resolution_high); fprintf(outfile,"minimizer_verbosity = %d\n",options->minimizer_verbosity); fprintf(outfile,"minimizer_method = %d\n",options->minimizer_method); fprintf(outfile,"poisson_errors = %d\n",options->poisson_errors); fprintf(outfile,"timeit = %d\n",options->timeit); fprintf(outfile,"circularize_mask = %d\n",options->circularize_mask); fprintf(outfile,"\n"); fprintf(outfile,"# MCMC Options - EXPERIMENTAL\n"); fprintf(outfile,"number_samples = %d\n",options->number_samples); fprintf(outfile,"burn_length = %d\n",options->burn_length); fprintf(outfile,"tuning_phase = %d\n",options->tuning_phase); fprintf(outfile,"scaling = %f\n",options->scaling); fprintf(outfile,"do_rotation = %d\n",options->do_rotation); fprintf(outfile,"mcmc_tune_covmat = %d\n",options->mcmc_tune_covmat); fprintf(outfile,"max_annealing_temperature = %f\n",options->max_annealing_temperature); fprintf(outfile,"annealing_one_point = %f\n",options->annealing_one_point); fprintf(outfile,"adaptive_metropolis_interval = %d\n",options->adaptive_metropolis_interval); fprintf(outfile,"climbing_only = %d\n",options->climbing_only); fprintf(outfile,"mcmc_filename_base = %s\n",options->mcmc_filename_base); fprintf(outfile,"use_mcmc_mean = %d\n",options->use_mcmc_mean); fprintf(outfile,"use_mcmc_sample = %d\n",options->use_mcmc_sample); fprintf(outfile,"print_mcmc_samples = %d\n",options->print_mcmc_samples); fprintf(outfile,"\n"); fprintf(outfile,"# MEDS Options - Probably DES only\n"); fprintf(outfile,"starting_params_only = %d\n",options->starting_params_only); fprintf(outfile,"rescale_weight = %d\n",options->rescale_weight); fprintf(outfile,"uberseg = %d\n",options->uberseg); fprintf(outfile,"use_image_flags = %d\n",options->use_image_flags); fprintf(outfile,"reject_outliers = %d\n",options->reject_outliers); fprintf(outfile,"replace_psf_path = %s\n",options->replace_psf_path); fprintf(outfile,"psfex_rerun_version = %s\n",options->psfex_rerun_version); fprintf(outfile,"database_output = %d\n",options->database_output); fprintf(outfile,"\n"); } void i3_options_printf(i3_options * options){ i3_options_fprintf(options, stdout); } void i3_options_save(i3_options * options, char * filename){ FILE * outfile = fopen(filename, "w"); i3_options_fprintf(options, outfile); fclose(outfile); } void i3_options_report_parameter_fail(char * parameter,char * type){ fprintf(stderr,"ERROR:\nFailed to parse string '%s' into parameter of type %s.\n",parameter,type); } int i3_options_parse_int(char * parameter, int * status){ int result; int count; count = sscanf(parameter,"%d",&result); *status=0; if (count!=1) { i3_options_report_parameter_fail(parameter,"int"); *status=1; } return result; } float i3_options_parse_float(char * parameter, int * status){ float result; int count; count = sscanf(parameter,"%f",&result); *status=0; if (count!=1) { i3_options_report_parameter_fail(parameter,"float"); *status=1; } return result; } double i3_options_parse_double(char * parameter, int * status){ double result; int count; count = sscanf(parameter,"%lf",&result); *status=0; if (count!=1) { i3_options_report_parameter_fail(parameter,"double"); *status=1; } return result; } bool i3_options_parse_bool(char * parameter, int * status){ bool result; char text[i3_options_max_line_length]; int count; bool found=false; int n_variants = 10; char * true_variants[] = {"T","True","true","TRUE","YES","Yes","yes","Y","y","1"}; char * false_variants[] = {"F","False","false","FALSE","NO","No","no","N","n","0"}; count = sscanf(parameter,"%s",text); for (int i=0;ii3_options_max_line_length){parameter_name[0]='\0';parameter_value[0]='\0'; return 5;} strncpy(parameter_value,lstripped_value_part,length_of_stripped_value); parameter_value[length_of_stripped_value]='\0'; return 0; } int i3_options_handle_name_value(i3_options * options, char * name, char * value){ int status = 0; i3_options_handle_name_value_body(options, name,value,true, &status); return status; } int i3_options_parse_float_array_element(i3_options * options, char * name, char * value, int * status){ char name_part[1024]; int element_number; char * bracket_pos = strstr(name, "["); int len_start = bracket_pos - name; strncpy(name_part, name, 1024); name_part[len_start]='\0'; int count = sscanf(name+len_start, "[%d]", &element_number); if (count!=1) { i3_options_report_parameter_fail(name,"array"); *status = 1; return 0; } if (!strcmp(name_part,"quadratic_test_x5_start")){ if(element_number>=sizeof(options->quadratic_test_x5_start)/sizeof(float)){ fprintf(stderr,"Element index too large for array option quadratic_test_x5_start!\n"); return 0; } else{ options->quadratic_test_x5_start[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"quadratic_test_x5_width")){ if(element_number>=sizeof(options->quadratic_test_x5_width)/sizeof(float)){ fprintf(stderr,"Element index too large for array option quadratic_test_x5_width!\n"); return 0; } else{ options->quadratic_test_x5_width[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"quadratic_test_x5_min")){ if(element_number>=sizeof(options->quadratic_test_x5_min)/sizeof(float)){ fprintf(stderr,"Element index too large for array option quadratic_test_x5_min!\n"); return 0; } else{ options->quadratic_test_x5_min[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"quadratic_test_x5_max")){ if(element_number>=sizeof(options->quadratic_test_x5_max)/sizeof(float)){ fprintf(stderr,"Element index too large for array option quadratic_test_x5_max!\n"); return 0; } else{ options->quadratic_test_x5_max[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"multixray_background_start")){ if(element_number>=sizeof(options->multixray_background_start)/sizeof(float)){ fprintf(stderr,"Element index too large for array option multixray_background_start!\n"); return 0; } else{ options->multixray_background_start[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"multixray_background_width")){ if(element_number>=sizeof(options->multixray_background_width)/sizeof(float)){ fprintf(stderr,"Element index too large for array option multixray_background_width!\n"); return 0; } else{ options->multixray_background_width[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"multixray_background_min")){ if(element_number>=sizeof(options->multixray_background_min)/sizeof(float)){ fprintf(stderr,"Element index too large for array option multixray_background_min!\n"); return 0; } else{ options->multixray_background_min[element_number]=i3_options_parse_float(value, status); return 1; } } if (!strcmp(name_part,"multixray_background_max")){ if(element_number>=sizeof(options->multixray_background_max)/sizeof(float)){ fprintf(stderr,"Element index too large for array option multixray_background_max!\n"); return 0; } else{ options->multixray_background_max[element_number]=i3_options_parse_float(value, status); return 1; } } return 0; }int i3_options_handle_name_value_body(i3_options * options, char * name, char * value, bool try_model, int * status){ bool found=false; if (strstr(name,"[")) {found = i3_options_parse_float_array_element(options, name, value, status);} if (!strcmp(name,"model_name")) {found=true;strcpy(options->model_name,value);} if (!strcmp(name,"noise_sigma")) {found=true;options->noise_sigma=i3_options_parse_float(value, status);} if (!strcmp(name,"image_mask")) {found=true;strcpy(options->image_mask,value);} if (!strcmp(name,"background_subtract")) {found=true;options->background_subtract=i3_options_parse_bool(value, status);} if (!strcmp(name,"rescale_stamp")) {found=true;options->rescale_stamp=i3_options_parse_bool(value, status);} if (!strcmp(name,"verbosity")) {found=true;options->verbosity=i3_options_parse_int(value, status);} if (!strcmp(name,"save_images")) {found=true;options->save_images=i3_options_parse_bool(value, status);} if (!strcmp(name,"save_output")) {found=true;options->save_output=i3_options_parse_bool(value, status);} if (!strcmp(name,"output_directory")) {found=true;strcpy(options->output_directory,value);} if (!strcmp(name,"output_filename")) {found=true;strcpy(options->output_filename,value);} if (!strcmp(name,"airy_psf")) {found=true;options->airy_psf=i3_options_parse_bool(value, status);} if (!strcmp(name,"psf_truncation_pixels")) {found=true;options->psf_truncation_pixels=i3_options_parse_float(value, status);} if (!strcmp(name,"use_computed_start")) {found=true;options->use_computed_start=i3_options_parse_bool(value, status);} if (!strcmp(name,"minimizer_tolerance")) {found=true;options->minimizer_tolerance=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_eps1")) {found=true;options->levmar_eps1=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_eps2")) {found=true;options->levmar_eps2=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_eps3")) {found=true;options->levmar_eps3=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_eps4")) {found=true;options->levmar_eps4=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_eps5")) {found=true;options->levmar_eps5=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_tau")) {found=true;options->levmar_tau=i3_options_parse_float(value, status);} if (!strcmp(name,"levmar_LM_INIT_MU")) {found=true;options->levmar_LM_INIT_MU=i3_options_parse_float(value, status);} if (!strcmp(name,"minimizer_max_iterations")) {found=true;options->minimizer_max_iterations=i3_options_parse_int(value, status);} if (!strcmp(name,"stamp_size")) {found=true;options->stamp_size=i3_options_parse_int(value, status);} if (!strcmp(name,"upsampling")) {found=true;options->upsampling=i3_options_parse_int(value, status);} if (!strcmp(name,"central_pixel_upsampling")) {found=true;options->central_pixel_upsampling=i3_options_parse_bool(value, status);} if (!strcmp(name,"n_central_pixel_upsampling")) {found=true;options->n_central_pixel_upsampling=i3_options_parse_int(value, status);} if (!strcmp(name,"n_central_pixels_to_upsample")) {found=true;options->n_central_pixels_to_upsample=i3_options_parse_int(value, status);} if (!strcmp(name,"padding")) {found=true;options->padding=i3_options_parse_int(value, status);} if (!strcmp(name,"sersics_disc_truncation")) {found=true;options->sersics_disc_truncation=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_truncation")) {found=true;options->sersics_bulge_truncation=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_x0_start")) {found=true;options->sersics_x0_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_y0_start")) {found=true;options->sersics_y0_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e1_start")) {found=true;options->sersics_e1_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e2_start")) {found=true;options->sersics_e2_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_start")) {found=true;options->sersics_radius_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_ratio_start")) {found=true;options->sersics_radius_ratio_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_A_start")) {found=true;options->sersics_bulge_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_A_start")) {found=true;options->sersics_disc_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_index_start")) {found=true;options->sersics_bulge_index_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_index_start")) {found=true;options->sersics_disc_index_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_e_bulge_start")) {found=true;options->sersics_delta_e_bulge_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_theta_bulge_start")) {found=true;options->sersics_delta_theta_bulge_start=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_x0_width")) {found=true;options->sersics_x0_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_y0_width")) {found=true;options->sersics_y0_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e1_width")) {found=true;options->sersics_e1_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e2_width")) {found=true;options->sersics_e2_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_width")) {found=true;options->sersics_radius_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_ratio_width")) {found=true;options->sersics_radius_ratio_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_A_width")) {found=true;options->sersics_bulge_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_A_width")) {found=true;options->sersics_disc_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_index_width")) {found=true;options->sersics_bulge_index_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_index_width")) {found=true;options->sersics_disc_index_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_e_bulge_width")) {found=true;options->sersics_delta_e_bulge_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_theta_bulge_width")) {found=true;options->sersics_delta_theta_bulge_width=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_x0_min")) {found=true;options->sersics_x0_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_y0_min")) {found=true;options->sersics_y0_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e1_min")) {found=true;options->sersics_e1_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e2_min")) {found=true;options->sersics_e2_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_min")) {found=true;options->sersics_radius_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_ratio_min")) {found=true;options->sersics_radius_ratio_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_A_min")) {found=true;options->sersics_bulge_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_A_min")) {found=true;options->sersics_disc_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_index_min")) {found=true;options->sersics_bulge_index_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_index_min")) {found=true;options->sersics_disc_index_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_e_bulge_min")) {found=true;options->sersics_delta_e_bulge_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_theta_bulge_min")) {found=true;options->sersics_delta_theta_bulge_min=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_x0_max")) {found=true;options->sersics_x0_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_y0_max")) {found=true;options->sersics_y0_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e1_max")) {found=true;options->sersics_e1_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_e2_max")) {found=true;options->sersics_e2_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_max")) {found=true;options->sersics_radius_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_radius_ratio_max")) {found=true;options->sersics_radius_ratio_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_A_max")) {found=true;options->sersics_bulge_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_A_max")) {found=true;options->sersics_disc_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_bulge_index_max")) {found=true;options->sersics_bulge_index_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_disc_index_max")) {found=true;options->sersics_disc_index_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_e_bulge_max")) {found=true;options->sersics_delta_e_bulge_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_delta_theta_bulge_max")) {found=true;options->sersics_delta_theta_bulge_max=i3_options_parse_float(value, status);} if (!strcmp(name,"sersics_x0_fixed")) {found=true;options->sersics_x0_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_y0_fixed")) {found=true;options->sersics_y0_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_e1_fixed")) {found=true;options->sersics_e1_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_e2_fixed")) {found=true;options->sersics_e2_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_radius_fixed")) {found=true;options->sersics_radius_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_radius_ratio_fixed")) {found=true;options->sersics_radius_ratio_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_bulge_A_fixed")) {found=true;options->sersics_bulge_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_disc_A_fixed")) {found=true;options->sersics_disc_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_bulge_index_fixed")) {found=true;options->sersics_bulge_index_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_disc_index_fixed")) {found=true;options->sersics_disc_index_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_delta_e_bulge_fixed")) {found=true;options->sersics_delta_e_bulge_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_delta_theta_bulge_fixed")) {found=true;options->sersics_delta_theta_bulge_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_x0_start")) {found=true;options->logsersics_x0_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_y0_start")) {found=true;options->logsersics_y0_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e1_start")) {found=true;options->logsersics_e1_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e2_start")) {found=true;options->logsersics_e2_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_start")) {found=true;options->logsersics_radius_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_ratio_start")) {found=true;options->logsersics_radius_ratio_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_A_start")) {found=true;options->logsersics_bulge_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_A_start")) {found=true;options->logsersics_disc_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_index_start")) {found=true;options->logsersics_bulge_index_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_index_start")) {found=true;options->logsersics_disc_index_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_e_bulge_start")) {found=true;options->logsersics_delta_e_bulge_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_theta_bulge_start")) {found=true;options->logsersics_delta_theta_bulge_start=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_x0_width")) {found=true;options->logsersics_x0_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_y0_width")) {found=true;options->logsersics_y0_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e1_width")) {found=true;options->logsersics_e1_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e2_width")) {found=true;options->logsersics_e2_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_width")) {found=true;options->logsersics_radius_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_ratio_width")) {found=true;options->logsersics_radius_ratio_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_A_width")) {found=true;options->logsersics_bulge_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_A_width")) {found=true;options->logsersics_disc_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_index_width")) {found=true;options->logsersics_bulge_index_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_index_width")) {found=true;options->logsersics_disc_index_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_e_bulge_width")) {found=true;options->logsersics_delta_e_bulge_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_theta_bulge_width")) {found=true;options->logsersics_delta_theta_bulge_width=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_x0_min")) {found=true;options->logsersics_x0_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_y0_min")) {found=true;options->logsersics_y0_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e1_min")) {found=true;options->logsersics_e1_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e2_min")) {found=true;options->logsersics_e2_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_min")) {found=true;options->logsersics_radius_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_ratio_min")) {found=true;options->logsersics_radius_ratio_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_A_min")) {found=true;options->logsersics_bulge_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_A_min")) {found=true;options->logsersics_disc_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_index_min")) {found=true;options->logsersics_bulge_index_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_index_min")) {found=true;options->logsersics_disc_index_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_e_bulge_min")) {found=true;options->logsersics_delta_e_bulge_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_theta_bulge_min")) {found=true;options->logsersics_delta_theta_bulge_min=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_x0_max")) {found=true;options->logsersics_x0_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_y0_max")) {found=true;options->logsersics_y0_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e1_max")) {found=true;options->logsersics_e1_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_e2_max")) {found=true;options->logsersics_e2_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_max")) {found=true;options->logsersics_radius_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_radius_ratio_max")) {found=true;options->logsersics_radius_ratio_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_A_max")) {found=true;options->logsersics_bulge_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_A_max")) {found=true;options->logsersics_disc_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_bulge_index_max")) {found=true;options->logsersics_bulge_index_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_disc_index_max")) {found=true;options->logsersics_disc_index_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_e_bulge_max")) {found=true;options->logsersics_delta_e_bulge_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_delta_theta_bulge_max")) {found=true;options->logsersics_delta_theta_bulge_max=i3_options_parse_float(value, status);} if (!strcmp(name,"logsersics_x0_fixed")) {found=true;options->logsersics_x0_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_y0_fixed")) {found=true;options->logsersics_y0_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_e1_fixed")) {found=true;options->logsersics_e1_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_e2_fixed")) {found=true;options->logsersics_e2_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_radius_fixed")) {found=true;options->logsersics_radius_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_radius_ratio_fixed")) {found=true;options->logsersics_radius_ratio_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_bulge_A_fixed")) {found=true;options->logsersics_bulge_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_disc_A_fixed")) {found=true;options->logsersics_disc_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_bulge_index_fixed")) {found=true;options->logsersics_bulge_index_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_disc_index_fixed")) {found=true;options->logsersics_disc_index_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_delta_e_bulge_fixed")) {found=true;options->logsersics_delta_e_bulge_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"logsersics_delta_theta_bulge_fixed")) {found=true;options->logsersics_delta_theta_bulge_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"quadratic_test_x1_start")) {found=true;options->quadratic_test_x1_start=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x2_start")) {found=true;options->quadratic_test_x2_start=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x3_start")) {found=true;options->quadratic_test_x3_start=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x4_start")) {found=true;options->quadratic_test_x4_start=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x5_start")) {found=true; i3_options_parse_float_array(options->quadratic_test_x5_start, value, 3, status);} if (!strcmp(name,"quadratic_test_x1_width")) {found=true;options->quadratic_test_x1_width=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x2_width")) {found=true;options->quadratic_test_x2_width=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x3_width")) {found=true;options->quadratic_test_x3_width=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x4_width")) {found=true;options->quadratic_test_x4_width=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x5_width")) {found=true; i3_options_parse_float_array(options->quadratic_test_x5_width, value, 3, status);} if (!strcmp(name,"quadratic_test_x1_min")) {found=true;options->quadratic_test_x1_min=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x2_min")) {found=true;options->quadratic_test_x2_min=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x3_min")) {found=true;options->quadratic_test_x3_min=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x4_min")) {found=true;options->quadratic_test_x4_min=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x5_min")) {found=true; i3_options_parse_float_array(options->quadratic_test_x5_min, value, 3, status);} if (!strcmp(name,"quadratic_test_x1_max")) {found=true;options->quadratic_test_x1_max=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x2_max")) {found=true;options->quadratic_test_x2_max=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x3_max")) {found=true;options->quadratic_test_x3_max=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x4_max")) {found=true;options->quadratic_test_x4_max=i3_options_parse_float(value, status);} if (!strcmp(name,"quadratic_test_x5_max")) {found=true; i3_options_parse_float_array(options->quadratic_test_x5_max, value, 3, status);} if (!strcmp(name,"quadratic_test_x1_fixed")) {found=true;options->quadratic_test_x1_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"quadratic_test_x2_fixed")) {found=true;options->quadratic_test_x2_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"quadratic_test_x3_fixed")) {found=true;options->quadratic_test_x3_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"quadratic_test_x4_fixed")) {found=true;options->quadratic_test_x4_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"quadratic_test_x5_fixed")) {found=true;options->quadratic_test_x5_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_ra_as_start")) {found=true;options->multisersics_ra_as_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_dec_as_start")) {found=true;options->multisersics_dec_as_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e1_start")) {found=true;options->multisersics_e1_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e2_start")) {found=true;options->multisersics_e2_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_start")) {found=true;options->multisersics_radius_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_ratio_start")) {found=true;options->multisersics_radius_ratio_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_A_start")) {found=true;options->multisersics_bulge_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_A_start")) {found=true;options->multisersics_disc_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_index_start")) {found=true;options->multisersics_bulge_index_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_index_start")) {found=true;options->multisersics_disc_index_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_ra_as_width")) {found=true;options->multisersics_ra_as_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_dec_as_width")) {found=true;options->multisersics_dec_as_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e1_width")) {found=true;options->multisersics_e1_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e2_width")) {found=true;options->multisersics_e2_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_width")) {found=true;options->multisersics_radius_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_ratio_width")) {found=true;options->multisersics_radius_ratio_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_A_width")) {found=true;options->multisersics_bulge_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_A_width")) {found=true;options->multisersics_disc_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_index_width")) {found=true;options->multisersics_bulge_index_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_index_width")) {found=true;options->multisersics_disc_index_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_ra_as_min")) {found=true;options->multisersics_ra_as_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_dec_as_min")) {found=true;options->multisersics_dec_as_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e1_min")) {found=true;options->multisersics_e1_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e2_min")) {found=true;options->multisersics_e2_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_min")) {found=true;options->multisersics_radius_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_ratio_min")) {found=true;options->multisersics_radius_ratio_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_A_min")) {found=true;options->multisersics_bulge_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_A_min")) {found=true;options->multisersics_disc_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_index_min")) {found=true;options->multisersics_bulge_index_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_index_min")) {found=true;options->multisersics_disc_index_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_ra_as_max")) {found=true;options->multisersics_ra_as_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_dec_as_max")) {found=true;options->multisersics_dec_as_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e1_max")) {found=true;options->multisersics_e1_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_e2_max")) {found=true;options->multisersics_e2_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_max")) {found=true;options->multisersics_radius_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_radius_ratio_max")) {found=true;options->multisersics_radius_ratio_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_A_max")) {found=true;options->multisersics_bulge_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_A_max")) {found=true;options->multisersics_disc_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_bulge_index_max")) {found=true;options->multisersics_bulge_index_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_disc_index_max")) {found=true;options->multisersics_disc_index_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multisersics_ra_as_fixed")) {found=true;options->multisersics_ra_as_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_dec_as_fixed")) {found=true;options->multisersics_dec_as_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_e1_fixed")) {found=true;options->multisersics_e1_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_e2_fixed")) {found=true;options->multisersics_e2_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_radius_fixed")) {found=true;options->multisersics_radius_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_radius_ratio_fixed")) {found=true;options->multisersics_radius_ratio_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_bulge_A_fixed")) {found=true;options->multisersics_bulge_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_disc_A_fixed")) {found=true;options->multisersics_disc_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_bulge_index_fixed")) {found=true;options->multisersics_bulge_index_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multisersics_disc_index_fixed")) {found=true;options->multisersics_disc_index_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_alpha_arcsec_start")) {found=true;options->multixray_alpha_arcsec_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_delta_arcsec_start")) {found=true;options->multixray_delta_arcsec_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e1_start")) {found=true;options->multixray_e1_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e2_start")) {found=true;options->multixray_e2_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_rc_start")) {found=true;options->multixray_rc_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_A_start")) {found=true;options->multixray_A_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_beta_start")) {found=true;options->multixray_beta_start=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_background_start")) {found=true; i3_options_parse_float_array(options->multixray_background_start, value, 30, status);} if (!strcmp(name,"multixray_alpha_arcsec_width")) {found=true;options->multixray_alpha_arcsec_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_delta_arcsec_width")) {found=true;options->multixray_delta_arcsec_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e1_width")) {found=true;options->multixray_e1_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e2_width")) {found=true;options->multixray_e2_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_rc_width")) {found=true;options->multixray_rc_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_A_width")) {found=true;options->multixray_A_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_beta_width")) {found=true;options->multixray_beta_width=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_background_width")) {found=true; i3_options_parse_float_array(options->multixray_background_width, value, 30, status);} if (!strcmp(name,"multixray_alpha_arcsec_min")) {found=true;options->multixray_alpha_arcsec_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_delta_arcsec_min")) {found=true;options->multixray_delta_arcsec_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e1_min")) {found=true;options->multixray_e1_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e2_min")) {found=true;options->multixray_e2_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_rc_min")) {found=true;options->multixray_rc_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_A_min")) {found=true;options->multixray_A_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_beta_min")) {found=true;options->multixray_beta_min=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_background_min")) {found=true; i3_options_parse_float_array(options->multixray_background_min, value, 30, status);} if (!strcmp(name,"multixray_alpha_arcsec_max")) {found=true;options->multixray_alpha_arcsec_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_delta_arcsec_max")) {found=true;options->multixray_delta_arcsec_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e1_max")) {found=true;options->multixray_e1_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_e2_max")) {found=true;options->multixray_e2_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_rc_max")) {found=true;options->multixray_rc_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_A_max")) {found=true;options->multixray_A_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_beta_max")) {found=true;options->multixray_beta_max=i3_options_parse_float(value, status);} if (!strcmp(name,"multixray_background_max")) {found=true; i3_options_parse_float_array(options->multixray_background_max, value, 30, status);} if (!strcmp(name,"multixray_alpha_arcsec_fixed")) {found=true;options->multixray_alpha_arcsec_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_delta_arcsec_fixed")) {found=true;options->multixray_delta_arcsec_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_e1_fixed")) {found=true;options->multixray_e1_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_e2_fixed")) {found=true;options->multixray_e2_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_rc_fixed")) {found=true;options->multixray_rc_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_A_fixed")) {found=true;options->multixray_A_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_beta_fixed")) {found=true;options->multixray_beta_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"multixray_background_fixed")) {found=true;options->multixray_background_fixed=i3_options_parse_bool(value, status);} if (!strcmp(name,"do_mcmc")) {found=true;options->do_mcmc=i3_options_parse_bool(value, status);} if (!strcmp(name,"minimizer_loops")) {found=true;options->minimizer_loops=i3_options_parse_int(value, status);} if (!strcmp(name,"save_sersics")) {found=true;options->save_sersics=i3_options_parse_bool(value, status);} if (!strcmp(name,"psf_input")) {found=true;strcpy(options->psf_input,value);} if (!strcmp(name,"perform_pixel_integration")) {found=true;options->perform_pixel_integration=i3_options_parse_bool(value, status);} if (!strcmp(name,"use_segmentation_mask")) {found=true;options->use_segmentation_mask=i3_options_parse_bool(value, status);} if (!strcmp(name,"segmentation_mask_filename")) {found=true;strcpy(options->segmentation_mask_filename,value);} if (!strcmp(name,"use_hankel_transform")) {found=true;options->use_hankel_transform=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersics_beermat_amplitudes_positive")) {found=true;options->sersics_beermat_amplitudes_positive=i3_options_parse_bool(value, status);} if (!strcmp(name,"sersic_lookup_file")) {found=true;strcpy(options->sersic_lookup_file,value);} if (!strcmp(name,"levmar_use_analytic_gradients")) {found=true;options->levmar_use_analytic_gradients=i3_options_parse_bool(value, status);} if (!strcmp(name,"levmar_check_analytic_gradients")) {found=true;options->levmar_check_analytic_gradients=i3_options_parse_bool(value, status);} if (!strcmp(name,"image_generator_resolution_high")) {found=true;options->image_generator_resolution_high=i3_options_parse_bool(value, status);} if (!strcmp(name,"minimizer_verbosity")) {found=true;options->minimizer_verbosity=i3_options_parse_int(value, status);} if (!strcmp(name,"minimizer_method")) {found=true;options->minimizer_method=i3_options_parse_int(value, status);} if (!strcmp(name,"poisson_errors")) {found=true;options->poisson_errors=i3_options_parse_bool(value, status);} if (!strcmp(name,"timeit")) {found=true;options->timeit=i3_options_parse_bool(value, status);} if (!strcmp(name,"circularize_mask")) {found=true;options->circularize_mask=i3_options_parse_bool(value, status);} if (!strcmp(name,"number_samples")) {found=true;options->number_samples=i3_options_parse_int(value, status);} if (!strcmp(name,"burn_length")) {found=true;options->burn_length=i3_options_parse_int(value, status);} if (!strcmp(name,"tuning_phase")) {found=true;options->tuning_phase=i3_options_parse_int(value, status);} if (!strcmp(name,"scaling")) {found=true;options->scaling=i3_options_parse_float(value, status);} if (!strcmp(name,"do_rotation")) {found=true;options->do_rotation=i3_options_parse_bool(value, status);} if (!strcmp(name,"mcmc_tune_covmat")) {found=true;options->mcmc_tune_covmat=i3_options_parse_bool(value, status);} if (!strcmp(name,"max_annealing_temperature")) {found=true;options->max_annealing_temperature=i3_options_parse_float(value, status);} if (!strcmp(name,"annealing_one_point")) {found=true;options->annealing_one_point=i3_options_parse_float(value, status);} if (!strcmp(name,"adaptive_metropolis_interval")) {found=true;options->adaptive_metropolis_interval=i3_options_parse_int(value, status);} if (!strcmp(name,"climbing_only")) {found=true;options->climbing_only=i3_options_parse_bool(value, status);} if (!strcmp(name,"mcmc_filename_base")) {found=true;strcpy(options->mcmc_filename_base,value);} if (!strcmp(name,"use_mcmc_mean")) {found=true;options->use_mcmc_mean=i3_options_parse_bool(value, status);} if (!strcmp(name,"use_mcmc_sample")) {found=true;options->use_mcmc_sample=i3_options_parse_bool(value, status);} if (!strcmp(name,"print_mcmc_samples")) {found=true;options->print_mcmc_samples=i3_options_parse_bool(value, status);} if (!strcmp(name,"starting_params_only")) {found=true;options->starting_params_only=i3_options_parse_bool(value, status);} if (!strcmp(name,"rescale_weight")) {found=true;options->rescale_weight=i3_options_parse_bool(value, status);} if (!strcmp(name,"uberseg")) {found=true;options->uberseg=i3_options_parse_bool(value, status);} if (!strcmp(name,"use_image_flags")) {found=true;options->use_image_flags=i3_options_parse_bool(value, status);} if (!strcmp(name,"reject_outliers")) {found=true;options->reject_outliers=i3_options_parse_bool(value, status);} if (!strcmp(name,"replace_psf_path")) {found=true;strcpy(options->replace_psf_path,value);} if (!strcmp(name,"psfex_rerun_version")) {found=true;strcpy(options->psfex_rerun_version,value);} if (!strcmp(name,"database_output")) {found=true;options->database_output=i3_options_parse_bool(value, status);} if (!found){ if (try_model){ char extended_name[i3_options_max_line_length]; snprintf(extended_name, i3_options_max_line_length,"%s_%s",options->model_name,name); found=i3_options_handle_name_value_body(options, extended_name, value, false, status); if (!found) fprintf(stderr,"Unkown parameter ignored: '%s'\n(Also tried '%s_%s', based on chosen model name)\n",name,options->model_name,name); } return found; } return found;}