Skip to content

Commit

Permalink
added additional enumerations for datasheet plots and json-file keys
Browse files Browse the repository at this point in the history
created new script to create empty material place in database
  • Loading branch information
Sebastian Schachten committed Nov 5, 2024
1 parent d37dc51 commit b9b2446
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 9 deletions.
30 changes: 30 additions & 0 deletions materialdatabase/enumerations.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,36 @@ class MeasurementDevice(str, Enum):
zimmer = "ZES_Zimmer_LMG640"


class DatasheetPlotName(str, Enum):
"""Sets the type of the datasheet plot."""

complex_permeability = "complex_permeability"
initial_permeability_temperature = "initial_permeability_temperature"
initial_permeability_frequency = "initial_permeability_frequency"
incremental_permeability_field_strength = "incremental_permeability_field_strength"
amplitude_permeability_flux_density = "amplitude_permeability_flux_density"
b_h_curve = "b_h_curve"
relative_core_loss_frequency = "relative_core_loss_frequency"
relative_core_loss_flux_density = "relative_core_loss_flux_density"
relative_core_loss_temperature = "relative_core_loss_temperature"
permeability_data = "permeability_data"


class MeasurementParameter(str, Enum):
"""Sets the type of the measurement parameter."""

signal_shape = "signal_shape"
temperature = "temperature"
frequency = "frequency"
H_DC_offset = "H_DC_offset"
flux_density = "flux_density"
field_strength = "field_strength"
mu_r_abs = "mu_r_abs"
mu_phi_deg = "mu_phi_deg"
epsilon_r = "epsilon_r"
epsilon_phi_deg = "epsilon_phi_deg"


class PlotLabels(str, Enum):
"""Labels for axes of possible plots."""

Expand Down
19 changes: 19 additions & 0 deletions materialdatabase/scripts/create_empty_material_in_database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Script to create empty material in database."""
from materialdatabase.material_data_base_classes import *


# Control
WRITE = True

# Set parameters
material_name = Material._3F4
manufacturer = Manufacturer.Ferroxcube
initial_permeability = 2300
resistivity = 5
max_flux_density = 0.47
volumetric_mass_density = 4800


if WRITE:
create_empty_material(material_name=material_name, manufacturer=manufacturer, initial_permeability=initial_permeability, resistivity=resistivity,
max_flux_density=max_flux_density, volumetric_mass_density=volumetric_mass_density)
18 changes: 9 additions & 9 deletions materialdatabase/scripts/write_datasheet_plots_into_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"temperature": data[2]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["complex_permeability"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.complex_permeability] = data_list

# INITIAL PERMEABILITY VERSUS FREQUENCY ------------------------------------------------------------------------------------------------------------------
if not initial_permeability_frequency:
Expand All @@ -195,7 +195,7 @@
"frequency": list(df[0])}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["initial_permeability_frequency"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.initial_permeability_frequency] = data_list


# INITIAL PERMEABILITY VERSUS TEMPERATURE ------------------------------------------------------------------------------------------------------------------
Expand All @@ -219,7 +219,7 @@
"temperature": list(df[0])}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["initial_permeability_temperature"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.initial_permeability_temperature] = data_list


# INCREMENTAL PERMEABILITY VERSUS FIELD STRENGTH----------------------------------------------------------------------------------------------------------------
Expand All @@ -245,7 +245,7 @@
"temperature": data[2]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["incremental_permeability_field_strength"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.incremental_permeability_field_strength] = data_list

# AMPLITUDE PERMEABILITY VERSUS FLUX DENSITY ---------------------------------------------------------------------------------------------------------------
if not amplitude_permeability_flux_density:
Expand All @@ -270,7 +270,7 @@
"temperature": data[2]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["amplitude_permeability_flux_density"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.amplitude_permeability_flux_density] = data_list

# HYSTERESIS-CURVE -----------------------------------------------------------------------------------------------------------------------------------------
if not bh_curves:
Expand Down Expand Up @@ -298,7 +298,7 @@
"temperature": data[3]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["b_h_curve"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.b_h_curve] = data_list

# RELATIVE CORE LOSS VERSUS FLUX DENSITY -------------------------------------------------------------------------------------------------------------------
if not relative_core_loss_flux_density:
Expand All @@ -323,7 +323,7 @@
"temperature": data[2]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["relative_core_loss_flux_density"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.relative_core_loss_flux_density] = data_list

# RELATIVE CORE LOSS VERSUS TEMPERATURE --------------------------------------------------------------------------------------------------------------------
if not relative_core_loss_temperature:
Expand All @@ -348,7 +348,7 @@
"flux_density": data[2]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["relative_core_loss_temperature"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.relative_core_loss_temperature] = data_list

# RELATIVE CORE LOSS VERSUS FREQUENCY ----------------------------------------------------------------------------------------------------------------------
if not relative_core_loss_frequency:
Expand All @@ -372,7 +372,7 @@
"flux_density": data[2]}
data_list.append(data_dict)

database[material]["manufacturer_datasheet"]["relative_core_loss_frequency"] = data_list
database[material][MaterialDataSource.ManufacturerDatasheet][DatasheetPlotName.relative_core_loss_frequency] = data_list

if WRITE:
with open(relative_path_to_db, "w") as jsonFile:
Expand Down

0 comments on commit b9b2446

Please sign in to comment.