starepandas.read_granule#
- read_granule(file_path, latlon=False, sidecar=False, sidecar_path=None, add_sids=False, adapt_resolution=True, xy=False, nom_res=None, read_timestamp=False, keep_na_sids=False, datasets=None, roi=None, **kwargs)#
Reads a granule into a STAREDataFrame
- Parameters
- file_path: str
path of the granule
- latlon: bool
toggle whether to read the latitude and longitude variables
- sidecar: bool
toggle whether to read the sidecar file
- sidecar_path: str
path of the sidecar file. If not provided, it is assumed to be ${file_path}_stare.nc
- add_sids: bool
toggle whether to lookup stare indices
- adapt_resolution: bool
toggle whether to adapt the resolution
- xy: bool
toggle wheather to add array coordinates to the dataframe.
- nom_res: str
optional; for multi-resolution products, specify which resolution to read
- read_timestamp:
toggle wheather to read the the timestamp
- keep_na_sids:
toggle whether or not to keep rows containing NA values for sids
- Returns
- df: starepandas.STAREDataFrame
A dataframe holding the granule data
Examples
>>> fname = starepandas.datasets.get_path('MOD05_L2.A2019336.0000.061.2019336211522.hdf') >>> modis = starepandas.read_granule(fname, latlon=True, sidecar=True)