project
logger = logging.getLogger(__name__)
module-attribute
Q_MIN = 0.001
module-attribute
Q_MAX = 0.3
module-attribute
Q_RESOLUTION = 500
module-attribute
DEFAULT_MINIMIZER = AvailableMinimizers.LMFit_leastsq
module-attribute
CalculatorFactory
Bases: InterfaceFactoryTemplate
Source code in src/easyreflectometry/calculators/factory.py
12 13 14 15 16 17 18 19 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 | |
fit_func
property
Fit func.
__init__()
Init function.
Source code in src/easyreflectometry/calculators/factory.py
13 14 15 | |
reset_storage()
Reset storage.
Source code in src/easyreflectometry/calculators/factory.py
17 18 19 | |
sld_profile(model_id)
Sld profile.
Source code in src/easyreflectometry/calculators/factory.py
21 22 23 | |
DataSet1D
Bases: SerializerComponent
Source code in src/easyreflectometry/data/data_store.py
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 124 125 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 | |
model
property
writable
Model function.
is_experiment
property
Is experiment.
is_simulation
property
Is simulation.
__init__(name='Series', x=None, y=None, ye=None, xe=None, model=None, x_label='x', y_label='y', auto_background=True)
Init function.
Source code in src/easyreflectometry/data/data_store.py
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 124 125 126 127 128 129 130 131 132 133 | |
data_points()
Data points.
Source code in src/easyreflectometry/data/data_store.py
155 156 157 | |
__repr__()
Repr function.
Source code in src/easyreflectometry/data/data_store.py
159 160 161 | |
MultiFitter
Source code in src/easyreflectometry/fitting.py
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 274 275 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 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | |
sampler
property
The Sampler behind the most recent :meth:mcmc_sample call, or None.
Holds the live BUMPS chain state, so the sampling run can be continued
with fitter.sampler.extend(additional_samples=...) instead of
starting a fresh chain.
chi2
property
Total chi-squared across all fitted datasets, or None if no fit has been performed.
reduced_chi
property
Reduced chi-squared from the most recent fit, or None if no fit has been performed.
classical_chi2
property
Classical chi-squared using only points with positive variances.
classical_reduced_chi
property
Reduced classical chi-squared using only points with positive variances.
objective_chi2
property
Objective-space chi-squared returned by the minimizer.
objective_reduced_chi
property
Objective-space reduced chi-squared returned by the minimizer.
__init__(*args, objective='hybrid')
A convenience class for the class:
easyscience.Fitting.Fitting
which will populate the class:
sc.DataGroup appropriately
after the fitting is performed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Model
|
Reflectometry model(s). |
()
|
objective
|
str
|
Zero-variance handling strategy. One of
|
'hybrid'
|
Source code in src/easyreflectometry/fitting.py
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 | |
fit(data, id=0, objective=None)
Perform the fitting and populate the DataGroups with the result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
sc.DataGroup
|
DataGroup to be fitted to and populated. |
required |
id
|
int
|
Unused parameter kept for backward compatibility. By default, 0. |
0
|
objective
|
str | None
|
Per-call override for the zero-variance objective.
If |
None
|
Returns:
| Type | Description |
|---|---|
sc.DataGroup
|
A new DataGroup with fitted model curves, SLD profiles, and fit statistics. |
Source code in src/easyreflectometry/fitting.py
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 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | |
fit_single_data_set_1d(data, objective=None)
Perform fitting on a single 1D dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataSet1D
|
The 1D dataset to fit. Note that |
required |
objective
|
str | None
|
Per-call override for the zero-variance objective.
If |
None
|
Returns:
| Type | Description |
|---|---|
FitResults
|
Fit results from the minimizer. |
Source code in src/easyreflectometry/fitting.py
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 | |
mcmc_sample(data, samples=10000, burn=2000, thin=10, population=None, objective=None, initializer=None, progress_callback=None, abort_test=None)
Run Bayesian MCMC sampling on reflectometry data using the DREAM sampler.
Requires that the minimizer is a BUMPS instance (i.e. the minimizer was
switched to AvailableMinimizers.Bumps).
:param data: DataGroup with reflectivity data.
:param samples: Number of retained DREAM samples requested from BUMPS.
:param burn: Burn-in steps.
:param thin: Thinning interval.
:param population: BUMPS DREAM population count for advanced users.
:param objective: Zero-variance handling strategy.
:param initializer: DREAM population initializer. One of 'eps',
'cov', 'lhs', or 'random'. By default, None (BUMPS
uses 'eps').
:param progress_callback: Optional callback for progress updates during
sampling. Forwarded to the core MultiFitter.
:return: Dictionary with keys 'draws', 'param_names', 'state',
and 'logp'.
:raises RuntimeError: If the current minimizer is not a BUMPS instance.
The underlying :class:~easyscience.fitting.Sampler is retained on
:attr:sampler, so the chain can be continued without re-running the
burn-in::
fitter.mcmc_sample(data, samples=2000, burn=500, thin=10)
extended = fitter.sampler.extend(additional_samples=8000, thin=10)
Source code in src/easyreflectometry/fitting.py
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
switch_minimizer(minimizer)
Switch the minimizer for the fitting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
minimizer
|
AvailableMinimizers
|
Minimizer to be switched to. |
required |
Source code in src/easyreflectometry/fitting.py
545 546 547 548 549 550 551 552 553 | |
Model
Bases: BaseCore
Model is the class that represents the experiment.
It is used to store the information about the experiment and to perform the calculations.
Source code in src/easyreflectometry/model/model.py
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 124 125 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 274 275 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 | |
is_default
property
writable
Whether this model was created as a default placeholder.
resolution_function
property
writable
Return the resolution function.
__init__(sample=None, scale=None, background=None, resolution_function=None, name='Model', color=COLORS[0], unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
color
|
str
|
By default, COLORS[0]. |
COLORS[0]
|
sample
|
Union[Sample, None]
|
The sample being modelled. By default, None. |
None
|
scale
|
Union[Parameter, Number, None]
|
Scaling factor of profile. By default, None. |
None
|
background
|
Union[Parameter, Number, None]
|
Linear background magnitude. By default, None. |
None
|
name
|
str
|
Name of the model. By default, 'Model'. |
'Model'
|
resolution_function
|
Union[ResolutionFunction, None]
|
Resolution function. By default, None. |
None
|
interface
|
Calculator interface. By default, None. |
None
|
Source code in src/easyreflectometry/model/model.py
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 | |
interface(new_interface)
Set the interface; runs generate_bindings and then refreshes the
calculator's resolution function.
Source code in src/easyreflectometry/model/model.py
225 226 227 228 229 230 231 232 233 | |
add_assemblies(*assemblies)
Add assemblies to the model sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*assemblies
|
list[BaseAssembly]
|
Assemblies to add to model sample. |
()
|
Source code in src/easyreflectometry/model/model.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
duplicate_assembly(index)
Duplicate a given item or layer in a sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
|
required |
idx
|
Index of the item or layer to duplicate. |
required |
Source code in src/easyreflectometry/model/model.py
172 173 174 175 176 177 178 179 180 181 182 183 | |
remove_assembly(index)
Remove an assembly from the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
|
required |
idx
|
Index of the item to remove. |
required |
Source code in src/easyreflectometry/model/model.py
185 186 187 188 189 190 191 192 193 194 195 196 197 | |
to_dict(skip=None)
Serialize the model, encoding the resolution function and interface name.
Source code in src/easyreflectometry/model/model.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
as_dict(skip=None)
Compatibility alias for :meth:to_dict.
Source code in src/easyreflectometry/model/model.py
273 274 275 | |
as_orso()
Convert the model to a dictionary suitable for ORSO.
Source code in src/easyreflectometry/model/model.py
277 278 279 | |
from_dict(passed_dict)
classmethod
Create a Model from a dictionary.
Source code in src/easyreflectometry/model/model.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | |
ModelCollection
Bases: BaseCollection
Source code in src/easyreflectometry/model/model_collection.py
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 124 125 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 | |
next_color_index
property
Index of the next colour to assign — kept around so it round-trips.
__init__(*models, name='Models', interface=None, unique_name=None, populate_if_none=True, next_color_index=None, **kwargs)
Init function.
Source code in src/easyreflectometry/model/model_collection.py
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 | |
add_model(model=None)
Add a model to the collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Optional[Model]
|
Model to add. By default, None. |
None
|
Source code in src/easyreflectometry/model/model_collection.py
66 67 68 69 70 71 72 73 74 75 76 | |
duplicate_model(index)
Duplicate a model in the collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Model to duplicate. |
required |
Source code in src/easyreflectometry/model/model_collection.py
78 79 80 81 82 83 84 85 86 87 88 89 | |
from_dict(this_dict)
classmethod
Create an instance of a collection from a dictionary.
Source code in src/easyreflectometry/model/model_collection.py
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 | |
append(model)
Append function.
Source code in src/easyreflectometry/model/model_collection.py
120 121 122 | |
PercentageFwhm
Bases: ResolutionFunction
Source code in src/easyreflectometry/model/resolution_functions.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
__init__(constant=None)
Init function.
Source code in src/easyreflectometry/model/resolution_functions.py
60 61 62 63 64 | |
smearing(q)
Return per-point sigma values from the constant FWHM percentage.
constant is a FWHM percentage of q; it is converted to an
absolute sigma so the smearing() contract is sigma for all types.
Source code in src/easyreflectometry/model/resolution_functions.py
66 67 68 69 70 71 72 73 74 | |
as_dict(skip=None)
As dict.
Source code in src/easyreflectometry/model/resolution_functions.py
76 77 78 79 80 | |
Pointwise
Bases: ResolutionFunction
Pointwise resolution defined by a per-point resolution provided with the data.
The resolution is supplied as the variance of the Qz values (sQz) at the
measured Qz data points, which is the form produced by data reduction (e.g.
Qz_0.variances). The resolution width at each point is sqrt(sQz).
For a requested q the width is obtained by linearly interpolating onto
q, exactly as :class:LinearSpline does for explicitly provided widths.
This is a convenience wrapper around :class:LinearSpline that derives the
widths from the [Qz, R, sQz] triple loaded from a data file; the returned
widths are consumed by the calculators (refnx x_err / refl1d dq),
which perform the actual convolution against the model.
Source code in src/easyreflectometry/model/resolution_functions.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 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 | |
__init__(q_data_points)
Init function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q_data_points
|
List[np.ndarray]
|
|
required |
Source code in src/easyreflectometry/model/resolution_functions.py
124 125 126 127 128 129 130 131 132 133 134 | |
smearing(q=None)
Return the resolution sigma interpolated onto q.
sQz is the variance of Qz, so the sigma at each data point is
sqrt(sQz); values are linearly interpolated onto the requested
q. This already satisfies the sigma smearing() contract, so no
FWHM conversion is applied. When q is None the sigma values
are returned at the stored data points.
Source code in src/easyreflectometry/model/resolution_functions.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
as_dict(skip=None)
As dict.
Source code in src/easyreflectometry/model/resolution_functions.py
151 152 153 154 155 156 157 158 159 160 | |
Layer
Bases: BaseCore
Source code in src/easyreflectometry/sample/elements/layers/layer.py
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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
__init__(material=None, thickness=None, roughness=None, name='EasyLayer', unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
material
|
Union[Material, None]
|
The material for the layer. By default, None. |
None
|
thickness
|
Union[Parameter, float, None]
|
Layer thickness in Angstrom. By default, None. |
None
|
roughness
|
Union[Parameter, float, None]
|
Upper roughness on the layer in Angstrom. By default, None. |
None
|
name
|
str
|
Name of the layer. By default, 'EasyLayer'. |
'EasyLayer'
|
interface
|
Interface object. By default, None. |
None
|
Source code in src/easyreflectometry/sample/elements/layers/layer.py
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 | |
assign_material(material)
Assign a material to the layer interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
material
|
Material
|
The material to assign to the layer. |
required |
Source code in src/easyreflectometry/sample/elements/layers/layer.py
122 123 124 125 126 127 128 129 130 131 132 | |
Material
Bases: BaseCore
Source code in src/easyreflectometry/sample/elements/materials/material.py
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 | |
__init__(sld=None, isld=None, name='EasyMaterial', unique_name=None, interface=None)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unique_name
|
Optional[str]
|
By default, None. |
None
|
sld
|
Union[Parameter, float, None]
|
Real scattering length density. By default, None. |
None
|
isld
|
Union[Parameter, float, None]
|
Imaginary scattering length density. By default, None. |
None
|
name
|
str
|
Name of the material. By default, 'EasyMaterial'. |
'EasyMaterial'
|
interface
|
Calculator interface. By default, None. |
None
|
Source code in src/easyreflectometry/sample/elements/materials/material.py
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 | |
MaterialCollection
Bases: BaseCollection
Source code in src/easyreflectometry/sample/collections/material_collection.py
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 | |
__init__(*materials, name='EasyMaterials', interface=None, unique_name=None, populate_if_none=True, **kwargs)
Init function.
Source code in src/easyreflectometry/sample/collections/material_collection.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
add_material(material=None)
Add a material to the collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
material
|
Optional[Material]
|
Material to add. By default, None. |
None
|
Source code in src/easyreflectometry/sample/collections/material_collection.py
48 49 50 51 52 53 54 55 56 57 58 59 | |
duplicate_material(index)
Duplicate a material in the collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
|
required |
material
|
Assembly to add. |
required |
Source code in src/easyreflectometry/sample/collections/material_collection.py
61 62 63 64 65 66 67 68 69 70 71 72 73 | |
Multilayer
Bases: BaseAssembly
A multi layer is build from a single or a list of Layer or LayerCollection.
The multi layer will arrange the layers as slabs, allowing the reflectometry to be determined from them. The front layer is where the neutron beam starts in, it has an index of 0.
More information about the usage of this assembly is available in the
multilayer documentation_
.. _multilayer documentation: ../sample/assemblies_library.html#multilayer
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
14 15 16 17 18 19 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 124 125 126 | |
__init__(layers=None, name='EasyMultilayer', unique_name=None, interface=None, type='Multi-layer', populate_if_none=True)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
populate_if_none
|
Optional[bool]
|
By default, True. |
True
|
unique_name
|
Optional[str]
|
By default, None. |
None
|
layers
|
Union[Layer, list[Layer], LayerCollection, None]
|
The layers that make up the multi-layer. By default, None. |
None
|
name
|
str
|
Name for multi layer. By default, 'EasyMultilayer'. |
'EasyMultilayer'
|
interface
|
Calculator interface. By default, None. |
None
|
|
type
|
str
|
Type of the constructed instance. By default, 'Multi-layer'. |
'Multi-layer'
|
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
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 | |
add_layer(*layers)
Add a layer to the multi layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*layers
|
tuple[Layer]
|
Layers to add to the multi layer. |
()
|
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
73 74 75 76 77 78 79 80 81 82 83 84 85 | |
duplicate_layer(idx)
Duplicate a given layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
Index of layer to duplicate. |
required |
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
remove_layer(idx)
Remove a layer from the item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
Index of layer to remove. |
required |
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
104 105 106 107 108 109 110 111 112 113 114 | |
from_dict(data)
classmethod
Create a Multilayer from a dictionary.
Source code in src/easyreflectometry/sample/assemblies/multilayer.py
122 123 124 125 126 | |
Sample
Bases: BaseCollection
A sample is a collection of assemblies that represent the structure for which experimental measurements exist.
Source code in src/easyreflectometry/sample/collections/sample.py
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 124 125 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 | |
superphase
property
The superphase of the sample.
subphase
property
The subphase of the sample.
__init__(*assemblies, name='EasySample', interface=None, unique_name=None, populate_if_none=True, **kwargs)
Constructor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
|
{}
|
|
populate_if_none
|
bool
|
By default, True. |
True
|
unique_name
|
Optional[str]
|
By default, None. |
None
|
*assemblies
|
Optional[List[BaseAssembly]]
|
|
()
|
args
|
The assemblies in the sample. |
required | |
name
|
str
|
Name of the sample. By default, 'EasySample'. |
'EasySample'
|
interface
|
Calculator interface. By default, None. |
None
|
Source code in src/easyreflectometry/sample/collections/sample.py
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 | |
add_assembly(assembly=None)
Add an assembly to the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
assembly
|
Optional[BaseAssembly]
|
Assembly to add. By default, None. |
None
|
Source code in src/easyreflectometry/sample/collections/sample.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
duplicate_assembly(index)
Add an assembly to the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
|
required |
assembly
|
Assembly to add. |
required |
Source code in src/easyreflectometry/sample/collections/sample.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
move_up(index)
Move the assembly at the given index up in the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Index of the assembly to move up. |
required |
Source code in src/easyreflectometry/sample/collections/sample.py
118 119 120 121 122 123 124 125 126 | |
move_down(index)
Move the assembly at the given index down in the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Index of the assembly to move down. |
required |
Source code in src/easyreflectometry/sample/collections/sample.py
128 129 130 131 132 133 134 135 136 | |
remove_assembly(index)
Remove the assembly at the given index from the sample.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Index of the assembly to remove. |
required |
Source code in src/easyreflectometry/sample/collections/sample.py
138 139 140 141 142 143 144 145 146 | |
BaseCollection
Bases: EasyList
Local base for sample-tree collections (Material/Layer/Assembly/Model collections).
Built on top of easyscience.base_classes.EasyList (the replacement for
the deprecated CollectionBase). On top of EasyList this class adds:
- a
nameproperty - an
interfaceproperty whose setter propagates the calculator interface to every contained item - propagation of the current
interfaceto newly inserted items - a
populate_if_noneflag preserved for serialization round-trip - convenience helpers
names,move_up,move_down,remove_at - a yaml-formatted
__repr__driven by_dict_repr - an
as_dictalias forto_dictwithskip=support andinterfaceexcluded by default
Subclasses (LayerCollection, MaterialCollection, Sample,
ModelCollection) keep their existing constructor shape — they pass
name and interface positionally to this class, items as *args, and
additional configuration as kwargs.
Source code in src/easyreflectometry/sample/collections/base_collection.py
17 18 19 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 124 125 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 274 275 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 | |
names
property
List of item names.
data
property
Read-only view of the underlying item list.
Provided for compatibility with code (and tests) written against the
legacy CollectionBase shape, which exposed items via .data.
insert(index, value)
Insert and (if an interface is set) propagate it to the new item.
Legacy CollectionBase.insert did value.interface = self.interface
after registering the item; we replicate the same behaviour here so
downstream calculator state stays in sync when items are appended
after the collection's interface was already set.
The type check from EasyList.insert is bypassed: each subclass
accepts a single item type (Layer / Material / BaseAssembly / Model)
and enforces it elsewhere, while the EasyList check would require
every item to be a NewBase subclass — which was historically not
guaranteed and forces an extra coupling we don't need.
Source code in src/easyreflectometry/sample/collections/base_collection.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
move_up(index)
Move the element at the given index up in the collection.
Source code in src/easyreflectometry/sample/collections/base_collection.py
167 168 169 170 171 | |
move_down(index)
Move the element at the given index down in the collection.
Source code in src/easyreflectometry/sample/collections/base_collection.py
173 174 175 176 177 | |
remove_at(index)
Remove the item at index from the collection.
Renamed from the legacy BaseCollection.remove(index) which shadowed
MutableSequence.remove(value) (remove-by-value, inherited from
EasyList). Callers that meant "remove by index" should use this; the
standard remove(value) is still available with its usual semantics.
Source code in src/easyreflectometry/sample/collections/base_collection.py
179 180 181 182 183 184 185 186 187 | |
get_parameters()
Compatibility alias for legacy callers; prefer get_all_parameters.
Source code in src/easyreflectometry/sample/collections/base_collection.py
191 192 193 | |
get_all_variables()
Flat list of every Parameter/Descriptor across all items.
Walks each item in the collection and unions whatever each item
exposes via its own get_all_variables (for ModelBase /
BaseCore children) or, for objects that lack that hook,
unions any direct DescriptorBase attributes.
Source code in src/easyreflectometry/sample/collections/base_collection.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
get_fit_parameters()
Alias kept for the minimizer; matches ModelBase.get_fit_parameters.
Source code in src/easyreflectometry/sample/collections/base_collection.py
225 226 227 | |
to_dict(skip=None)
Serialize with skip support; interface excluded by default.
EasyList.to_dict doesn't accept a skip argument and is hard-wired
to dump data plus the parent's _arg_spec view. We reimplement here
so existing callers (Project, Model.as_dict, etc.) can keep
passing skip=['unique_name'] or similar.
NewBase.to_dict mutates the skip list in-place (e.g. it
appends 'unique_name' when the collection's own unique_name is
default-generated). We therefore pass a copy to it, otherwise the
mutation would leak into the per-item serialization below and force
every item Parameter dict to drop its unique_name — breaking the
from_dict round-trip.
Source code in src/easyreflectometry/sample/collections/base_collection.py
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 | |
as_dict(skip=None)
Compatibility alias for :meth:to_dict.
Source code in src/easyreflectometry/sample/collections/base_collection.py
319 320 321 | |
__deepcopy__(memo)
Round-trip via dict-skip-unique to get a fresh copy.
NewBase.__copy__ already does this; the override is kept (rather
than deleted) to mirror the legacy BaseCollection.__deepcopy__
semantics — callers that relied on copy.deepcopy(collection) still
get a clone built from from_dict(as_dict(skip=['unique_name'])).
Source code in src/easyreflectometry/sample/collections/base_collection.py
323 324 325 326 327 328 329 330 331 | |
Project
Source code in src/easyreflectometry/project.py
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 124 125 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 274 275 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 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 | |
parameters
property
Get all unique parameters from all models in the project.
Parameters shared across multiple models (e.g. material SLD) are only included once to avoid double-counting.
q_min
property
writable
Q min.
q_max
property
writable
Q max.
q_resolution
property
writable
Q resolution.
current_material_index
property
writable
Current material index.
current_model_index
property
writable
Current model index.
current_assembly_index
property
writable
Current assembly index.
current_layer_index
property
writable
Current layer index.
current_experiment_index
property
writable
Current experiment index.
created
property
Created function.
path
property
Path function.
models
property
writable
Models function.
fitter
property
Fitter function.
calculator
property
writable
Calculator function.
minimizer
property
writable
Minimizer function.
experiments
property
writable
Experiments function.
path_json
property
Path json.
__init__()
Init function.
Source code in src/easyreflectometry/project.py
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 | |
reset()
Reset function.
Source code in src/easyreflectometry/project.py
75 76 77 78 79 80 81 | |
set_path_project_parent(path)
Set path project parent.
Source code in src/easyreflectometry/project.py
263 264 265 | |
get_index_air()
Get index air.
Source code in src/easyreflectometry/project.py
350 351 352 353 354 | |
get_index_si()
Get index si.
Source code in src/easyreflectometry/project.py
356 357 358 359 360 | |
get_index_sio2()
Get index sio2.
Source code in src/easyreflectometry/project.py
362 363 364 365 366 | |
get_index_d2o()
Get index d2o.
Source code in src/easyreflectometry/project.py
368 369 370 371 372 | |
load_orso_file(path)
Load an ORSO file and optionally create a model and a data from it.
Source code in src/easyreflectometry/project.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | |
set_sample_from_orso(sample)
Replace the current project model collection with a single model built from an ORSO-parsed sample.
This is a convenience helper for the ORSO import pipeline where a complete
:class:~easyreflectometry.sample.Sample is constructed elsewhere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
Sample
|
Sample to set as the project's (single) model. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/easyreflectometry/project.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | |
add_sample_from_orso(sample)
Add a new model with the given sample to the existing model collection.
The created model is appended to :attr:models, its calculator interface is
set to the project's current calculator, and any materials referenced in the
sample are added to the project's material collection.
After adding the model, :attr:current_model_index is updated to point to
the newly added model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
Sample
|
Sample to add as a new model. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/easyreflectometry/project.py
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | |
replace_models_from_orso(sample)
Replace all models and materials with a single model from an ORSO sample.
All existing models and their associated materials are removed. A new model is created from sample, assigned to the project's calculator, and the material collection is rebuilt from the new model only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample
|
Sample
|
Sample to set as the project's only model. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/easyreflectometry/project.py
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | |
load_new_experiment(path)
Load new experiment.
Source code in src/easyreflectometry/project.py
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 | |
count_datasets_in_file(path)
Return the number of datasets contained in the file at path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[Path, str]
|
Path to the data file. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Number of datasets found; 1 if the file cannot be introspected. |
Source code in src/easyreflectometry/project.py
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | |
load_all_experiments_from_file(path)
Load all datasets from a file as separate experiments sharing the current model.
For a multi-dataset ORSO file (e.g. a multi-angle measurement), each dataset is
registered as an independent experiment. All experiments share the model that is
currently selected. Falls back to :meth:load_new_experiment for single-dataset
files or on any loading error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Union[Path, str]
|
Path to the data file. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Number of experiments that were added. |
Source code in src/easyreflectometry/project.py
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
load_experiment_for_model_at_index(path, index=0)
Load experiment for model at index.
Source code in src/easyreflectometry/project.py
641 642 643 644 645 646 647 648 649 650 | |
sld_data_for_model_at_index(index=0)
Sld data for model at index.
Source code in src/easyreflectometry/project.py
652 653 654 655 656 657 658 659 660 | |
sample_data_for_model_at_index(index=0, q_range=None)
Sample data for model at index.
Source code in src/easyreflectometry/project.py
662 663 664 665 666 667 668 669 | |
model_data_for_model_at_index(index=0, q_range=None)
Model data for model at index.
Source code in src/easyreflectometry/project.py
671 672 673 674 675 676 677 678 679 680 681 | |
experimental_data_for_model_at_index(index=0)
Experimental data for model at index.
Source code in src/easyreflectometry/project.py
683 684 685 686 687 688 | |
default_model()
Default model.
Source code in src/easyreflectometry/project.py
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
is_default_model(index)
Check if the model at the given index is a default model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Index of the model to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the model was created as a default placeholder. |
Source code in src/easyreflectometry/project.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 | |
remove_model_at_index(index)
Remove the model at the given index.
Removes the model from the model collection, removes the experiment at the same index (if any), and reindexes experiments above the removed index so model/experiment indices stay aligned.
Adjusts the current model index if necessary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Index of the model to remove. |
required |
Raises:
| Type | Description |
|---|---|
IndexError :
|
If the index is out of range. |
ValueError :
|
If trying to remove the last remaining model. |
Source code in src/easyreflectometry/project.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |
add_material(material)
Add material.
Source code in src/easyreflectometry/project.py
798 799 800 801 802 803 | |
remove_material(index)
Remove material.
Source code in src/easyreflectometry/project.py
805 806 807 808 809 810 | |
create()
Create function.
Source code in src/easyreflectometry/project.py
820 821 822 823 824 825 826 827 828 | |
save_as_json(overwrite=False)
Save as json.
Source code in src/easyreflectometry/project.py
830 831 832 833 834 835 836 837 838 839 840 841 | |
load_from_json(path=None)
Load from json.
Source code in src/easyreflectometry/project.py
843 844 845 846 847 848 849 850 851 852 853 854 855 856 | |
as_dict(include_materials_not_in_model=False)
As dict.
Source code in src/easyreflectometry/project.py
866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | |
from_dict(project_dict)
From dict.
Source code in src/easyreflectometry/project.py
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | |
load_as_dataset(fname)
Load data from an ORSO .ort file as a DataSet1D.
Source code in src/easyreflectometry/data/measurement.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
extract_orso_title(data_group, data_name)
Extract orso title.
Source code in src/easyreflectometry/data/measurement.py
47 48 49 50 51 52 53 54 55 56 57 | |
load_data_from_orso_file(fname)
Load data from an ORSO file.
Source code in src/easyreflectometry/orso_utils.py
45 46 47 48 49 50 51 | |
apply_default_limits(parameter, kind)
Apply default min/max to a parameter if current bounds are infinite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameter
|
Parameter
|
The parameter to adjust. |
required |
kind
|
str
|
One of 'thickness', 'roughness', 'sld', 'isld', 'scale'. |
required |
Source code in src/easyreflectometry/limits.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |