Ejemplo n.º 1
0
    def test_variable_propagation_support() -> None:
        """Test a time variable effect can be added and called without error"""

        effect = VariablePWVTrans(create_mock_pwv_model())
        model = SNModel(sncosmo_test_models.flatsource())
        model.add_effect(effect=effect, frame='obs', name='Variable PWV')
        model.flux(time=0, wave=[4000])
Ejemplo n.º 2
0
    def test_sed_matches_sncosmo_model() -> None:
        """Test the SED returned by the ``modeling.SNModel`` class matches the ``sncosmo.Model`` class"""

        wave = np.arange(3000, 12000)
        sncosmo_model = sncosmo.Model('salt2-extended')
        sncosmo_flux = sncosmo_model.flux(0, wave)
        custom_model = SNModel(sncosmo_model.source)
        custom_flux = custom_model.flux(0, wave)
        np.testing.assert_equal(custom_flux, sncosmo_flux)