Exemple #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])
Exemple #2
0
    def test_error_for_bad_frame(self) -> None:
        """Test an error is raised for a band reference frame name"""

        model = SNModel(source='salt2')
        with self.assertRaises(ValueError):
            model.add_effect(effect=sncosmo.CCM89Dust(),
                             frame='bad_frame_name',
                             name='mw')
Exemple #3
0
    def test_free_effect_adds_z_parameter(self) -> None:
        """Test effects in the ``free`` frame of reference include an added redshift parameter"""

        effect_name = 'freeMW'
        model = SNModel(source='salt2')
        model.add_effect(effect=sncosmo.CCM89Dust(),
                         frame='free',
                         name=effect_name)
        self.assertIn(effect_name + 'z', model.param_names)