@@ -10,22 +10,28 @@ def create_parser():
10
10
description = "Stretched Nonnegative Matrix Factorization"
11
11
)
12
12
parser .add_argument ('-v' , '--version' , action = 'version' , help = 'Print the software version number' )
13
- parser .add_argument ('-d' , '--directory' , type = str ,
14
- help = "Directory containing experimental data. Ensure it is in quotations or apostrophes." )
15
-
16
- parser .add_argument ('component_number' , type = int ,
13
+ parser .add_argument ('-i' , '--input-directory' , type = str ,
14
+ help = "Directory containing experimental data. Has a default value of None which sets the input as your current working directory." )
15
+ parser .add_argument ('-o' , '--output-directory' , type = str ,
16
+ help = "The directory where the results will be dumped. Default behavior will create a new directory named 'smnf_results' inside the input directory." )
17
+ parser .add_argument ('-t' , '--data-type' , type = str , choices = ['xrd' , 'pdf' ],
18
+ help = "The type of the experimental data." )
19
+ parser .add_argument ('components' , type = int ,
17
20
help = "The number of component signals to obtain from experimental "
18
21
"data. Must be an integer greater than 0." )
19
- parser .add_argument ('data_type' , type = str , choices = ['xrd' , 'pdf' ], help = "The type of the experimental data." )
20
22
args = parser .parse_args ()
21
23
return args
22
24
23
25
24
26
def main ():
25
27
args = create_parser ()
26
28
27
- grid , data_input = load_input_signals (args .directory )
28
- variables = initialize_variables (data_input , args .component_number , args .data_type )
29
+ grid , data_input , data_type = load_input_signals (args .input_directory )
30
+ if args .data_type is not None :
31
+ variables = initialize_variables (data_input , args .components , args .data_type )
32
+ else :
33
+ variables = initialize_variables (data_input , args .components , data_type )
34
+
29
35
if variables ["data_type" ] == 'pdf' :
30
36
lifted_data = data_input - np .ndarray .min (data_input [:])
31
37
maxiter = 300
0 commit comments