Exemple #1
0
    def __init__(self, filename):
        """
        Initialize SpotGridPSF from input file

        See specter.psf.PSF for futher details
        """
        #- Use PSF class to Load Generic PSF values (x, y, wavelength, ...)
        PSF.__init__(self, filename)

        #- Load extensions specific to this PSF type
        fx = fits.open(filename, memmap=False)
        self._spots = fx['SPOTS'].data        #- PSF spots
        # self._spotx  = fx['SPOTX'].data     #- X location of spots
        # self._spoty  = fx['SPOTY'].data     #- Y location of spots
        self._fiberpos = fx['FIBERPOS'].data  #- Location of fibers on slit
        self._spotpos = fx['SPOTPOS'].data    #- Slit loc of sampled spots
        self._spotwave = fx['SPOTWAVE'].data  #- Wavelengths of spots

        #- 2D linerar interpolators
        pp = self._spotpos
        ww = self._spotwave
        self._fspot = LinearInterp2D(pp, ww, self._spots)
        # self._fx    = LinearInterp2D(pp, ww, self._spotx)
        # self._fy    = LinearInterp2D(pp, ww, self._spoty)

        #- Read spot vs. CCD pixel scales from header
        hdr = fx[0].header
        self.CcdPixelSize = hdr['CCDPIXSZ']  #- CCD pixel size in mm
        self.SpotPixelSize = hdr['PIXSIZE']  #- Spot pixel size in mm

        fx.close()
Exemple #2
0
 def __init__(self, filename):
     """
     Initialize SpotGridPSF from input file
     
     See specter.psf.PSF for futher details
     """
     #- Use PSF class to Load Generic PSF values (x, y, wavelength, ...)
     PSF.__init__(self, filename)
     
     #- Load extensions specific to this PSF type
     fx = fits.open(filename, memmap=False)
     self._spots = fx['SPOTS'].data        #- PSF spots
     # self._spotx  = fx['SPOTX'].data     #- X location of spots
     # self._spoty  = fx['SPOTY'].data     #- Y location of spots
     self._fiberpos = fx['FIBERPOS'].data  #- Location of fibers on slit
     self._spotpos = fx['SPOTPOS'].data    #- Slit loc of sampled spots
     self._spotwave = fx['SPOTWAVE'].data  #- Wavelengths of spots
     
     #- 2D linerar interpolators
     pp = self._spotpos
     ww = self._spotwave
     self._fspot = LinearInterp2D(pp, ww, self._spots)
     # self._fx    = LinearInterp2D(pp, ww, self._spotx)
     # self._fy    = LinearInterp2D(pp, ww, self._spoty)
     
     #- Read spot vs. CCD pixel scales from header
     hdr = fx[0].header
     self.CcdPixelSize = hdr['CCDPIXSZ']  #- CCD pixel size in mm
     self.SpotPixelSize = hdr['PIXSIZE']  #- Spot pixel size in mm
     
     fx.close()
Exemple #3
0
 def __init__(self, filename):
     """
     Loads pixelated PSF parameters from a fits file
     """
     #- Use PSF class to Load Generic PSF values (x, y, wavelength, ...)
     PSF.__init__(self, filename)
     
     #- Additional headers are a custom format for the pixelated psf
     fx = fits.open(filename, memmap=False)
     self.nexp     = fx[3].data.view(np.ndarray)  #- icoeff xexp yexp
     self.xyscale  = fx[4].data.view(np.ndarray)  #- ifiber igroup x0 xscale y0 yscale
     self.psfimage = fx[5].data.view(np.ndarray)  #- [igroup, icoeff, iy, ix]
     fx.close()
Exemple #4
0
    def __init__(self, filename):
        """
        Loads pixelated PSF parameters from a fits file
        """
        #- Use PSF class to Load Generic PSF values (x, y, wavelength, ...)
        PSF.__init__(self, filename)

        #- Additional headers are a custom format for the pixelated psf
        fx = fits.open(filename, memmap=False)
        self.nexp = fx[3].data.view(np.ndarray)  #- icoeff xexp yexp
        self.xyscale = fx[4].data.view(
            np.ndarray)  #- ifiber igroup x0 xscale y0 yscale
        self.psfimage = fx[5].data.view(
            np.ndarray)  #- [igroup, icoeff, iy, ix]
        fx.close()
Exemple #5
0
 def __init__(self, filename, spot=None, scale=1.0):
     """
     Initialize MonoSpotPSF from input file with optional override of
     which spot[y,x] to use.  If overriding spot, scale gives ratio of
     spot pixel-size to CCD pixel-size.  Must be >1 and evenly divisible
     by spot dimensions.
     
     See specter.psf.PSF for futher details
     """
     #- Use PSF class to Load Generic PSF values (x, y, wavelength, ...)
     PSF.__init__(self, filename)
     
     if spot is None:
         self._spot = fits.getdata(filename, 'SPOT')
         self._scale = fits.getheader(filename, 'SPOT')['SCALE']
     else:
         self._spot = spot.copy()
         self._scale = scale
Exemple #6
0
    def __init__(self, filename, spot=None, scale=1.0):
        """
        Initialize MonoSpotPSF from input file with optional override of
        which spot[y,x] to use.  If overriding spot, scale gives ratio of
        spot pixel-size to CCD pixel-size.  Must be >1 and evenly divisible
        by spot dimensions.
        
        See specter.psf.PSF for futher details
        """
        #- Use PSF class to Load Generic PSF values (x, y, wavelength, ...)
        PSF.__init__(self, filename)

        if spot is None:
            self._spot = fits.getdata(filename, 'SPOT')
            self._scale = fits.getheader(filename, 'SPOT')['SCALE']
        else:
            self._spot = spot.copy()
            self._scale = scale