@@ -79,22 +79,22 @@ Schema::Schema(const std::string & input_file_name,
7979 const std::string & params_file_name){
8080 // create a parameter list from the selected file
8181 Teuchos::RCP<Teuchos::ParameterList> corr_params = read_correlation_params (params_file_name);
82- default_constructor_tasks (corr_params);
8382 // create a parameter list from the selected file
8483 Teuchos::RCP<Teuchos::ParameterList> input_params = read_input_params (input_file_name);
84+ default_constructor_tasks (corr_params,input_params);
8585 initialize (input_params,corr_params);
8686}
8787
8888Schema::Schema (const Teuchos::RCP<Teuchos::ParameterList> & input_params,
8989 const Teuchos::RCP<Teuchos::ParameterList> & correlation_params){
90- default_constructor_tasks (correlation_params);
90+ default_constructor_tasks (correlation_params,input_params );
9191 initialize (input_params,correlation_params);
9292}
9393
9494Schema::Schema (const Teuchos::RCP<Teuchos::ParameterList> & input_params,
9595 const Teuchos::RCP<Teuchos::ParameterList> & correlation_params,
9696 const Teuchos::RCP<Schema> & schema){
97- default_constructor_tasks (correlation_params);
97+ default_constructor_tasks (correlation_params,input_params );
9898 initialize (input_params,schema);
9999}
100100
@@ -445,7 +445,8 @@ Schema::set_ref_image(Teuchos::RCP<Image> img){
445445}
446446
447447void
448- Schema::default_constructor_tasks (const Teuchos::RCP<Teuchos::ParameterList> & params){
448+ Schema::default_constructor_tasks (const Teuchos::RCP<Teuchos::ParameterList> & corr_params,
449+ const Teuchos::RCP<Teuchos::ParameterList> & input_params){
449450 global_num_subsets_ = 0 ;
450451 local_num_subsets_ = 0 ;
451452 subset_dim_ = -1 ;
@@ -462,8 +463,15 @@ Schema::default_constructor_tasks(const Teuchos::RCP<Teuchos::ParameterList> & p
462463 normalize_gamma_with_active_pixels_ = false ;
463464 gauss_filter_images_ = false ;
464465 gauss_filter_mask_size_ = 7 ;
465- init_params_ = params==Teuchos::null ? Teuchos::rcp (new Teuchos::ParameterList ()):
466- Teuchos::rcp (new Teuchos::ParameterList (*params));
466+ init_params_ = corr_params==Teuchos::null ? Teuchos::rcp (new Teuchos::ParameterList ()):
467+ Teuchos::rcp (new Teuchos::ParameterList (*corr_params));
468+ if (input_params!=Teuchos::null){
469+ // copy over the camera system file to so both the input and correlation params have it
470+ // could be needed by the post processors
471+ if (input_params->isParameter (DICe::camera_system_file)){
472+ init_params_->set (DICe::camera_system_file,input_params->get <std::string>(DICe::camera_system_file));
473+ }
474+ }
467475 comm_ = Teuchos::rcp (new MultiField_Comm ());
468476 path_file_names_ = Teuchos::rcp (new std::map<int_t ,std::string>());
469477 optical_flow_flags_ = Teuchos::rcp (new std::map<int_t ,bool >());
@@ -478,7 +486,7 @@ Schema::default_constructor_tasks(const Teuchos::RCP<Teuchos::ParameterList> & p
478486 read_full_images_ = false ;
479487 sort_txt_output_ = false ;
480488 threshold_block_size_ = -1 ;
481- set_params (params );
489+ set_params (corr_params );
482490 prev_imgs_.push_back (Teuchos::null);
483491 def_imgs_.push_back (Teuchos::null);
484492 has_extents_ = false ;
@@ -771,6 +779,13 @@ Schema::set_params(const Teuchos::RCP<Teuchos::ParameterList> & params){
771779 Teuchos::RCP<VSG_Strain_Post_Processor> vsg_ptr = Teuchos::rcp (new VSG_Strain_Post_Processor (ppParams));
772780 post_processors_.push_back (vsg_ptr);
773781 }
782+ if (diceParams->isParameter (DICe::post_process_distortion_correction)){
783+ Teuchos::RCP<Teuchos::ParameterList> ppParams = Teuchos::rcp ( new Teuchos::ParameterList ());
784+ TEUCHOS_TEST_FOR_EXCEPTION (!init_params_->isParameter (camera_system_file),std::runtime_error," Error, Distortion Correction Post Processor requires a camera system file" );
785+ ppParams->set <std::string>(camera_system_file,init_params_->get <std::string>(camera_system_file));
786+ Teuchos::RCP<Distortion_Correction_Post_Processor> dc_ptr = Teuchos::rcp (new Distortion_Correction_Post_Processor (ppParams));
787+ post_processors_.push_back (dc_ptr);
788+ }
774789 if (diceParams->isParameter (DICe::post_process_plotly_contour)){
775790 Teuchos::ParameterList sublist = diceParams->sublist (DICe::post_process_plotly_contour);
776791 Teuchos::RCP<Teuchos::ParameterList> ppParams = Teuchos::rcp ( new Teuchos::ParameterList ());
@@ -977,10 +992,6 @@ Schema::initialize(const Teuchos::RCP<Teuchos::ParameterList> & input_params,
977992 const std::string output_prefix = input_params->get <std::string>(DICe::output_prefix," DICe_solution" );
978993 init_params_->set (DICe::output_prefix,output_prefix);
979994 init_params_->set (DICe::output_folder,output_folder);
980- if (input_params->isParameter (DICe::camera_system_file)){
981- const std::string camera_sys_file = input_params->get <std::string>(DICe::camera_system_file);
982- init_params_->set (DICe::camera_system_file,camera_sys_file);
983- }
984995
985996 if (analysis_type_==GLOBAL_DIC){
986997 // create the computational mesh:
0 commit comments