-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b42b537
commit 6e6c483
Showing
80 changed files
with
280 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .interpol import interpol | ||
|
||
__all__ = [ | ||
'interpol' | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
from .interpol import interpol | ||
from .Msqr_HbyM import Msqr_HbyM | ||
from .data_reading import data_reading | ||
from .color_marker import color_marker | ||
from .data_plotting import data_plotting | ||
from .delSm_T import delSm_T | ||
from .delSm_Pivoting import delSm_Pivoting | ||
from .MH_Pivoting import MH_Pivoting | ||
from .arrott_plotting import arrott_plotting | ||
from .data_writing import data_writing | ||
from .T_FWHM_RCP import T_FWHM_RCP | ||
from .data_3d_plotting import mce_3d | ||
from .mag_sus import mag_sus | ||
from .mce_2D_Operations.data_2d_operation import mce | ||
from .mce_3D_Distribution.data_3d_plotting import mce_3d | ||
from .MH_Interpolation.interpol import interpol | ||
|
||
__all__ = [ | ||
'interpol', | ||
'Msqr_HbyM', | ||
'data_reading', | ||
'color_marker', | ||
'data_plotting', | ||
'delSm_T', | ||
'delSm_Pivoting', | ||
'MH_Pivoting', | ||
'arrott_plotting', | ||
'data_writing', | ||
'T_FWHM_RCP', | ||
'mce_3d', | ||
'mag_sus' | ||
'mce', | ||
'mce_3d' | ||
] | ||
# magnetocaloric package | ||
# Developed by Supratim Das | ||
# First release: November 5, 2021 | ||
# Email: supratim0707@gmail.com | ||
|
||
# This file can include package-level metadata or comments. | ||
# It's executed when the package is imported. | ||
|
||
# Example metadata: | ||
|
||
__version__ = '1.6.6' # Package version | ||
__author__ = 'Supratim Das' # Package author | ||
__email__ = 'supratim0707@gmail.com' #Get in Touch | ||
__description__ = 'Effective Approach To Calculate Magnetocaloric Effect Of Any Magnetic Material Using Python' # Package description | ||
__license__ = 'MIT' # License information | ||
__url__ = 'https://pypi.org/project/magnetocaloric/' # URL to the package's repository | ||
__keywords__ = ['magnetism', 'thermodynamics', 'magnetocaloric'] # Keywords describing the package |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .data_2d_operation import mce | ||
|
||
__all__ = [ | ||
'mce' | ||
] |
File renamed without changes.
File renamed without changes.
81 changes: 81 additions & 0 deletions
81
build/lib/magnetocaloric/mce_2D_Operations/data_2d_operation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import matplotlib.pyplot as plt | ||
import sys | ||
from .Msqr_HbyM import Msqr_HbyM | ||
from .data_reading import data_reading | ||
from .color_marker import color_marker | ||
from .data_plotting import data_plotting | ||
from .delSm_T import delSm_T | ||
from .delSm_Pivoting import delSm_Pivoting | ||
from .MH_Pivoting import MH_Pivoting | ||
from .arrott_plotting import arrott_plotting | ||
from .data_writing import data_writing | ||
from .T_FWHM_RCP import T_FWHM_RCP | ||
from .mag_sus import mag_sus | ||
from .N_exponent import n_expo | ||
|
||
if not sys.warnoptions: | ||
import warnings | ||
warnings.simplefilter("ignore") | ||
|
||
plt.rcParams.update({'font.size': 7}) | ||
|
||
|
||
def mce(samp_name, file_dir, sheet_index, T_row, H_col, g_name, M_unit, H_unit, T_unit, plot_legend, loc, field, linear_threshold, save_data): | ||
""" | ||
Perform Magnetocaloric Effect (MCE) analysis. | ||
Args: | ||
n (int): Number of temperature values. | ||
one_n (int): Number of data points at each temperature. | ||
Returns: | ||
None: The function performs the MCE analysis and generates plots, without returning any value. | ||
""" | ||
# Data Collection | ||
H, M, T, n, one_n, two_n = data_reading(file_dir, sheet_index, T_row, H_col) | ||
# Entropy Change Calculation | ||
three_entropy_change_con, temperatures, Label_one = delSm_T(n, one_n, two_n, H, M, T) | ||
five_entropy_change_con, six_entropy_change_con = delSm_Pivoting(n, three_entropy_change_con, Label_one, temperatures) | ||
# Local Exponent Calculation | ||
N_expo_con, T_arr, H_arr, N_H_label = n_expo(n, one_n, two_n, H, M, T) | ||
# Color and Marker Definitions | ||
colour, marker = color_marker() | ||
# Magnetization and Field Reshaping | ||
one_M_plot_final, two_M_plot_final = MH_Pivoting(one_n, n, M, H) | ||
# Arrott Plot | ||
H_plot_final, M_sqr, one_H_by_M_con = Msqr_HbyM(one_n, n, M, H, T, one_M_plot_final) | ||
# Susceptibility | ||
susceptibility_final = [] | ||
T_sus = [] | ||
sus_inv = [] | ||
sus = [] | ||
np_T_sus = [] | ||
regression_line = [] | ||
np_T_sus_bu = [] | ||
regression_bu = [] | ||
x = 0 | ||
if (g_name== 'sus_plot' or g_name== 'all_plots'): | ||
susceptibility_final, T_sus, sus_inv, sus, np_T_sus, regression_line, np_T_sus_bu, regression_bu, x = mag_sus(g_name, n, one_n, T, H, M, field, linear_threshold) | ||
else: | ||
pass | ||
T_FWHM_con = [] | ||
T_FWHM_con_final = [] | ||
RCP_con = [] | ||
RCP_final = [] | ||
H_for_RCP = [] | ||
if (g_name== 'RCP_plot' or g_name== 'all_plots'): | ||
# Calculate T_FWHM and RCP | ||
T_FWHM_con, T_FWHM_con_final, RCP_con, RCP_final, H_for_RCP = T_FWHM_RCP(n, Label_one, six_entropy_change_con) | ||
else: | ||
pass | ||
# Data Visualization | ||
data_plotting(g_name, one_n, n, T, H, M_unit, H_unit, T_unit, colour, marker, Label_one, plot_legend, loc, one_M_plot_final, two_M_plot_final, H_plot_final, temperatures, five_entropy_change_con, M_sqr, one_H_by_M_con, N_expo_con, T_arr, N_H_label, T_sus, sus_inv, sus, np_T_sus, regression_line, np_T_sus_bu, regression_bu, x, linear_threshold, T_FWHM_con, T_FWHM_con_final, RCP_con, RCP_final, H_for_RCP, samp_name) | ||
# Modified Arrott Plot | ||
M_pow_MFT, H_by_M_pow_MFT, M_pow_TMFT, H_by_M_pow_TMFT, M_pow_3DH, H_by_M_pow_3DH, M_pow_3DI, H_by_M_pow_3DI = arrott_plotting(g_name, n, one_M_plot_final, one_H_by_M_con) | ||
# Store Data to Excel Files | ||
if (save_data == 'allow'): | ||
data_writing(g_name, file_dir, n, T, Label_one, six_entropy_change_con, M_sqr, one_H_by_M_con, M_pow_MFT, H_by_M_pow_MFT, M_pow_TMFT, H_by_M_pow_TMFT, M_pow_3DH, H_by_M_pow_3DH, M_pow_3DI, H_by_M_pow_3DI, susceptibility_final, T_FWHM_con_final, RCP_final, H_for_RCP, N_expo_con, T_arr, N_H_label) | ||
else: | ||
pass | ||
return ("") | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .data_3d_plotting import mce_3d | ||
|
||
__all__ = [ | ||
'mce_3d', | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,18 @@ | ||
import numpy as np | ||
import xlsxwriter | ||
from random import randint | ||
import xlrd | ||
import matplotlib.pyplot as plt | ||
from num2words import num2words | ||
# Import necessary libraries | ||
import sys | ||
import itertools | ||
|
||
import matplotlib.pyplot as plt | ||
|
||
from .interpol import interpol | ||
from .Msqr_HbyM import Msqr_HbyM | ||
from .data_reading import data_reading | ||
from .color_marker import color_marker | ||
from .data_plotting import data_plotting | ||
from .delSm_T import delSm_T | ||
from .delSm_Pivoting import delSm_Pivoting | ||
from .MH_Pivoting import MH_Pivoting | ||
from .arrott_plotting import arrott_plotting | ||
from .data_writing import data_writing | ||
from .T_FWHM_RCP import T_FWHM_RCP | ||
from .data_3d_plotting import mce_3d | ||
from .mag_sus import mag_sus | ||
from .N_exponent import n_expo | ||
# Import modules from different packages | ||
from .mce_2D_Operations.data_2d_operation import mce | ||
from .mce_3D_Distribution.data_3d_plotting import mce_3d | ||
from .MH_Interpolation.interpol import interpol | ||
|
||
# Suppress warnings if not already suppressed | ||
if not sys.warnoptions: | ||
import warnings | ||
warnings.simplefilter("ignore") | ||
|
||
# Customize font size for matplotlib | ||
plt.rcParams.update({'font.size': 7}) | ||
|
||
|
||
def mce(samp_name, file_dir, sheet_index, T_row, H_col, g_name, M_unit, H_unit, T_unit, plot_legend, loc, field, linear_threshold, save_data): | ||
""" | ||
Perform Magnetocaloric Effect (MCE) analysis. | ||
Args: | ||
n (int): Number of temperature values. | ||
one_n (int): Number of data points at each temperature. | ||
Returns: | ||
None: The function performs the MCE analysis and generates plots, without returning any value. | ||
""" | ||
# Data Collection | ||
H, M, T, n, one_n, two_n = data_reading(file_dir, sheet_index, T_row, H_col) | ||
# Entropy Change Calculation | ||
three_entropy_change_con, temperatures, Label_one = delSm_T(n, one_n, two_n, H, M, T) | ||
five_entropy_change_con, six_entropy_change_con = delSm_Pivoting(n, three_entropy_change_con, Label_one, temperatures) | ||
# Local Exponent Calculation | ||
N_expo_con, T_arr, H_arr, N_H_label = n_expo(n, one_n, two_n, H, M, T) | ||
# Color and Marker Definitions | ||
colour, marker = color_marker() | ||
# Magnetization and Field Reshaping | ||
one_M_plot_final, two_M_plot_final = MH_Pivoting(one_n, n, M, H) | ||
# Arrott Plot | ||
H_plot_final, M_sqr, one_H_by_M_con = Msqr_HbyM(one_n, n, M, H, T, one_M_plot_final) | ||
# Susceptibility | ||
susceptibility_final = [] | ||
T_sus = [] | ||
sus_inv = [] | ||
sus = [] | ||
np_T_sus = [] | ||
regression_line = [] | ||
np_T_sus_bu = [] | ||
regression_bu = [] | ||
x = 0 | ||
if (g_name== 'sus_plot' or g_name== 'all_plots'): | ||
susceptibility_final, T_sus, sus_inv, sus, np_T_sus, regression_line, np_T_sus_bu, regression_bu, x = mag_sus(g_name, n, one_n, T, H, M, field, linear_threshold) | ||
else: | ||
pass | ||
T_FWHM_con = [] | ||
T_FWHM_con_final = [] | ||
RCP_con = [] | ||
RCP_final = [] | ||
H_for_RCP = [] | ||
if (g_name== 'RCP_plot' or g_name== 'all_plots'): | ||
# Calculate T_FWHM and RCP | ||
T_FWHM_con, T_FWHM_con_final, RCP_con, RCP_final, H_for_RCP = T_FWHM_RCP(n, Label_one, six_entropy_change_con) | ||
else: | ||
pass | ||
# Data Visualization | ||
data_plotting(g_name, one_n, n, T, H, M_unit, H_unit, T_unit, colour, marker, Label_one, plot_legend, loc, one_M_plot_final, two_M_plot_final, H_plot_final, temperatures, five_entropy_change_con, M_sqr, one_H_by_M_con, N_expo_con, T_arr, N_H_label, T_sus, sus_inv, sus, np_T_sus, regression_line, np_T_sus_bu, regression_bu, x, linear_threshold, T_FWHM_con, T_FWHM_con_final, RCP_con, RCP_final, H_for_RCP, samp_name) | ||
# Modified Arrott Plot | ||
M_pow_MFT, H_by_M_pow_MFT, M_pow_TMFT, H_by_M_pow_TMFT, M_pow_3DH, H_by_M_pow_3DH, M_pow_3DI, H_by_M_pow_3DI = arrott_plotting(g_name, n, one_M_plot_final, one_H_by_M_con) | ||
# Store Data to Excel Files | ||
if (save_data == 'allow'): | ||
data_writing(g_name, file_dir, n, T, Label_one, six_entropy_change_con, M_sqr, one_H_by_M_con, M_pow_MFT, H_by_M_pow_MFT, M_pow_TMFT, H_by_M_pow_TMFT, M_pow_3DH, H_by_M_pow_3DH, M_pow_3DI, H_by_M_pow_3DI, susceptibility_final, T_FWHM_con_final, RCP_final, H_for_RCP, N_expo_con, T_arr, N_H_label) | ||
else: | ||
pass | ||
return ("") | ||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .interpol import interpol | ||
|
||
__all__ = [ | ||
'interpol' | ||
] |
Binary file added
BIN
+262 Bytes
magnetocaloric/MH_Interpolation/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file renamed
BIN
+7.3 KB
...oric/__pycache__/interpol.cpython-311.pyc → ...tion/__pycache__/interpol.cpython-311.pyc
Binary file not shown.
File renamed without changes.
Oops, something went wrong.