Beispiel #1
0
 def setUp(self):
     tmcname = os.path.join('mtab','r1j2146sm_tmc.fits')
     self.oldrefs = refs.getref()
     refs.COMPTABLE = locations._refTable(tmcname)
     tmgname = os.path.join('mtab','rbg2236im_tmg.fits')
     refs.GRAPHTABLE = locations._refTable(tmgname)
     self.omstring='acs,hrc,f555w,mjd#54000'
Beispiel #2
0
 def setUp(self):
     tmcname = os.path.join('mtab', 'r1j2146sm_tmc.fits')
     self.oldrefs = refs.getref()
     refs.COMPTABLE = locations._refTable(tmcname)
     tmgname = os.path.join('mtab', 'rbg2236im_tmg.fits')
     refs.GRAPHTABLE = locations._refTable(tmgname)
     self.omstring = 'acs,hrc,f555w,mjd#54000'
 def setUp(self):
   tmg = locations._refTable(os.path.join('mtab','u921351jm_tmg.fits'))
   tmc = locations._refTable(os.path.join('mtab','ub31649mm_tmc.fits'))
   
   spec = FlatSpectrum(1,fluxunits='flam')
   bandpass = ObsBandpass('acs,hrc,f555w',graphtable=tmg,comptable=tmc)
   
   self.obs = Observation(spec,bandpass)
   self.obs.initbinflux()
Beispiel #4
0
    def setUp(self):
        tmg = locations._refTable(os.path.join('mtab', 'u921351jm_tmg.fits'))
        tmc = locations._refTable(os.path.join('mtab', 'ub31649mm_tmc.fits'))

        spec = FlatSpectrum(1, fluxunits='flam')
        bandpass = ObsBandpass('acs,hrc,f555w', graphtable=tmg, comptable=tmc)

        self.obs = Observation(spec, bandpass)
        self.obs.initbinflux()
Beispiel #5
0
 def setUp(self):
     cmptb_name = os.path.join('mtab', 'r1j2146sm_tmc.fits')
     self.old_comptable = refs.COMPTABLE
     refs.COMPTABLE = locations._refTable(cmptb_name)
     print("ui_Test.BandTests:")
     print("  Tests are being run with comptable", refs.COMPTABLE)
     print("  Comparison results were computed with r1j2146sm_tmc.fits")
Beispiel #6
0
 def setUp(self):
     cmptb_name=os.path.join('mtab','r1j2146sm_tmc.fits')
     self.old_comptable = refs.COMPTABLE
     refs.COMPTABLE = locations._refTable(cmptb_name)
     print("ui_Test.BandTests:")
     print("  Tests are being run with comptable",refs.COMPTABLE)
     print("  Comparison results were computed with r1j2146sm_tmc.fits")
def aper_no_extrap_test():
    interp_val = -5.
    filename = os.path.join('comp', 'acs', 'acs_wfc_aper_002_syn.fits')
    filename = locations._refTable(filename) + '[aper#]'

    nose.tools.assert_raises(exceptions.ExtrapolationNotAllowed,
                             S.spectrum.InterpolatedSpectralElement, filename,
                             interp_val)
def aper_no_extrap_test():
  interp_val = -5.
  filename = os.path.join('comp','acs','acs_wfc_aper_002_syn.fits')
  filename = locations._refTable(filename) + '[aper#]'
  
  nose.tools.assert_raises(exceptions.ExtrapolationNotAllowed,
                            S.spectrum.InterpolatedSpectralElement,
                            filename,interp_val)
Beispiel #9
0
def setUpModule():
    #Freeze the version of the comptable so tests are not susceptible to
    # updates to CDBS
    global old_comptable
    cmptb_name = os.path.join('mtab','rcb1833hm_tmc.fits')
    old_comptable = refs.COMPTABLE
    refs.COMPTABLE = locations._refTable(cmptb_name)
    print("%s:" % os.path.basename(__file__))
    print("   Tests are being run with %s" % refs.COMPTABLE)
Beispiel #10
0
 def setUp(self):
     self.old_comptable = refs.COMPTABLE
     refs.COMPTABLE = locations._refTable(cmptb_name)
     self.oldpath = os.path.abspath(os.curdir)
     if os.path.isdir(os.path.join(locations.specdir, 'generic')):
         os.chdir(os.path.join(locations.specdir, 'generic'))
     else:
         os.chdir(locations.specdir)
     self.accuracy = 0.00109
     self.setparms()
     if self.sp is not None:  # Skip the base class!!
         self.obs = Observation(self.sp, self.bp)
Beispiel #11
0
def setUpModule():
    # Freeze the version of the comptable so tests are not susceptible to
    # updates to CDBS
    global old_comptable
    global old_vegafile

    cmptb_name = os.path.join('mtab', 't260548pm_tmc.fits')
    old_comptable = refs.COMPTABLE
    refs.COMPTABLE = locations._refTable(cmptb_name)
    print("%s:" % os.path.basename(__file__))
    print("  Tests are being run with %s" % refs.COMPTABLE)

    # Also set the version of Vega for similar reasons
    old_vegafile = locations.VegaFile
    locations.VegaFile = os.path.join('crcalspec', 'alpha_lyr_stis_003.fits')
    print("Using Vega spectrum: %s" % locations.VegaFile)
Beispiel #12
0
def setUpModule():
    # Freeze the version of the comptable so tests are not susceptible to
    # updates to CDBS
    global old_comptable
    global old_vegafile

    cmptb_name = os.path.join('mtab', 't260548pm_tmc.fits')
    old_comptable = refs.COMPTABLE
    refs.COMPTABLE = locations._refTable(cmptb_name)
    print("%s:" % os.path.basename(__file__))
    print("  Tests are being run with %s" % refs.COMPTABLE)

    # Also set the version of Vega for similar reasons
    old_vegafile = locations.VegaFile
    locations.VegaFile = os.path.join('crcalspec', 'alpha_lyr_stis_003.fits')
    print("Using Vega spectrum: %s" % locations.VegaFile)
Beispiel #13
0
def setUpModule():
    #Freeze the version of the comptable so tests are not susceptible to
    # updates to CDBS
    global old_comptable
    global old_vegafile

    old_comptable = refs.COMPTABLE
    cmptb_name = os.path.join('mtab', 'r1j2146sm_tmc.fits')
    refs.COMPTABLE = locations._refTable(cmptb_name)
    print("%s:" % os.path.basename(__file__))
    print("   Tests are being run with %s" % refs.COMPTABLE)
    print("   Synphot comparison results were computed with r1j2146sm_tmc.fits")
    #Synphot comparison results are identified with the varname synphot_ref.
    #Also set the version of Vega for similar reasons
    old_vegafile = locations.VegaFile
    locations.VegaFile = os.path.join(testdir, 'alpha_lyr_stis_002.fits')
    print("Using Vega spectrum: %s" % locations.VegaFile)
Beispiel #14
0
def setUpModule():
    #Freeze the version of the comptable so tests are not susceptible to
    # updates to CDBS
    global old_comptable
    global old_vegafile

    old_comptable = refs.COMPTABLE
    cmptb_name = os.path.join('mtab', 'r1j2146sm_tmc.fits')
    refs.COMPTABLE = locations._refTable(cmptb_name)
    print("%s:" % os.path.basename(__file__))
    print("   Tests are being run with %s" % refs.COMPTABLE)
    print("   Synphot comparison results were computed with r1j2146sm_tmc.fits")
    #Synphot comparison results are identified with the varname synphot_ref.

    #Also set the version of Vega for similar reasons
    old_vegafile = locations.VegaFile
    locations.VegaFile = os.path.join(testdir, 'alpha_lyr_stis_002.fits')
    print("Using Vega spectrum: %s" % locations.VegaFile)
    def test_two(self):
        throughput_list = ['comp/ota/hst_ota_007_syn.fits',
                           'comp/acs/acs_hrc_m12_005_syn.fits',
                           'comp/acs/acs_hrc_m3_005_syn.fits',
                           'comp/acs/acs_f435w_004_syn.fits',
                           'comp/acs/acs_hrc_win_005_syn.fits',
                           'comp/acs/acs_hrc_ccd_011_syn.fits']

        for i, f in enumerate(throughput_list):
            throughput_list[i] = os.path.join(self.cdbs, f)

        cmptb_name = os.path.join('mtab', 'r1j2146sm_tmc.fits')
        refs.COMPTABLE = locations._refTable(cmptb_name)

        obs = observationmode.ObservationMode('acs,hrc,f435w')

        n = self.check_list(throughput_list,
                            [c.throughput_name for c in obs.components])

        if n:
            raise AssertionError(n)
 def setUp(self):
   interp_val = 51252.0
   filename = os.path.join('comp','stis','stis_nm16_mjd_010_syn.fits')
   filename = locations._refTable(filename) + '[MJD#]'
   self.spec = S.spectrum.InterpolatedSpectralElement(filename,interp_val)
 def setUp(self):
     interp_val = 0.0
     filename = os.path.join('comp', 'acs', 'acs_wfc_aper_002_syn.fits')
     filename = locations._refTable(filename) + '[aper#]'
     self.spec = S.spectrum.InterpolatedSpectralElement(
         filename, interp_val)
 def setUp(self):
   interp_val = -5.
   filename = os.path.join('comp','acs','acs_fr656n_005_syn.fits')
   filename = locations._refTable(filename) + '[fr656n#]'
   self.spec = S.spectrum.InterpolatedSpectralElement(filename,interp_val)
 def setUp(self):
     interp_val = 51252.0
     filename = os.path.join('comp', 'stis', 'stis_nm16_mjd_010_syn.fits')
     filename = locations._refTable(filename) + '[MJD#]'
     self.spec = S.spectrum.InterpolatedSpectralElement(
         filename, interp_val)
    def setUp(self):
        self.cdbs = os.environ['PYSYN_CDBS']

        graphtab = os.path.join('mtab','u921351jm_tmg.fits')
        self.old_refs = refs.getref()
        refs.GRAPHTABLE = locations._refTable(graphtab)
 def setUp(self):
     interp_val = -5.
     filename = os.path.join('comp', 'acs', 'acs_fr656n_005_syn.fits')
     filename = locations._refTable(filename) + '[fr656n#]'
     self.spec = S.spectrum.InterpolatedSpectralElement(
         filename, interp_val)
 def setUp(self):
   interp_val = 0.0
   filename = os.path.join('comp','acs','acs_wfc_aper_002_syn.fits')
   filename = locations._refTable(filename) + '[aper#]'
   self.spec = S.spectrum.InterpolatedSpectralElement(filename,interp_val)