Exemplo n.º 1
0
def test_free_param():

    spectrum = Log_parabola()
    source = PointSource("test_source",
                         ra=123.4,
                         dec=56.7,
                         spectral_shape=spectrum)

    parameters = [
        spectrum.alpha, spectrum.beta, spectrum.piv, spectrum.K,
        source.position.ra, source.position.dec
    ]

    for param in parameters:
        param.free = False

    assert len(source.free_parameters) == 0

    for i, param in enumerate(parameters):
        param.free = True
        assert len(source.free_parameters) == i + 1
Exemplo n.º 2
0
def test_free_param():

    spectrum = Log_parabola()
    source = ExtendedSource("test_source",
                            spatial_shape=Gaussian_on_sphere(),
                            spectral_shape=spectrum)

    parameters = [
        spectrum.alpha, spectrum.beta, spectrum.piv, spectrum.K,
        source.spatial_shape.lat0, source.spatial_shape.lon0,
        source.spatial_shape.sigma
    ]

    for param in parameters:
        param.free = False

    assert len(source.free_parameters) == 0

    for i, param in enumerate(parameters):
        param.free = True
        assert len(source.free_parameters) == i + 1