podpac.datalib.SMAP

class podpac.datalib.SMAP(**kwargs)[source]

Bases: podpac.core.compositor.OrderedCompositor

Compositor of all the SMAPDateFolder’s for every available SMAP date. Essentially a compositor of all SMAP data for a particular product.

auth_class

Class used to make an authenticated session from a username and password (both are defined in base class)

Type

EarthDataSession (Class object)

auth_session

Authenticated session used to make http requests usingNASA Earth Data Login credentials

Type

Instance(EarthDataSession)

base_url

Url to nsidc openDAP server

Type

str

date_url_re

Regular expression used to extract all folder dates (or folder names) for the particular SMAP product.

Type

SRE_Pattern

layerkey

Key used to retrieve data from OpenDAP dataset. This specifies the key used to retrieve the data

Type

str

password
Type

User’s EarthData password

product

SMAP product name

Type

str

username
Type

User’s EarthData username

Methods

__init__(**kwargs)

Do not overwrite me

composite(outputs[, result])

Composites outputs in order that they appear.

create_output_array(coords[, data])

Initialize an output data array

eval(coordinates[, output])

Evaluates this nodes using the supplied coordinates.

eval_group(group)

Evaluate the node for each of the coordinates in the group.

find_coordinates()

The coordinates of the data source.

get_available_times_dates()

Returns the available folder dates in the SMAP product

get_cache(key[, coordinates])

Get cached data for this node.

get_filename_coordinates_sources([bounds, …])

Returns coordinates solely based on the filenames of the sources.

get_shared_coordinates()

Coordinates that are shared by all files in the SMAP product family.

get_source_coordinates()

Returns the coordinates that uniquely describe each source

has_cache(key[, coordinates])

Check for cached data for this node.

init()

Overwrite this method if a node needs to do any additional initialization after the standard initialization.

iteroutputs(coordinates)

Summary

put_cache(data, key[, coordinates, overwrite])

Cache data for this node.

rem_cache(key[, coordinates, mode, all_cache])

Clear cached data for this node.

select_sources(coordinates)

Downselect compositor sources based on requested coordinates.

Attributes

auth_class

A trait whose value must be a subclass of a specified class.

auth_session

A trait whose value must be an instance of a specified class.

base_definition

Definition for SMAP node.

base_ref

Summary

base_url

A trait for unicode strings.

cache_ctrl

A trait whose value must be an instance of a specified class.

cache_native_coordinates

A boolean (True, False) trait.

cache_output

A boolean (True, False) trait.

cache_update

A boolean (True, False) trait.

date_url_re

definition

Full pipeline definition for this node.

dtype

A trait which allows any value.

hash

interpolation

A trait type representing a Union type.

is_source_coordinates_complete

A boolean (True, False) trait.

json

definition for this node in json format

json_pretty

keys

Available layers that are in the OpenDAP dataset

layerkey

A trait for unicode strings.

password

A trait for unicode strings.

pipeline

Create a pipeline node from this node

product

An enum whose value must be in a given sequence.

shared_coordinates

A trait whose value must be an instance of a specified class.

source

The source is used for a unique name to cache SMAP products.

source_coordinates

A trait whose value must be an instance of a specified class.

sources

A coercing numpy array trait.

sources_default

style

A trait whose value must be an instance of a specified class.

units

A trait for unicode strings.

username

A trait for unicode strings.

version

An int trait.

Members

__init__(**kwargs)

Do not overwrite me

auth_class

A trait whose value must be a subclass of a specified class.

auth_session

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

base_definition

Definition for SMAP node. Sources not required as these are computed.

base_ref

Summary

Returns

Description

Return type

TYPE

base_url

A trait for unicode strings.

date_url_re = re.compile('[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}')
find_coordinates()[source]

The coordinates of the data source.

Notes

These coordinates are computed, assuming dataset is regular.

get_available_times_dates()[source]

Returns the available folder dates in the SMAP product

Returns

  • np.ndarray – Array of dates in numpy datetime64 format

  • list – list of dates in SMAP date format

Raises

RuntimeError – If the http resource could not be accessed (check Earthdata login credentials)

get_filename_coordinates_sources(bounds=None, update_cache=False)[source]

Returns coordinates solely based on the filenames of the sources. This function was motivated by the SMAP-Sentinel product, which does not have regularly stored tiles (in space and time).

Parameters
  • bounds (podpac.Coordinates, Optional) – Default is None. Return the coordinates based on filenames of the source only within the specified bounds. When not None, the result is not cached.

  • update_cache (bool, optional) – Default is False. The results of this call are automatically cached to disk. This function will try to update the cache if new data arrives. Only set this flag to True to rebuild the entire index locally (which may be needed when version numbers in the filenames change).

Returns

  • podpac.Coordinates – Coordinates of all the sources in the product family

  • Container – Container that will generate an array of the SMAPSources pointing to unique OpenDAP urls corresponding to the returned coordinates

Notes

The outputs of this function can be used to find source that overlap spatially or temporally with a subset region specified by the user.

If ‘bounds’ is not specified, the result is cached for faster future access after the first invocation.

This call uses NASA’s Common Metadata Repository (CMR) and requires an internet connection.

get_shared_coordinates()[source]

Coordinates that are shared by all files in the SMAP product family.

Returns

Coordinates shared by all files in the SMAP product.

Return type

podpac.Coordinates

Notes

For example, the gridded SMAP data have the same lat-lon coordinates in every file (global at some resolution), and the only difference between files is the time coordinate. This is not true for the SMAP-Sentinel product, in which case this function returns None

get_source_coordinates()[source]

Returns the coordinates that uniquely describe each source

Returns

Coordinates that uniquely describe each source

Return type

podpac.Coordinates

keys

Available layers that are in the OpenDAP dataset

Returns

The list of available keys from the OpenDAP dataset. Any of these keys can be set as self.datakey.

Return type

List

Notes

This function assumes that all of the keys in the available dataset are the same for every file.

layerkey

A trait for unicode strings.

password

A trait for unicode strings.

product

An enum whose value must be in a given sequence.

source

The source is used for a unique name to cache SMAP products.

Returns

The SMAP product name.

Return type

str

sources_default
username

A trait for unicode strings.

version

An int trait.