From f8cf63f717d4dd9bcd85b371e3d029f44300bd0d Mon Sep 17 00:00:00 2001 From: BO ZHANG Date: Wed, 26 Oct 2022 23:09:34 +0800 Subject: [PATCH] new doc for CsstMsDataManager --- doc/source/ch08_csst_common.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/source/ch08_csst_common.rst b/doc/source/ch08_csst_common.rst index 2434050..1ed79cd 100644 --- a/doc/source/ch08_csst_common.rst +++ b/doc/source/ch08_csst_common.rst @@ -9,23 +9,26 @@ Package source code and installation guide can be found in the link below. ``csst_common.data_manager.CsstMsDataManager`` ---------------------------------------------- -A class that helps developers to access simulation files. +This class provides an interface to switch between local files and DFS. + +To initilize from local directory: .. code-block:: python from csst_common.data_manager import CsstMsDataManager # for full basic initialization - dm_mbi = CsstMsDataManager( + dm_mbi = CsstMsDataManager.from_dir( ver_sim="C5.2", # version of simulation, "C5.2" is the latest dir_l0="", # the L0/input directory dir_l1="", # the L1/output directory dir_pcref="", # position calibration reference (will be deprecated) path_aux="", # aux file paths (master bias, dark, flat) - assert_all_detectors=False, # if True, assert all detectors are available datatype="mbi", # "mbi", "sls" or "all" ) dm_mbi.set_detectors(detectors=None) # use all available detectors +In particular, if you are on ``dandelion`` or ``PM node``, you can use a ``quickstart`` method. + .. code-block:: python # for a quick start () @@ -39,10 +42,11 @@ A class that helps developers to access simulation files. .. note:: This ``quickstart`` method is ONLY available on - ``dandelion`` and the Purple Mountain Lab node. + ``dandelion`` or the ``Purple Mountain Lab node``. In your local development environment, you have to use - ``CsstMsDataManager(...)`` to initialize it. + ``CsstMsDataManager.from_dir(...)`` to initialize it. +Some attributes can be accessed as below. .. code-block:: python @@ -65,6 +69,8 @@ A class that helps developers to access simulation files. # define an L1 file (non-detector-specified) dm_mbi.l1_file("flipped_image.fits") +To get master files: + .. code-block:: python # to get bias @@ -74,6 +80,7 @@ A class that helps developers to access simulation files. # to get flat dm_mbi.get_flat() + Access code to data products ---------------------------- -- GitLab