asaf.isotherm
Provides the Isotherm class to store, manipulate, plot and save adsorption isotherm data.
Isotherm
Isotherm(
data: DataFrame | None = None,
saturation_fugacity: float | None = None,
saturation_pressure: float | None = None,
metadata: dict[str, Any] | None = None,
fugacity_unit: str = "Pa",
uptake_unit: str = "molecules/unitcell",
)
Isotherm class to store, recalculate and save the adsorption isotherm.
Parameters:
-
data(DataFrame | None, default:None) –A pandas DataFrame containing the adsorption data. Should contain 'pressure' and 'uptake' columns.
-
saturation_fugacity(float | None, default:None) –The saturation fugacity at given conditions. Used to calculate relative fugacity (f/f0).
-
saturation_pressure(float | None, default:None) –The saturation pressure at given conditions. Used to calculate relative pressure (p/p0).
-
metadata(dict[str, Any] | None, default:None) –A dictionary with the simulation metadata.
-
uptake_unit(str, default:'molecules/unitcell') –Units at which uptake is stored. Default value is 'molecules/unitcell'.
Source code in src/asaf/isotherm.py
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 | |
amount_adsorbed
property
amount_adsorbed: Series
Return the uptake column.
dataframe
property
writable
dataframe: DataFrame
Return dataframe with isotherm data.
fugacity
property
fugacity: Series | None
Return the fugacity column.
metastable_gas
property
metastable_gas: Series | None
Return the metastable gas column, if it exists.
metastable_liq
property
metastable_liq: Series | None
Return the metastable liquid column, if it exists.
pressure
property
writable
pressure: Series | None
Return the pressure column.
saturation_fugacity
property
writable
saturation_fugacity: float | None
Return the saturation fugacity.
saturation_pressure
property
writable
saturation_pressure: float | None
Return the saturation pressure.
plot
plot(
label: str | None = None,
fig: Figure | None = None,
x_axis: str = "auto",
y_axis: str | None = None,
trace_kwargs: dict[str, Any] | None = None,
layout_kwargs: dict[str, Any] | None = None,
uptake_conversion_factor: float | None = None,
show: bool = False,
) -> Figure
Plot an isotherm (stable + metastable gas and / or liquid) and group all traces under a single legend entry.
You can pass any kwargs through trace_kwargs or layout_kwargs; missing values will be filled in by defaults.
Source code in src/asaf/isotherm.py
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 | |
set_pressure_unit
Convert the pressure column to the target unit using the provided conversion factor.
Source code in src/asaf/isotherm.py
136 137 138 139 140 141 142 143 | |
set_uptake_unit
Convert the uptake column to the target unit.
Source code in src/asaf/isotherm.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
to_aif
Save the isotherm in an AIF file format.
Parameters:
-
filename(str) –The name of the file to be saved.
-
user_key_mapper(dict[str, Any] | None, default:None) –A dictionary based on which keys from the metadata are transformed into keys according to aifdictionary.json. Required format: {'_AIF_key': 'metadata_key'}.
Returns:
-
None–
Source code in src/asaf/isotherm.py
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 | |
to_csv
to_csv(filename: str) -> None
Save the isotherm data to a CSV file.
Source code in src/asaf/isotherm.py
539 540 541 | |
options: filters: ["!^_"]