Esempio n. 1
0
    def slurp_into_file(self, multi_root):
        """
        Write the data of an Exposure object into a JSON file

        Args:
            multi_root:

        Returns:

        """
        # Load
        mdict_root = os.path.join(self.qaprod_dir, multi_root)
        mdict = load_qa_multiexp(mdict_root)
        # Check on night
        if self.night not in mdict.keys():
            mdict[self.night] = {}
        # Insert
        idict = write_qa_exposure('foo', self, ret_dict=True)
        mdict[self.night][str(self.expid)] = idict[self.night][self.expid]
        # Write
        write_qa_multiexp(mdict_root, mdict)
Esempio n. 2
0
    def write_qa_exposures(self, outroot=None, **kwargs):
        """  Write the slurp of QA Exposures to the hard drive
        Args:
            outroot: str
            **kwargs:

        Returns:
            output_file : str

        """
        if outroot is None:
            outroot = self.qaexp_outroot
        return write_qa_multiexp(outroot, self, **kwargs)
Esempio n. 3
0
    def write_qa_exposures(self, outroot=None, skip_rebuild=False, **kwargs):
        """  Write the slurp of QA Exposures to the hard drive
        Args:
            outroot: str
            skip_rebuild : bool, optional
              Do not rebuild the data dict
            **kwargs:

        Returns:
            output_file : str

        """
        if outroot is None:
            outroot = self.qaexp_outroot
        # Rebuild?
        if not skip_rebuild:
            self.build_data()
        # Do it
        return write_qa_multiexp(outroot, self.data, **kwargs)
Esempio n. 4
0
    def write_qa_exposures(self, outroot=None, skip_rebuild=False, **kwargs):
        """  Write the slurp of QA Exposures to the hard drive
        Args:
            outroot: str
            skip_rebuild : bool, optional
              Do not rebuild the data dict
            **kwargs:

        Returns:
            output_file : str

        """
        if outroot is None:
            outroot = self.qaexp_outroot
        # Rebuild?
        if not skip_rebuild:
            self.build_data()
        # Do it
        return write_qa_multiexp(outroot, self.data, **kwargs)