Пример #1
0
    def __new__(cls, cat_id, **kwargs):
        query = "item_type:GBDXCatalogRecord AND (attributes.catalogID.keyword:{} OR id:{})".format(
            cat_id, cat_id)
        query += " AND NOT item_type:DigitalGlobeAcquisition"
        result = vector_services_query(query, count=1)
        if len(result) == 0:
            # the image isn't in GBDX, check if it's an acquisition
            query = "item_type:DigitalGlobeAcquisition AND (attributes.catalogID.keyword:{} OR id:{})".format(
                cat_id, cat_id)
            result = vector_services_query(query, count=1)
            if len(result) == 0:
                raise Exception(
                    'Could not find a catalog entry for {}'.format(cat_id))
            else:
                msg = '\n{} exists in Catalog but image is not in GBDX'.format(
                    cat_id)
                msg += '\nOrder the image (see Ordering.order()) and/or wait for delivery'
                raise ImageNotAvailable(msg)

        image = cls._image_class(result[0], **kwargs)

        if issubclass(type(image), WorldViewImage):
            if not is_available(cat_id):
                msg = '\n%s is not available in RDA. Order the image, or wait for an order to complete' % cat_id
                msg += ' and finish ingestion into RDA'
                raise ImageNotAvailable(msg)

            if 'acomp' in kwargs and kwargs['acomp'] is True:
                if not can_acomp(cat_id):
                    raise AcompUnavailable(
                        '\nAcomp is not available for {}'.format(cat_id))

        return image
Пример #2
0
    def acomp_available(cls, cat_id):
        """
        Checks to see if a CatalogID can be atmos. compensated or not.

        Args:
          catalogID (str): The catalog ID from the platform catalog.
        Returns:
          available (bool): Whether or not the image can be acomp'd
      """
        return can_acomp(cat_id)
Пример #3
0
    def acomp_available(cls, cat_id):
      """
        Checks to see if a CatalogID can be atmos. compensated or not.

        Args:
          catalogID (str): The catalog ID from the platform catalog.
        Returns:
          available (bool): Whether or not the image can be acomp'd
      """
      return can_acomp(cat_id)