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).

http://research.metoffice.gov.uk/research/interproj/nwpsaf/aapp/ NWPSAF-MF-UD-003_Formats.pdf

class satpy.readers.aapp_l1b.AVHRRAAPPL1BFile(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

calibrate(dataset_id, pre_launch_coeffs=False, calib_coeffs=None)

Calibrate the data

end_time
get_angles(angle_id)

Get sun-satellite viewing angles

get_dataset(key, info)

Get a dataset from the file.

navigate()

Return the longitudes and latitudes of the scene.

read()

Read the data.

shape()
start_time
satpy.readers.aapp_l1b.create_xarray(arr)

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_area_def(key)

Get the area definition of the data at hand.

get_dataset(key, info)

Load a dataset.

get_shape(key, info)

Get the shape of the data.

start_time

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)

Bases: satpy.readers.netcdf_utils.NetCDF4FileHandler

ACSPO L2P SST File Reader

end_time
get_dataset(dataset_id, ds_info, xslice=slice(None, None, None), yslice=slice(None, None, None))

Load data array and metadata from file on disk.

get_metadata(dataset_id, ds_info)
get_shape(ds_id, ds_info)

Get numpy array shape for the specified dataset.

Parameters:
  • ds_id (DatasetID) – ID of dataset that will be loaded
  • ds_info (dict) – Dictionary of dataset information from config file
Returns:

(rows, cols)

Return type:

tuple

platform_name
sensor_name
start_time

satpy.readers.ahi_hsd module

Advanced Himawari Imager (AHI) standard format data reader.

References

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

AHI standard format reader.

Initialize the reader.

calibrate(data, calibration)

Calibrate the data

convert_to_radiance(data)

Calibrate to radiance.

end_time
geo_mask()

Masking the space pixels from geometry info.

get_area_def(dsid)
get_dataset(key, info)
read_band(key, info)

Read the data.

scheduled_time

Time this band was scheduled to be recorded.

start_time

satpy.readers.amsr2_l1b module

Reader for AMSR2 L1B files in HDF5 format.

class satpy.readers.amsr2_l1b.AMSR2L1BFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hdf5_utils.HDF5FileHandler

get_dataset(ds_id, ds_info)

Get output data and metadata of specified dataset.

get_metadata(ds_id, ds_info)
get_shape(ds_id, ds_info)

Get output shape of specified dataset.

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

Reader for GAC and LAC data.

end_time
get_dataset(key, info)
start_time

satpy.readers.caliop_l2_cloud module

class satpy.readers.caliop_l2_cloud.HDF4BandReader(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

CALIOP v3 HDF4 reader.

end_time
get_dataset(key, info)

Read data from file and return the corresponding projectables.

get_end_time()

Get observation end time from file metadata.

get_filehandle()

Get HDF4 filehandle.

get_lonlats()

Get longitude and latitude arrays from the file.

get_sds_variable(name)

Read variable from the HDF4 file.

static parse_metadata_string(metadata_string)

Grab end time with regular expression.

start_time

satpy.readers.clavrx module

Interface to CLAVR-X HDF4 products.

class satpy.readers.clavrx.CLAVRXFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hdf4_utils.HDF4FileHandler

available_datasets()

Automatically determine datasets provided by this file

end_time
get_area_def(key)

Get the area definition of the data at hand.

get_dataset(dataset_id, ds_info)
get_metadata(data_arr, ds_info)
get_nadir_resolution(sensor)
get_platform(platform)
get_rows_per_scan(sensor)
get_sensor(sensor)
get_shape(dataset_id, ds_info)
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'}
start_time

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)

Bases: satpy.readers.hrit_base.HRITFileHandler

GOMS HRIT format reader.

Initialize the reader.

read_epilogue()

Read the prologue metadata.

class satpy.readers.electrol_hrit.HRITGOMSFileHandler(filename, filename_info, filetype_info, prologue, epilogue)

Bases: satpy.readers.hrit_base.HRITFileHandler

GOMS HRIT format reader.

Initialize the reader.

calibrate(data, calibration)

Calibrate the data.

get_area_def(dsid)

Get the area definition of the band.

get_dataset(key, info)

Get the data from the files.

class satpy.readers.electrol_hrit.HRITGOMSPrologueFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hrit_base.HRITFileHandler

GOMS HRIT format reader.

Initialize the reader.

process_prologue()

Reprocess prologue to correct types.

read_prologue()

Read the prologue metadata.

satpy.readers.electrol_hrit.recarray2dict(arr)

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

Eps level 1b reader for AVHRR data.

end_time
get_bounding_box()

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.

get_dataset(key, info)

Get calibrated channel data.

get_full_angles()

Get the interpolated lons/lats.

get_full_lonlats()

Get the interpolated lons/lats.

get_lonlats()
keys()

List of reader’s keys.

platform_name
sensor_name
sensors = {'AVHR': 'avhrr-3'}
spacecrafts = {'M01': 'Metop-B', 'M02': 'Metop-A', 'M03': 'Metop-C'}
start_time
satpy.readers.eps_l1b.create_xarray(arr)
satpy.readers.eps_l1b.radiance_to_bt(arr, wc_, a__, b__)

Convert to BT.

satpy.readers.eps_l1b.radiance_to_refl(arr, solar_flux)

Convert to reflectances.

satpy.readers.eps_l1b.read_raw(filename)

Read filename without scaling it afterwards.

satpy.readers.eum_base module

Utilities for EUMETSAT satellite data (HRIT/NATIVE)

satpy.readers.eum_base.recarray2dict(arr)
satpy.readers.eum_base.timecds2datetime(tcds)

Method for converting time_cds-variables to datetime-objectsself. Works both with a dictionary and a numpy record_array.

satpy.readers.fci_l1c_fdhsi module

Interface to MTG-FCI Retrieval NetCDF files

class satpy.readers.fci_l1c_fdhsi.FCIFDHSIFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

MTG FCI FDHSI File Reader

calc_area_extent(key)

Calculate area extent for a dataset.

calibrate(data, key)

Data calibration.

end_time
get_area_def(key, info=None)

Calculate on-fly area definition for 0 degree geos-projection for a dataset.

get_dataset(key, info=None)

Load a dataset.

start_time

satpy.readers.file_handlers module

class satpy.readers.file_handlers.BaseFileHandler(filename, filename_info, filetype_info)

Bases: object

available_datasets()

Get information of available datasets in file.

This is used for dynamically specifying what datasets are available from a file instead of those listed in a YAML configuration file.

Returns: Iterator of (DatasetID, dict) pairs where dict is the
dataset’s metadata, similar to that specified in the YAML configuration files.
combine_info(all_infos)

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

Also, concatenate the areas.

end_time
get_area_def(dsid)
get_bounding_box()

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.

get_dataset(dataset_id, ds_info)
sensor_names

List of sensors represented in this file.

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_area_def(dsid)
get_dataset(key, info)

Get a dataset from the file.

get_geotiff_area_def(crs)

Get extents from GeoTIFF file

read()

Read the image

start_time
satpy.readers.generic_image.get_geotiff_area_def(filename, crs)

Read area definition from a geotiff.

satpy.readers.generic_image.mask_image_data(data)

Mask image data if alpha channel is present.

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)

Bases: satpy.readers.netcdf_utils.NetCDF4FileHandler

available_datasets()

Automatically determine datasets provided by this file

end_time
get_area_def(dsid)
get_dataset(dataset_id, ds_info, xslice=slice(None, None, None), yslice=slice(None, None, None))
get_metadata(dataset_id, ds_info)
get_platform(platform)
get_sensor(sensor)
get_shape(dataset_id, ds_info)
is_geo
platforms = {}
resolution
resolutions = {'abi': {1: 1002.0086577437705, 2: 2004.017315487541}, 'ahi': {1: 999.9999820317674, 2: 1999.999964063535, 4: 3999.99992812707}}
sensor_names

List of sensors represented in this file.

sensors = {'goes': 'goes_imager', 'goes16': 'abi', 'goesr': 'abi', 'himawari8': 'ahi'}
start_time

satpy.readers.ghrsst_l3c_sst module

An OSISAF SST reader for the netCDF GHRSST format

class satpy.readers.ghrsst_l3c_sst.GHRSST_OSISAFL2(filename, filename_info, filetype_info, auto_maskandscale=False, xarray_kwargs=None)

Bases: satpy.readers.netcdf_utils.NetCDF4FileHandler

Reader for the OSISAF SST GHRSST format.

end_time
get_area_def(area_id, area_info)

Override abstract baseclass method

get_dataset(dataset_id, ds_info, out=None)

Load a dataset.

get_lonlats(navid, nav_info, lon_out=None, lat_out=None)

Load an area.

start_time

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

Bases: Exception

class satpy.readers.goes_imager_hrit.HRITGOESFileHandler(filename, filename_info, filetype_info, prologue)

Bases: satpy.readers.hrit_base.HRITFileHandler

GOES HRIT format reader.

Initialize the reader.

calibrate(data, calibration)

Calibrate the data.

get_area_def(dsid)

Get the area definition of the band.

get_dataset(key, info)

Get the data from the files.

class satpy.readers.goes_imager_hrit.HRITGOESPrologueFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hrit_base.HRITFileHandler

GOES HRIT format reader

Initialize the reader.

process_prologue()

Reprocess prologue to correct types.

read_prologue()

Read the prologue metadata.

satpy.readers.goes_imager_hrit.make_gvar_float(float_val)
satpy.readers.goes_imager_hrit.make_sgs_time(sgs_time_array)

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:

  1. Subsatellite point
  2. Calibration coefficients
  3. 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

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

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

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

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

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

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

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

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:

[GVAR] https://goes.gsfc.nasa.gov/text/GVARRDL98.pdf [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: 1: The geolocation is in a separate file, used for all bands 2: VIS data is calibrated to Albedo (or reflectance) 3: IR data is calibrated to radiance. 4: VIS data is downsampled to IR resolution (4km) 5: File name differs also slightly 6: Data is received via EumetCast

class satpy.readers.goes_imager_nc.GOESCoefficientReader(ir_url, vis_url)

Bases: object

Read GOES Imager calibration coefficients from NOAA reference HTMLs

get_coefs(platform, channel)
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)

Bases: satpy.readers.file_handlers.BaseFileHandler

File handler for GOES Geolocation data in EUM netCDF format

Initialize the reader.

get_dataset(key, info)

Load dataset designated by the given key from file

resolution

Specify the spatial resolution of the dataset.

In the EUMETSAT format VIS data is downsampled to IR resolution (4km).

class satpy.readers.goes_imager_nc.GOESEUMNCFileHandler(filename, filename_info, filetype_info, geo_data)

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.

calibrate(data, calibration, channel)

Perform calibration

get_dataset(key, info)

Load dataset designated by the given key from file

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

File handler for GOES Imager data in netCDF format

Initialize the reader.

calibrate(data, calibration, channel)

Perform calibration

end_time

End timestamp of the dataset

get_dataset(key, info)

Load dataset designated by the given key from file

get_shape(key, info)

Get the shape of the data

Returns:Number of lines, number of columns
ir_sectors
meta

Derive metadata from the coordinates

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
start_time

Start timestamp of the dataset

vis_sectors
class satpy.readers.goes_imager_nc.GOESNCFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.goes_imager_nc.GOESNCBaseFileHandler

File handler for GOES Imager data in netCDF format

Initialize the reader.

calibrate(counts, calibration, channel)

Perform calibration

get_dataset(key, info)

Load dataset designated by the given key from file

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)

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.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)

Bases: satpy.readers.file_handlers.BaseFileHandler

available_datasets()

Automatically determine datasets provided by this file

end_time

Get end time of this entire file.

Assumes the last message is the latest message.

get_area_def(dsid)

Get area definition for message.

If latlong grid then convert to valid eqc grid.

get_dataset(dataset_id, ds_info)

Read a GRIB message into an xarray DataArray.

get_metadata(msg, ds_info)
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)

Bases: satpy.readers.file_handlers.BaseFileHandler

Small class for inspecting a HDF5 file and retrieve its metadata/header data.

collect_metadata(name, obj)
get(item, default=None)
satpy.readers.hdf4_utils.from_sds(var, *args, **kwargs)

Create a dask array from a SD dataset.

satpy.readers.hdf5_utils module

Helpers for reading hdf5-based files.

class satpy.readers.hdf5_utils.HDF5FileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

Small class for inspecting a HDF5 file and retrieve its metadata/header data.

collect_metadata(name, obj)
get(item, default=None)

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

HRIT standard format reader.

Initialize the reader.

end_time
get_area_def(dsid)

Get the area definition of the band.

get_area_extent(size, offsets, factors, platform_height)

Get the area extent of the file.

get_dataset(key, info)

Load a dataset.

get_shape(dsid, ds_info)
get_xy_from_linecol(line, col, offsets, factors)

Get the intermediate coordinates from line & col.

Intermediate coordinates are actually the instruments scanning angles.

read_band(key, info)

Read the data.

start_time
satpy.readers.hrit_base.decompress(infile, outdir='.')

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_base.get_xritdecompress_cmd()

Find a valid binary for the xRITDecompress command.

satpy.readers.hrit_base.get_xritdecompress_outfile(stdout)

Analyse the output of the xRITDecompress command call and return the file.

satpy.readers.hrit_jma module

HRIT format reader for JMA data

References

JMA HRIT - Mission Specific Implementation http://www.jma.go.jp/jma/jma-eng/satellite/introduction/4_2HRIT.pdf

class satpy.readers.hrit_jma.HRITJMAFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hrit_base.HRITFileHandler

JMA HRIT format reader.

Initialize the reader.

calibrate(data, calibration)

Calibrate the data.

get_area_def(dsid)

Get the area definition of the band.

get_dataset(key, info)

Get the dataset designated by key.

satpy.readers.hrpt module

Reading and calibrating hrpt avhrr data. Todo: - AMSU - Compare output with AAPP

Reading: http://www.ncdc.noaa.gov/oa/pod-guide/ncdc/docs/klm/html/c4/sec4-1.htm#t413-1

Calibration: http://www.ncdc.noaa.gov/oa/pod-guide/ncdc/docs/klm/html/c7/sec7-1.htm

class satpy.readers.hrpt.HRPTFile(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

Reader for HRPT Minor Frame, 10 bits data expanded to 16 bits.

end_time
get_dataset(key, info)
get_lonlats()
get_telemetry()
read()
start_time
satpy.readers.hrpt.bfield(array, bit)

return the bit array.

satpy.readers.hrpt.geo_interpolate(lons32km, lats32km)
satpy.readers.hrpt.time_seconds(tc_array, year)

Return the time object from the timecodes

satpy.readers.iasi_l2 module

IASI L2 HDF5 files.

class satpy.readers.iasi_l2.IASIL2HDF5(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

File handler for IASI L2 HDF5 files.

end_time
get_dataset(key, info)

Load a dataset

start_time
satpy.readers.iasi_l2.read_dataset(fid, key)

Read dataset

satpy.readers.iasi_l2.read_geo(fid, key)

Read geolocation and related datasets.

satpy.readers.li_l2 module

Interface to MTG-LI L2 product NetCDF files

The reader is based on preliminary test data provided by EUMETSAT. The data description is described in the “LI L2 Product User Guide [LIL2PUG] Draft version” documentation.

class satpy.readers.li_l2.LIFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

MTG LI File Reader.

end_time
get_area_def(key, info=None)

Create AreaDefinition for specified product.

Projection information are hard coded for 0 degree geos projection Test dataset doesn’t provide the values in the file container. Only fill values are inserted.

get_dataset(key, info=None, out=None, xslice=None, yslice=None)

Load a dataset

start_time

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)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_dataset(key, info, out=None)

Get a dataset from the file.

get_platform(platform)
read(filename)
start_time

satpy.readers.modis_l1b module

Interface to Modis level 1b format. http://www.icare.univ-lille1.fr/wiki/index.php/MODIS_geolocation http://www.sciencedirect.com/science?_ob=MiamiImageURL&_imagekey=B6V6V-4700BJP-3-27&_cdi=5824&_user=671124&_check=y&_orig=search&_coverDate=11%2F30%2F2002&view=c&wchp=dGLzVlz-zSkWz&md5=bac5bc7a4f08007722ae793954f1dd63&ie=/sdarticle.pdf

class satpy.readers.modis_l1b.HDFEOSBandReader(filename, filename_info, filetype_info)

Bases: satpy.readers.modis_l1b.HDFEOSFileReader

Handler for the regular band channels.

get_dataset(key, info)

Read data from file and return the corresponding projectables.

res = {'1': 1000, 'H': 500, 'Q': 250}
class satpy.readers.modis_l1b.HDFEOSFileReader(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

Base file handler for EOS level 1 data.

end_time
read_mda(attribute)
start_time
class satpy.readers.modis_l1b.HDFEOSGeoReader(filename, filename_info, filetype_info)

Bases: satpy.readers.modis_l1b.HDFEOSFileReader

Handler for the geographical files.

get_dataset(key, info)

Get the dataset designated by key.

load(file_key)

Load the data.

class satpy.readers.modis_l1b.MixedHDFEOSReader(filename, filename_info, filetype_info)

Bases: satpy.readers.modis_l1b.HDFEOSGeoReader, satpy.readers.modis_l1b.HDFEOSBandReader

A file handler for the files that have both regular bands and geographical information in them.

get_dataset(key, info)

Get the dataset designated by key.

satpy.readers.modis_l1b.calibrate_bt(array, attributes, index, band_name)

Calibration for the emissive channels.

satpy.readers.modis_l1b.calibrate_counts(array, attributes, index)

Calibration for counts channels.

satpy.readers.modis_l1b.calibrate_radiance(array, attributes, index)

Calibration for radiance channels.

satpy.readers.modis_l1b.calibrate_refl(array, attributes, index)

Calibration for reflective channels.

satpy.readers.msi_safe module

SAFE MSI L1C reader.

class satpy.readers.msi_safe.SAFEMSIL1C(filename, filename_info, filetype_info, mda)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_area_def(dsid)
get_dataset(key, info)

Load a dataset.

start_time
class satpy.readers.msi_safe.SAFEMSIMDXML(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_area_def(dsid)

Get the area definition of the dataset.

get_dataset(key, info)

Get the dataset refered to by key.

interpolate_angles(angles, resolution)
start_time

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)

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, but to get just the shape of the dataset append “/shape” to the item string:

wrapper[“group/subgroup/var_name/shape”]
collect_dimensions(name, obj)
collect_metadata(name, obj)

Collect all file variables and attributes for the provided file object.

This method also iterates through subgroups of the provided object.

get(item, default=None)

satpy.readers.nucaps module

Interface to NUCAPS Retrieval NetCDF files

class satpy.readers.nucaps.NUCAPSFileHandler(*args, **kwargs)

Bases: satpy.readers.netcdf_utils.NetCDF4FileHandler

NUCAPS File Reader

end_orbit_number

Return orbit number for the end of the swath.

end_time
get_dataset(dataset_id, ds_info)

Load data array and metadata for specified dataset

get_metadata(dataset_id, ds_info)
get_shape(ds_id, ds_info)

Return data array shape for item specified.

platform_name

Return standard platform name for the file’s data.

sensor_names

Return standard sensor or instrument name for the file’s data.

start_orbit_number

Return orbit number for the beginning of the swath.

start_time
class satpy.readers.nucaps.NUCAPSReader(config_files, mask_surface=True, mask_quality=True, **kwargs)

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)

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()

Convert config dataset entries to DatasetIDs

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_nc module

Nowcasting SAF common PPS&MSG NetCDF/CF format reader

class satpy.readers.nwcsaf_nc.NcNWCSAF(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

NWCSAF PPS&MSG NetCDF reader.

Init method.

end_time

Return the end time of the object.

get_area_def(dsid)

Get the area definition of the datasets in the file.

Only applicable for MSG products!

get_dataset(dsid, info)

Load a dataset.

remove_timedim(var)

Remove time dimension from dataset

scale_dataset(dsid, variable, info)

Scale the data set, applying the attributes from the netCDF file

start_time

Return the start time of the object.

upsample_geolocation(dsid, info)

Upsample the geolocation (lon,lat) from the tiepoint grid

satpy.readers.nwcsaf_nc.remove_empties(variable)

Remove empty objects from the variable’s attrs.

satpy.readers.olci_nc module

Sentinel-3 OLCI reader

class satpy.readers.olci_nc.BitFlags(value)

Bases: object

Manipulate flags stored bitwise.

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)

Bases: satpy.readers.olci_nc.NCOLCIChannelBase

get_dataset(key, info)

Load a dataset.

class satpy.readers.olci_nc.NCOLCI2(filename, filename_info, filetype_info)

Bases: satpy.readers.olci_nc.NCOLCIChannelBase

get_dataset(key, info)

Load a dataset

getbitmask(wqsf, items=[])
class satpy.readers.olci_nc.NCOLCIAngles(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

datasets = {'satellite_azimuth_angle': 'OAA', 'satellite_zenith_angle': 'OZA', 'solar_azimuth_angle': 'SAA', 'solar_zenith_angle': 'SZA'}
end_time
get_dataset(key, info)

Load a dataset.

start_time
class satpy.readers.olci_nc.NCOLCIBase(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_dataset(key, info)

Load a dataset.

start_time
class satpy.readers.olci_nc.NCOLCICal(filename, filename_info, filetype_info)

Bases: satpy.readers.olci_nc.NCOLCIBase

class satpy.readers.olci_nc.NCOLCIChannelBase(filename, filename_info, filetype_info)

Bases: satpy.readers.olci_nc.NCOLCIBase

class satpy.readers.olci_nc.NCOLCIGeo(filename, filename_info, filetype_info)

Bases: satpy.readers.olci_nc.NCOLCIBase

satpy.readers.omps_edr module

Interface to OMPS EDR format

class satpy.readers.omps_edr.EDREOSFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.omps_edr.EDRFileHandler

class satpy.readers.omps_edr.EDRFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hdf5_utils.HDF5FileHandler

adjust_scaling_factors(factors, file_units, output_units)
end_orbit_number
get_dataset(dataset_id, ds_info)
get_metadata(dataset_id, ds_info)
get_shape(ds_id, ds_info)
platform_name
sensor_name
start_orbit_number

satpy.readers.sar_c_safe module

SAFE SAR-C format.

class satpy.readers.sar_c_safe.SAFEGRD(filename, filename_info, filetype_info, calfh, noisefh)

Bases: satpy.readers.file_handlers.BaseFileHandler

Measurement file reader.

end_time
get_dataset(key, info)

Load a dataset.

get_gcps()

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_gdal_filehandle()

Try to create the filehandle using gdal.

get_lonlats()

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)

read_band(blocksize=4096)

Read the band in blocks.

start_time
class satpy.readers.sar_c_safe.SAFEXML(filename, filename_info, filetype_info, header_file=None)

Bases: satpy.readers.file_handlers.BaseFileHandler

XML file reader for the SAFE format.

end_time
get_calibration(name, shape)

Get the calibration array.

get_calibration_constant()

Load the calibration constant.

get_dataset(key, info)

Load a dataset.

get_metadata()

Convert the xml metadata to dict.

get_noise_correction(shape)

Get the noise correction array.

static interpolate_xml_array(data, low_res_coords, shape)

Interpolate arbitrary size dataset to a full sized grid.

static read_xml_array(elts, variable_name)

Read an array from an xml elements elts.

start_time
satpy.readers.sar_c_safe.dictify(r, root=True)

Convert an ElementTree into a dict.

satpy.readers.sar_c_safe.interpolate_slice(slice_rows, slice_cols, interpolator)

Interpolate the given slice of the larger array.

satpy.readers.sar_c_safe.interpolate_xarray(xpoints, ypoints, values, shape, kind='cubic', blocksize=4096)

Interpolate, generating a dask array.

satpy.readers.sar_c_safe.interpolate_xarray_linear(xpoints, ypoints, values, shape)

Interpolate linearly, generating a dask array.

satpy.readers.scatsat1_l2b module

ScatSat-1 L2B Reader, distributed by Eumetsat in HDF5 format

class satpy.readers.scatsat1_l2b.SCATSAT1L2BFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

get_dataset(key, info)

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:

  1. 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.
  2. 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)

Bases: satpy.readers.file_handlers.BaseFileHandler

Handle a single SCMI NetCDF4 file.

end_time
get_area_def(key)

Get the area definition of the data at hand.

get_dataset(key, info)

Load a dataset.

get_shape(key, info)

Get the shape of the data.

sensor_names

List of sensors represented in this file.

start_time

satpy.readers.seviri_base module

Utilities and eventually also base classes for MSG HRIT/Native data reading

class satpy.readers.seviri_base.SEVIRICalibrationHandler

Bases: object

Calibration handler for SEVIRI HRIT- and native-formats.

satpy.readers.seviri_base.dec10216(inbuf)

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)

Get the datetime object of the time since epoch given in days and milliseconds of day

satpy.readers.seviri_l1b_hrit module

SEVIRI HRIT format reader

References

  • MSG Level 1.5 Image Data Format Description
  • Radiometric Calibration of MSG SEVIRI Level 1.5 Image Data in Equivalent Spectral Blackbody Radiance
class satpy.readers.seviri_l1b_hrit.HRITMSGEpilogueFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hrit_base.HRITFileHandler

SEVIRI HRIT epilogue reader.

Initialize the reader.

read_epilogue()

Read the epilogue metadata.

class satpy.readers.seviri_l1b_hrit.HRITMSGFileHandler(filename, filename_info, filetype_info, prologue, epilogue)

Bases: satpy.readers.hrit_base.HRITFileHandler, satpy.readers.seviri_base.SEVIRICalibrationHandler

SEVIRI HRIT format reader

Initialize the reader.

calibrate(data, calibration)

Calibrate the data.

end_time
get_area_def(dsid)

Get the area definition of the band.

get_area_extent(size, offsets, factors, platform_height)

Get the area extent of the file.

get_dataset(key, info)

Load a dataset.

get_xy_from_linecol(line, col, offsets, factors)

Get the intermediate coordinates from line & col.

Intermediate coordinates are actually the instruments scanning angles.

start_time
class satpy.readers.seviri_l1b_hrit.HRITMSGPrologueFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hrit_base.HRITFileHandler

SEVIRI HRIT prologue reader.

Initialize the reader.

read_prologue()

Read the prologue metadata.

satpy.readers.seviri_l1b_hrit.show(data, negate=False)

Show the stretched data.

satpy.readers.seviri_l1b_native module

SEVIRI native format reader.

References

MSG Level 1.5 Native Format File Definition https://www.eumetsat.int/website/wcm/idc/idcplg?IdcService=GET_FILE&dDocName=PDF_FG15_MSG-NATIVE-FORMAT-15&RevisionSelectionMethod=LatestReleased&Rendition=Web 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_l1b_native.NativeMSGFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler, satpy.readers.seviri_base.SEVIRICalibrationHandler

SEVIRI native format reader.

Initialize the reader.

calibrate(data, dsid)

Calibrate the data.

end_time
get_area_def(dsid)
get_area_extent(dsid)
get_dataset(dsid, info, xslice=slice(None, None, None), yslice=slice(None, None, None))
start_time
satpy.readers.seviri_l1b_native.get_available_channels(header)

Get the available channels from the header information

satpy.readers.seviri_l1b_native_hdr module

Header and trailer records of SEVIRI native format.

class satpy.readers.seviri_l1b_native_hdr.GSDTRecords

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

Bases: satpy.readers.seviri_l1b_native_hdr.L15DataHeaderRecord

get()
class satpy.readers.seviri_l1b_native_hdr.L15DataHeaderRecord

Bases: object

Reference Document (EUM/MSG/ICD/105): MSG Level 1.5 Image Data Format Description

celestial_events
geometric_processing
get()
image_acquisition
image_description
impf_configuration
radiometric_processing
satellite_status
class satpy.readers.seviri_l1b_native_hdr.L15MainProductHeaderRecord

Bases: object

Reference Document: MSG Level 1.5 Native Format File Definition

get()
class satpy.readers.seviri_l1b_native_hdr.L15PhData

Bases: object

l15_ph_data = [('Name', 'S30'), ('Value', 'S50')]
class satpy.readers.seviri_l1b_native_hdr.L15SecondaryProductHeaderRecord

Bases: object

Reference Document: MSG Level 1.5 Native Format File Definition

get()
class satpy.readers.seviri_l1b_native_hdr.Msg15NativeHeaderRecord

Bases: object

SEVIRI Level 1.5 header for native-format

get()
class satpy.readers.seviri_l1b_native_hdr.Msg15NativeTrailerRecord

Bases: object

SEVIRI Level 1.5 trailer for native-format

Reference Document (EUM/MSG/ICD/105): MSG Level 1.5 Image Data Format Description

geometric_quality
get()
image_production_stats
navigation_extraction_results
radiometric_quality
seviri_l15_trailer
timeliness_and_completeness

satpy.readers.seviri_l1b_nc module

SEVIRI netcdf format reader.

class satpy.readers.seviri_l1b_nc.NCSEVIRIFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler, satpy.readers.seviri_base.SEVIRICalibrationHandler

end_time
get_area_def(dataset_id)
get_area_extent(dsid)
get_dataset(dataset_id, dataset_info)
start_time
class satpy.readers.seviri_l1b_nc.NCSEVIRIHRVFileHandler

Bases: object

satpy.readers.slstr_l1b module

Compact viirs format.

class satpy.readers.slstr_l1b.NCSLSTR1B(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_dataset(key, info)

Load a dataset.

start_time
class satpy.readers.slstr_l1b.NCSLSTRAngles(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_dataset(key, info)

Load a dataset

start_time
class satpy.readers.slstr_l1b.NCSLSTRFlag(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_dataset(key, info)

Load a dataset.

start_time
class satpy.readers.slstr_l1b.NCSLSTRGeo(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

end_time
get_dataset(key, info)

Load a dataset

start_time

satpy.readers.utils module

Helper functions for area extent calculations.

satpy.readers.utils.bbox(img)

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_area_slices(data_area, area_to_cover)

Compute the slice to read from an area based on an area_to_cover.

satpy.readers.utils.get_geostationary_angle_extent(geos_area)

Get the max earth (vs space) viewing angles in x and y.

satpy.readers.utils.get_geostationary_bounding_box(geos_area, nb_points=50)

Get the bbox in lon/lats of the valid pixels inside geos_area.

Parameters:nb_points – Number of points on the polygon
satpy.readers.utils.get_geostationary_mask(area)

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)

Apply slices to the area_extent and size of the area.

satpy.readers.utils.np2str(value)

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.unzip_file(filename)

Unzip the file if file is bzipped = ending with ‘bz2’

satpy.readers.viirs_compact module

Compact viirs format.

class satpy.readers.viirs_compact.VIIRSCompactFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.file_handlers.BaseFileHandler

angles(azi_name, zen_name)
end_time
get_bounding_box()

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.

get_dataset(key, info)

Load a dataset

navigate()
read_dataset(dataset_key, info)
read_geo(key, info)

Read angles.

start_time
satpy.readers.viirs_compact.expand_array(data, scans, c_align, c_exp, scan_size=16, tpz_size=16, nties=200, track_offset=0.5, scan_offset=0.5)

Expand data according to alignment and expansion.

satpy.readers.viirs_compact.navigate_dnb(h5f)
satpy.readers.viirs_compact.read_dnb(h5f)

satpy.readers.viirs_edr_flood module

class satpy.readers.viirs_edr_flood.VIIRSEDRFlood(filename, filename_info, filetype_info)

Bases: satpy.readers.hdf4_utils.HDF4FileHandler

end_time
get_area_def(ds_id)
get_dataset(ds_id, ds_info)
get_metadata(data, ds_info)
platform_name
sensor_name
start_time

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)

Bases: satpy.readers.netcdf_utils.NetCDF4FileHandler

VIIRS L1B File Reader

adjust_scaling_factors(factors, file_units, output_units)
end_orbit_number
end_time
get_dataset(dataset_id, ds_info)
get_metadata(dataset_id, ds_info)
get_shape(ds_id, ds_info)
platform_name
sensor_name
start_orbit_number
start_time

satpy.readers.viirs_sdr module

Interface to VIIRS SDR format

Format documentation: http://npp.gsfc.nasa.gov/science/sciencedocuments/082012/474-00001-03_CDFCBVolIII_RevC.pdf

class satpy.readers.viirs_sdr.VIIRSSDRFileHandler(filename, filename_info, filetype_info)

Bases: satpy.readers.hdf5_utils.HDF5FileHandler

VIIRS HDF5 File Reader

adjust_scaling_factors(factors, file_units, output_units)
end_orbit_number
end_time
get_bounding_box()

Get the bounding box of this file.

get_dataset(dataset_id, ds_info)
get_file_units(dataset_id, ds_info)
get_shape(ds_id, ds_info)
platform_name
scale_swath_data(data, scaling_factors)

Scale swath data using scaling factors and offsets.

Multi-granule (a.k.a. aggregated) files will have more than the usual two values.

sensor_name
start_orbit_number
start_time
class satpy.readers.viirs_sdr.VIIRSSDRReader(config_files, use_tc=True, **kwargs)

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 (default) use the terrain corrected file types specified in the config files. If False, switch all terrain corrected file types to non-TC file types. If None

satpy.readers.xmlformat module

Reads a format from an xml file to create dtypes and scaling factor arrays.

class satpy.readers.xmlformat.XMLFormat(filename)

Bases: object

XMLFormat object.

apply_scales(array)

Apply scales to array.

dtype(key)

Get the dtype for the format object.

satpy.readers.xmlformat.parse_format(xml_file)

Parse the xml file to create types, scaling factor types, and scales.

satpy.readers.xmlformat.process_array(elt, ascii=False)

Process an ‘array’ tag.

satpy.readers.xmlformat.process_delimiter(elt, ascii=False)

Process a ‘delimiter’ tag.

satpy.readers.xmlformat.process_field(elt, ascii=False)

Process a ‘field’ tag.

satpy.readers.xmlformat.to_dtype(val)

Parse val to return a dtype.

satpy.readers.xmlformat.to_scaled_dtype(val)

Parse val to return a dtype.

satpy.readers.xmlformat.to_scales(val)

Parse val to return an array of scale factors.

satpy.readers.yaml_reader module

class satpy.readers.yaml_reader.AbstractYAMLReader(config_files)

Bases: object

all_dataset_ids
all_dataset_names
available_dataset_ids
available_dataset_names
end_time

End time of the reader.

filter_selected_filenames(filenames)

Filter provided filenames by parameters in reader configuration.

Returns: iterable of usable files

get_dataset_key(key, **kwargs)

Get the fully qualified DatasetID matching key.

See satpy.readers.get_key for more information about kwargs.

load(dataset_keys)

Load dataset_keys.

load_ds_ids_from_config()

Get the dataset ids from the config.

select_files_from_directory(directory=None)

Find files for this reader in directory.

If directory is None or ‘’, look in the current directory.

select_files_from_pathnames(filenames)

Select the files from filenames this reader can handle.

sensor_names
start_time

Start time of the reader.

supports_sensor(sensor)

Check if sensor is supported.

Returns True is sensor is None.

class satpy.readers.yaml_reader.FileYAMLReader(config_files, filter_parameters=None, filter_filenames=True, **kwargs)

Bases: satpy.readers.yaml_reader.AbstractYAMLReader

Implementation of the YAML reader.

add_ds_ids_from_files()

Check files for more dynamically discovered datasets.

available_dataset_ids
static check_file_covers_area(file_handler, check_area)

Checks 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)

Organize the filenames into file types and create file handlers.

end_time

End time of the reader.

static filename_items_for_filetype(filenames, filetype_info)

Iterator over the filenames matching filetype_info.

filter_fh_by_metadata(filehandlers)

Filter out filehandlers using provide filter parameters.

filter_filenames_by_info(filename_items)

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)

Filter provided filenames by parameters in reader configuration.

Returns: iterable of usable files

find_required_filehandlers(requirements, filename_info)

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.
load(dataset_keys, previous_datasets=None)

Load dataset_keys.

If previous_datasets is provided, do not reload those.

metadata_matches(sample_dict, file_handler=None)
new_filehandler_instances(filetype_info, filename_items)

Generate new filehandler instances.

new_filehandlers_for_filetype(filetype_info, filenames)

Create filehandlers for a given filetype.

sensor_names
sorted_filetype_items()

Sort the instance’s filetypes in using order.

start_time

Start time of the reader.

time_matches(fstart, fend)
update_ds_ids_from_file_handlers()

Update DatasetIDs with information from loaded files.

This is useful, for example, if dataset resolution may change depending on what files were loaded.

satpy.readers.yaml_reader.get_filebase(path, pattern)

Get the end of path of same length as pattern.

satpy.readers.yaml_reader.listify_string(something)

Takes 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.match_filenames(filenames, pattern)

Get the filenames matching pattern.

Module contents

Shared objects of the various reader classes.

class satpy.readers.DatasetDict(*args, **kwargs)

Bases: dict

Special dictionary object that can handle dict operations based on dataset name, wavelength, or DatasetID.

Note: Internal dictionary keys are DatasetID objects.

contains(item)

Check contains when we know the exact DatasetID.

get(key, default=None)

Get value with optional default.

get_key(match_key, num_results=1, best=True, **dfilter)

Get multiple fully-specified keys that match the provided query.

Parameters:
  • key (DatasetID) – DatasetID of query parameters to use for searching. Any parameter that is None is considered a wild card and any match is accepted. Can also be a string representing the dataset name or a number representing the dataset wavelength.
  • num_results (int) – Number of results to return. If 0 return all, if 1 return only that element, otherwise return a list of matching keys.
  • **dfilter (dict) – See get_key function for more information.
getitem(item)

Get Node when we know the exact DatasetID.

keys() → a set-like object providing a view on D's keys
exception satpy.readers.TooManyResults

Bases: KeyError

satpy.readers.available_readers(as_dict=False)

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)

Generator of 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.filter_keys_by_dataset_id(did, key_container)

Filer provided key iterable by the provided DatasetID.

Note: The modifiers attribute of did should be None to allow for
any modifier in the results.
Parameters:
  • did (DatasetID) – Query parameters to match in the key_container.
  • key_container (iterable) – Set, list, tuple, or dict of DatasetID keys.
Returns (list): List of keys matching the provided parameters in no
specific order.
satpy.readers.find_files_and_readers(start_time=None, end_time=None, base_dir=None, reader=None, sensor=None, ppp_config_dir='/build/satpy-0.11.1/satpy/etc', filter_parameters=None, reader_kwargs=None)

Find on-disk 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.

The returned dictionary can be passed directly to the Scene object through the filenames keyword argument.

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
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.

Returns: Dictionary mapping reader name string to list of filenames

satpy.readers.get_best_dataset_key(key, choices)

Choose the “best” DatasetID from choices based on key.

The best key is chosen based on the follow criteria:

  1. Central wavelength is nearest to the key wavelength if specified.
  2. Least modified dataset if modifiers is None in key. Otherwise, the modifiers are ignored.
  3. Highest calibration if calibration is None in key. Calibration priority is chosen by satpy.CALIBRATION_ORDER.
  4. Best resolution (smallest number) if resolution is None in key. Otherwise, the resolution is ignored.

This function assumes choices has already been filtered to only include datasets that match the provided key.

Parameters:
  • key (DatasetID) – Query parameters to sort choices by.
  • choices (iterable) – DatasetID objects to sort through to determine the best dataset.
Returns: List of best DatasetID`s from `choices. If there is more
than one element this function could not choose between the available datasets.
satpy.readers.get_key(key, key_container, num_results=1, best=True, resolution=None, calibration=None, polarization=None, level=None, modifiers=None)

Get the fully-specified key best matching the provided key.

Only the best match is returned if best is True (default). See get_best_dataset_key for more information on how this is determined.

The resolution and other identifier keywords are provided as a convenience to filter by multiple parameters at once without having to filter by multiple key inputs.

Parameters:
  • key (DatasetID) – DatasetID of query parameters to use for searching. Any parameter that is None is considered a wild card and any match is accepted.
  • key_container (dict or set) – Container of DatasetID objects that uses hashing to quickly access items.
  • num_results (int) – Number of results to return. Use 0 for all matching results. If 1 then the single matching key is returned instead of a list of length 1. (default: 1)
  • best (bool) – Sort results to get “best” result first (default: True). See get_best_dataset_key for details.
  • resolution (float, int, or list) – Resolution of the dataset in dataset units (typically meters). This can also be a list of these numbers.
  • calibration (str or list) – Dataset calibration (ex.’reflectance’). This can also be a list of these strings.
  • polarization (str or list) – Dataset polarization (ex.’V’). This can also be a list of these strings.
  • level (number or list) – Dataset level (ex. 100). This can also be a list of these numbers.
  • modifiers (list) – Modifiers applied to the dataset. Unlike resolution and calibration this is the exact desired list of modifiers for one dataset, not a list of possible modifiers.

Returns (list or DatasetID): Matching key(s)

Raises: KeyError if no matching results or if more than one result is
found when num_results is 1.
satpy.readers.load_reader(reader_configs, **reader_kwargs)

Import and setup the reader from reader_info

satpy.readers.load_readers(filenames=None, reader=None, reader_kwargs=None, ppp_config_dir='/build/satpy-0.11.1/satpy/etc')

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.
  • filter_parameters (dict) – Specify loaded file filtering parameters. Shortcut for reader_kwargs[‘filter_parameters’].
  • 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

satpy.readers.read_reader_config(config_files, loader=<class 'yaml.loader.Loader'>)

Read the reader config_files and return the info extracted.