import os
import sys

try:
    # TODO: If we made the tests dir a package this could be avoided by using
    # package-relative imports
    import conv_base
except ImportError:
    sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
                                                    os.pardir)))
    import conv_base


class Test1411(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_55.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.2,lmc)"
        cls.fname="C1411_%s.fits"
        cls.setup2()

class Test1412(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_56.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.24,xgal)"
        cls.fname="C1412_%s.fits"
        cls.setup2()

class Test1413(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_6.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.12,gal3)"
        cls.fname="C1413_%s.fits"
        cls.setup2()

class Test1414(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_60.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.08,gal1)"
        cls.fname="C1414_%s.fits"
        cls.setup2()

class Test1415(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_63.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.16,smc)"
        cls.fname="C1415_%s.fits"
        cls.setup2()

class Test1416(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_63.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.2,lmc)"
        cls.fname="C1416_%s.fits"
        cls.setup2()

class Test1417(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_65.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.04,gal1)"
        cls.fname="C1417_%s.fits"
        cls.setup2()

class Test1418(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_65.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.08,gal1)"
        cls.fname="C1418_%s.fits"
        cls.setup2()

class Test1419(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_65.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.12,gal3)"
        cls.fname="C1419_%s.fits"
        cls.setup2()

class Test1420(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_67.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.16,smc)"
        cls.fname="C1420_%s.fits"
        cls.setup2()

class Test1421(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_67.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.2,lmc)"
        cls.fname="C1421_%s.fits"
        cls.setup2()

class Test1422(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_69.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.24,xgal)"
        cls.fname="C1422_%s.fits"
        cls.setup2()

class Test1423(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_76.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.08,gal1)"
        cls.fname="C1423_%s.fits"
        cls.setup2()

class Test1424(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_87.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.2,lmc)"
        cls.fname="C1424_%s.fits"
        cls.setup2()

class Test1425(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_9.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.04,gal1)"
        cls.fname="C1425_%s.fits"
        cls.setup2()

class Test1426(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_93.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.04,gal1)"
        cls.fname="C1426_%s.fits"
        cls.setup2()

class Test1427(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="rn(spec($PYSYN_CDBS/grid/pickles/dat_uvk/pickles_uk_95.fits),band(cousins,i),28.0,vegamag)*ebmvx(0.12,gal3)"
        cls.fname="C1427_%s.fits"
        cls.setup2()

class Test1428(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f160w"
        cls.spectrum="spec(earthshine.fits)*0.5+rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1428_%s.fits"
        cls.setup2()

class Test1429(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f164n"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),22.0,vegamag)"
        cls.fname="C1429_%s.fits"
        cls.setup2()

class Test1430(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f164n"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),28.0,vegamag)"
        cls.fname="C1430_%s.fits"
        cls.setup2()

class Test1431(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f164n"
        cls.spectrum="spec(earthshine.fits)*0.5+rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1431_%s.fits"
        cls.setup2()

class Test1432(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f167n"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),22.0,vegamag)"
        cls.fname="C1432_%s.fits"
        cls.setup2()

class Test1433(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f167n"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),28.0,vegamag)"
        cls.fname="C1433_%s.fits"
        cls.setup2()

class Test1434(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,f167n"
        cls.spectrum="spec(earthshine.fits)*0.5+rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1434_%s.fits"
        cls.setup2()

class Test1435(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,11900,0.0,4.0)*ebmvx(0.2,lmc),band(johnson,b),23.0,vegamag)"
        cls.fname="C1435_%s.fits"
        cls.setup2()

class Test1436(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,15400,0.0,3.9)*ebmvx(0.16,smc),band(johnson,b),23.0,vegamag)"
        cls.fname="C1436_%s.fits"
        cls.setup2()

class Test1437(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,18700,0.0,3.9)*ebmvx(0.12,gal3),band(johnson,b),23.0,vegamag)"
        cls.fname="C1437_%s.fits"
        cls.setup2()

class Test1438(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,25400,0.0,3.9)*ebmvx(0.08,gal1),band(johnson,b),23.0,vegamag)"
        cls.fname="C1438_%s.fits"
        cls.setup2()

class Test1439(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,30000,0.0,4.0)*ebmvx(0.04,gal1),band(johnson,b),23.0,vegamag)"
        cls.fname="C1439_%s.fits"
        cls.setup2()

class Test1440(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1)*ebmvx(0.24,xgal),band(johnson,b),23.0,vegamag)"
        cls.fname="C1440_%s.fits"
        cls.setup2()

class Test1441(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),17.0,vegamag)"
        cls.fname="C1441_%s.fits"
        cls.setup2()

class Test1442(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),18.0,vegamag)"
        cls.fname="C1442_%s.fits"
        cls.setup2()

class Test1443(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),23.0,vegamag)"
        cls.fname="C1443_%s.fits"
        cls.setup2()

class Test1444(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(pl(4000.0,-2.0,flam),band(Bessell,j),23.0,vegamag)"
        cls.fname="C1444_%s.fits"
        cls.setup2()

class Test1445(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(pl(4000.0,-2.0,flam),band(bessell,h),23.0,vegamag)"
        cls.fname="C1445_%s.fits"
        cls.setup2()

class Test1446(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(pl(4000.0,-2.0,flam),band(bessell,k),23.0,vegamag)"
        cls.fname="C1446_%s.fits"
        cls.setup2()

class Test1447(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(z(spec($PYSYN_CDBS/calspec/g191b2b_mod_004.fits),0.05),band(johnson,b),23.0,vegamag)"
        cls.fname="C1447_%s.fits"
        cls.setup2()

class Test1448(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(z(spec($PYSYN_CDBS/calspec/gd153_mod_004.fits),0.1),band(johnson,b),23.0,vegamag)"
        cls.fname="C1448_%s.fits"
        cls.setup2()

class Test1449(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102"
        cls.spectrum="rn(z(spec($PYSYN_CDBS/calspec/gd71_mod_005.fits),0.15),band(johnson,b),23.0,vegamag)"
        cls.fname="C1449_%s.fits"
        cls.setup2()

class Test1450(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102,bkg"
        cls.spectrum="rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1450_%s.fits"
        cls.setup2()

class Test1451(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102,bkg"
        cls.spectrum="spec(earthshine.fits)*0.5+rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1451_%s.fits"
        cls.setup2()

class Test1452(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102,bkg"
        cls.spectrum="spec(earthshine.fits)*2.0+rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1452_%s.fits"
        cls.setup2()

class Test1453(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g102,bkg"
        cls.spectrum="spec(earthshine.fits)+rn(spec(Zodi.fits),band(johnson,v),22.7,vegamag)+(spec(el1215a.fits)+spec(el1302a.fits)+spec(el1356a.fits)+spec(el2471a.fits))"
        cls.fname="C1453_%s.fits"
        cls.setup2()

class Test1454(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(bb(10000),band(cousins,r),23.0,vegamag)"
        cls.fname="C1454_%s.fits"
        cls.setup2()

class Test1455(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(bb(10000),band(johnson,i),23.0,vegamag)"
        cls.fname="C1455_%s.fits"
        cls.setup2()

class Test1456(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(bb(10000),band(johnson,j),23.0,vegamag)"
        cls.fname="C1456_%s.fits"
        cls.setup2()

class Test1457(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(bb(10000),band(johnson,k),23.0,vegamag)"
        cls.fname="C1457_%s.fits"
        cls.setup2()

class Test1458(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(bb(10000),band(johnson,r),23.0,vegamag)"
        cls.fname="C1458_%s.fits"
        cls.setup2()

class Test1459(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(bb(10000),band(johnson,u),23.0,vegamag)"
        cls.fname="C1459_%s.fits"
        cls.setup2()

class Test1460(conv_base.ThermCase):
    @classmethod
    def setUpClass(cls):
        cls.obsmode="wfc3,ir,g141"
        cls.spectrum="rn(icat(k93models,9230,0.0,4.1),band(johnson,v),17.0,vegamag)"
        cls.fname="C1460_%s.fits"
        cls.setup2()

