MagnetoPy Compatible
If your data can be read into a Magnetometry
object and you are trying to analyze an MvsH
experiment, the CauchyCDFAnalysis
and CauchyPDFAnalysis
classes work within the MagnetoPy
system.
An example notebook demonstrates how to work with the classes and functions described herein: Quantification of Hysteresis Data using Cauchy Distribution Functions
CauchyCDFAnalysis
An analysis of dM/dH vs. H data using a sum of Cauchy cumulative distribution functions (CDFs).
Equation:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
Magnetometry
|
The Magnetometry object containing the data to be analyzed. |
required |
parsing_args |
CauchyParsingArgs
|
The arguments needed to parse the dataset and obtain the data to be analyzed. |
required |
fitting_args |
CauchyFittingArgs | int
|
The arguments needed to perform the fit. If an |
required |
Attributes:
Name | Type | Description |
---|---|---|
parsing_args |
CauchyParsingArgs
|
The arguments needed to parse the dataset and obtain the data to be analyzed. |
fitting_args |
CauchyFittingArgs
|
The arguments needed to perform the fit. |
results |
CauchyAnalysisResults
|
The results of the fit. |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
plot(segment='', show_full_fit=True, show_fit_components=False, show_input=False, **kwargs)
Plots the results of a Cauchy CDF analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
segment |
Literal['', 'forward', 'reverse', 'loop']
|
The segment of the measurement to be plotted. The default option, |
""
|
show_full_fit |
bool
|
Whether to show the full fit (i.e., the composite of the individual terms), by default True. |
True
|
show_fit_components |
bool
|
Whether to show the individual fit components, by default False. |
False
|
show_input |
bool
|
Whether to show the input simulated data, by default False. |
False
|
Returns:
Type | Description |
---|---|
tuple[plt.Figure, plt.Axes]
|
The figure and axes objects. |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
as_dict()
Returns a dictionary representation of the object.
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Keys are: "class", "parsing_args", "fitting_args", "results". |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
CauchyPDFAnalysis
An analysis of dM/dH vs. H data using a sum of Cauchy probability density functions (PDFs).
Equation:
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
Magnetometry
|
The Magnetometry object containing the data to be analyzed. |
required |
parsing_args |
CauchyParsingArgs
|
The arguments needed to parse the dataset and obtain the data to be analyzed. |
required |
fitting_args |
CauchyFittingArgs | int
|
The arguments needed to perform the fit. If an |
required |
Attributes:
Name | Type | Description |
---|---|---|
parsing_args |
CauchyParsingArgs
|
The arguments needed to parse the dataset and obtain the data to be analyzed. |
fitting_args |
CauchyFittingArgs
|
The arguments needed to perform the fit. |
results |
CauchyAnalysisResults
|
The results of the fit. |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
|
plot(show_full_fit=True, show_fit_components=False, input_params=False, **kwargs)
Plots the results of a Cauchy PDF analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
show_full_fit |
bool
|
Whether to show the full fit, by default True. |
True
|
show_fit_components |
bool
|
Whether to show the individual fit components, by default False. |
False
|
input_params |
CauchyFittingArgs | None
|
If given, plots the terms given by the CauchyFittingArgs object, by default None. |
False
|
Returns:
Type | Description |
---|---|
tuple[plt.Figure, plt.Axes]
|
The figure and axes objects. |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
as_dict()
Returns a dictionary representation of the object.
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Keys are: "class", "parsing_args", "fitting_args", "results". |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
CauchyParsingArgs
dataclass
Arguments needed to parse a Magnetometry
object during the course of an
analysis performed by CauchyPDFAnalysis
or CauchyCDFAnalysis
.
Attributes:
Name | Type | Description |
---|---|---|
temperature |
float
|
The temperature in Kelvin of the measurement to be analyzed. |
segments |
(Literal['auto', 'loop', 'forward', 'reverse'], optional)
|
The segments of the measurement to be analyzed. If |
experiment |
(Literal['MvsH'], optional)
|
The type of measurement to be analyzed. Reserved for future use (e.g., |
Source code in magnetopy\analyses\cauchy\magpy_compatible.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
prepare_data(dataset, analysis)
Parses the given dataset and returns a DataFrame containing the data to be analyzed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset |
Magnetometry
|
The Magnetometry object containing the data to be analyzed. |
required |
analysis |
Literal['cdf', 'pdf']
|
The type of analysis to be performed. |
required |
Returns:
Type | Description |
---|---|
pd.DataFrame
|
DataFrame has two columns: "h" and "target", where "h" is the applied field and "target" is the value under investigation, e.g., the magnetization (M), the derivative of magnetization with respect to field (dM/dH), or a form of susceptibility (e.g., chi, chi', chi"). |
Raises:
Type | Description |
---|---|
InvalidExperimentError
|
If the experiment is not supported by the analysis. |