コード例 #1
0
    def from_master_file(cls, master_file):
        """
        Instantiate from a master_file

        Args:
            master_file (str):

        Returns:
            wavetilts.WaveTilts:
                With tilts_dict loaded up

        """
        # Spectrograph
        spectrograph, extras = masterframe.items_from_master_file(master_file)
        head0 = extras[0]
        # Master info
        master_dir = head0['MSTRDIR']
        master_key = head0['MSTRKEY']
        # Instantiate
        slf = cls(None,
                  None,
                  spectrograph,
                  None,
                  None,
                  master_dir=master_dir,
                  master_key=master_key,
                  reuse_masters=True)
        # Load
        slf.tilts_dict = slf.load(ifile=master_file)
        # Return
        return slf
コード例 #2
0
ファイル: waveimage.py プロジェクト: joshwalawender/PypeIt
    def from_master_file(cls, master_file):
        """

        Args:
            master_file (str):

        Returns:
            waveimage.WaveImage:

        """
        # Spectrograph
        spectrograph, extras = masterframe.items_from_master_file(master_file)
        head0 = extras[0]
        # Master info
        master_dir = head0['MSTRDIR']
        master_key = head0['MSTRKEY']
        # Instantiate
        slf = cls(None,
                  None,
                  None,
                  spectrograph,
                  None,
                  None,
                  master_dir=master_dir,
                  master_key=master_key,
                  reuse_masters=True)
        slf.image = slf.load(ifile=master_file)
        # Return
        return slf
コード例 #3
0
ファイル: biasframe.py プロジェクト: santoshmh/PypeIt
    def from_master_file(cls, master_file, par=None):
        """
        Instantiate from a master file

        Args:
            master_file (str):
            par (:class:`pypeit.par.pypeitpar.FrameGroupPar`, optional):

        Returns:
            biasframe.BiasFrame:
                The PypeItImage is loaded into self.pypeitImage

        """
        # Spectrograph
        spectrograph, extras = masterframe.items_from_master_file(master_file)
        head0 = extras[0]
        # Master info
        master_dir = head0['MSTRDIR']
        master_key = head0['MSTRKEY']
        # Instantiate
        slf = cls(spectrograph, par=par, master_dir=master_dir, master_key=master_key,
                  reuse_masters=True)
        slf.pypeitImage = slf.load(ifile=master_file)
        # Return
        return slf
コード例 #4
0
ファイル: flatfield.py プロジェクト: joshwalawender/PypeIt
    def from_master_file(cls, master_file, par=None):
        """
        Instantiate the class from a master file

        Args:
            master_file (str):
            par (:class:`pypeit.par.pypeitpar.PypeItPar`, optional):
                Full par set

        Returns:
            :class:`pypeit.flatfield.FlatField`:
                With the flat images loaded up

        """
        # Spectrograph
        spectrograph, extras = masterframe.items_from_master_file(master_file)
        head0 = extras[0]
        # Par
        if par is None:
            par = spectrograph.default_pypeit_par()
        # Master info
        master_dir = head0['MSTRDIR']
        master_key = head0['MSTRKEY']
        # Instantiate
        slf = cls(spectrograph,
                  par['calibrations']['pixelflatframe'],
                  master_dir=master_dir,
                  master_key=master_key,
                  reuse_masters=True)
        # Load
        rawflatimg, slf.mspixelflat, slf.msillumflat = slf.load(
            ifile=master_file)
        # Convert rawflatimg to a PypeItImage
        slf.rawflatimg = pypeitimage.PypeItImage(rawflatimg)
        # Return
        return slf