Esempio n. 1
0
def test_instrument_model(make_data_path):
    """Check the full response model"""

    from sherpa.astro import xspec

    s = Session()
    s.load_pha(make_data_path('3c273.pi'))

    a1 = xspec.XSpowerlaw()
    m1 = xspec.XSwabs()

    s.set_source(m1 * a1)

    src = s.get_source()
    mdl = s.get_model()
    assert src.ndim == 1
    assert mdl.ndim == 1
Esempio n. 2
0
def psf_fixture(request):
    configuration = request.param

    fixture_data = make_images(configuration)

    ui = Session()

    ui.set_data(1, fixture_data.image)

    exact_expected_sigma = configuration.source_sigma
    approx_expected_sigma = approx(exact_expected_sigma, rel=3e-2)

    # Set the source model as a 2D Gaussian, and set the PSF in Sherpa
    source_position = configuration.source_position
    sherpa_source = SigmaGauss2D('source')
    sherpa_source.ampl = configuration.source_amplitude
    sherpa_source.sigma_a = exact_expected_sigma
    sherpa_source.sigma_b = exact_expected_sigma
    sherpa_source.xpos = source_position
    sherpa_source.ypos = source_position
    ui.set_source(sherpa_source)
    ui.set_psf(fixture_data.psf_model)

    return ui, sherpa_source, approx_expected_sigma