diff --git a/generate_dataset/dataset_generator.py b/generate_dataset/dataset_generator.py index f09a7ac..58768d4 100644 --- a/generate_dataset/dataset_generator.py +++ b/generate_dataset/dataset_generator.py @@ -25,7 +25,7 @@ def generate_dataset(save_png=False, debug=False): _, cls = os.path.split(circuit_class_folder) cir_path = os.path.join(circuit_class_folder, cls + '.cir') scheme_png_path = os.path.join(circuit_class_folder, cls + '.png') - output_path = os.path.join(DATASET_FOLDER, measurement_variant['name'], cls) + output_path = os.path.join(DATASET_FOLDER, measurement_variant['name']) changer = ParametersChanger(cir_path, parameters_settings) changer.generate_circuits(debug) @@ -37,15 +37,15 @@ def generate_dataset(save_png=False, debug=False): print(output_path, i) analysis = simulator.get_ivc(circuit) if measurement_variant['noise_settings']['without_noise']: - uzf_name = os.path.join(output_path, f'{i}_no_noise.uzf') - png_name = os.path.join(output_path, f'{i}_no_noise.png') + uzf_name = os.path.join(output_path, f'{cls}.uzf') + png_name = os.path.join(output_path, f'p_{cls}.png') simulator.save_ivc(circuit.plot_title, analysis, uzf_name) simulator.save_plot(circuit.plot_title, analysis, png_name, scheme_png_path, save_png=save_png) - for noise_number in range(measurement_variant['noise_settings']['with_noise']): - analysis = simulator.add_noise(analysis, measurement_variant['noise_settings']['SNR']) + # for noise_number in range(measurement_variant['noise_settings']['with_noise']): + # analysis = simulator.add_noise(analysis, measurement_variant['noise_settings']['SNR']) - uzf_name = os.path.join(output_path, f'{i}_noise{noise_number}.uzf') - png_name = os.path.join(output_path, f'{i}_noise{noise_number}.png') - simulator.save_ivc(circuit.plot_title, analysis, uzf_name) - simulator.save_plot(circuit.plot_title, analysis, png_name, scheme_png_path, save_png=save_png) + # uzf_name = os.path.join(output_path, f'{i}_noise{noise_number}.uzf') + # png_name = os.path.join(output_path, f'{i}_noise{noise_number}.png') + # simulator.save_ivc(circuit.plot_title, analysis, uzf_name) + # simulator.save_plot(circuit.plot_title, analysis, png_name, scheme_png_path, save_png=save_png) diff --git a/generate_dataset/measurement_settings.json b/generate_dataset/measurement_settings.json index 4725e8c..7fc02f6 100644 --- a/generate_dataset/measurement_settings.json +++ b/generate_dataset/measurement_settings.json @@ -34,33 +34,33 @@ } }, { - "name": "measurement_10kHz_middle_5v", + "name": "measurement_1kHz_middle_5v", "noise_settings": { "without_noise": true, "with_noise": 0, "SNR": 40.0 }, "measurement_settings": { - "sampling_rate": 1000000, + "sampling_rate": 100000, "internal_resistance": 4750.0, "max_voltage": 5.0, "precharge_delay": 0.01, - "probe_signal_frequency": 10000 + "probe_signal_frequency": 1000 } }, { - "name": "measurement_100kHz_high_5v", + "name": "measurement_10kHz_middle_5v", "noise_settings": { "without_noise": true, "with_noise": 0, "SNR": 40.0 }, "measurement_settings": { - "sampling_rate": 2000000, - "internal_resistance": 47500.0, + "sampling_rate": 1000000, + "internal_resistance": 4750.0, "max_voltage": 5.0, - "precharge_delay": 0.001, - "probe_signal_frequency": 100000 + "precharge_delay": 0.01, + "probe_signal_frequency": 10000 } }, { diff --git a/generate_dataset/parameters_changer.py b/generate_dataset/parameters_changer.py index 9858b20..6a7f916 100644 --- a/generate_dataset/parameters_changer.py +++ b/generate_dataset/parameters_changer.py @@ -91,9 +91,9 @@ def dump_circuits_on_disk(self, base_folder) -> None: :param base_folder: Folder to save .cir files. (If not exist - it's ok) """ os.makedirs(base_folder, exist_ok=True) - for i, circuit in enumerate(self.circuits): - with open(os.path.join(base_folder, f'{i}.cir'), 'w+') as f: - f.write(str(circuit)) + # for i, circuit in enumerate(self.circuits): + # with open(os.path.join(base_folder, f'{i}.cir'), 'w+') as f: + # f.write(str(circuit)) def _params_combination_to_circuit(self, params_combination): # Make from combination-dict a circuit with this params.