diff --git a/README.md b/README.md index bf2c287..10c443c 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,9 @@ Training requires simulated diffuse gamma-ray events. An example configuration can be found in [examples/config_disp.yaml](examples/config_disp.yaml). +**Note: By applying the disp regressor, `Theta` wil be deleted from the feature set.** +Theta has to be calculated from the source prediction e.g. by using `fact_calculate_theta` from pyfact. + # Utility scripts diff --git a/klaas/scripts/apply_disp_regressor.py b/klaas/scripts/apply_disp_regressor.py index 1f83d53..2cb305d 100644 --- a/klaas/scripts/apply_disp_regressor.py +++ b/klaas/scripts/apply_disp_regressor.py @@ -57,7 +57,9 @@ def main(configuration_path, data_path, disp_model_path, sign_model_path, key, c 'theta_deg_off_' + str(i), 'theta_off_rec_pos_' + str(i), ]) - + + n_del_cols = 0 + with h5py.File(data_path, 'r+') as f: for column in columns_to_delete: if column in f[key].keys(): @@ -68,6 +70,12 @@ def main(configuration_path, data_path, disp_model_path, sign_model_path, key, c ) yes = True del f[key][column] + log.warn("Deleted {} from the feature set.".format(column)) + n_del_cols += 1 + + if n_del_cols > 0: + log.warn("Source dependent features need to be calculated from the predicted source possition. " + + "Use e.g. `fact_calculate_theta` from https://github.com/fact-project/pyfact.") log.info('Loading model') disp_model = joblib.load(disp_model_path) @@ -122,6 +130,6 @@ def main(configuration_path, data_path, disp_model_path, sign_model_path, key, c append_to_h5py(f, rec_pos[:, 1], key, 'source_y_prediction') append_to_h5py(f, disp_prediction, key, 'disp_prediction') - + if __name__ == '__main__': main() diff --git a/setup.py b/setup.py index ce7ca62..b2d1b0c 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='klaas', - version='0.7.0', + version='0.7.1', description='KLAssification And regression Scripts. yay', url='https://github.com/fact-project/klaas', author='Kai Brügge, Maximilian Nöthe, Jens Buss',