コード例 #1
0
ファイル: test_spectrum.py プロジェクト: vandalt/species
    def test_read_spectrum(self):
        database = species.Database()

        with pytest.warns(UserWarning) as warning:
            database.add_spectrum('irtf', sptypes=['L', ])

        read_spectrum = species.ReadSpectrum('irtf', filter_name='MKO/NSFCam.H')
        assert read_spectrum.wavel_range == pytest.approx((1.382, 1.8656), rel=1e-6, abs=0.)
コード例 #2
0
    def test_read_calibration(self):
        database = species.Database()
        database.add_spectra("vega")

        read_calib = species.ReadCalibration("vega",
                                             filter_name="Paranal/NACO.H")
        assert read_calib.wavel_range == pytest.approx((1.44, 1.88),
                                                       rel=1e-7,
                                                       abs=0.0)
コード例 #3
0
    def test_read_model(self):
        database = species.Database()

        database.add_model('ames-cond',
                           wavel_range=(1., 5.),
                           spec_res=100.,
                           teff_range=(2000., 2500))

        read_model = species.ReadModel('ames-cond')
        assert read_model.model == 'ames-cond'
コード例 #4
0
    def test_read_color_magnitude(self):
        database = species.Database()
        database.add_photometry('vlm-plx')
        database.add_photometry('leggett')

        read_colormag = species.ReadColorMagnitude(
            'vlm-plx', ('MKO/NSFCam.J', 'MKO/NSFCam.H'), 'MKO/NSFCam.J')

        assert read_colormag.filters_color == ('MKO/NSFCam.J', 'MKO/NSFCam.H')
        assert read_colormag.filter_mag == 'MKO/NSFCam.J'
コード例 #5
0
ファイル: test_isochrone.py プロジェクト: gotten/species
    def test_read_isochrone(self):
        database = species.Database()
        database.add_isochrones('model.AMES-Cond-2000.M-0.0.NaCo.Vega', 'ames-cond_isochrone')

        database.add_model('ames-cond',
                           wavel_range=(1., 5.),
                           spec_res=100.,
                           teff_range=(2000., 2500))

        read_isochrone = species.ReadIsochrone('ames-cond_isochrone')
        assert read_isochrone.tag == 'ames-cond_isochrone'
コード例 #6
0
ファイル: test_model.py プロジェクト: tomasstolker/species
    def test_read_model(self):
        database = species.Database()

        database.add_model(
            "ames-cond",
            wavel_range=(1.0, 5.0),
            spec_res=100.0,
            teff_range=(2000.0, 2500.0),
        )

        read_model = species.ReadModel("ames-cond")
        assert read_model.model == "ames-cond"
コード例 #7
0
    def test_read_object(self):
        database = species.Database()
        database.add_companion(name='beta Pic b')

        read_object = species.ReadObject('beta Pic b')
        assert read_object.object_name == 'beta Pic b'

        with pytest.raises(ValueError) as error:
            species.ReadObject('wrong name')

        assert str(
            error.value
        ) == 'The object \'wrong name\' is not present in the database.'
コード例 #8
0
    def test_read_isochrone(self):
        database = species.Database()
        database.add_isochrones("ames")

        database.add_model(
            "ames-cond",
            wavel_range=(1.0, 5.0),
            spec_res=100.0,
            teff_range=(2000.0, 2500.0),
        )

        read_isochrone = species.ReadIsochrone("ames-cond")
        assert read_isochrone.tag == "ames-cond"
コード例 #9
0
    def test_read_object(self):
        database = species.Database()

        with pytest.warns(UserWarning):
            database.add_companion(name="beta Pic b")

        read_object = species.ReadObject("beta Pic b")
        assert read_object.object_name == "beta Pic b"

        with pytest.raises(ValueError) as error:
            species.ReadObject("wrong name")

        assert (str(error.value) ==
                "The object 'wrong name' is not present in the database.")
コード例 #10
0
input_dir = "/Users/nasedkin/data/HR8799/.../"
filename = "hr8799e.dat"
gravity_wavel, gravity_contrast = np.loadtxt(input_dir + filename, unpack=True)
species.SpeciesInit()

distance = ( 41.2925, 0.1502)  # [pc]

magnitudes = {'TYCHO2/TYCHO2.B': (6.21,0.01),
              'TYCHO2/TYCHO2.V': (5.953,0.010),
              '2MASS/2MASS.J': (5.383, 0.027),
              '2MASS/2MASS.H': (5.280, 0.018),
              '2MASS/2MASS.K': (5.240, 0.018)}

filters = list(magnitudes.keys())

database = species.Database()

database.add_model(model='bt-nextgen',
                    wavel_range=(0.5, 5.),
                    teff_range=(7200., 7600.),
                    spec_res=1000.)


database.add_object(object_name='HD 218396',
                    distance=distance,
                    app_mag=magnitudes)

#database.add_calibration(filename='../data/star_spec_approx.dat',
#                         tag='btnextgen')
urllib.request.urlretrieve('http://irtfweb.ifa.hawaii.edu/~spex/IRTF_Spectral_Library/Data/F0V(n)_HD108519.txt',
database.add_calibration(filename='data/F0V_HD218396.txt',