Reintroduced option to shortage calculations
This commit is contained in:
@@ -97,7 +97,8 @@ def synth_and_ana(noise_cov,
|
|||||||
|
|
||||||
def mc(
|
def mc(
|
||||||
n, noise_sd, df_parameter_synth, basis_path, output_path,
|
n, noise_sd, df_parameter_synth, basis_path, output_path,
|
||||||
fit_parameters=[], fit_snr=[], fit_sdnoise=[], fit_varnoise=[]
|
fit_parameters=[], fit_snr=[], fit_sdnoise=[], fit_varnoise=[],
|
||||||
|
shortage=False
|
||||||
):
|
):
|
||||||
"""Function for calling synth_and_ana repeatedly,
|
"""Function for calling synth_and_ana repeatedly,
|
||||||
as in Monte-Carlo approach"""
|
as in Monte-Carlo approach"""
|
||||||
@@ -109,6 +110,14 @@ def mc(
|
|||||||
str(round(noise_sd, 3)) + "_runs_"+str(n) + ".csv"
|
str(round(noise_sd, 3)) + "_runs_"+str(n) + ".csv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if shortage:
|
||||||
|
try:
|
||||||
|
noise_fit = pd.read_csv(file_out_path)
|
||||||
|
print("Found existing file: ", file_out_path)
|
||||||
|
return noise_fit, file_out_path
|
||||||
|
except:
|
||||||
|
None
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"Starting noise_sd", round(noise_sd, 2), " with ",
|
"Starting noise_sd", round(noise_sd, 2), " with ",
|
||||||
round(n, 2), "repetitions"
|
round(n, 2), "repetitions"
|
||||||
|
|||||||
Reference in New Issue
Block a user