Parcourir la source

Update generate feature data python script

Jérôme BUISINE il y a 5 ans
Parent
commit
0ff9d07913
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5 2
      generate/generate_all_data.py

+ 5 - 2
generate/generate_all_data.py

@@ -163,8 +163,7 @@ def main():
     parser = argparse.ArgumentParser(description="Compute and prepare data of feature of all scenes (keep in memory min and max value found)")
     parser = argparse.ArgumentParser(description="Compute and prepare data of feature of all scenes (keep in memory min and max value found)")
 
 
     parser.add_argument('--feature', type=str, 
     parser.add_argument('--feature', type=str, 
-                                    help="feature choice in order to compute data (use 'all' if all features are needed)", 
-                                    choices=features_choices)
+                                    help="feature choice in order to compute data (use 'all' if all features are needed)")
 
 
     args = parser.parse_args()
     args = parser.parse_args()
 
 
@@ -177,6 +176,10 @@ def main():
             generate_data_svd(m, 'svdn')
             generate_data_svd(m, 'svdn')
             generate_data_svd(m, 'svdne')
             generate_data_svd(m, 'svdne')
     else:
     else:
+
+        if p_feature not in features_choices:
+            raise ValueError('Unknown feature choice : ', features_choices)
+            
         generate_data_svd(p_feature, 'svd')
         generate_data_svd(p_feature, 'svd')
         generate_data_svd(p_feature, 'svdn')
         generate_data_svd(p_feature, 'svdn')
         generate_data_svd(p_feature, 'svdne')
         generate_data_svd(p_feature, 'svdne')