satpy.readers package¶
Submodules¶
satpy.readers.aapp_l1b module¶
Reader for aapp level 1b data.
Options for loading:
pre_launch_coeffs (False): use pre-launch coefficients if True, operational otherwise (if available).
https://nwp-saf.eumetsat.int/site/download/documentation/aapp/NWPSAF-MF-UD-003_Formats_v8.0.pdf
-
class
satpy.readers.aapp_l1b.
AVHRRAAPPL1BFile
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Reader for AVHRR L1B files created from the AAPP software.
Initialize object information by reading the input file.
-
property
end_time
¶ Get the time of the final observation.
Get the longitudes and latitudes of the scene.
-
property
start_time
¶ Get the time of the first observation.
-
property
satpy.readers.abi_base module¶
Advance Baseline Imager reader base class for the Level 1b and l2+ reader.
-
class
satpy.readers.abi_base.
NC_ABI_BASE
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Base reader for ABI L1B L2+ NetCDF4 files.
Open the NetCDF file with xarray and prepare the Dataset for reading.
-
property
end_time
¶ End time of the current file’s observations.
-
property
sensor
¶ Get sensor name for current file handler.
-
spatial_resolution_to_number
()[source]¶ Convert the ‘spatial_resolution’ global attribute to meters.
-
property
start_time
¶ Start time of the current file’s observations.
-
property
satpy.readers.abi_l1b module¶
Advance Baseline Imager reader for the Level 1b format.
The files read by this reader are described in the official PUG document:
-
class
satpy.readers.abi_l1b.
NC_ABI_L1B
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.abi_base.NC_ABI_BASE
File reader for individual ABI L1B NetCDF4 files.
Open the NetCDF file with xarray and prepare the Dataset for reading.
satpy.readers.abi_l2_nc module¶
Advance Baseline Imager NOAA Level 2+ products reader.
- The files read by this reader are described in the official PUG document:
-
class
satpy.readers.abi_l2_nc.
NC_ABI_L2
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.abi_base.NC_ABI_BASE
Reader class for NOAA ABI l2+ products in netCDF format.
Open the NetCDF file with xarray and prepare the Dataset for reading.
satpy.readers.acspo module¶
ACSPO SST Reader.
See the following page for more information:
https://podaac.jpl.nasa.gov/dataset/VIIRS_NPP-OSPO-L2P-v2.3
-
class
satpy.readers.acspo.
ACSPOFileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
ACSPO L2P SST File Reader.
Initialize object.
-
property
end_time
¶ Get final observation time of data.
-
get_shape
(ds_id, ds_info)[source]¶ Get numpy array shape for the specified dataset.
- Parameters
ds_id (DataID) – ID of dataset that will be loaded
ds_info (dict) – Dictionary of dataset information from config file
- Returns
(rows, cols)
- Return type
tuple
-
property
platform_name
¶ Get satellite name for this file’s data.
-
property
sensor_name
¶ Get instrument name for this file’s data.
-
property
start_time
¶ Get first observation time of data.
-
property
satpy.readers.agri_l1 module¶
Advanced Geostationary Radiation Imager reader for the Level_1 HDF format.
The files read by this reader are described in the official Real Time Data Service:
-
class
satpy.readers.agri_l1.
HDF_AGRI_L1
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
AGRI l1 file handler.
Init filehandler.
-
calibrate
(data, lut)[source]¶ Calibrate digital number (DN) to brightness_temperature.
- Parameters
dn – Raw detector digital number
lut – the look up table
- Returns
brightness_temperature [K]
-
dn2
(dn, calibration, slope, offset)[source]¶ Convert digital number (DN) to reflectance or radiance.
- Parameters
dn – Raw detector digital number
slope – Slope
offset – Offset
- Returns
Reflectance [%] or Radiance [mW/ (m2 cm-1 sr)]
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
satpy.readers.ahi_hsd module¶
Advanced Himawari Imager (AHI) standard format data reader.
References
Himawari-8/9 Himawari Standard Data User’s Guide
http://www.data.jma.go.jp/mscweb/en/himawari89/space_segment/spsg_ahi.html
Time Information¶
AHI observations use the idea of a “scheduled” time and an “observation time. The “scheduled” time is when the instrument was told to record the data, usually at a specific and consistent interval. The “observation” time is when the data was actually observed. Scheduled time can be accessed from the scheduled_time metadata key and observation time from the start_time key.
-
class
satpy.readers.ahi_hsd.
AHIHSDFileHandler
(filename, filename_info, filetype_info, mask_space=True, calib_mode='nominal', user_calibration=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
AHI standard format reader.
The AHI sensor produces data for some pixels outside the Earth disk (i,e: atmospheric limb or deep space pixels). By default, these pixels are masked out as they contain data of limited or no value, but some applications do require these pixels. It is therefore possible to override the default behaviour and perform no masking of non-Earth pixels.
In order to change the default behaviour, use the ‘mask_space’ variable as part of
reader_kwargs
upon Scene creation:import satpy import glob filenames = glob.glob('*FLDK*.dat') scene = satpy.Scene(filenames, reader='ahi_hsd', reader_kwargs={'mask_space':: False}) scene.load([0.6])
The AHI HSD data files contain multiple VIS channel calibration coefficients. By default, the standard coefficients in header block 5 are used. If the user prefers the updated calibration coefficients then they can pass calib_mode=’update’ when creating a scene:
import satpy import glob filenames = glob.glob('*FLDK*.dat') scene = satpy.Scene(filenames, reader='ahi_hsd', reader_kwargs={'calib_mode':: 'update'}) scene.load([0.6])
Alternative AHI calibrations are also available, such as GSICS coefficients. As such, you can supply custom per-channel correction by setting calib_mode=’custom’ and passing correction factors via:
user_calibration={‘chan’: [‘slope’: slope, ‘offset’: offset]}
- Where slo and off are per-channel slope and offset coefficients defined by::
rad_leo = (rad_geo - off) / slo
If you do not have coefficients for a particular band, then by default the slope will be set to 1 .and the offset to 0.:
import satpy import glob # Load bands 7, 14 and 15, but we only have coefs for 7+14 calib_dict = {'B07': {'slope': 0.99, 'offset': 0.002}, 'B14': {'slope': 1.02, 'offset': -0.18}} filenames = glob.glob('*FLDK*.dat') scene = satpy.Scene(filenames, reader='ahi_hsd', reader_kwargs={'user_calibration':: calib_dict) # B15 will not have custom radiance correction applied. scene.load(['B07', 'B14', 'B15'])
By default, user-supplied calibrations / corrections are applied to the radiance data in accordance with the GSICS standard defined in the equation above. However, user-supplied gain and offset values for converting digital number into radiance via Rad = DN * gain + offset are also possible. To supply your own factors, supply a user calibration dict using type: ‘DN’ as follows:
calib_dict = {'B07': {'slope': 0.0037, 'offset': 18.5}, 'B14': {'slope': -0.002, 'offset': 22.8}, 'type': 'DN'}
You can also explicitly select radiance correction with ‘type’: ‘RAD’ but this is not necessary as it is the default option if you supply your own correction coefficients.
Initialize the reader.
-
property
end_time
¶ Get the end time.
-
property
scheduled_time
¶ Time this band was scheduled to be recorded.
-
property
start_time
¶ Get the start time.
satpy.readers.ami_l1b module¶
Advanced Meteorological Imager reader for the Level 1b NetCDF4 format.
-
class
satpy.readers.ami_l1b.
AMIL1bNetCDF
(filename, filename_info, filetype_info, calib_mode='PYSPECTRAL', allow_conditional_pixels=False, user_calibration=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Base reader for AMI L1B NetCDF4 files.
AMI data contains GSICS adjustment factors for the IR bands. By default, these are not applied. If you wish to apply them then you must set the calibration mode appropriately:
import satpy import glob
filenames = glob.glob(‘FLDK.dat’) scene = satpy.Scene(filenames,
reader=’ahi_hsd’, reader_kwargs={‘calib_mode’:: ‘gsics’})
scene.load([‘B13’])
In addition, the GSICS website (and other sources) also supply radiance correction coefficients like so: radiance_corr = (radiance_orig - corr_offset) / corr_slope
If you wish to supply such coefficients, pass ‘user_calibration’ and a dictionary containing per-channel slopes and offsets as a reader_kwarg:
user_calibration={'chan': {'slope': slope, 'offset': offset}}
If you do not have coefficients for a particular band, then by default the slope will be set to 1 .and the offset to 0.:
import satpy import glob # Load bands 7, 14 and 15, but we only have coefs for 7+14 calib_dict = {'WV063': {'slope': 0.99, 'offset': 0.002}, 'IR087': {'slope': 1.02, 'offset': -0.18}} filenames = glob.glob('*.nc') scene = satpy.Scene(filenames, reader='ami_l1b', reader_kwargs={'user_calibration':: calib_dict, 'calib_mode':: 'file') # IR133 will not have radiance correction applied. scene.load(['WV063', 'IR087', 'IR133'])
By default these updated coefficients are not used. In most cases, setting calib_mode to file is required in order to use external coefficients.
Open the NetCDF file with xarray and prepare the Dataset for reading.
-
property
end_time
¶ Get observation end time.
-
property
start_time
¶ Get observation start time.
-
property
satpy.readers.amsr2_l1b module¶
Reader for AMSR2 L1B files in HDF5 format.
-
class
satpy.readers.amsr2_l1b.
AMSR2L1BFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
File handler for AMSR2 l1b.
Initialize file handler.
satpy.readers.amsr2_l2 module¶
Reader for AMSR2 L2 files in HDF5 format.
-
class
satpy.readers.amsr2_l2.
AMSR2L2FileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.amsr2_l1b.AMSR2L1BFileHandler
AMSR2 level 2 file handler.
Initialize file handler.
satpy.readers.avhrr_l1b_gaclac module¶
Reading and calibrating GAC and LAC AVHRR data.
-
class
satpy.readers.avhrr_l1b_gaclac.
GACLACFile
(filename, filename_info, filetype_info, start_line=None, end_line=None, strip_invalid_coords=True, interpolate_coords=True, **reader_kwargs)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Reader for GAC and LAC data.
Init the file handler.
- Parameters
start_line – User defined start scanline
end_line – User defined end scanline
strip_invalid_coords – Strip scanlines with invalid coordinates in the beginning/end of the orbit
interpolate_coords – Interpolate coordinates from every eighth pixel to all pixels.
reader_kwargs – More keyword arguments to be passed to pygac.Reader. See the pygac documentation for available options.
-
property
end_time
¶ Get the end time.
-
slice
(data, times)[source]¶ Select user-defined scanlines and/or strip invalid coordinates.
Furthermore, update scanline timestamps.
- Parameters
data – Data to be sliced
times – Scanline timestamps
- Returns
Sliced data and timestamps
-
property
start_time
¶ Get the start time.
satpy.readers.caliop_l2_cloud module¶
satpy.readers.clavrx module¶
Interface to CLAVR-X HDF4 products.
-
class
satpy.readers.clavrx.
CLAVRXFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf4_utils.HDF4FileHandler
A file handler for CLAVRx files.
Open file and collect information.
-
available_datasets
(configured_datasets=None)[source]¶ Automatically determine datasets provided by this file.
-
property
end_time
¶ Get the end time.
-
nadir_resolution
= {'ahi': 2000, 'avhrr': 1050, 'modis': 1000, 'viirs': 742}¶
-
platforms
= {'H08': 'himawari8', 'H09': 'himawari9', 'HIM8': 'himawari8', 'HIM9': 'himawari9', 'SNPP': 'npp'}¶
-
rows_per_scan
= {'modis': 10, 'viirs': 16}¶
-
sensors
= {'AHI': 'ahi', 'AVHRR': 'avhrr', 'MODIS': 'modis', 'VIIRS': 'viirs'}¶
-
property
start_time
¶ Get the start time.
-
satpy.readers.cmsaf_claas2 module¶
Module containing CMSAF CLAAS v2 FileHandler.
-
class
satpy.readers.cmsaf_claas2.
CLAAS2
(*args, **kwargs)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
Handle CMSAF CLAAS-2 files.
Initialise class.
-
available_datasets
(configured_datasets=None)[source]¶ Yield a collection of available datasets.
Return a generator that will yield the datasets available in the loaded files. See docstring in parent class for specification details.
-
property
end_time
¶ Get end time from file.
-
property
start_time
¶ Get start time from file.
-
satpy.readers.electrol_hrit module¶
HRIT format reader.
References
- ELECTRO-L GROUND SEGMENT MSU-GS INSTRUMENT,
LRIT/HRIT Mission Specific Implementation, February 2012
-
class
satpy.readers.electrol_hrit.
HRITGOMSEpilogueFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
GOMS HRIT format reader.
Initialize the reader.
-
class
satpy.readers.electrol_hrit.
HRITGOMSFileHandler
(filename, filename_info, filetype_info, prologue, epilogue)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
GOMS HRIT format reader.
Initialize the reader.
-
class
satpy.readers.electrol_hrit.
HRITGOMSPrologueFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
GOMS HRIT format reader.
Initialize the reader.
satpy.readers.eps_l1b module¶
Reader for eps level 1b data. Uses xml files as a format description.
-
class
satpy.readers.eps_l1b.
EPSAVHRRFile
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Eps level 1b reader for AVHRR data.
Initialize FileHandler.
-
property
end_time
¶ Get end time.
-
property
platform_name
¶ Get platform name.
-
property
sensor_name
¶ Get sensor name.
-
sensors
= {'AVHR': 'avhrr-3'}¶
-
spacecrafts
= {'M01': 'Metop-B', 'M02': 'Metop-A', 'M03': 'Metop-C'}¶
-
property
start_time
¶ Get start time.
-
property
satpy.readers.eum_base module¶
Utilities for EUMETSAT satellite data.
satpy.readers.fci_l1c_fdhsi module¶
Interface to MTG-FCI-FDHSI L1C NetCDF files.
This module defines the FCIFDHSIFileHandler
file handler, to
be used for reading Meteosat Third Generation (MTG) Flexible Combined
Imager (FCI) Full Disk High Spectral Imagery (FDHSI) data. FCI will fly
on the MTG Imager (MTG-I) series of satellites, scheduled to be launched
in 2021 by the earliest. For more information about FCI, see EUMETSAT.
Geolocation is based on information from the data files. It uses:
From the shape of the data variable
data/<channel>/measured/effective_radiance
, start and end line columns of current swath.From the data variable
data/<channel>/measured/x
, the x-coordinates for the grid, in radiansFrom the data variable
data/<channel>/measured/y
, the y-coordinates for the grid, in radiansFrom the attribute
semi_major_axis
on the data variabledata/mtg_geos_projection
, the Earth equatorial radiusFrom the attribute
semi_minor_axis
on the same, the Earth polar radiusFrom the attribute
perspective_point_height
on the same data variable, the geostationary altitude in the normalised geostationary projection (see PUG §5.2)From the attribute
longitude_of_projection_origin
on the same data variable, the longitude of the projection originFrom the attribute
inverse_flattening
on the same data variable, the (inverse) flattening of the ellipsoidFrom the attribute
sweep_angle_axis
on the same, the sweep angle axis, see https://proj.org/operations/projections/geos.html
From the pixel centre angles in radians and the geostationary altitude, the
extremities of the lower left and upper right corners are calculated in units
of arc length in m. This extent along with the number of columns and rows, the
sweep angle axis, and a dictionary with equatorial radius, polar radius,
geostationary altitude, and longitude of projection origin, are passed on to
pyresample.geometry.AreaDefinition
, which then uses proj4 for the actual
geolocation calculations.
The brightness temperature calculation is based on the formulas indicated in PUG and RADTOBR.
The reading routine supports channel data in counts, radiances, and (depending
on channel) brightness temperatures or reflectances. For each channel, it also
supports the pixel quality, obtained by prepending the channel name such as
"vis_04_pixel_quality"
.
Warning
The API for the direct reading of pixel quality is temporary and likely to
change. Currently, for each channel, the pixel quality is available by
<chan>_pixel_quality
. In the future, they will likely all be called
pixel_quality
and disambiguated by a to-be-decided property in the
DataID.
-
class
satpy.readers.fci_l1c_fdhsi.
FCIFDHSIFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
Class implementing the MTG FCI FDHSI File .
This class implements the Meteosat Third Generation (MTG) Flexible Combined Imager (FCI) Full Disk High Spectral Imagery (FDHSI) reader. It is designed to be used through the
Scene
class using theload
method with the reader"fci_l1c_fdhsi"
.Initialize file handler.
-
calibrate_counts_to_physical_quantity
(data, key)[source]¶ Calibrate counts to radiances, brightness temperatures, or reflectances.
-
property
end_time
¶ Get end time.
-
get_area_def
(key, info=None)[source]¶ Calculate on-fly area definition for 0 degree geos-projection for a dataset.
-
property
start_time
¶ Get start time.
-
satpy.readers.fci_l2_nc module¶
Reader for the FCI L2 products in NetCDF4 format.
-
class
satpy.readers.fci_l2_nc.
FciL2NCFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Reader class for FCI L2 products in NetCDF4 format.
Open the NetCDF file with xarray and prepare for dataset reading.
-
property
end_time
¶ Get observation end time.
-
property
sensor
¶ Return instrument.
-
property
spacecraft_name
¶ Return spacecraft name.
-
property
ssp_lon
¶ Return subsatellite point longitude.
-
property
start_time
¶ Get observation start time.
-
property
satpy.readers.file_handlers module¶
Interface for BaseFileHandlers.
-
class
satpy.readers.file_handlers.
BaseFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
object
Base file handler.
Initialize file handler.
-
available_datasets
(configured_datasets=None)[source]¶ Get information of available datasets in this file.
This is used for dynamically specifying what datasets are available from a file in addition to what’s configured in a YAML configuration file. Note that this method is called for each file handler for each file type; care should be taken when possible to reduce the amount of redundant datasets produced.
This method should not update values of the dataset information dictionary unless this file handler has a matching file type (the data could be loaded from this object in the future) and at least one
satpy.dataset.DataID
key is also modified. Otherwise, this file type may override the information provided by a more preferred file type (as specified in the YAML file). It is recommended that any non-ID metadata be updated during theBaseFileHandler.get_dataset()
part of loading. This method is not guaranteed that it will be called before any other file type’s handler. The availability “boolean” not beingNone
does not mean that a file handler called later can’t provide an additional dataset, but it must provide more identifying (DataID) information to do so and should yield its new dataset in addition to the previous one.- Parameters
configured_datasets (list) – Series of (bool or None, dict) in the same way as is returned by this method (see below). The bool is whether or not the dataset is available from at least one of the current file handlers. It can also be
None
if no file handler knows before us knows how to handle it. The dictionary is existing dataset metadata. The dictionaries are typically provided from a YAML configuration file and may be modified, updated, or used as a “template” for additional available datasets. This argument could be the result of a previous file handler’s implementation of this method.
- Returns: Iterator of (bool or None, dict) pairs where dict is the
dataset’s metadata. If the dataset is available in the current file type then the boolean value should be
True
,False
if we know about the dataset but it is unavailable, orNone
if this file object is not responsible for it.
Example 1 - Supplement existing configured information:
def available_datasets(self, configured_datasets=None): "Add information to configured datasets." # we know the actual resolution res = self.resolution # update previously configured datasets for is_avail, ds_info in (configured_datasets or []): # some other file handler knows how to load this # don't override what they've done if is_avail is not None: yield is_avail, ds_info matches = self.file_type_matches(ds_info['file_type']) if matches and ds_info.get('resolution') != res: # we are meant to handle this dataset (file type matches) # and the information we can provide isn't available yet new_info = ds_info.copy() new_info['resolution'] = res yield True, new_info elif is_avail is None: # we don't know what to do with this # see if another future file handler does yield is_avail, ds_info
Example 2 - Add dynamic datasets from the file:
def available_datasets(self, configured_datasets=None): "Add information to configured datasets." # pass along existing datasets for is_avail, ds_info in (configured_datasets or []): yield is_avail, ds_info # get dynamic variables known to this file (that we created) for var_name, val in self.dynamic_variables.items(): ds_info = { 'file_type': self.filetype_info['file_type'], 'resolution': 1000, 'name': var_name, } yield True, ds_info
-
combine_info
(all_infos)[source]¶ Combine metadata for multiple datasets.
When loading data from multiple files it can be non-trivial to combine things like start_time, end_time, start_orbit, end_orbit, etc.
By default this method will produce a dictionary containing all values that were equal across all provided info dictionaries.
Additionally it performs the logical comparisons to produce the following if they exist:
start_time
end_time
start_orbit
end_orbit
satellite_altitude
satellite_latitude
satellite_longitude
orbital_parameters
Also, concatenate the areas.
-
property
end_time
¶ Get end time.
-
file_type_matches
(ds_ftype)[source]¶ Match file handler’s type to this dataset’s file type.
- Parameters
ds_ftype (str or list) – File type or list of file types that a dataset is configured to be loaded from.
- Returns:
True
if this file handler object’s type matches the dataset’s file type(s),
False
otherwise.
-
get_bounding_box
()[source]¶ Get the bounding box of the files, as a (lons, lats) tuple.
The tuple return should a lons and lats list of coordinates traveling clockwise around the points available in the file.
-
property
sensor_names
¶ List of sensors represented in this file.
-
property
start_time
¶ Get start time.
-
satpy.readers.generic_image module¶
Reader for generic image (e.g. gif, png, jpg, tif, geotiff, …).
Returns a dataset without calibration. Includes coordinates if available in the file (eg. geotiff).
-
class
satpy.readers.generic_image.
GenericImageFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Handle reading of generic image files.
Initialize filehandler.
-
property
end_time
¶ Return end time.
-
property
start_time
¶ Return start time.
-
property
satpy.readers.geocat module¶
Interface to GEOCAT HDF4 or NetCDF4 products.
Note: GEOCAT files do not currently have projection information or precise pixel resolution information. Additionally the longitude and latitude arrays are stored as 16-bit integers which causes loss of precision. For this reason the lon/lats can’t be used as a reliable coordinate system to calculate the projection X/Y coordinates.
Until GEOCAT adds projection information and X/Y coordinate arrays, this reader will estimate the geostationary area the best it can. It currently takes a single lon/lat point as reference and uses hardcoded resolution and projection information to calculate the area extents.
-
class
satpy.readers.geocat.
GEOCATFileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
GEOCAT netCDF4 file handler.
Initialize object.
-
available_datasets
(configured_datasets=None)[source]¶ Update information for or add datasets provided by this file.
If this file handler can load a dataset then it will supplement the dataset info with the resolution and possibly coordinate datasets needed to load it. Otherwise it will continue passing the dataset information down the chain.
See
satpy.readers.file_handlers.BaseFileHandler.available_datasets()
for details.
-
property
end_time
¶ Get end time.
-
property
is_geo
¶ Check platform.
-
platforms
= {}¶
-
property
resolution
¶ Get resolution.
-
resolutions
= {'abi': {1: 1002.0086577437705, 2: 2004.017315487541}, 'ahi': {1: 999.9999820317674, 2: 1999.999964063535, 4: 3999.99992812707}}¶
-
property
sensor_names
¶ Get sensor names.
-
sensors
= {'goes': 'goes_imager', 'goes16': 'abi', 'goesr': 'abi', 'himawari8': 'ahi'}¶
-
property
start_time
¶ Get start time.
-
satpy.readers.ghrsst_l3c_sst module¶
satpy.readers.glm_l2 module¶
Geostationary Lightning Mapper reader for the Level 2 format from glmtools.
More information about glmtools and the files it produces can be found on the project’s GitHub repository:
-
class
satpy.readers.glm_l2.
NCGriddedGLML2
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.abi_base.NC_ABI_BASE
File reader for individual GLM L2 NetCDF4 files.
Open the NetCDF file with xarray and prepare the Dataset for reading.
-
available_datasets
(configured_datasets=None)[source]¶ Check actual Add information to configured datasets.
-
property
end_time
¶ End time of the current file’s observations.
-
property
sensor
¶ Get sensor name for current file handler.
-
property
start_time
¶ Start time of the current file’s observations.
-
satpy.readers.goes_imager_hrit module¶
GOES HRIT format reader.
References
LRIT/HRIT Mission Specific Implementation, February 2012 GVARRDL98.pdf 05057_SPE_MSG_LRIT_HRI
-
exception
satpy.readers.goes_imager_hrit.
CalibrationError
[source]¶ Bases:
Exception
Dummy error-class.
-
class
satpy.readers.goes_imager_hrit.
HRITGOESFileHandler
(filename, filename_info, filetype_info, prologue)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
GOES HRIT format reader.
Initialize the reader.
-
class
satpy.readers.goes_imager_hrit.
HRITGOESPrologueFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
GOES HRIT format reader.
Initialize the reader.
satpy.readers.goes_imager_nc module¶
Reader for GOES 8-15 imager data in netCDF format from NOAA CLASS. Also handles GOES 15 data in netCDF format reformated by Eumetsat
GOES Imager netCDF files contain geolocated detector counts. If ordering via NOAA CLASS, select 16 bits/pixel. The instrument oversamples the viewed scene in E-W direction by a factor of 1.75: IR/VIS pixels are 112/28 urad on a side, but the instrument samples every 64/16 urad in E-W direction (see [BOOK-I] and [BOOK-N]).
Important note: Some essential information are missing in the netCDF files, which might render them inappropriate for certain applications. The unknowns are:
Subsatellite point
Calibration coefficients
Detector-scanline assignment, i.e. information about which scanline was recorded by which detector
Items 1. and 2. are not critical because the images are geo-located and NOAA provides static calibration coefficients ([VIS], [IR]). The detector-scanline assignment however cannot be reconstructed properly. This is where an approximation has to be applied (see below).
Calibration¶
Calibration is performed according to [VIS] and [IR], but with an average calibration coefficient applied to all detectors in a certain channel. The reason for and impact of this approximation is described below.
The GOES imager simultaneously records multiple scanlines per sweep using multiple detectors per channel. The VIS channel has 8 detectors, the IR channels have 1-2 detectors (see e.g. Figures 3-5a/b, 3-6a/b and 3-7/a-b in [BOOK-N]). Each detector has its own calibration coefficients, so in order to perform an accurate calibration, the detector-scanline assignment is needed.
In theory it is known which scanline was recorded by which detector (VIS: 5,6,7,8,1,2,3,4; IR: 1,2). However, the plate on which the detectors are mounted flexes due to thermal gradients in the instrument which leads to a N-S shift of +/- 8 visible or +/- 2 IR pixels. This shift is compensated in the GVAR scan formation process, but in a way which is hard to reconstruct properly afterwards. See [GVAR], section 3.2.1. for details.
Since the calibration coefficients of the detectors in a certain channel only differ slightly, a workaround is to calibrate each scanline with the average calibration coefficients. A worst case estimate of the introduced error can be obtained by calibrating all possible counts with both the minimum and the maximum calibration coefficients and computing the difference. The maximum differences are:
GOES-8 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
0.0 |
% # Counts are normalized |
03_9 |
0.187 |
K |
06_8 |
0.0 |
K # only one detector |
10_7 |
0.106 |
K |
12_0 |
0.036 |
K |
GOES-9 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
0.0 |
% # Counts are normalized |
03_9 |
0.0 |
K # coefs identical |
06_8 |
0.0 |
K # only one detector |
10_7 |
0.021 |
K |
12_0 |
0.006 |
K |
GOES-10 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
1.05 |
% |
03_9 |
0.0 |
K # coefs identical |
06_8 |
0.0 |
K # only one detector |
10_7 |
0.013 |
K |
12_0 |
0.004 |
K |
GOES-11 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
1.25 |
% |
03_9 |
0.0 |
K # coefs identical |
06_8 |
0.0 |
K # only one detector |
10_7 |
0.0 |
K # coefs identical |
12_0 |
0.065 |
K |
GOES-12 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
0.8 |
% |
03_9 |
0.0 |
K # coefs identical |
06_5 |
0.044 |
K |
10_7 |
0.0 |
K # coefs identical |
13_3 |
0.0 |
K # only one detector |
GOES-13 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
1.31 |
% |
03_9 |
0.0 |
K # coefs identical |
06_5 |
0.085 |
K |
10_7 |
0.008 |
K |
13_3 |
0.0 |
K # only one detector |
GOES-14 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
0.66 |
% |
03_9 |
0.0 |
K # coefs identical |
06_5 |
0.043 |
K |
10_7 |
0.006 |
K |
13_3 |
0.003 |
K |
GOES-15 |
||
---|---|---|
Channel |
Diff |
Unit |
00_7 |
0.86 |
% |
03_9 |
0.0 |
K # coefs identical |
06_5 |
0.02 |
K |
10_7 |
0.009 |
K |
13_3 |
0.008 |
K |
References:
[BOOK-N] https://goes.gsfc.nasa.gov/text/GOES-N_Databook/databook.pdf
[BOOK-I] https://goes.gsfc.nasa.gov/text/databook/databook.pdf
[IR] https://www.ospo.noaa.gov/Operations/GOES/calibration/gvar-conversion.html
[VIS] https://www.ospo.noaa.gov/Operations/GOES/calibration/goes-vis-ch-calibration.html
[FAQ] https://www.ncdc.noaa.gov/sites/default/files/attachments/Satellite-Frequently-Asked-Questions_2.pdf
[SCHED-W] http://www.ospo.noaa.gov/Operations/GOES/west/imager-routine.html
[SCHED-E] http://www.ospo.noaa.gov/Operations/GOES/east/imager-routine.html
Eumetsat formated netCDF data:
The main differences are:
The geolocation is in a separate file, used for all bands
VIS data is calibrated to Albedo (or reflectance)
IR data is calibrated to radiance.
VIS data is downsampled to IR resolution (4km)
File name differs also slightly
Data is received via EumetCast
-
class
satpy.readers.goes_imager_nc.
GOESCoefficientReader
(ir_url, vis_url)[source]¶ Bases:
object
Read GOES Imager calibration coefficients from NOAA reference HTMLs.
Init the coef reader.
-
gvar_channels
= {'GOES-10': {'00_7': 1, '03_9': 2, '06_8': 3, '10_7': 4, '12_0': 5}, 'GOES-11': {'00_7': 1, '03_9': 2, '06_8': 3, '10_7': 4, '12_0': 5}, 'GOES-12': {'00_7': 1, '03_9': 2, '06_5': 3, '10_7': 4, '13_3': 6}, 'GOES-13': {'00_7': 1, '03_9': 2, '06_5': 3, '10_7': 4, '13_3': 6}, 'GOES-14': {'00_7': 1, '03_9': 2, '06_5': 3, '10_7': 4, '13_3': 6}, 'GOES-15': {'00_7': 1, '03_9': 2, '06_5': 3, '10_7': 4, '13_3': 6}, 'GOES-8': {'00_7': 1, '03_9': 2, '06_8': 3, '10_7': 4, '12_0': 5}, 'GOES-9': {'00_7': 1, '03_9': 2, '06_8': 3, '10_7': 4, '12_0': 5}}¶
-
ir_tables
= {'GOES-10': '2-3', 'GOES-11': '2-4', 'GOES-12': '2-5a', 'GOES-13': '2-6', 'GOES-14': '2-7c', 'GOES-15': '2-8b', 'GOES-8': '2-1', 'GOES-9': '2-2'}¶
-
vis_tables
= {'GOES-10': 'Table 2.', 'GOES-11': 'Table 3.', 'GOES-12': 'Table 4.', 'GOES-13': 'Table 5.', 'GOES-14': 'Table 6.', 'GOES-15': 'Table 7.', 'GOES-8': 'Table 1.', 'GOES-9': 'Table 1.'}¶
-
-
class
satpy.readers.goes_imager_nc.
GOESEUMGEONCFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for GOES Geolocation data in EUM netCDF format.
Initialize the reader.
-
property
resolution
¶ Specify the spatial resolution of the dataset.
In the EUMETSAT format VIS data is downsampled to IR resolution (4km).
-
property
-
class
satpy.readers.goes_imager_nc.
GOESEUMNCFileHandler
(filename, filename_info, filetype_info, geo_data)[source]¶ Bases:
satpy.readers.goes_imager_nc.GOESNCBaseFileHandler
File handler for GOES Imager data in EUM netCDF format.
TODO: Remove datasets which are not available in the file (counts, VIS radiance) via available_datasets() -> See #434
Initialize the reader.
-
ir_sectors
= {(566, 3464): 'Southern Hemisphere (GOES-East)', (1062, 2760): 'Southern Hemisphere (GOES-West)', (1354, 3312): 'Northern Hemisphere (GOES-West)', (1826, 3464): 'Northern Hemisphere (GOES-East)', (2704, 5208): 'Full Disc'}¶
-
vis_sectors
= {(566, 3464): 'Southern Hemisphere (GOES-East)', (1062, 2760): 'Southern Hemisphere (GOES-West)', (1354, 3312): 'Northern Hemisphere (GOES-West)', (1826, 3464): 'Northern Hemisphere (GOES-East)', (2704, 5208): 'Full Disc'}¶
-
-
class
satpy.readers.goes_imager_nc.
GOESNCBaseFileHandler
(filename, filename_info, filetype_info, geo_data=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for GOES Imager data in netCDF format.
Initialize the reader.
-
available_datasets
(configured_datasets=None)[source]¶ Update information for or add datasets provided by this file.
If this file handler can load a dataset then it will supplement the dataset info with the resolution and possibly coordinate datasets needed to load it. Otherwise it will continue passing the dataset information down the chain.
See
satpy.readers.file_handlers.BaseFileHandler.available_datasets()
for details.
-
property
end_time
¶ End timestamp of the dataset.
-
abstract property
ir_sectors
¶ Get the ir sectors.
-
property
meta
¶ Derive metadata from the coordinates.
-
property
resolution
¶ Specify the spatial resolution of the dataset.
Channel 13_3’s spatial resolution changes from one platform to another while the wavelength and file format remain the same. In order to avoid multiple YAML reader definitions for the same file format, read the channel’s resolution from the file instead of defining it in the YAML dataset. This information will then be used by the YAML reader to complement the YAML definition of the dataset.
- Returns
Spatial resolution in kilometers
-
property
start_time
¶ Start timestamp of the dataset.
-
abstract property
vis_sectors
¶ Get the vis sectors.
-
-
class
satpy.readers.goes_imager_nc.
GOESNCFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.goes_imager_nc.GOESNCBaseFileHandler
File handler for GOES Imager data in netCDF format.
Initialize the reader.
-
ir_sectors
= {(566, 3464): 'Southern Hemisphere (GOES-East)', (1062, 2760): 'Southern Hemisphere (GOES-West)', (1354, 3312): 'Northern Hemisphere (GOES-West)', (1826, 3464): 'Northern Hemisphere (GOES-East)', (2704, 5208): 'Full Disc'}¶
-
vis_sectors
= {(2267, 13852): 'Southern Hemisphere (GOES-East)', (4251, 11044): 'Southern Hemisphere (GOES-West)', (5419, 13244): 'Northern Hemisphere (GOES-West)', (7307, 13852): 'Northern Hemisphere (GOES-East)', (10819, 20800): 'Full Disc'}¶
-
-
satpy.readers.goes_imager_nc.
test_coefs
(ir_url, vis_url)[source]¶ Test calibration coefficients against NOAA reference pages.
Currently the reference pages are:
ir_url = https://www.ospo.noaa.gov/Operations/GOES/calibration/gvar-conversion.html vis_url = https://www.ospo.noaa.gov/Operations/GOES/calibration/goes-vis-ch-calibration.html
- Parameters
ir_url – Path or URL to HTML page with IR coefficients
vis_url – Path or URL to HTML page with VIS coefficients
- Raises
ValueError if coefficients don't match the reference –
satpy.readers.gpm_imerg module¶
Reader for GPM imerg data on half-hourly timesteps.
References
The NASA IMERG ATBD: https://pmm.nasa.gov/sites/default/files/document_files/IMERG_ATBD_V06.pdf
-
class
satpy.readers.gpm_imerg.
Hdf5IMERG
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
IMERG hdf5 reader.
Init method.
-
property
end_time
¶ Find the end time from filename info.
-
property
start_time
¶ Find the start time from filename info.
-
property
satpy.readers.grib module¶
Generic Reader for GRIB2 files.
Currently this reader depends on the pygrib python package. The eccodes package from ECMWF is preferred, but does not support python 3 at the time of writing.
-
class
satpy.readers.grib.
GRIBFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for grib files.
Init the file handler.
-
available_datasets
(configured_datasets=None)[source]¶ Automatically determine datasets provided by this file.
-
property
end_time
¶ Get end time of this entire file.
Assumes the last message is the latest message.
-
get_area_def
(dsid)[source]¶ Get area definition for message.
If latlong grid then convert to valid eqc grid.
-
property
start_time
¶ Get start time of this entire file.
Assumes the first message is the earliest message.
-
satpy.readers.hdf4_utils module¶
Helpers for reading hdf4-based files.
-
class
satpy.readers.hdf4_utils.
HDF4FileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Base class for common HDF4 operations.
Open file and collect information.
satpy.readers.hdf5_utils module¶
Helpers for reading hdf5-based files.
-
class
satpy.readers.hdf5_utils.
HDF5FileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Small class for inspecting a HDF5 file and retrieve its metadata/header data.
Initialize file handler.
satpy.readers.hdfeos_base module¶
Base HDF-EOS reader.
-
class
satpy.readers.hdfeos_base.
HDFEOSBaseFileReader
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Base file handler for HDF EOS data for both L1b and L2 products.
Initialize the base reader.
-
property
end_time
¶ Get the end time of the dataset.
-
property
start_time
¶ Get the start time of the dataset.
-
property
-
class
satpy.readers.hdfeos_base.
HDFEOSGeoReader
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdfeos_base.HDFEOSBaseFileReader
Handler for the geographical datasets.
Initialize the geographical reader.
-
DATASET_NAMES
= {'latitude': 'Latitude', 'longitude': 'Longitude', 'satellite_azimuth_angle': ('SensorAzimuth', 'Sensor_Azimuth'), 'satellite_zenith_angle': ('SensorZenith', 'Sensor_Zenith'), 'solar_azimuth_angle': ('SolarAzimuth', 'SolarAzimuth'), 'solar_zenith_angle': ('SolarZenith', 'Solar_Zenith')}¶
-
property
geo_resolution
¶ Resolution of the geographical data retrieved in the metadata.
-
satpy.readers.hrit_base module¶
HRIT/LRIT format reader.
This module is the base module for all HRIT-based formats. Here, you will find the common building blocks for hrit reading.
One of the features here is the on-the-fly decompression of hrit files. It needs a path to the xRITDecompress binary to be provided through the environment variable called XRIT_DECOMPRESS_PATH. When compressed hrit files are then encountered (files finishing with .C_), they are decompressed to the system’s temporary directory for reading.
-
class
satpy.readers.hrit_base.
HRITFileHandler
(filename, filename_info, filetype_info, hdr_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
HRIT standard format reader.
Initialize the reader.
-
property
end_time
¶ Get end time.
-
get_xy_from_linecol
(line, col, offsets, factors)[source]¶ Get the intermediate coordinates from line & col.
Intermediate coordinates are actually the instruments scanning angles.
-
property
start_time
¶ Get start time.
-
property
-
satpy.readers.hrit_base.
decompress
(infile, outdir='.')[source]¶ Decompress an XRIT data file and return the path to the decompressed file.
It expect to find Eumetsat’s xRITDecompress through the environment variable XRIT_DECOMPRESS_PATH.
satpy.readers.hrit_jma module¶
HRIT format reader for JMA data.
Introduction¶
The JMA HRIT format is described in the JMA HRIT - Mission Specific Implementation. There are three readers for this format in Satpy:
jami_hrit
: For data from the JAMI instrument on MTSAT-1Rmtsat2-imager_hrit
: For data from the Imager instrument on MTSAT-2ahi_hrit
: For data from the AHI instrument on Himawari-8/9
Although the data format is identical, the instruments have different characteristics, which is why there is a dedicated reader for each of them. Sample data is available here:
Example
Here is an example how to read Himwari-8 HRIT data with Satpy:
from satpy import Scene
import glob
filenames = glob.glob('data/IMG_DK01B14_2018011109*')
scn = Scene(filenames=filenames, reader='ahi_hrit')
scn.load(['B14'])
print(scn['B14'])
Output:
<xarray.DataArray (y: 5500, x: 5500)>
dask.array<concatenate, shape=(5500, 5500), dtype=float64, chunksize=(550, 4096), ...
Coordinates:
acq_time (y) datetime64[ns] 2018-01-11T09:00:20.995200 ... 2018-01-11T09:09:40.348800
crs object +proj=geos +lon_0=140.7 +h=35785831 +x_0=0 +y_0=0 +a=6378169 ...
* y (y) float64 5.5e+06 5.498e+06 5.496e+06 ... -5.496e+06 -5.498e+06
* x (x) float64 -5.498e+06 -5.496e+06 -5.494e+06 ... 5.498e+06 5.5e+06
Attributes:
satellite_longitude: 140.7
satellite_latitude: 0.0
satellite_altitude: 35785831.0
orbital_parameters: {'projection_longitude': 140.7, 'projection_latitud...
standard_name: toa_brightness_temperature
level: None
wavelength: (11.0, 11.2, 11.4)
units: K
calibration: brightness_temperature
file_type: ['hrit_b14_seg', 'hrit_b14_fd']
modifiers: ()
polarization: None
sensor: ahi
name: B14
platform_name: Himawari-8
resolution: 4000
start_time: 2018-01-11 09:00:20.995200
end_time: 2018-01-11 09:09:40.348800
area: Area ID: FLDK, Description: Full Disk, Projection I...
ancillary_variables: []
JMA HRIT data contain the scanline acquisition time for only a subset of scanlines. Timestamps of
the remaining scanlines are computed using linear interpolation. This is what you’ll find in the
acq_time
coordinate of the dataset.
-
class
satpy.readers.hrit_jma.
HRITJMAFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
JMA HRIT format reader.
Initialize the reader.
-
property
end_time
¶ Get end time of the scan.
-
property
start_time
¶ Get start time of the scan.
-
property
satpy.readers.hrpt module¶
satpy.readers.hsaf_grib module¶
A reader for files produced by the Hydrology SAF.
Currently this reader depends on the pygrib python package. The eccodes package from ECMWF is preferred, but does not support python 3 at the time of writing.
-
class
satpy.readers.hsaf_grib.
HSAFFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for HSAF grib files.
Init the file handler.
-
property
analysis_time
¶ Get validity time of this file.
-
property
satpy.readers.hy2_scat_l2b_h5 module¶
HY-2B L2B Reader, distributed by Eumetsat in HDF5 format.
-
class
satpy.readers.hy2_scat_l2b_h5.
HY2SCATL2BH5FileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
File handler for HY2 scat.
Initialize file handler.
-
property
end_time
¶ Time for final observation.
-
property
platform_name
¶ Get the Platform ShortName.
-
property
start_time
¶ Time for first observation.
-
property
satpy.readers.iasi_l2 module¶
IASI L2 HDF5 files.
-
class
satpy.readers.iasi_l2.
IASIL2HDF5
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for IASI L2 HDF5 files.
Init the file handler.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
satpy.readers.iasi_l2_so2_bufr module¶
IASI L2 SO2 BUFR format reader.
Introduction¶
The iasi_l2_so2_bufr
reader reads IASI level2 SO2 data in BUFR format. The algorithm is described in the
Theoretical Basis Document, linked below.
Each BUFR file consists of a number of messages, one for each scan, each of which contains SO2 column amounts in Dobson units for retrievals performed with plume heights of 7, 10, 13, 16 and 25 km.
Reader Arguments¶
A list of retrieval files, fnames, can be opened as follows:
Scene(reader="iasi_l2_so2_bufr", filenames=fnames)
Example
Here is an example how to read the data in satpy:
from satpy import Scene
import glob
filenames = glob.glob(
'/test_data/W_XX-EUMETSAT-Darmstadt,SOUNDING+SATELLITE,METOPA+IASI_C_EUMC_20200204091455_68984_eps_o_so2_l2.bin')
scn = Scene(filenames=filenames, reader='iasi_l2_so2_bufr')
scn.load(['so2_height_3', 'so2_height_4'])
print(scn['so2_height_3'])
Output:
<xarray.DataArray 'so2_height_3' (y: 23, x: 120)>
dask.array<where, shape=(23, 120), dtype=float64, chunksize=(1, 120), chunktype=numpy.ndarray>
Coordinates:
crs object +proj=latlong +datum=WGS84 +ellps=WGS84 +type=crs
Dimensions without coordinates: y, x
Attributes:
sensor: IASI
units: dobson
file_type: iasi_l2_so2_bufr
wavelength: None
modifiers: ()
platform_name: METOP-2
resolution: 12000
fill_value: -1e+100
level: None
polarization: None
coordinates: ('longitude', 'latitude')
calibration: None
key: #3#sulphurDioxide
name: so2_height_3
start_time: 2020-02-04 09:14:55
end_time: 2020-02-04 09:17:51
area: Shape: (23, 120)\nLons: <xarray.DataArray 'longitud...
ancillary_variables: []
References: Algorithm Theoretical Basis Document: https://acsaf.org/docs/atbd/Algorithm_Theoretical_Basis_Document_IASI_SO2_Jul_2016.pdf
-
class
satpy.readers.iasi_l2_so2_bufr.
IASIL2SO2BUFR
(filename, filename_info, filetype_info, **kwargs)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for the IASI L2 SO2 BUFR product.
Initialise the file handler for the IASI L2 SO2 BUFR data.
-
property
end_time
¶ Return the end time of data acquisition.
-
property
platform_name
¶ Return spacecraft name.
-
property
start_time
¶ Return the start time of data acqusition.
-
property
satpy.readers.li_l2 module¶
satpy.readers.maia module¶
Reader for NWPSAF AAPP MAIA Cloud product.
https://nwpsaf.eu/site/software/aapp/
Documentation reference:
[NWPSAF-MF-UD-003] DATA Formats [NWPSAF-MF-UD-009] MAIA version 4 Scientific User Manual
-
class
satpy.readers.maia.
MAIAFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for Maia files.
Init the file handler.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
satpy.readers.mersi2_l1b module¶
Reader for the FY-3D MERSI-2 L1B file format.
The files for this reader are HDF5 and come in four varieties; band data and geolocation data, both at 250m and 1000m resolution.
This reader was tested on FY-3D MERSI-2 data, but should work on future platforms as well assuming no file format changes.
-
class
satpy.readers.mersi2_l1b.
MERSI2L1B
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
MERSI-2 L1B file reader.
Initialize file handler.
-
property
end_time
¶ Time for final observation.
-
property
sensor_name
¶ Map sensor name to Satpy ‘standard’ sensor names.
-
property
start_time
¶ Time for first observation.
-
property
satpy.readers.mimic_TPW2_nc module¶
Reader for Mimic TPW data in netCDF format from SSEC.
This module implements reader for MIMIC_TPW2 netcdf files. MIMIC-TPW2 is an experimental global product of total precipitable water (TPW), using morphological compositing of the MIRS retrieval from several available operational microwave-frequency sensors. Originally described in a 2010 paper by Wimmers and Velden. This Version 2 is developed from an older method that uses simpler, but more limited TPW retrievals and advection calculations.
More information, data and credits at http://tropic.ssec.wisc.edu/real-time/mtpw2/credits.html
-
class
satpy.readers.mimic_TPW2_nc.
MimicTPW2FileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
NetCDF4 reader for MIMC TPW.
Initialize the reader.
-
available_datasets
(configured_datasets=None)[source]¶ Get datasets in file matching gelocation shape (lat/lon).
-
property
end_time
¶ End timestamp of the dataset same as start_time.
-
property
sensor_name
¶ Sensor name.
-
property
start_time
¶ Start timestamp of the dataset determined from yaml.
-
satpy.readers.modis_l1b module¶
Modis level 1b hdf-eos format reader.
Introduction¶
The modis_l1b
reader reads and calibrates Modis L1 image data in hdf-eos format. Files often have
a pattern similar to the following one:
M[O/Y]D02[1/H/Q]KM.A[date].[time].[collection].[processing_time].hdf
Other patterns where “collection” and/or “proccessing_time” are missing might also work (see the readers yaml file for details). Geolocation files (MOD03) are also supported.
Geolocation files¶
For the 1km data (mod021km) geolocation files (mod03) are optional. If not given to the reader 1km geolocations will be interpolated from the 5km geolocation contained within the file.
For the 500m and 250m data geolocation files are needed.
References
Modis gelocation description: http://www.icare.univ-lille1.fr/wiki/index.php/MODIS_geolocation
-
class
satpy.readers.modis_l1b.
HDFEOSBandReader
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdfeos_base.HDFEOSBaseFileReader
Handler for the regular band channels.
Init the file handler.
-
res
= {'1': 1000, 'H': 500, 'Q': 250}¶
-
-
class
satpy.readers.modis_l1b.
MixedHDFEOSReader
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdfeos_base.HDFEOSGeoReader
,satpy.readers.modis_l1b.HDFEOSBandReader
A file handler for the files that have both regular bands and geographical information in them.
Init the file handler.
-
satpy.readers.modis_l1b.
calibrate_bt
(array, attributes, index, band_name)[source]¶ Calibration for the emissive channels.
-
satpy.readers.modis_l1b.
calibrate_counts
(array, attributes, index)[source]¶ Calibration for counts channels.
satpy.readers.modis_l2 module¶
Modis level 2 hdf-eos format reader.
Introduction¶
The modis_l2
reader reads and calibrates Modis L2 image data in hdf-eos format.
Since there are a multitude of different level 2 datasets not all of theses are implemented (yet).
- Currently the reader supports:
m[o/y]d35_l2: cloud_mask dataset
some datasets in m[o/y]d06 files
To get a list of the available datasets for a given file refer to the “Load data” section in Readers.
Geolocation files¶
Similar to the modis_l1b
reader the geolocation files (mod03) for the 1km data are optional and if not
given 1km geolocations will be interpolated from the 5km geolocation contained within the file.
For the 500m and 250m data geolocation files are needed.
References
Documentation about the format: https://modis-atmos.gsfc.nasa.gov/products
-
class
satpy.readers.modis_l2.
ModisL2HDFFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdfeos_base.HDFEOSGeoReader
File handler for MODIS HDF-EOS Level 2 files.
Initialize the geographical reader.
-
satpy.readers.modis_l2.
bits_strip
(bit_start, bit_count, value)[source]¶ Extract specified bit from bit representation of integer value.
- Parameters
bit_start (int) – Starting index of the bits to extract (first bit has index 0)
bit_count (int) – Number of bits starting from bit_start to extract
value (int) – Number from which to extract the bits
- Returns
int
Value of the extracted bits
satpy.readers.msi_safe module¶
SAFE MSI L1C reader.
-
class
satpy.readers.msi_safe.
SAFEMSIL1C
(filename, filename_info, filetype_info, mda)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for SAFE MSI files (jp2).
Init the reader.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
-
class
satpy.readers.msi_safe.
SAFEMSIMDXML
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handle for sentinel 2 safe XML manifest.
Init the reader.
-
property
end_time
¶ Get end time.
-
property
start_time
¶ Get start time.
-
property
satpy.readers.netcdf_utils module¶
Helpers for reading netcdf-based files.
-
class
satpy.readers.netcdf_utils.
NetCDF4FileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Small class for inspecting a NetCDF4 file and retrieving its metadata/header data.
File information can be accessed using bracket notation. Variables are accessed by using:
wrapper[“var_name”]
Or:
wrapper[“group/subgroup/var_name”]
Attributes can be accessed by appending “/attr/attr_name” to the item string:
wrapper[“group/subgroup/var_name/attr/units”]
Or for global attributes:
wrapper[“/attr/platform_short_name”]
Note that loading datasets requires reopening the original file (unless those datasets are cached, see below), but to get just the shape of the dataset append “/shape” to the item string:
wrapper[“group/subgroup/var_name/shape”]
If your file has many small data variables that are frequently accessed, you may choose to cache some of them. You can do this by passing a number, any variable smaller than this number in bytes will be read into RAM. Warning, this part of the API is provisional and subject to change.
You may get an additional speedup by passing
cache_handle=True
. This will keep the netCDF4 dataset handles open throughout the lifetime of the object, and instead of using xarray.open_dataset to open every data variable, a dask array will be created “manually”. This may be useful if you have a dataset distributed over many files, such as for FCI. Note that the coordinates will be missing in this case. If you use this option,xarray_kwargs
will have no effect.- Parameters
filename (str) – File to read
filename_info (dict) – Dictionary with filename information
filetype_info (dict) – Dictionary with filetype information
auto_maskandscale (bool) – Apply mask and scale factors
xarray_kwargs (dict) – Addition arguments to xarray.open_dataset
cache_var_size (int) – Cache variables smaller than this size.
cache_handle (bool) – Keep files open for lifetime of filehandler.
Initialize object.
-
collect_cache_vars
(cache_vars, obj)[source]¶ Collect data variables for caching.
This method will collect some data variables and store them in RAM. This may be useful if some small variables are frequently accessed, to prevent needlessly frequently opening and closing the file, which in case of xarray is associated with some overhead.
Should be called later than collect_metadata.
- Parameters
cache_vars (List[str]) – Names of data variables to be cached.
obj (netCDF4.Dataset) – Dataset object from which to read them.
-
collect_metadata
(name, obj)[source]¶ Collect all file variables and attributes for the provided file object.
This method also iterates through subgroups of the provided object.
-
file_handle
= None¶
satpy.readers.nucaps module¶
Interface to NUCAPS Retrieval NetCDF files.
NUCAPS stands for NOAA Unique Combined Atmospheric Processing System. NUCAPS retrievals include temperature, moisture, trace gas, and cloud-cleared radiance profiles. Product details can be found at:
https://www.ospo.noaa.gov/Products/atmosphere/soundings/nucaps/
This reader supports both standard NOAA NUCAPS EDRs, and Science EDRs, which are essentially a subset of the standard EDRs with some additional parameters such as relative humidity and boundary layer temperature.
NUCAPS data is derived from Cross-track Infrared Sounder (CrIS) data, and from Advanced Technology Microwave Sounder (ATMS) data, instruments onboard Joint Polar Satellite System spacecraft.
-
class
satpy.readers.nucaps.
NUCAPSFileHandler
(*args, **kwargs)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
File handler for NUCAPS netCDF4 format.
Initialize file handler.
-
property
end_orbit_number
¶ Return orbit number for the end of the swath.
-
property
end_time
¶ Get end time.
-
property
platform_name
¶ Return standard platform name for the file’s data.
-
property
sensor_names
¶ Return standard sensor or instrument name for the file’s data.
-
property
start_orbit_number
¶ Return orbit number for the beginning of the swath.
-
property
start_time
¶ Get start time.
-
property
-
class
satpy.readers.nucaps.
NUCAPSReader
(config_files, mask_surface=True, mask_quality=True, **kwargs)[source]¶ Bases:
satpy.readers.yaml_reader.FileYAMLReader
Reader for NUCAPS NetCDF4 files.
Configure reader behavior.
- Parameters
mask_surface (boolean) – mask anything below the surface pressure
mask_quality (boolean) – mask anything where the Quality_Flag metadata is
!= 1
.
-
load
(dataset_keys, previous_datasets=None, pressure_levels=None)[source]¶ Load data from one or more set of files.
- Parameters
pressure_levels – mask out certain pressure levels: True for all levels (min, max) for a range of pressure levels […] list of levels to include
-
load_ds_ids_from_config
()[source]¶ Convert config dataset entries to DataIDs.
Special handling is done to provide level specific datasets for any pressured based datasets. For example, a dataset is added for each pressure level of ‘Temperature’ with each new dataset being named ‘Temperature_Xmb’ where X is the pressure level.
satpy.readers.nwcsaf_msg2013_hdf5 module¶
Reader for the old NWCSAF/Geo (v2013 and earlier) cloud product format.
References
The NWCSAF GEO 2013 products documentation: http://www.nwcsaf.org/web/guest/archive - Search for Code “ICD/3”; Type “MSG” and the box to the right should say ‘Status’ (which means any status). Version 7.0 seems to be for v2013
-
class
satpy.readers.nwcsaf_msg2013_hdf5.
Hdf5NWCSAF
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
NWCSAF MSG hdf5 reader.
Init method.
-
property
start_time
¶ Return the start time of the object.
-
property
satpy.readers.nwcsaf_nc module¶
Nowcasting SAF common PPS&MSG NetCDF/CF format reader.
References
The NWCSAF GEO 2018 products documentation: http://www.nwcsaf.org/web/guest/archive
-
class
satpy.readers.nwcsaf_nc.
NcNWCSAF
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
NWCSAF PPS&MSG NetCDF reader.
Init method.
-
property
end_time
¶ Return the end time of the object.
-
get_area_def
(dsid)[source]¶ Get the area definition of the datasets in the file.
Only applicable for MSG products!
-
scale_dataset
(dsid, variable, info)[source]¶ Scale the data set, applying the attributes from the netCDF file.
The scale and offset attributes will then be removed from the resulting variable.
-
property
sensor_names
¶ List of sensors represented in this file.
-
set_platform_and_sensor
(**kwargs)[source]¶ Set some metadata: platform_name, sensors, and pps (identifying PPS or Geo).
-
property
start_time
¶ Return the start time of the object.
-
property
satpy.readers.olci_nc module¶
Sentinel-3 OLCI reader.
This reader supports an optional argument to choose the ‘engine’ for reading
OLCI netCDF4 files. By default, this reader uses the default xarray choice of
engine, as defined in the xarray.open_dataset()
documentation`.
As an alternative, the user may wish to use the ‘h5netcdf’ engine, but that is not default as it typically prints many non-fatal but confusing error messages to the terminal. To choose between engines the user can do as follows for the default:
scn = Scene(filenames=my_files, reader='olci_l1b')
or as follows for the h5netcdf engine:
scn = Scene(filenames=my_files,
reader='olci_l1b', reader_kwargs={'engine': 'h5netcdf'})
References
xarray.open_dataset()
-
class
satpy.readers.olci_nc.
BitFlags
(value)[source]¶ Bases:
object
Manipulate flags stored bitwise.
Init the flags.
-
flag_list
= ['INVALID', 'WATER', 'LAND', 'CLOUD', 'SNOW_ICE', 'INLAND_WATER', 'TIDAL', 'COSMETIC', 'SUSPECT', 'HISOLZEN', 'SATURATED', 'MEGLINT', 'HIGHGLINT', 'WHITECAPS', 'ADJAC', 'WV_FAIL', 'PAR_FAIL', 'AC_FAIL', 'OC4ME_FAIL', 'OCNN_FAIL', 'Extra_1', 'KDM_FAIL', 'Extra_2', 'CLOUD_AMBIGUOUS', 'CLOUD_MARGIN', 'BPAC_ON', 'WHITE_SCATT', 'LOWRW', 'HIGHRW']¶
-
meaning
= {'AC_FAIL': 17, 'ADJAC': 14, 'BPAC_ON': 25, 'CLOUD': 3, 'CLOUD_AMBIGUOUS': 23, 'CLOUD_MARGIN': 24, 'COSMETIC': 7, 'Extra_1': 20, 'Extra_2': 22, 'HIGHGLINT': 12, 'HIGHRW': 28, 'HISOLZEN': 9, 'INLAND_WATER': 5, 'INVALID': 0, 'KDM_FAIL': 21, 'LAND': 2, 'LOWRW': 27, 'MEGLINT': 11, 'OC4ME_FAIL': 18, 'OCNN_FAIL': 19, 'PAR_FAIL': 16, 'SATURATED': 10, 'SNOW_ICE': 4, 'SUSPECT': 8, 'TIDAL': 6, 'WATER': 1, 'WHITECAPS': 13, 'WHITE_SCATT': 26, 'WV_FAIL': 15}¶
-
-
class
satpy.readers.olci_nc.
NCOLCI1B
(filename, filename_info, filetype_info, cal, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCIChannelBase
File handler for OLCI l1b.
Init the file handler.
-
class
satpy.readers.olci_nc.
NCOLCI2
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCIChannelBase
File handler for OLCI l2.
Init the file handler.
-
class
satpy.readers.olci_nc.
NCOLCIAngles
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCILowResData
File handler for the OLCI angles.
Init the file handler.
-
datasets
= {'satellite_azimuth_angle': 'OAA', 'satellite_zenith_angle': 'OZA', 'solar_azimuth_angle': 'SAA', 'solar_zenith_angle': 'SZA'}¶
-
-
class
satpy.readers.olci_nc.
NCOLCIBase
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
The OLCI reader base.
Init the olci reader base.
-
property
end_time
¶ End time property.
-
property
start_time
¶ Start time property.
-
property
-
class
satpy.readers.olci_nc.
NCOLCICal
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCIBase
Dummy class for calibration.
Init the olci reader base.
-
class
satpy.readers.olci_nc.
NCOLCIChannelBase
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCIBase
Base class for channel reading.
Init the file handler.
-
class
satpy.readers.olci_nc.
NCOLCIGeo
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCIBase
Dummy class for navigation.
Init the olci reader base.
-
class
satpy.readers.olci_nc.
NCOLCILowResData
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Handler for low resolution data.
Init the file handler.
-
class
satpy.readers.olci_nc.
NCOLCIMeteo
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.olci_nc.NCOLCILowResData
File handler for the OLCI meteo data.
Init the file handler.
-
datasets
= ['humidity', 'sea_level_pressure', 'total_columnar_water_vapour', 'total_ozone']¶
-
satpy.readers.omps_edr module¶
Interface to OMPS EDR format.
-
class
satpy.readers.omps_edr.
EDREOSFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.omps_edr.EDRFileHandler
EDR EOS file handler.
Initialize file handler.
-
class
satpy.readers.omps_edr.
EDRFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
EDR file handler.
Initialize file handler.
-
property
end_orbit_number
¶ Get the end orbit number.
-
property
platform_name
¶ Get the platform name.
-
property
sensor_name
¶ Get the sensor name.
-
property
start_orbit_number
¶ Get the start orbit number.
-
property
satpy.readers.safe_sar_l2_ocn module¶
SAFE SAR L2 OCN format reader.
The OCN data contains various parameters, but mainly the wind speed and direction calculated from SAR data and input model data from ECMWF
Implemented in this reader is the OWI, Ocean Wind field.
See more at ESA webpage https://sentinel.esa.int/web/sentinel/ocean-wind-field-component
-
class
satpy.readers.safe_sar_l2_ocn.
SAFENC
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Measurement file reader.
Init the file reader.
-
property
end_time
¶ Product end_time, parsed from the measurement file name.
-
property
fend_time
¶ Product fend_time meaning the end time parsed from the SAFE directory.
-
property
fstart_time
¶ Product fstart_time meaning the start time parsed from the SAFE directory.
-
property
start_time
¶ Product start_time, parsed from the measurement file name.
-
property
satpy.readers.sar_c_safe module¶
SAFE SAR-C reader.
This module implements a reader for Sentinel 1 SAR-C GRD (level1) SAFE format as provided by ESA. The format is comprised of a directory containing multiple files, most notably two measurement files in geotiff and a few xml files for calibration, noise and metadata.
References
Level 1 Product Formatting https://sentinel.esa.int/web/sentinel/technical-guides/sentinel-1-sar/products-algorithms/level-1-product-formatting
J. Park, A. A. Korosov, M. Babiker, S. Sandven and J. Won, “Efficient Thermal Noise Removal for Sentinel-1 TOPSAR Cross-Polarization Channel,” in IEEE Transactions on Geoscience and Remote Sensing, vol. 56, no. 3, pp. 1555-1565, March 2018. doi: 10.1109/TGRS.2017.2765248
-
class
satpy.readers.sar_c_safe.
SAFEGRD
(filename, filename_info, filetype_info, calfh, noisefh)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Measurement file reader.
The measurement files are in geotiff format and read using rasterio. For performance reasons, the reading adapts the chunk size to match the file’s block size.
Init the grd filehandler.
-
property
end_time
¶ Get the end time.
-
get_gcps
()[source]¶ Read GCP from the GDAL band.
- Parameters
band (gdal band) – Measurement band which comes with GCP’s
coordinates (tuple) – A tuple with longitude and latitude arrays
- Returns
Pixel and Line indices 1d arrays gcp_coords (tuple): longitude and latitude 1d arrays
- Return type
points (tuple)
-
get_lonlatalts
()[source]¶ Obtain GCPs and construct latitude and longitude arrays.
- Parameters
band (gdal band) – Measurement band which comes with GCP’s
array_shape (tuple) – The size of the data array
- Returns
A tuple with longitude and latitude arrays
- Return type
coordinates (tuple)
-
property
start_time
¶ Get the start time.
-
property
-
class
satpy.readers.sar_c_safe.
SAFEXML
(filename, filename_info, filetype_info, header_file=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
XML file reader for the SAFE format.
Init the xml filehandler.
-
property
end_time
¶ Get the end time.
-
static
interpolate_xml_array
(data, low_res_coords, shape, chunks)[source]¶ Interpolate arbitrary size dataset to a full sized grid.
-
static
read_azimuth_noise_array
(elts)[source]¶ Read the azimuth noise vectors.
The azimuth noise is normalized per swath to account for gain differences between the swaths in EW mode.
This is based on the this reference: J. Park, A. A. Korosov, M. Babiker, S. Sandven and J. Won, “Efficient Thermal Noise Removal for Sentinel-1 TOPSAR Cross-Polarization Channel,” in IEEE Transactions on Geoscience and Remote Sensing, vol. 56, no. 3, pp. 1555-1565, March 2018. doi: 10.1109/TGRS.2017.2765248
-
property
start_time
¶ Get the start time.
-
property
-
satpy.readers.sar_c_safe.
interpolate_slice
(slice_rows, slice_cols, interpolator)[source]¶ Interpolate the given slice of the larger array.
-
satpy.readers.sar_c_safe.
interpolate_xarray
(xpoints, ypoints, values, shape, kind='cubic', blocksize=4096)[source]¶ Interpolate, generating a dask array.
satpy.readers.scatsat1_l2b module¶
satpy.readers.scmi module¶
SCMI NetCDF4 Reader.
SCMI files are typically used for data for the ABI instrument onboard the GOES-16/17 satellites. It is the primary format used for providing ABI data to the AWIPS visualization clients used by the US National Weather Service forecasters. The python code for this reader may be reused by other readers as NetCDF schemes/metadata change for different products. The initial reader using this code is the “scmi_abi” reader (see abi_l1b_scmi.yaml for more information).
There are two forms of these files that this reader supports:
- Official SCMI format: NetCDF4 files where the main data variable is stored
in a variable called “Sectorized_CMI”. This variable name can be configured in the YAML configuration file.
- Satpy/Polar2Grid SCMI format: NetCDF4 files based on the official SCMI
format created for the Polar2Grid project. This format was migrated to Satpy as part of Polar2Grid’s adoption of Satpy for the majority of its features. This format is what is produced by Satpy’s scmi writer. This format can be identified by a single variable named “data” and a global attribute named
"awips_id"
that is set to a string starting with"AWIPS_"
.
-
class
satpy.readers.scmi.
SCMIFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Handle a single SCMI NetCDF4 file.
Set up the SCMI file handler.
-
property
end_time
¶ Get the end time.
-
property
sensor_names
¶ Get the sensor names.
-
property
start_time
¶ Get the start time.
-
property
satpy.readers.seviri_base module¶
Utilities and helper classes for MSG HRIT/Native data reading.
References
MSG Level 1.5 Image Data Format Description https://www.eumetsat.int/website/wcm/idc/idcplg?IdcService=GET_FILE&dDocName=PDF_TEN_05105_MSG_IMG_DATA&RevisionSelectionMethod=LatestReleased&Rendition=Web
-
class
satpy.readers.seviri_base.
MpefProductHeader
[source]¶ Bases:
object
MPEF product header class.
-
property
images_used
¶ Return structure for images_used.
-
property
-
class
satpy.readers.seviri_base.
SEVIRICalibrationHandler
[source]¶ Bases:
object
Calibration handler for SEVIRI HRIT- and native-formats.
-
satpy.readers.seviri_base.
calculate_area_extent
(area_dict)[source]¶ Calculate the area extent seen by a geostationary satellite.
- Parameters
area_dict – A dictionary containing the required parameters center_point: Center point for the projection resolution: Pixel resulution in meters north: Northmost row number east: Eastmost column number west: Westmost column number south: Southmost row number [column_offset: Column offset, defaults to 0 if not given] [row_offset: Row offset, defaults to 0 if not given]
- Returns
- An area extent for the scene defined by the lower left and
upper right corners
- Return type
tuple
-
satpy.readers.seviri_base.
chebyshev
(coefs, time, domain)[source]¶ Evaluate a Chebyshev Polynomial.
- Parameters
coefs (list, np.array) – Coefficients defining the polynomial
time (int, float) – Time where to evaluate the polynomial
domain (list, tuple) – Domain (or time interval) for which the polynomial is defined: [left, right]
Reference: Appendix A in the MSG Level 1.5 Image Data Format Description.
-
satpy.readers.seviri_base.
dec10216
(inbuf)[source]¶ Decode 10 bits data into 16 bits words.
/* * pack 4 10-bit words in 5 bytes into 4 16-bit words * * 0 1 2 3 4 5 * 01234567890123456789012345678901234567890 * 0 1 2 3 4 */ ip = &in_buffer[i]; op = &out_buffer[j]; op[0] = ip[0]*4 + ip[1]/64; op[1] = (ip[1] & 0x3F)*16 + ip[2]/16; op[2] = (ip[2] & 0x0F)*64 + ip[3]/4; op[3] = (ip[3] & 0x03)*256 +ip[4];
-
satpy.readers.seviri_base.
get_cds_time
(days, msecs)[source]¶ Compute timestamp given the days since epoch and milliseconds of the day.
1958-01-01 00:00 is interpreted as fill value and will be replaced by NaT (Not a Time).
- Parameters
days (int, either scalar or numpy.ndarray) – Days since 1958-01-01
msecs (int, either scalar or numpy.ndarray) – Milliseconds of the day
- Returns
Timestamp(s)
- Return type
numpy.datetime64
satpy.readers.seviri_l1b_hrit module¶
SEVIRI HRIT format reader.
Introduction¶
The seviri_l1b_hrit
reader reads and calibrates MSG-SEVIRI L1.5 image data in HRIT format. The format is explained
in the MSG Level 1.5 Image Format Description. The files are usually named as
follows:
H-000-MSG4__-MSG4________-_________-PRO______-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000001___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000002___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000003___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000004___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000005___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000006___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000007___-201903011200-__
H-000-MSG4__-MSG4________-IR_108___-000008___-201903011200-__
H-000-MSG4__-MSG4________-_________-EPI______-201903011200-__
Each image is decomposed into 24 segments (files) for the high-resolution-visible (HRV) channel and 8 segments for other visible (VIS) and infrared (IR) channels. Additionally there is one prologue and one epilogue file for the entire scan which contain global metadata valid for all channels.
Reader Arguments¶
Some arguments can be provided to the reader to change it’s behaviour. These are provided through the Scene instantiation, eg:
Scene(reader="seviri_l1b_hrit", filenames=fnames, reader_kwargs={'fill_hrv': False})
To see the full list of arguments that can be provided, look into the documentation
of HRITMSGFileHandler
.
Example
Here is an example how to read the data in satpy:
from satpy import Scene
import glob
filenames = glob.glob('data/H-000-MSG4__-MSG4________-*201903011200*')
scn = Scene(filenames=filenames, reader='seviri_l1b_hrit')
scn.load(['VIS006', 'IR_108'])
print(scn['IR_108'])
Output:
<xarray.DataArray (y: 3712, x: 3712)>
dask.array<shape=(3712, 3712), dtype=float32, chunksize=(464, 3712)>
Coordinates:
acq_time (y) datetime64[ns] NaT NaT NaT NaT NaT NaT ... NaT NaT NaT NaT NaT
* x (x) float64 5.566e+06 5.563e+06 5.56e+06 ... -5.566e+06 -5.569e+06
* y (y) float64 -5.566e+06 -5.563e+06 ... 5.566e+06 5.569e+06
Attributes:
satellite_longitude: 0.0
satellite_latitude: 0.0
satellite_altitude: 35785831.0
orbital_parameters: {'projection_longitude': 0.0, 'projection_latit...
platform_name: Meteosat-11
georef_offset_corrected: True
standard_name: brightness_temperature
raw_metadata: {'file_type': 0, 'total_header_length': 6198, '...
wavelength: (9.8, 10.8, 11.8)
units: K
sensor: seviri
platform_name: Meteosat-11
start_time: 2019-03-01 12:00:09.716000
end_time: 2019-03-01 12:12:42.946000
area: Area ID: some_area_name\\nDescription: On-the-fl...
name: IR_108
resolution: 3000.403165817
calibration: brightness_temperature
polarization: None
level: None
modifiers: ()
ancillary_variables: []
The
orbital_parameters
attribute provides the nominal and actual satellite position, as well as the projection centre.You can choose between nominal and GSICS calibration coefficients or even specify your own coefficients, see
HRITMSGFileHandler
.The
raw_metadata
attribute provides raw metadata from the prologue, epilogue and segment header. By default, arrays with more than 100 elements are excluded in order to limit memory usage. This threshold can be adjusted, seeHRITMSGFileHandler
.The
acq_time
coordinate provides the acquisition time for each scanline. Use aMultiIndex
to enable selection by acquisition time:import pandas as pd mi = pd.MultiIndex.from_arrays([scn['IR_108']['y'].data, scn['IR_108']['acq_time'].data], names=('y_coord', 'time')) scn['IR_108']['y'] = mi scn['IR_108'].sel(time=np.datetime64('2019-03-01T12:06:13.052000000'))
Notes
When loading solar channels, this reader applies a correction for the Sun-Earth distance variation throughout the year - as recommended by the EUMETSAT document:
‘Conversion from radiances to reflectances for SEVIRI warm channels’
In the unlikely situation that this correction is not required, it can be removed on a per-channel basis using the satpy.readers.utils.remove_earthsun_distance_correction(channel, utc_time) function.
References
Radiometric Calibration of MSG SEVIRI Level 1.5 Image Data in Equivalent Spectral Blackbody Radiance
Conversion from radiances to reflectances for SEVIRI warm channels
-
class
satpy.readers.seviri_l1b_hrit.
HRITMSGEpilogueFileHandler
(filename, filename_info, filetype_info, calib_mode='nominal', ext_calib_coefs=None, mda_max_array_size=None, fill_hrv=None)[source]¶ Bases:
satpy.readers.seviri_l1b_hrit.HRITMSGPrologueEpilogueBase
SEVIRI HRIT epilogue reader.
Initialize the reader.
-
class
satpy.readers.seviri_l1b_hrit.
HRITMSGFileHandler
(filename, filename_info, filetype_info, prologue, epilogue, calib_mode='nominal', ext_calib_coefs=None, mda_max_array_size=100, fill_hrv=True)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
,satpy.readers.seviri_base.SEVIRICalibrationHandler
SEVIRI HRIT format reader.
Calibration
It is possible to choose between two file-internal calibration coefficients for the conversion from counts to radiances:
Nominal for all channels (default)
GSICS for IR channels and nominal for VIS channels
In order to change the default behaviour, use the
reader_kwargs
upon Scene creation:import satpy import glob filenames = glob.glob('H-000-MSG3*') scene = satpy.Scene(filenames, reader='seviri_l1b_hrit', reader_kwargs={'calib_mode': 'GSICS'}) scene.load(['VIS006', 'IR_108'])
Furthermore, it is possible to specify external calibration coefficients for the conversion from counts to radiances. They must be specified in [mW m-2 sr-1 (cm-1)-1]. External coefficients take precedence over internal coefficients. If external calibration coefficients are specified for only a subset of channels, the remaining channels will be calibrated using the chosen file-internal coefficients (nominal or GSICS).
In the following example we use external calibration coefficients for the
VIS006
&IR_108
channels, and nominal coefficients for the remaining channels:coefs = {'VIS006': {'gain': 0.0236, 'offset': -1.20}, 'IR_108': {'gain': 0.2156, 'offset': -10.4}} scene = satpy.Scene(filenames, reader='seviri_l1b_hrit', reader_kwargs={'ext_calib_coefs': coefs}) scene.load(['VIS006', 'VIS008', 'IR_108', 'IR_120'])
In the next example we use we use external calibration coefficients for the
VIS006
&IR_108
channels, nominal coefficients for the remaining VIS channels and GSICS coefficients for the remaining IR channels:coefs = {'VIS006': {'gain': 0.0236, 'offset': -1.20}, 'IR_108': {'gain': 0.2156, 'offset': -10.4}} scene = satpy.Scene(filenames, reader='seviri_l1b_hrit', reader_kwargs={'calib_mode': 'GSICS', 'ext_calib_coefs': coefs}) scene.load(['VIS006', 'VIS008', 'IR_108', 'IR_120'])
Raw Metadata
By default, arrays with more than 100 elements are excluded from the raw reader metadata to limit memory usage. This threshold can be adjusted using the mda_max_array_size keyword argument:
scene = satpy.Scene(filenames, reader='seviri_l1b_hrit', reader_kwargs={'mda_max_array_size': 1000})
Padding of the HRV channel
By default, the HRV channel is loaded padded with no-data, that is it is returned as a full-disk dataset. If you want the original, unpadded, data, just provide the fill_hrv as False in the reader_kwargs:
scene = satpy.Scene(filenames, reader='seviri_l1b_hrit', reader_kwargs={'fill_hrv': False})
Initialize the reader.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
class
satpy.readers.seviri_l1b_hrit.
HRITMSGPrologueEpilogueBase
(filename, filename_info, filetype_info, hdr_info)[source]¶ Bases:
satpy.readers.hrit_base.HRITFileHandler
Base reader for prologue and epilogue files.
Initialize the file handler for prologue and epilogue files.
-
class
satpy.readers.seviri_l1b_hrit.
HRITMSGPrologueFileHandler
(filename, filename_info, filetype_info, calib_mode='nominal', ext_calib_coefs=None, mda_max_array_size=None, fill_hrv=None)[source]¶ Bases:
satpy.readers.seviri_l1b_hrit.HRITMSGPrologueEpilogueBase
SEVIRI HRIT prologue reader.
Initialize the reader.
-
get_earth_radii
()[source]¶ Get earth radii from prologue.
- Returns
Equatorial radius, polar radius [m]
-
satpy.readers.seviri_l1b_icare module¶
Interface to SEVIRI L1B data from ICARE (Lille).
Introduction¶
The seviri_l1b_icare
reader reads MSG-SEVIRI L1.5 image data in HDF format
that has been produced by the ICARE Data and Services Center
Data can be accessed via: http://www.icare.univ-lille1.fr
Each SEVIRI timeslot comes as 12 HDF files, one per band. Only those bands that are of interest need to be passed to the reader. Others can be ignored. Filenames follow the format: GEO_L1B-MSG1_YYYY-MM-DDTHH-MM-SS_G_CHANN_VX-XX.hdf Where: YYYY, MM, DD, HH, MM, SS specify the timeslot starting time. CHANN is the channel (i.e: HRV, IR016, WV073, etc) VX-XX is the processing version number
Example
Here is an example how to read the data in satpy:
from satpy import Scene
import glob
filenames = glob.glob('data/*2019-03-01T12-00-00*.hdf')
scn = Scene(filenames=filenames, reader='seviri_l1b_icare')
scn.load(['VIS006', 'IR_108'])
print(scn['IR_108'])
Output:
<xarray.DataArray 'array-a1d52b7e19ec5a875e2f038df5b60d7e' (y: 3712, x: 3712)>
dask.array<add, shape=(3712, 3712), dtype=float32, chunksize=(1024, 1024), chunktype=numpy.ndarray>
Coordinates:
crs object +proj=geos +a=6378169.0 +b=6356583.8 +lon_0=0.0 +h=35785831.0 +units=m +type=crs
* y (y) float64 5.566e+06 5.563e+06 5.56e+06 ... -5.566e+06 -5.569e+06
* x (x) float64 -5.566e+06 -5.563e+06 -5.56e+06 ... 5.566e+06 5.569e+06
Attributes:
start_time: 2004-12-29 12:15:00
end_time: 2004-12-29 12:27:44
area: Area ID: geosmsg\nDescription: MSG/SEVIRI low resol...
name: IR_108
resolution: 3000.403165817
calibration: brightness_temperature
polarization: None
level: None
modifiers: ()
ancillary_variables: []
-
class
satpy.readers.seviri_l1b_icare.
SEVIRI_ICARE
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf4_utils.HDF4FileHandler
SEVIRI L1B handler for HDF4 files.
Init the file handler.
-
property
alt
¶ Get the altitude.
-
property
end_time
¶ Get the end time.
-
property
geoloc
¶ Get the geolocation.
-
property
projection
¶ Get the projection.
-
property
projlon
¶ Get the projection longitude.
-
property
res
¶ Get the resolution.
-
property
satlon
¶ Get the satellite longitude.
-
property
sensor_name
¶ Get the sensor name.
-
property
start_time
¶ Get the start time.
-
property
zone
¶ Get the zone.
-
property
satpy.readers.seviri_l1b_native module¶
SEVIRI native format reader.
Notes
When loading solar channels, this reader applies a correction for the Sun-Earth distance variation throughout the year - as recommended by the EUMETSAT document:
‘Conversion from radiances to reflectances for SEVIRI warm channels’
In the unlikely situation that this correction is not required, it can be removed on a per-channel basis using the satpy.readers.utils.remove_earthsun_distance_correction(channel, utc_time) function.
References
-
class
satpy.readers.seviri_l1b_native.
NativeMSGFileHandler
(filename, filename_info, filetype_info, calib_mode='nominal')[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
,satpy.readers.seviri_base.SEVIRICalibrationHandler
SEVIRI native format reader.
The Level1.5 Image data calibration method can be changed by adding the required mode to the Scene object instantiation kwargs eg kwargs = {“calib_mode”: “gsics”,}
Initialize the reader.
-
property
end_time
¶ Read the repeat cycle end time from metadata.
-
get_area_extent
(dataset_id)[source]¶ Get the area extent of the file.
Until December 2017, the data is shifted by 1.5km SSP North and West against the nominal GEOS projection. Since December 2017 this offset has been corrected. A flag in the data indicates if the correction has been applied. If no correction was applied, adjust the area extent to match the shifted data.
For more information see Section 3.1.4.2 in the MSG Level 1.5 Image Data Format Description. The correction of the area extent is documented in a developer’s memo.
-
property
start_time
¶ Read the repeat cycle start time from metadata.
-
property
satpy.readers.seviri_l1b_native_hdr module¶
Header and trailer records of SEVIRI native format.
-
class
satpy.readers.seviri_l1b_native_hdr.
GSDTRecords
[source]¶ Bases:
object
MSG Ground Segment Data Type records.
Reference Document (EUM/MSG/SPE/055): MSG Ground Segment Design Specification (GSDS)
-
gp_cpu_address
= [('Qualifier_1', <class 'numpy.uint8'>), ('Qualifier_2', <class 'numpy.uint8'>), ('Qualifier_3', <class 'numpy.uint8'>), ('Qualifier_4', <class 'numpy.uint8'>)]¶
-
gp_fac_env
¶ alias of
numpy.uint8
-
gp_fac_id
¶ alias of
numpy.uint8
-
gp_pk_header
= [('HeaderVersionNo', <class 'numpy.uint8'>), ('PacketType', <class 'numpy.uint8'>), ('SubHeaderType', <class 'numpy.uint8'>), ('SourceFacilityId', <class 'numpy.uint8'>), ('SourceEnvId', <class 'numpy.uint8'>), ('SourceInstanceId', <class 'numpy.uint8'>), ('SourceSUId', <class 'numpy.uint32'>), ('SourceCPUId', [('Qualifier_1', <class 'numpy.uint8'>), ('Qualifier_2', <class 'numpy.uint8'>), ('Qualifier_3', <class 'numpy.uint8'>), ('Qualifier_4', <class 'numpy.uint8'>)]), ('DestFacilityId', <class 'numpy.uint8'>), ('DestEnvId', <class 'numpy.uint8'>), ('SequenceCount', <class 'numpy.uint16'>), ('PacketLength', <class 'numpy.int32'>)]¶
-
gp_pk_sh1
= [('SubHeaderVersionNo', <class 'numpy.uint8'>), ('ChecksumFlag', <class 'bool'>), ('Acknowledgement', (<class 'numpy.uint8'>, 4)), ('ServiceType', <class 'numpy.uint8'>), ('ServiceSubtype', <class 'numpy.uint8'>), ('PacketTime', [('Days', '>u2'), ('Milliseconds', '>u4')]), ('SpacecraftId', <class 'numpy.uint16'>)]¶
-
gp_sc_id
¶ alias of
numpy.uint16
-
gp_su_id
¶ alias of
numpy.uint32
-
gp_svce_type
¶ alias of
numpy.uint8
-
-
class
satpy.readers.seviri_l1b_native_hdr.
HritPrologue
[source]¶ Bases:
satpy.readers.seviri_l1b_native_hdr.L15DataHeaderRecord
-
class
satpy.readers.seviri_l1b_native_hdr.
L15DataHeaderRecord
[source]¶ Bases:
object
Reference Document (EUM/MSG/ICD/105): MSG Level 1.5 Image Data Format Description
-
property
celestial_events
¶
-
property
geometric_processing
¶
-
property
image_acquisition
¶
-
property
image_description
¶
-
property
impf_configuration
¶
-
property
radiometric_processing
¶
-
property
satellite_status
¶
-
property
-
class
satpy.readers.seviri_l1b_native_hdr.
L15MainProductHeaderRecord
[source]¶ Bases:
object
Reference Document: MSG Level 1.5 Native Format File Definition
-
class
satpy.readers.seviri_l1b_native_hdr.
L15PhData
[source]¶ Bases:
object
-
l15_ph_data
= [('Name', 'S30'), ('Value', 'S50')]¶
-
-
class
satpy.readers.seviri_l1b_native_hdr.
L15SecondaryProductHeaderRecord
[source]¶ Bases:
object
Reference Document: MSG Level 1.5 Native Format File Definition
-
class
satpy.readers.seviri_l1b_native_hdr.
Msg15NativeHeaderRecord
[source]¶ Bases:
object
SEVIRI Level 1.5 header for native-format
-
class
satpy.readers.seviri_l1b_native_hdr.
Msg15NativeTrailerRecord
[source]¶ Bases:
object
SEVIRI Level 1.5 trailer for native-format
Reference Document (EUM/MSG/ICD/105): MSG Level 1.5 Image Data Format Description
-
property
geometric_quality
¶
-
property
image_production_stats
¶
-
property
radiometric_quality
¶
-
property
seviri_l15_trailer
¶
-
property
timeliness_and_completeness
¶
-
property
satpy.readers.seviri_l1b_nc module¶
SEVIRI netcdf format reader.
Notes
When loading solar channels, this reader applies a correction for the Sun-Earth distance variation throughout the year - as recommended by the EUMETSAT document:
‘Conversion from radiances to reflectances for SEVIRI warm channels’
In the unlikely situation that this correction is not required, it can be removed on a per-channel basis using the satpy.readers.utils.remove_earthsun_distance_correction(channel, utc_time) function.
References
-
class
satpy.readers.seviri_l1b_nc.
NCSEVIRIFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
,satpy.readers.seviri_base.SEVIRICalibrationHandler
File handler for NC seviri files.
Init the file handler.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
-
class
satpy.readers.seviri_l1b_nc.
NCSEVIRIHRVFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
,satpy.readers.seviri_base.SEVIRICalibrationHandler
HRV filehandler.
Initialize file handler.
satpy.readers.seviri_l2_bufr module¶
SEVIRI L2 BUFR format reader.
-
class
satpy.readers.seviri_l2_bufr.
SeviriL2BufrFileHandler
(filename, filename_info, filetype_info, **kwargs)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for SEVIRI L2 BUFR products.
Initialise the file handler for SEVIRI L2 BUFR data.
-
property
end_time
¶ Return the repeat cycle end time.
-
property
platform_name
¶ Return spacecraft name.
-
property
ssp_lon
¶ Return subsatellite point longitude.
-
property
start_time
¶ Return the repeat cycle start time.
-
property
satpy.readers.seviri_l2_grib module¶
Reader for the SEVIRI L2 products in GRIB2 format.
References
FM 92 GRIB Edition 2 https://www.wmo.int/pages/prog/www/WMOCodes/Guides/GRIB/GRIB2_062006.pdf
-
class
satpy.readers.seviri_l2_grib.
SeviriL2GribFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Reader class for SEVIRI L2 products in GRIB format.
Read the global attributes and prepare for dataset reading.
-
property
end_time
¶ Return the sensing end time.
-
get_dataset
(dataset_id, dataset_info)[source]¶ Get dataset using the parameter_number key in dataset_info.
-
property
start_time
¶ Return the sensing start time.
-
property
satpy.readers.slstr_l1b module¶
SLSTR L1b reader.
-
class
satpy.readers.slstr_l1b.
NCSLSTR1B
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Filehandler for l1 SLSTR data.
Initialize the SLSTR l1 data filehandler.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
-
class
satpy.readers.slstr_l1b.
NCSLSTRAngles
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Filehandler for angles.
Initialize the angles reader.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
-
class
satpy.readers.slstr_l1b.
NCSLSTRFlag
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for flags.
Initialize the flag reader.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
-
class
satpy.readers.slstr_l1b.
NCSLSTRGeo
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
Filehandler for geo info.
Initialize the geo filehandler.
-
property
end_time
¶ Get the end time.
-
property
start_time
¶ Get the start time.
-
property
satpy.readers.slstr_l2 module¶
Reader for Sentinel-3 SLSTR SST data.
-
class
satpy.readers.slstr_l2.
SLSTRL2FileHandler
(filename, filename_info, filetype_info, engine=None)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
File handler for Sentinel-3 SSL L2 netCDF files.
Initialize the file handler for Sentinel-3 SSL L2 netCDF data.
-
property
end_time
¶ Get end time.
-
property
start_time
¶ Get start time.
-
property
satpy.readers.smos_l2_wind module¶
SMOS L2 wind Reader.
Data can be found here after register: https://www.smosstorm.org/Data2/SMOS-NRT-wind-Products-access Format documentation at the same site after register: SMOS_WIND_DS_PDD_20191107_signed.pdf
-
class
satpy.readers.smos_l2_wind.
SMOSL2WINDFileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
File handler for SMOS L2 wind netCDF files.
Initialize object.
-
available_datasets
(configured_datasets=None)[source]¶ Automatically determine datasets provided by this file.
-
property
end_time
¶ Get end time.
-
property
platform_name
¶ Get platform.
-
property
platform_shortname
¶ Get platform shortname.
-
property
start_time
¶ Get start time.
-
satpy.readers.tropomi_l2 module¶
Interface to TROPOMI L2 Reader.
The TROPOspheric Monitoring Instrument (TROPOMI) is the satellite instrument on board the Copernicus Sentinel-5 Precursor satellite. It measures key atmospheric trace gasses, such as ozone, nitrogen oxides, sulfur dioxide, carbon monoxide, methane, and formaldehyde.
Level 2 data products are available via the Copernicus Open Access Hub. For more information visit the following URL: http://www.tropomi.eu/data-products/level-2-products
-
class
satpy.readers.tropomi_l2.
TROPOMIL2FileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
File handler for TROPOMI L2 netCDF files.
Initialize object.
-
available_datasets
(configured_datasets=None)[source]¶ Automatically determine datasets provided by this file.
-
property
end_time
¶ Get end time.
-
property
platform_shortname
¶ Get platform shortname.
-
prepare_geo
(bounds_data)[source]¶ Prepare lat/lon bounds for pcolormesh.
lat/lon bounds are ordered in the following way:
3----2 | | 0----1
Extend longitudes and latitudes with one element to support “pcolormesh”:
(X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1]) +--------+ | C[i,j] | +--------+ (X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
-
property
sensor
¶ Get sensor.
-
property
sensor_names
¶ Get sensor set.
-
property
start_time
¶ Get start time.
-
satpy.readers.utils module¶
Helper functions for satpy readers.
-
satpy.readers.utils.
apply_earthsun_distance_correction
(reflectance, utc_date=None)[source]¶ Correct reflectance data to account for changing Earth-Sun distance.
-
satpy.readers.utils.
apply_rad_correction
(data, slope, offset)[source]¶ Apply GSICS-like correction factors to radiance data.
-
satpy.readers.utils.
bbox
(img)[source]¶ Find the bounding box around nonzero elements in the given array.
Copied from https://stackoverflow.com/a/31402351/5703449 .
- Returns
rowmin, rowmax, colmin, colmax
-
satpy.readers.utils.
get_array_date
(scn_data, utc_date=None)[source]¶ Get start time from a channel data array.
-
satpy.readers.utils.
get_earth_radius
(lon, lat, a, b)[source]¶ Compute radius of the earth ellipsoid at the given longitude and latitude.
- Parameters
lon – Geodetic longitude (degrees)
lat – Geodetic latitude (degrees)
a – Semi-major axis of the ellipsoid (meters)
b – Semi-minor axis of the ellipsoid (meters)
- Returns
Earth Radius (meters)
-
satpy.readers.utils.
get_geostationary_angle_extent
(geos_area)[source]¶ Get the max earth (vs space) viewing angles in x and y.
-
satpy.readers.utils.
get_geostationary_bounding_box
(geos_area, nb_points=50)[source]¶ Get the bbox in lon/lats of the valid pixels inside geos_area.
- Parameters
geos_area – The geostationary area to analyse.
nb_points – Number of points on the polygon
-
satpy.readers.utils.
get_geostationary_mask
(area)[source]¶ Compute a mask of the earth’s shape as seen by a geostationary satellite.
- Parameters
area (pyresample.geometry.AreaDefinition) – Corresponding area definition
- Returns
Boolean mask, True inside the earth’s shape, False outside.
-
satpy.readers.utils.
get_sub_area
(area, xslice, yslice)[source]¶ Apply slices to the area_extent and size of the area.
-
satpy.readers.utils.
get_user_calibration_factors
(band_name, correction_dict)[source]¶ Retrieve radiance correction factors from user-supplied dict.
-
satpy.readers.utils.
np2str
(value)[source]¶ Convert an numpy.string_ to str.
- Parameters
value (ndarray) – scalar or 1-element numpy array to convert
- Raises
ValueError – if value is array larger than 1-element or it is not of type numpy.string_ or it is not a numpy array
-
satpy.readers.utils.
reduce_mda
(mda, max_size=100)[source]¶ Recursively remove arrays with more than max_size elements from the given metadata dictionary.
satpy.readers.vaisala_gld360 module¶
Vaisala Global Lightning Dataset 360 reader.
Vaisala Global Lightning Dataset GLD360 is data as a service that provides real-time lightning data for accurate and early detection and tracking of severe weather. The data provided is generated by a Vaisala owned and operated world-wide lightning detection sensor network.
References: - [GLD360] https://www.vaisala.com/en/products/data-subscriptions-and-reports/data-sets/gld360
-
class
satpy.readers.vaisala_gld360.
VaisalaGLD360TextFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
ASCII reader for Vaisala GDL360 data.
Initialize VaisalaGLD360TextFileHandler.
-
property
end_time
¶ Get end time.
-
property
start_time
¶ Get start time.
-
property
satpy.readers.vii_base_nc module¶
EUMETSAT EPS-SG Visible/Infrared Imager (VII) readers base class.
-
class
satpy.readers.vii_base_nc.
ViiNCBaseFileHandler
(filename, filename_info, filetype_info, orthorect=False)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
Base reader class for VII products in netCDF format.
- Parameters
filename (str) – File to read
filename_info (dict) – Dictionary with filename information
filetype_info (dict) – Dictionary with filetype information
orthorect (bool) – activates the orthorectification correction where available
Prepare the class for dataset reading.
-
property
end_time
¶ Get observation end time.
-
property
sensor
¶ Return sensor.
-
property
spacecraft_name
¶ Return spacecraft name.
-
property
ssp_lon
¶ Return subsatellite point longitude.
-
property
start_time
¶ Get observation start time.
satpy.readers.vii_l1b_nc module¶
EUMETSAT EPS-SG Visible/Infrared Imager (VII) Level 1B products reader.
The vii_l1b_nc
reader reads and calibrates EPS-SG VII L1b image data in netCDF format. The format is explained
in the `EPS-SG VII Level 1B Product Format Specification`_.
References:
.. _EPS-SG VII Level 1B Product Format Specification: https://www.eumetsat.int/website/wcm/idc/idcplg?IdcService
=GET_FILE&dDocName=PDF_EPSSG_VII_L1B_PFS&RevisionSelectionMethod=LatestReleased&Rendition=Web
-
class
satpy.readers.vii_l1b_nc.
ViiL1bNCFileHandler
(filename, filename_info, filetype_info, **kwargs)[source]¶ Bases:
satpy.readers.vii_base_nc.ViiNCBaseFileHandler
Reader class for VII L1B products in netCDF format.
Read the calibration data and prepare the class for dataset reading.
satpy.readers.vii_l2_nc module¶
EUMETSAT EPS-SG Visible/Infrared Imager (VII) Level 2 products reader.
-
class
satpy.readers.vii_l2_nc.
ViiL2NCFileHandler
(filename, filename_info, filetype_info, orthorect=False)[source]¶ Bases:
satpy.readers.vii_base_nc.ViiNCBaseFileHandler
Reader class for VII L2 products in netCDF format.
Prepare the class for dataset reading.
satpy.readers.vii_utils module¶
Utilities for the management of VII products.
satpy.readers.viirs_compact module¶
Compact viirs format.
This is a reader for the Compact VIIRS format shipped on Eumetcast for the VIIRS SDR. The format is compressed in multiple ways, notably by shipping only tie-points for geographical data. The interpolation of this data is done using dask operations, so it should be relatively performant.
For more information on this format, the reader can refer to the Compact VIIRS SDR Product Format User Guide that can be found on this EARS page.
-
class
satpy.readers.viirs_compact.
VIIRSCompactFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
A file handler class for VIIRS compact format.
Initialize the reader.
-
property
end_time
¶ Get the end time.
Expand angle and navigation datasets.
-
property
expansion_coefs
¶ Compute the expansion coefficients.
Generate the navigation datasets.
-
property
start_time
¶ Get the start time.
-
property
-
satpy.readers.viirs_compact.
convert_from_angles
(azi, zen)[source]¶ Convert the angles to cartesian coordinates.
satpy.readers.viirs_edr_active_fires module¶
VIIRS Active Fires reader.
This module implements readers for VIIRS Active Fires NetCDF and ASCII files.
-
class
satpy.readers.viirs_edr_active_fires.
VIIRSActiveFiresFileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
NetCDF4 reader for VIIRS Active Fires.
Open and perform initial investigation of NetCDF file.
-
property
end_time
¶ Get last date/time when observations were recorded.
-
get_dataset
(dsid, dsinfo)[source]¶ Get requested data as DataArray.
- Parameters
dsid – Dataset ID
param2 – Dataset Information
- Returns
Data
- Return type
Dask DataArray
-
property
platform_name
¶ Name of platform/satellite for this file.
-
property
sensor_name
¶ Name of sensor for this file.
-
property
start_time
¶ Get first date/time when observations were recorded.
-
property
-
class
satpy.readers.viirs_edr_active_fires.
VIIRSActiveFiresTextFileHandler
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.file_handlers.BaseFileHandler
ASCII reader for VIIRS Active Fires.
Make sure filepath is valid and then reads data into a Dask DataFrame.
- Parameters
filename – Filename
filename_info – Filename information
filetype_info – Filetype information
-
property
end_time
¶ Get last date/time when observations were recorded.
-
property
start_time
¶ Get first date/time when observations were recorded.
satpy.readers.viirs_edr_flood module¶
Interface to VIIRS flood product.
-
class
satpy.readers.viirs_edr_flood.
VIIRSEDRFlood
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf4_utils.HDF4FileHandler
VIIRS EDR Flood-product handler for HDF4 files.
Open file and collect information.
-
property
end_time
¶ Get end time.
-
property
platform_name
¶ Get platform name.
-
property
sensor_name
¶ Get sensor name.
-
property
start_time
¶ Get start time.
-
property
satpy.readers.viirs_l1b module¶
Interface to VIIRS L1B format.
-
class
satpy.readers.viirs_l1b.
VIIRSL1BFileHandler
(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None, cache_var_size=0, cache_handle=False)[source]¶ Bases:
satpy.readers.netcdf_utils.NetCDF4FileHandler
VIIRS L1B File Reader.
Initialize object.
-
property
end_orbit_number
¶ Get end orbit number.
-
property
end_time
¶ Get end time.
-
property
platform_name
¶ Get platform name.
-
property
sensor_name
¶ Get sensor name.
-
property
start_orbit_number
¶ Get start orbit number.
-
property
start_time
¶ Get start time.
-
property
satpy.readers.viirs_sdr module¶
Interface to VIIRS SDR format.
This reader implements the support of VIIRS SDR files as produced by CSPP and CLASS. It is comprised of two parts:
A subclass of the YAMLFileReader class to allow handling all the files
A filehandler class to implement the actual reading
Format documentation:
-
class
satpy.readers.viirs_sdr.
VIIRSSDRFileHandler
(filename, filename_info, filetype_info, use_tc=None, **kwargs)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
VIIRS HDF5 File Reader.
Initialize file handler.
-
available_datasets
(configured_datasets=None)[source]¶ Generate dataset info and their availablity.
See
satpy.readers.file_handlers.BaseFileHandler.available_datasets()
for details.
-
property
end_orbit_number
¶ Get end orbit number.
-
property
end_time
¶ Get end time.
-
static
expand_single_values
(var, scans)[source]¶ Expand single valued variable to full scan lengths.
-
get_dataset
(dataset_id, ds_info)[source]¶ Get the dataset corresponding to dataset_id.
The size of the return DataArray will be dependent on the number of scans actually sensed, and not necessarily the regular 768 scanlines that the file contains for each granule. To that end, the number of scans for each granule is read from:
Data_Products/...Gran_x/N_Number_Of_Scans
.
-
property
platform_name
¶ Get platform name.
-
scale_swath_data
(data, scaling_factors)[source]¶ Scale swath data using scaling factors and offsets.
Multi-granule (a.k.a. aggregated) files will have more than the usual two values.
-
property
sensor_name
¶ Get sensor name.
-
property
start_orbit_number
¶ Get start orbit number.
-
property
start_time
¶ Get start time.
-
-
class
satpy.readers.viirs_sdr.
VIIRSSDRReader
(config_files, use_tc=None, **kwargs)[source]¶ Bases:
satpy.readers.yaml_reader.FileYAMLReader
Custom file reader for finding VIIRS SDR geolocation at runtime.
Initialize file reader and adjust geolocation preferences.
- Parameters
config_files (iterable) – yaml config files passed to base class
use_tc (boolean) – If True use the terrain corrected files. If False, switch to non-TC files. If None (default), use TC if available, non-TC otherwise.
satpy.readers.virr_l1b module¶
Interface to VIRR (Visible and Infra-Red Radiometer) level 1b format.
The file format is HDF5. Important attributes:
Latitude
Longitude
SolarZenith
EV_Emissive
EV_RefSB
Emissive_Radiance_Offsets
Emissive_Radiance_Scales
RefSB_Cal_Coefficients
RefSB_Effective_Wavelength
Emmisive_Centroid_Wave_Number
Supported satellites:
FY-3B and FY-3C.
For more information:
-
class
satpy.readers.virr_l1b.
VIRR_L1B
(filename, filename_info, filetype_info)[source]¶ Bases:
satpy.readers.hdf5_utils.HDF5FileHandler
VIRR Level 1b reader.
Open file and perform initial setup.
-
property
end_time
¶ Get ending observation time.
-
property
start_time
¶ Get starting observation time.
-
property
satpy.readers.xmlformat module¶
Reads a format from an xml file to create dtypes and scaling factor arrays.
-
class
satpy.readers.xmlformat.
XMLFormat
(filename)[source]¶ Bases:
object
XMLFormat object.
Init the format reader.
satpy.readers.yaml_reader module¶
Base classes and utilities for all readers configured by YAML files.
-
class
satpy.readers.yaml_reader.
AbstractYAMLReader
(config_dict)[source]¶ Bases:
object
Base class for all readers that use YAML configuration files.
This class should only be used in rare cases. Its child class FileYAMLReader should be used in most cases.
Load information from YAML configuration file about how to read data files.
-
property
all_dataset_ids
¶ Get DataIDs of all datasets known to this reader.
-
property
all_dataset_names
¶ Get names of all datasets known to this reader.
-
property
available_dataset_ids
¶ Get DataIDs that are loadable by this reader.
-
property
available_dataset_names
¶ Get names of datasets that are loadable by this reader.
-
abstract property
end_time
¶ End time of the reader.
-
abstract
filter_selected_filenames
(filenames)[source]¶ Filter provided filenames by parameters in reader configuration.
Returns: iterable of usable files
-
classmethod
from_config_files
(*config_files, **reader_kwargs)[source]¶ Create a reader instance from one or more YAML configuration files.
-
get_dataset_key
(key, **kwargs)[source]¶ Get the fully qualified DataID matching key.
See satpy.readers.get_key for more information about kwargs.
-
select_files_from_directory
(directory=None, fs=None)[source]¶ Find files for this reader in directory.
If directory is None or ‘’, look in the current directory.
Searches the local file system by default. Can search on a remote filesystem by passing an instance of a suitable implementation of
fsspec.spec.AbstractFileSystem
.- Parameters
directory (Optional[str]) – Path to search.
fs (Optional[FileSystem]) – fsspec FileSystem implementation to use. Defaults to None, using local file system.
- Returns
list of strings describing matching files
-
select_files_from_pathnames
(filenames)[source]¶ Select the files from filenames this reader can handle.
-
property
sensor_names
¶ Names of sensors whose data is being loaded by this reader.
-
abstract property
start_time
¶ Start time of the reader.
-
property
-
class
satpy.readers.yaml_reader.
FileYAMLReader
(config_dict, filter_parameters=None, filter_filenames=True, **kwargs)[source]¶ Bases:
satpy.readers.yaml_reader.AbstractYAMLReader
Primary reader base class that is configured by a YAML file.
This class uses the idea of per-file “file handler” objects to read file contents and determine what is available in the file. This differs from the base
AbstractYAMLReader
which does not depend on individual file handler objects. In almost all cases this class should be used over its base class and can be used as a reader by itself and requires no subclassing.Set up initial internal storage for loading file data.
-
property
available_dataset_ids
¶ Get DataIDs that are loadable by this reader.
-
static
check_file_covers_area
(file_handler, check_area)[source]¶ Check if the file covers the current area.
If the file doesn’t provide any bounding box information or ‘area’ was not provided in filter_parameters, the check returns True.
-
create_filehandlers
(filenames, fh_kwargs=None)[source]¶ Organize the filenames into file types and create file handlers.
-
property
end_time
¶ End time of the latest file used by this reader.
-
static
filename_items_for_filetype
(filenames, filetype_info)[source]¶ Iterate over the filenames matching filetype_info.
-
filter_fh_by_metadata
(filehandlers)[source]¶ Filter out filehandlers using provide filter parameters.
-
filter_filenames_by_info
(filename_items)[source]¶ Filter out file using metadata from the filenames.
Currently only uses start and end time. If only start time is available from the filename, keep all the filename that have a start time before the requested end time.
-
filter_selected_filenames
(filenames)[source]¶ Filter provided files based on metadata in the filename.
-
find_required_filehandlers
(requirements, filename_info)[source]¶ Find the necessary file handlers for the given requirements.
We assume here requirements are available.
- Raises
KeyError, if no handler for the given requirements is available. –
RuntimeError, if there is a handler for the given requirements, –
but it doesn't match the filename info. –
-
get_dataset_key
(key, available_only=False, **kwargs)[source]¶ Get the fully qualified DataID matching key.
This will first search through available DataIDs, datasets that should be possible to load, and fallback to “known” datasets, those that are configured but aren’t loadable from the provided files. Providing
available_only=True
will stop this fallback behavior and raise aKeyError
exception if no available dataset is found.- Parameters
key (str, float, DataID, DataQuery) – Key to search for in this reader.
available_only (bool) – Search only loadable datasets for the provided key. Loadable datasets are always searched first, but if
available_only=False
(default) then all known datasets will be searched.kwargs – See
satpy.readers.get_key()
for more information about kwargs.
- Returns
Best matching DataID to the provided
key
.- Raises
KeyError – if no key match is found.
-
load
(dataset_keys, previous_datasets=None, **kwargs)[source]¶ Load dataset_keys.
If previous_datasets is provided, do not reload those.
-
metadata_matches
(sample_dict, file_handler=None)[source]¶ Check that file metadata matches filter_parameters of this reader.
-
property
sensor_names
¶ Names of sensors whose data is being loaded by this reader.
-
property
start_time
¶ Start time of the earlier file used by this reader.
-
time_matches
(fstart, fend)[source]¶ Check that a file’s start and end time mtach filter_parameters of this reader.
-
update_ds_ids_from_file_handlers
()[source]¶ Add or modify available dataset information.
Each file handler is consulted on whether or not it can load the dataset with the provided information dictionary. See
satpy.readers.file_handlers.BaseFileHandler.available_datasets()
for more information.
-
property
-
class
satpy.readers.yaml_reader.
GEOFlippableFileYAMLReader
(config_dict, filter_parameters=None, filter_filenames=True, **kwargs)[source]¶ Bases:
satpy.readers.yaml_reader.FileYAMLReader
Reader for flippable geostationary data.
Set up initial internal storage for loading file data.
-
class
satpy.readers.yaml_reader.
GEOSegmentYAMLReader
(config_dict, filter_parameters=None, filter_filenames=True, **kwargs)[source]¶ Bases:
satpy.readers.yaml_reader.GEOFlippableFileYAMLReader
Reader for segmented geostationary data.
This reader pads the data to full geostationary disk if necessary.
This reader uses an optional
pad_data
keyword argument that can be passed toScene.load()
to control if padding is done (True by default). Passing pad_data=False will return data unpadded.When using this class in a reader’s YAML configuration, segmented file types (files that may have multiple segments) should specify an extra
expected_segments
piece of file_type metadata. This tells this reader how many total segments it should expect when padding data. Alternatively, the file patterns for a file type can include atotal_segments
field which will be used ifexpected_segments
is not defined. This will default to 1 segment.Set up initial internal storage for loading file data.
-
satpy.readers.yaml_reader.
listify_string
(something)[source]¶ Take something and make it a list.
something is either a list of strings or a string, in which case the function returns a list containing the string. If something is None, an empty list is returned.
-
satpy.readers.yaml_reader.
load_yaml_configs
(*config_files, loader=<class 'yaml.loader.UnsafeLoader'>)[source]¶ Merge a series of YAML reader configuration files.
- Parameters
*config_files (str) – One or more pathnames to YAML-based reader configuration files that will be merged to create a single configuration.
loader – Yaml loader object to load the YAML with. Defaults to UnsafeLoader.
- Returns: dict
Dictionary representing the entire YAML configuration with the addition of config[‘reader’][‘config_files’] (the list of YAML pathnames that were merged).
Module contents¶
Shared objects of the various reader classes.
-
satpy.readers.
available_readers
(as_dict=False)[source]¶ Available readers based on current configuration.
- Parameters
as_dict (bool) – Optionally return reader information as a dictionary. Default: False
- Returns: List of available reader names. If as_dict is True then
a list of dictionaries including additionally reader information is returned.
-
satpy.readers.
configs_for_reader
(reader=None, ppp_config_dir=None)[source]¶ Generate reader configuration files for one or more readers.
- Parameters
reader (Optional[str]) – Yield configs only for this reader
ppp_config_dir (Optional[str]) – Additional configuration directory to search for reader configuration files.
Returns: Generator of lists of configuration files
-
satpy.readers.
find_files_and_readers
(start_time=None, end_time=None, base_dir=None, reader=None, sensor=None, ppp_config_dir=None, filter_parameters=None, reader_kwargs=None, missing_ok=False, fs=None)[source]¶ Find files matching the provided parameters.
Use start_time and/or end_time to limit found filenames by the times in the filenames (not the internal file metadata). Files are matched if they fall anywhere within the range specified by these parameters.
Searching is NOT recursive.
Files may be either on-disk or on a remote file system. By default, files are searched for locally. Users can search on remote filesystems by passing an instance of an implementation of fsspec.spec.AbstractFileSystem (strictly speaking, any object of a class implementing a
glob
method works).If locating files on a local file system, the returned dictionary can be passed directly to the Scene object through the filenames keyword argument. If it points to a remote file system, it is the responsibility of the user to download the files first (directly reading from cloud storage is not currently available in Satpy).
The behaviour of time-based filtering depends on whether or not the filename contains information about the end time of the data or not:
if the end time is not present in the filename, the start time of the filename is used and has to fall between (inclusive) the requested start and end times
otherwise, the timespan of the filename has to overlap the requested timespan
Example usage for querying a s3 filesystem using the s3fs module:
>>> import s3fs, satpy.readers, datetime >>> satpy.readers.find_files_and_readers( ... base_dir="s3://noaa-goes16/ABI-L1b-RadF/2019/321/14/", ... fs=s3fs.S3FileSystem(anon=True), ... reader="abi_l1b", ... start_time=datetime.datetime(2019, 11, 17, 14, 40)) {'abi_l1b': [...]}
- Parameters
start_time (datetime) – Limit used files by starting time.
end_time (datetime) – Limit used files by ending time.
base_dir (str) – The directory to search for files containing the data to load. Defaults to the current directory.
reader (str or list) – The name of the reader to use for loading the data or a list of names.
sensor (str or list) – Limit used files by provided sensors.
ppp_config_dir (str) – The directory containing the configuration files for Satpy.
filter_parameters (dict) – Filename pattern metadata to filter on. start_time and end_time are automatically added to this dictionary. Shortcut for reader_kwargs[‘filter_parameters’].
reader_kwargs (dict) – Keyword arguments to pass to specific reader instances to further configure file searching.
missing_ok (bool) – If False (default), raise ValueError if no files are found. If True, return empty dictionary if no files are found.
fs (FileSystem) – Optional, instance of implementation of fsspec.spec.AbstractFileSystem (strictly speaking, any object of a class implementing
.glob
is enough). Defaults to searching the local filesystem.
Returns: Dictionary mapping reader name string to list of filenames
-
satpy.readers.
group_files
(files_to_sort, reader=None, time_threshold=10, group_keys=None, ppp_config_dir=None, reader_kwargs=None)[source]¶ Group series of files by file pattern information.
By default this will group files by their filename
start_time
assuming it exists in the pattern. By passing the individual dictionaries returned by this function to the Scene classes’filenames
, a series Scene objects can be easily created.New in version 0.12.
- Parameters
files_to_sort (iterable) – File paths to sort in to group
reader (str or Collection[str]) – Reader or readers whose file patterns should be used to sort files. If not given, try all readers (slow, adding a list of readers is strongly recommended).
time_threshold (int) – Number of seconds used to consider time elements in a group as being equal. For example, if the ‘start_time’ item is used to group files then any time within time_threshold seconds of the first file’s ‘start_time’ will be seen as occurring at the same time.
group_keys (list or tuple) – File pattern information to use to group files. Keys are sorted in order and only the first key is used when comparing datetime elements with time_threshold (see above). This means it is recommended that datetime values should only come from the first key in
group_keys
. Otherwise, there is a good chance that files will not be grouped properly (datetimes being barely unequal). Defaults to a reader’sgroup_keys
configuration (set in YAML), otherwise('start_time',)
. When passing multiple readers, passing group_keys is strongly recommended as the behaviour without doing so is undefined.ppp_config_dir (str) – Root usser configuration directory for Satpy. This will be deprecated in the future, but is here for consistency with other Satpy features.
reader_kwargs (dict) – Additional keyword arguments to pass to reader creation.
- Returns
List of dictionaries mapping ‘reader’ to a list of filenames. Each of these dictionaries can be passed as
filenames
to a Scene object.
-
satpy.readers.
load_reader
(reader_configs, **reader_kwargs)[source]¶ Import and setup the reader from reader_info.
-
satpy.readers.
load_readers
(filenames=None, reader=None, reader_kwargs=None, ppp_config_dir=None)[source]¶ Create specified readers and assign files to them.
- Parameters
filenames (iterable or dict) – A sequence of files that will be used to load data from. A
dict
object should map reader names to a list of filenames for that reader.reader (str or list) – The name of the reader to use for loading the data or a list of names.
reader_kwargs (dict) – Keyword arguments to pass to specific reader instances.
ppp_config_dir (str) – The directory containing the configuration files for satpy.
Returns: Dictionary mapping reader name to reader instance