diff --git a/README.rst b/README.rst index 6b48140..eb37c81 100644 --- a/README.rst +++ b/README.rst @@ -51,6 +51,18 @@ Load an entire **study**: dataset.data # access data array dataset.VisuCoreSize # get a value of a single parameter +Load a parametric file: + +.. code-block:: python + + from brukerapi.jcampdx import JCAMPDX + + parameters = JCAMPDX('path_to_scan/method') + + TR = data.params["PVM_RepetitionTime"].value # This way + TR = data.get_value("PVM_RepetitionTime") # Or this way + + diff --git a/brukerapi/schemas.py b/brukerapi/schemas.py index e2af9c7..1fa50c1 100644 --- a/brukerapi/schemas.py +++ b/brukerapi/schemas.py @@ -630,9 +630,11 @@ def _framegroups_to_frames(self, data, layouts): """ def ra(self, slice_): """ - Random access to the data matrix - :param slice_: - :return: + Random access to the data matrix. + + :param tuple slice_: Slice object(s) to select data in each dimension. + :return: Selected subset of the data. + :rtype: np.ndarray """ layouts, layouts_ra = self._get_ra_layouts(slice_) diff --git a/docs/source/brukerapi.rst b/docs/source/brukerapi.rst deleted file mode 100644 index aead065..0000000 --- a/docs/source/brukerapi.rst +++ /dev/null @@ -1,62 +0,0 @@ -brukerapi package -================= - -Submodules ----------- - -brukerapi.dataset module ------------------------- - -.. automodule:: brukerapi.dataset - :members: - :undoc-members: - :show-inheritance: - -brukerapi.exceptions module ---------------------------- - -.. automodule:: brukerapi.exceptions - :members: - :undoc-members: - :show-inheritance: - -brukerapi.jcampdx module ------------------------- - -.. automodule:: brukerapi.jcampdx - :members: - :undoc-members: - :show-inheritance: - -brukerapi.schemes module ------------------------- - -.. automodule:: brukerapi.schemas - :members: - :undoc-members: - :show-inheritance: - -brukerapi.folders module ------------------------- - -.. automodule:: brukerapi.folders - :members: - :undoc-members: - :show-inheritance: - -brukerapi.utils module ----------------------- - -.. automodule:: brukerapi.utils - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: brukerapi - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index 3a153b6..efea38e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = 'brukerapi' -copyright = '2020, Tomas Psorn' +copyright = '2025, Tomas Psorn' author = 'Tomas Psorn' # The full version, including alpha/beta/rc tags -release = '0.1.0' +release = '0.1.2' # -- General configuration --------------------------------------------------- @@ -55,7 +55,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = [] autodoc_member_order = 'bysource' diff --git a/docs/source/index.rst b/docs/source/index.rst index e4b9a54..3ffea25 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,6 +16,7 @@ Bruker API documentation. tutorials/how-to-study tutorials/how-to-2dseq tutorials/how-to-fid + tutorials/how-to-jcampdx tutorials/how-to-use-filter cli @@ -25,6 +26,8 @@ Bruker API documentation. dataset folders + jcampdx + schemas .. toctree:: :maxdepth: 2 @@ -32,6 +35,11 @@ Bruker API documentation. test_data +.. toctree:: + :maxdepth: 2 + :caption: Compatibility: + + compatibility Indices and tables ------------------- diff --git a/docs/source/modules.rst b/docs/source/modules.rst deleted file mode 100644 index f6da484..0000000 --- a/docs/source/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -brukerapi -========= - -.. toctree:: - :maxdepth: 4 - - brukerapi diff --git a/docs/source/tutorials/how-to-jcampdx.rst b/docs/source/tutorials/how-to-jcampdx.rst new file mode 100644 index 0000000..10d75f7 --- /dev/null +++ b/docs/source/tutorials/how-to-jcampdx.rst @@ -0,0 +1,23 @@ +How to read parametric files +=============================== + + +Simply by importing the JCAMPDX class we can read e.g. the method file. + +.. code-block:: python + + from brukerapi.jcampdx import JCAMPDX + + parameters = JCAMPDX('path_to_scan/method') + + TR = data.params["PVM_RepetitionTime"].value # This way + TR = data.get_value("PVM_RepetitionTime") # Or this way + + +The loaded parameters can be simply cast into dictionary for easier manipulation + +.. code-block:: python + + parameters_dict = parameters.to_dict() + TR = parameters_dict["PVM_RepetitionTime"]["value"] +