icepyx.Read

class icepyx.Read(data_source, glob_kwargs={}, out_obj_type=None, product=None, filename_pattern=None, catalog=None)

Data object to read ICESat-2 data into the specified formats. Provides flexiblity for reading nested hdf5 files into common analysis formats.

Parameters:
data_sourcestring, List

A string or list which specifies the files to be read. The string can be either: 1) the path of a single file 2) the path to a directory or 3) a [glob string](https://docs.python.org/3/library/glob.html). The List must be a list of strings, each of which is the path of a single file.

glob_kwargsdict, default {}

Additional arguments to be passed into the [glob.glob()](https://docs.python.org/3/library/glob.html#glob.glob)function

out_obj_typeobject, default xarray.Dataset

The desired format for the data to be read in. Currently, only xarray.Dataset objects (default) are available. Please ask us how to help enable usage of other data objects!

productstring

ICESat-2 data product ID, also known as “short name” (e.g. ATL03). Available data products can be found at: https://nsidc.org/data/icesat-2/data-sets Deprecation warning: This argument is no longer required and has been deprecated. The dataset product is read from the file metadata.

filename_patternstring, default None

String that shows the filename pattern as previously required for Intake’s path_as_pattern argument. The default describes files downloaded directly from NSIDC (subsetted and non-subsetted) for most products (e.g. ATL06). The ATL11 filename pattern from NSIDC is: ‘ATL{product:2}_{rgt:4}{orbitsegment:2}_{cycles:4}_{version:3}_{revision:2}.h5’. Deprecation warning: This argument is no longer required and has been deprecated.

catalogstring, default None

Full path to an Intake catalog for reading in data. If you still need to create a catalog, leave as default. Deprecation warning: This argument has been deprecated. Please use the data_source argument to pass in valid data.

Returns:
read object

Examples

Reading a single file >>> ipx.Read(‘/path/to/data/processed_ATL06_20190226005526_09100205_006_02.h5’) # doctest: +SKIP

Reading all files in a directory >>> ipx.Read(‘/path/to/data/’) # doctest: +SKIP

Reading files that match a particular pattern (here, all .h5 files that start with processed_ATL06_). >>> ipx.Read(‘/path/to/data/processed_ATL06_*.h5’) # doctest: +SKIP

Reading a specific list of files >>> list_of_files = [ … ‘/path/to/data/processed_ATL06_20190226005526_09100205_006_02.h5’, … ‘/path/to/more/data/processed_ATL06_20191202102922_10160505_006_01.h5’, … ] >>> ipx.Read(list_of_files) # doctest: +SKIP

__init__(data_source, glob_kwargs={}, out_obj_type=None, product=None, filename_pattern=None, catalog=None)

Methods

__init__(data_source[, glob_kwargs, ...])

earthdata_login([uid, email, s3token])

Authenticate with NASA Earthdata to enable data ordering and download.

load()

Create a single Xarray Dataset containing the data from one or more files and/or ground tracks.

Attributes

auth

Authentication object returned from earthaccess.login() which stores user authentication.

filelist

Return the list of files represented by this Read object.

product

Return the product associated with the Read object.

s3login_credentials

A dictionary which stores login credentials for AWS s3 access.

session

Earthaccess session object for connecting to Earthdata resources.

vars

Return the variables object associated with the data being read in.