How to use the tweakwcs.__version__ function in tweakwcs

To help you get started, we’ve selected a few tweakwcs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spacetelescope / tweakwcs / tweakwcs / imalign.py View on Github external
* **'status'**: Alignment status. Currently two possible status are
          possible ``'SUCCESS'`` or ``'FAILED: reason for failure'``.
          When alignment failed, the reason for failure is provided after
          alignment status.

    """
    function_name = fit_wcs.__name__

    # Time it
    runtime_begin = datetime.now()

    log.info(" ")
    log.info("***** {:s}.{:s}() started on {}"
             .format(__name__, function_name, runtime_begin))
    log.info("      Version {}".format(__version__))
    log.info(" ")

    try:
        # Attempt to set initial status to FAILED.
        tpwcs.meta['fit_info'] = {'status': 'FAILED: Unknown error'}
    except Exception:
        raise AttributeError("Unable to set/modify tpwcs.meta attribute.")

    # check fitgeom:
    fitgeom = fitgeom.lower()
    if fitgeom not in ['shift', 'rscale', 'general']:
        raise ValueError("Unsupported 'fitgeom'. Valid values are: "
                         "'shift', 'rscale', or 'general'")

    wimcat = WCSImageCatalog(imcat, tpwcs,
                             name=imcat.meta.get('name', 'Unnamed'))
github spacetelescope / tweakwcs / tweakwcs / imalign.py View on Github external
dictionary may differ from
        the values of the same items in ``TPWCS.meta`` dictionary. This is
        normal since WCS corrections (in `~tweakwcs.tpwcs.TPWCS`) are applied
        in the image's WCS plane while fit may be performed in a slightly
        different tangent plane.

    """
    function_name = align_wcs.__name__

    # Time it
    runtime_begin = datetime.now()

    log.info(" ")
    log.info("***** {:s}.{:s}() started on {}"
             .format(__name__, function_name, runtime_begin))
    log.info("      Version {}".format(__version__))
    log.info(" ")

    # Check that type of `wcscat` is correct and set initial status to FAILED:
    if isinstance(wcscat, TPWCS):
        wcscat = [wcscat]
        start = 1
    else:
        start = 0

    if not (hasattr(wcscat, '__iter__') and all(isinstance(wcat, TPWCS)
                                                for wcat in wcscat[start:])):
        raise TypeError("Input 'wcscat' must be either a single TPWCS-derived "
                        " object or a list of TPWCS-derived objects.")

    wcs_im_cats = []
    for wcat in wcscat:
github spacetelescope / tweakwcs / docs / source / conf.py View on Github external
# Suppress the warnings requires Sphinx v1.4.2
suppress_warnings = ['app.add_directive', ]


# General information about the project
project = setup_cfg['package_name']
author = setup_cfg['author']
copyright = u'{0}, {1}'.format(datetime.datetime.now().year, author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# build documents.
#
# package = importlib.import_module(setup_cfg['package_name'])
import tweakwcs
release = "{:s}".format(tweakwcs.__version__)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
# unused_docs = []

# List of directories, relative to source directory, that shouldn't be searched
# for source files.