Exemplo n.º 1
0
def write_fits(hdulist, outfile, keywords):

    for h in hdulist:
        for k, v in keywords.items():
            h.header[k] = v
        h.header['CREATOR'] = 'fermipy ' + fermipy.__version__
        h.header['STVER'] = fermipy.get_st_version()

    hdulist.writeto(outfile, clobber=True)
Exemplo n.º 2
0
def write_fits(hdulist, outfile, keywords):

    for h in hdulist:
        for k, v in keywords.items():
            h.header[k] = v
        h.header['CREATOR'] = 'fermipy ' + fermipy.__version__
        h.header['STVER'] = fermipy.get_st_version()

    hdulist.writeto(outfile, clobber=True)
Exemplo n.º 3
0
def requires_st_version(version_str):
    """Decorator to declare minimum ST version needed for tests.
    """
    reason = 'Requires ST Version >=: {}'.format(version_str)

    version = version_str_to_int(version_str)

    st_version = get_st_version()
    if st_version == 'unknown':
        return pytest.mark.skipif(False, reason=reason)

    try:
        st_version = version_str_to_int(get_st_version())
    except:
        st_version = 0

    if st_version >= version:
        skip_it = False
    else:
        skip_it = True

    return pytest.mark.skipif(skip_it, reason=reason)
Exemplo n.º 4
0
def write_hdus(hdus, outfile, **kwargs):

    keywords = kwargs.get('keywords', {})

    hdulist = fits.HDUList(hdus)
    for h in hdulist:

        for k, v in keywords.items():
            h.header[k] = v

        h.header['CREATOR'] = 'fermipy ' + fermipy.__version__
        h.header['STVER'] = fermipy.get_st_version()
    hdulist.writeto(outfile, clobber=True)
Exemplo n.º 5
0
def write_hdus(hdus, outfile, **kwargs):

    keywords = kwargs.get('keywords', {})

    hdulist = fits.HDUList(hdus)
    for h in hdulist:

        for k, v in keywords.items():
            h.header[k] = v

        h.header['CREATOR'] = 'fermipy ' + fermipy.__version__
        h.header['STVER'] = fermipy.get_st_version()
    hdulist.writeto(outfile, clobber=True)
Exemplo n.º 6
0
def requires_st_version(version_str):
    """Decorator to declare minimum ST version needed for tests.
    """

    version = version_str_to_int(version_str)
    st_version = version_str_to_int(get_st_version())

    if st_version >= version:
        skip_it = False
    else:
        skip_it = True

    reason = 'Requires ST Version >=: {}'.format(version_str)
    return pytest.mark.skipif(skip_it, reason=reason)