diff --git a/examples/example.ini b/examples/example.ini index c1f9edcc..cac0a5be 100644 --- a/examples/example.ini +++ b/examples/example.ini @@ -78,7 +78,7 @@ q_max = 90 # Training data file training_image = /home/ceholden/Documents/yatsm/examples/training_data.gtif # Training data masked values -mask_values = 0,255 +roi_mask_values = 0,255 # Date range training_start = 1999-01-01 training_end = 2001-01-01 diff --git a/examples/p035r032_example.ini b/examples/p035r032_example.ini index 997e69cf..6688dffe 100644 --- a/examples/p035r032_example.ini +++ b/examples/p035r032_example.ini @@ -78,7 +78,7 @@ q_max = 90 # Training data file training_image = # Training data masked values -mask_values = 0,255 +roi_mask_values = 0,255 # Date range training_start = 1999-01-01 training_end = 2001-01-01 diff --git a/scripts/train_yatsm.py b/scripts/train_yatsm.py index d4a63ca0..5d2be3f6 100755 --- a/scripts/train_yatsm.py +++ b/scripts/train_yatsm.py @@ -128,7 +128,7 @@ def get_training_inputs(dataset_config, exit_on_missing=False): raise # Loop through samples in ROI extracting features - mask = ~np.in1d(roi, dataset_config['mask_values']).reshape(roi.shape) + mask = ~np.in1d(roi, dataset_config['roi_mask_values']).reshape(roi.shape) row, col = np.where(mask) y = roi[row, col] diff --git a/yatsm/config_parser.py b/yatsm/config_parser.py index 2e0198d8..fb54907b 100644 --- a/yatsm/config_parser.py +++ b/yatsm/config_parser.py @@ -30,7 +30,7 @@ def parse_config_v0_1_x(config_file): robust = false [classification] training_image = None -mask_values = 0, 255 +roi_mask_values = 0, 255 cache_training = """ @@ -57,12 +57,12 @@ def parse_config_v0_1_x(config_file): if config.has_section('classification'): dataset_config['training_image'] = config.get('classification', 'training_image') - dataset_config['mask_values'] = config.get('classification', - 'mask_values') - if dataset_config['mask_values']: - dataset_config['mask_values'] = np.array([ + dataset_config['roi_mask_values'] = config.get('classification', + 'roi_mask_values') + if dataset_config['roi_mask_values']: + dataset_config['roi_mask_values'] = np.array([ int(v) for v in - dataset_config['mask_values'].replace(' ', ',').split(',') + dataset_config['roi_mask_values'].replace(' ', ',').split(',') if v != ',']) dataset_config['cache_training'] = config.get( 'classification', 'cache_training')