Commit 3eb32fd0 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

changed DFS node local to kmust

parent a4b0b19c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ pml:
  CSST_DFS_APP_ID: test
  CSST_DFS_APP_TOKEN: test

local:
kmust:
  CSST_DFS_API_MODE: cluster
  CSST_DFS_GATEWAY: 222.197.214.168:30880
  CSST_DFS_APP_ID: 1
+12 −12
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class CsstMsDataManager:
        The aux data directory (bias, flat, dark).
    dfs_mode : bool
        DFS mode. If True, ``CsstMsDataManager`` will use DFS.
    node : str
    dfs_node : str
        The environment in which the pipeline will run.
        Use "pml" for Purple Mountain Lab cluster and "local" for others.
    _exp_id : int
@@ -119,7 +119,7 @@ class CsstMsDataManager:
                 dir_l1: str = ".",
                 path_aux: str = "",  # bias dark flat
                 dfs_mode: bool = False,
                 node: str = "local",
                 dfs_node: str = "kmust",
                 _exp_id: int = 100000100,
                 _exp_start: int = 20270810081950,
                 _exp_stop: int = 20270810082220,
@@ -171,10 +171,10 @@ class CsstMsDataManager:
        # for catalog query
        self.dfs_mode = dfs_mode
        # for DFS configuration, defaults to "local", could be "pml"
        assert node in DFS_CONF.keys()
        self.node = node
        for k, v in DFS_CONF[node].items():
            os.putenv(k, v)
        assert dfs_node in DFS_CONF.keys()
        self.node = dfs_node
        for k, v in DFS_CONF[dfs_node].items():
            os.putenv(k, f"{v}")

        # data directory
        self.dir_l0 = dir_l0
@@ -189,7 +189,7 @@ class CsstMsDataManager:
        raise NotImplementedError("from_dfs is currently not available!")

    @staticmethod
    def from_dir(ver_sim="C5.2", datatype="mbi", dir_l0=".", dir_l1=".", path_aux="", dfs_mode=False, node="local"):
    def from_dir(ver_sim="C5.2", datatype="mbi", dir_l0=".", dir_l1=".", path_aux="", dfs_mode=False, dfs_node="kmust"):
        """ initialize the multi-band imaging data manager """

        assert ver_sim in ["C5.2", ]
@@ -220,7 +220,7 @@ class CsstMsDataManager:
                                 dir_l1=dir_l1,
                                 path_aux=path_aux,  # bias dark flat
                                 dfs_mode=dfs_mode,
                                 node=node,
                                 dfs_node=dfs_node,
                                 _exp_id=_exp_id,
                                 _exp_start=_exp_start,
                                 _exp_stop=_exp_stop,
@@ -393,7 +393,7 @@ class CsstMsDataManager:
        return info

    @staticmethod
    def quickstart(ver_sim="C5.2", datatype="mbi", dir_l1=".", exposure_id=100, dfs_mode=False, node="local"):
    def quickstart(ver_sim="C5.2", datatype="mbi", dir_l1=".", exposure_id=100, dfs_mode=False, dfs_node="kmust"):
        """Quick dataset generator for tests on dandelion or PMO

        Parameters
@@ -408,8 +408,8 @@ class CsstMsDataManager:
            The serial number of the exposure. 20-154 for C5.2.
        dfs_mode : bool
            If True, use DFS.
        node : str
            The node in which this program runs. Defaults to "local", could be "pml".
        dfs_node : str
            The DFS node. Defaults to "kmust", could be "pml".

        Returns
        -------
@@ -446,7 +446,7 @@ class CsstMsDataManager:

        return CsstMsDataManager.from_dir(
            ver_sim=ver_sim, datatype=datatype, dir_l0=dir_l0, dir_l1=dir_l1, path_aux=path_aux,
            dfs_mode=dfs_mode, node=node)
            dfs_mode=dfs_mode, dfs_node=dfs_node)

    def query_rc(self, ra=180, dec=0, radius=2, min_mag=0, max_mag=20, obstime=-1, limit=-1):
        """ Query Reference Catalog (RC) from DFS """