pygmi.rsense.emit#

EMIT is used to import EMIT satellite data into PyGMI.

It uses code by Erik Bolch, ebolch@contractor.usgs.gov

Functions#

emit_xarray(filepath[, ortho, qmask, unpackedbmask])

EMIT xarray.

apply_glt(ds_array, glt_array[, fill_value, ...])

Apply GLT.

coord_vects(ds)

Calculate the Lat and Lon Vectors/Coordinate Grid.

ortho_xr(ds[, GLT_NODATA_VALUE, fill_value])

Use apply_glt to create an orthorectified xarray dataset.

xr_to_pygmi(xrds[, piter, showlog, tnames, metaonly])

Xarray to PyGMI dataset.

main()

EMIT data.

Module Contents#

pygmi.rsense.emit.emit_xarray(filepath, ortho=False, qmask=None, unpackedbmask=None)#

EMIT xarray.

This function utilizes other functions in this module to streamline opening an EMIT dataset as an xarray.Dataset.

Parameters:
  • filepath (str) – a file path to an EMIT netCDF file.

  • ortho (bool, optional) – Whether to orthorectify the dataset or leave in crosstrack/downtrack coordinates. The default is False.

  • qmask (numpy array, optional) – Output from the quality_mask function used to mask pixels based on quality flags selected in that function. Any non-orthorectified array with the proper crosstrack and downtrack dimensions can also be used. The default is None.

  • unpackedbmask (numpy array, optional) – From the band_mask function, used to mask band-specific pixels that have been interpolated. The default is None.

Returns:

out_xr – Dataset constructed based on the parameters provided.

Return type:

xarray.Dataset

pygmi.rsense.emit.apply_glt(ds_array, glt_array, fill_value=-9999, GLT_NODATA_VALUE=0)#

Apply GLT.

This function applies the GLT array to a numpy array of either 2 or 3 dimensions.

Parameters:
  • ds_array (numpy array) – A numpy array of the desired variable.

  • glt_array (GLT array) – A GLT array constructed from EMIT GLT data.

  • fill_value (int, optional) – Fill value. The default is -9999.

  • GLT_NODATA_VALUE (int, optional) – GLT nodata value. The default is 0.

Returns:

out_ds – a numpy array of orthorectified data.

Return type:

numpy array

pygmi.rsense.emit.coord_vects(ds)#

Calculate the Lat and Lon Vectors/Coordinate Grid.

This function calculates the Lat and Lon Coordinate Vectors using the GLT and Metadata from an EMIT dataset read into xarray.

Parameters:

ds (xarray.Dataset) – an xarray.Dataset containing the root variable and metadata of an EMIT dataset.

Returns:

  • lon (numpy array) – Longitude.

  • lat (numpy array) – Latitude.

pygmi.rsense.emit.ortho_xr(ds, GLT_NODATA_VALUE=0, fill_value=-9999)#

Use apply_glt to create an orthorectified xarray dataset.

Parameters:
  • ds (xarray.Dataset) – Dataset produced by emit_xarray.

  • GLT_NODATA_VALUE (int, optional) – No data value for the GLT tables. The default is 0.

  • fill_value (int, optional) – The fill value for EMIT datasets. The default is -9999.

Returns:

out_xr – an orthocorrected xarray dataset.

Return type:

xarray.Dataset

pygmi.rsense.emit.xr_to_pygmi(xrds, piter=iter, showlog=print, tnames=None, metaonly=False)#

Xarray to PyGMI dataset.

Takes an EMIT dataset read into an xarray dataset using the emit_xarray function and convert to PyGMI dataset.

Parameters:

xrds (xarray.Dataset) – an EMIT dataset read into xarray using the emit_xarray function.

Returns:

dat – list of pygmi.raster.datatypes.Data

Return type:

list

pygmi.rsense.emit.main()#

EMIT data.