How to use the pysynphot.GaussianSource function in pysynphot

To help you get started, we’ve selected a few pysynphot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gbrammer / grizli / grizli / multifit.py View on Github external
wlimit=grism_limits[g], dlam=dlam, 
                                      spatial_scale=scale, NY=size,
                                      pixfrac=pixfrac,
                                      kernel=kernel,
                                      convert_to_flambda=flambda,
                                      fcontam=fcontam, ds9=None)
            
            hdu[0].header['RA'] = (self.ra, 'Right ascension')
            hdu[0].header['DEC'] = (self.dec, 'Declination')
            hdu[0].header['GRISM'] = (g, 'Grism')
            hdu[0].header['ISFLAM'] = (flambda, 'Pixels in f-lam units')
            hdu[0].header['CONF'] = (beams[0].beam.conf.conf_file,
                                     'Configuration file')
            
            h = hdu[1].header
            gau = S.GaussianSource(1.e-17, h['CRVAL1'], h['CD1_1']*1)
            for beam in all_beams:
                beam.compute_model(spectrum_1d=[gau.wave, gau.flux/beam.beam.total_flux])
            
            data = [beam.model for beam in all_beams]
            
            h_kern = drizzle_2d_spectrum(all_beams, data=data, 
                                      wlimit=grism_limits[g], dlam=dlam, 
                                      spatial_scale=scale, NY=size,
                                      pixfrac=pixfrac,
                                      kernel=kernel,
                                      convert_to_flambda=flambda,
                                      fcontam=0, ds9=None)
            
            kern = h_kern[1].data[:,h['CRPIX1']-1-size:h['CRPIX1']-1+size]
            hdu_kern = pyfits.ImageHDU(data=kern, header=h_kern[1].header, name='KERNEL')
            hdu.append(hdu_kern)

pysynphot

Python Synthetic Photometry Utilities

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis