1717 type = str ,
1818 required = True ,
1919 help = "EccDefinition method to save the regression data for." )
20+ parser .add_argument (
21+ "--interp_method" ,
22+ type = str ,
23+ required = True ,
24+ help = "omega_gw_extrema_interpolation_method to save the regression data for." )
2025args = parser .parse_args ()
2126
2227
23- def generate_regression_data (method ):
28+ def generate_regression_data (method , interp_method ):
2429 """Generate data for regression test using a method."""
2530 # Load test waveform
2631 lal_kwargs = {"approximant" : "EccentricTD" ,
@@ -42,7 +47,7 @@ def generate_regression_data(method):
4247 raise Exception (f"method { method } is not available. Must be one of "
4348 f"{ available_methods } " )
4449
45- extra_kwargs = {}
50+ extra_kwargs = {"omega_gw_extrema_interpolation_method" : interp_method }
4651 user_kwargs = extra_kwargs .copy ()
4752 regression_data .update ({"extra_kwargs" : extra_kwargs })
4853 # Try evaluating at an array of times
@@ -56,9 +61,9 @@ def generate_regression_data(method):
5661 meanano_ref = gwecc_dict ["mean_anomaly" ]
5762 # We save the measured data 3 reference times
5863 n = len (tref_out )
59- dict_tref = {"time" : [tref_out [0 ], tref_out [n // 4 ], tref_out [n // 2 ]],
60- "eccentricity" : [ecc_ref [0 ], ecc_ref [n // 4 ], ecc_ref [n // 2 ]],
61- "mean_anomaly" : [meanano_ref [0 ], meanano_ref [n // 4 ], meanano_ref [n // 2 ]]}
64+ dict_tref = {"time" : [tref_out [n // 8 ], tref_out [n // 4 ], tref_out [n // 2 ]],
65+ "eccentricity" : [ecc_ref [n // 8 ], ecc_ref [n // 4 ], ecc_ref [n // 2 ]],
66+ "mean_anomaly" : [meanano_ref [n // 8 ], meanano_ref [n // 4 ], meanano_ref [n // 2 ]]}
6267
6368 # Try evaluating at an array of frequencies
6469 gwecc_dict = measure_eccentricity (
@@ -70,18 +75,18 @@ def generate_regression_data(method):
7075 ecc_ref = gwecc_dict ["eccentricity" ]
7176 meanano_ref = gwecc_dict ["mean_anomaly" ]
7277 n = len (fref_out )
73- dict_fref = {"frequency" : [fref_out [0 ], fref_out [n // 4 ], fref_out [n // 2 ]],
74- "eccentricity" : [ecc_ref [0 ], ecc_ref [n // 4 ], ecc_ref [n // 2 ]],
75- "mean_anomaly" : [meanano_ref [0 ], meanano_ref [n // 4 ], meanano_ref [n // 2 ]]}
78+ dict_fref = {"frequency" : [fref_out [n // 8 ], fref_out [n // 4 ], fref_out [n // 2 ]],
79+ "eccentricity" : [ecc_ref [n // 8 ], ecc_ref [n // 4 ], ecc_ref [n // 2 ]],
80+ "mean_anomaly" : [meanano_ref [n // 8 ], meanano_ref [n // 4 ], meanano_ref [n // 2 ]]}
7681 regression_data .update ({"tref" : dict_tref ,
7782 "fref" : dict_fref })
7883
7984 if not os .path .exists (data_dir ):
8085 os .mkdir (data_dir )
8186 # save to a json file
82- fl = open (f"{ data_dir } /{ method } _regression_data.json" , "w" )
87+ fl = open (f"{ data_dir } /{ method } _ { interp_method } _regression_data.json" , "w" )
8388 json .dump (regression_data , fl )
8489 fl .close ()
8590
8691# generate regression data
87- generate_regression_data (args .method )
92+ generate_regression_data (args .method , args . interp_method )
0 commit comments