Пример #1
0
def subset_granule(variable, name='', path='/tmp', input_file_path=''):
    '''Subset Granule service allows users to Submit subset jobs. \
        Use of this service should be preceded by a Granule Search in \
        order to identify and generate a list of granules to be subsetted.

    :param variable: The name of the variable to read from the dataset.
    :type variable: :mod:`string`

    :param name: (Optional) A name for the loaded dataset.
    :type name: :mod:`string`

    :param path: (Optional) a path on the filesystem to store the granule.
    :type path: :mod:`string`

    :param input_file_path: path to a json file which contains the \
        the subset request that you want to send to PO.DAAC
    :type input_file_path: :mod:`string`

    :returns: a token on successful request reception. This can be \
        further used to check the status of the request.

    '''
    podaac = Podaac()
    if path is not None:
        path = os.path.dirname(os.path.abspath(__file__))
    granule_name = podaac.granule_subset(input_file_path, path)
    path = path + '/' + granule_name
    return read_dataset(name, granule_name, variable, path)
Пример #2
0
def subset_granule(input_file_path=''):
    '''Subset Granule service allows users to Submit subset jobs. \
        Use of this service should be preceded by a Granule Search in \
        order to identify and generate a list of granules to be subsetted.

    :param input_file_path: path to a json file which contains the \
        the request that you want to send to PO.DAAC
    :type input_file_path: :mod:`string`

    :returns: a token on successful request reception. This can be \
        further used to check the status of the request.

    '''
    podaac = Podaac()
    status = podaac.subset_status(podaac.granule_subset(input_file_path))
    print("Granule subsetting initiated with request tracking token '%s'." % status)
    while status is not "done":
        print('...')
    return status
Пример #3
0
def subset_granule(input_file_path=''):
    '''Subset Granule service allows users to Submit subset jobs. \
        Use of this service should be preceded by a Granule Search in \
        order to identify and generate a list of granules to be subsetted.

    :param input_file_path: path to a json file which contains the \
        the request that you want to send to PO.DAAC
    :type input_file_path: :mod:`string`

    :returns: a token on successful request reception. This can be \
        further used to check the status of the request.

    '''
    podaac = Podaac()
    status = podaac.subset_status(podaac.granule_subset(input_file_path))
    print("Granule subsetting initiated with request tracking token '%s'." %
          status)
    while status is not "done":
        print('...')
    return status