satpy.readers.mviri_l1b_fiduceo_nc module

FIDUCEO MVIRI FCDR Reader.

Introduction

The FIDUCEO MVIRI FCDR is a Fundamental Climate Data Record (FCDR) of re-calibrated Level 1.5 Infrared, Water Vapour, and Visible radiances from the Meteosat Visible Infra-Red Imager (MVIRI) instrument onboard the Meteosat First Generation satellites. There are two variants of the dataset: The full FCDR and a simplified version called easy FCDR. Some datasets are only available in one of the two variants, see the corresponding YAML definition in satpy/etc/readers/.

Dataset Names

The FIDUCEO MVIRI readers use names VIS, WV and IR for the visible, water vapor and infrared channels, respectively. These are different from the original netCDF variable names for the following reasons:

  • VIS channel is named differently in full FCDR (counts_vis) and easy FCDR (toa_bidirectional_reflectance_vis)

  • netCDF variable names contain the calibration level (e.g. counts_...), which might be confusing for satpy users if a different calibration level is chosen.

Remaining datasets (such as quality flags and uncertainties) have the same name in the reader as in the netCDF file.

Example:

This is how to read FIDUCEO MVIRI FCDR data in satpy:

from satpy import Scene

scn = Scene(filenames=['FIDUCEO_FCDR_L15_MVIRI_MET7-57.0...'],
            reader='mviri_l1b_fiduceo_nc')
scn.load(['VIS', 'WV', 'IR'])

Global netCDF attributes are available in the raw_metadata attribute of each loaded dataset.

Image Orientation

The images are stored in MVIRI scanning direction, that means South is up and East is right. This can be changed as follows:

scn.load(['VIS'], upper_right_corner='NE')

Geolocation

In addition to the image data, FIDUCEO also provides so called static FCDRs containing latitude and longitude coordinates. In order to simplify their usage, the FIDUCEO MVIRI readers do not make use of these static files, but instead provide an area definition that can be used to compute longitude and latitude coordinates on demand.

area = scn['VIS'].attrs['area']
lons, lats = area.get_lonlats()

Those were compared to the static FCDR and they agree very well, however there are small differences. The mean difference is < 1E3 degrees for all channels and projection longitudes.

Huge VIS Reflectances

You might encounter huge VIS reflectances (10^8 percent and greater) in situations where both radiance and solar zenith angle are small. The reader certainly needs some improvement in this regard. Maybe the corresponding uncertainties can be used to filter these cases before calculating reflectances.

VIS Channel Quality Flags

Quality flags are available for the VIS channel only. A simple approach for masking bad quality pixels is to set the mask_bad_quality keyword argument to True:

scn = Scene(filenames=['FIDUCEO_FCDR_L15_MVIRI_MET7-57.0...'],
            reader='mviri_l1b_fiduceo_nc',
            reader_kwargs={'mask_bad_quality': True})

See FiduceoMviriBase for an argument description. In some situations however the entire image can be flagged (look out for warnings). In that case check out the quality_pixel_bitmask and data_quality_bitmask datasets to find out why.

Angles

The FIDUCEO MVIRI FCDR provides satellite and solar angles on a coarse tiepoint grid. By default these datasets will be interpolated to the higher VIS resolution. This can be changed as follows:

scn.load(['solar_zenith_angle'], resolution=4500)

If you need the angles in both resolutions, use data queries:

from satpy import DataQuery

query_vis = DataQuery(
    name='solar_zenith_angle',
    resolution=2250
)
query_ir = DataQuery(
    name='solar_zenith_angle',
    resolution=4500
)
scn.load([query_vis, query_ir])

# Use the query objects to access the datasets as follows
sza_vis = scn[query_vis]

References:

satpy.readers.mviri_l1b_fiduceo_nc.ALTITUDE = 35785860.0

[Handbook] section 5.2.1.

class satpy.readers.mviri_l1b_fiduceo_nc.DatasetWrapper(nc)[source]

Bases: object

Helper class for accessing the dataset.

Wrap the given dataset.

_cleanup_attrs(ds)[source]

Cleanup dataset attributes.

_coordinates_not_assigned(ds)[source]
_reassign_coords(ds)[source]

Re-assign coordinates.

For some reason xarray doesn’t assign coordinates to all high resolution data variables.

_rename_dims(ds)[source]

Rename dataset dimensions to match satpy’s expectations.

_should_dims_be_renamed(ds)[source]

Determine whether dataset dimensions need to be renamed.

property attrs

Exposes dataset attributes.

get_image_size(resolution)[source]

Get image size for the given resolution.

get_time()[source]

Get time coordinate.

Variable is sometimes named “time” and sometimes “time_ir_wv”.

get_xy_coords(resolution)[source]

Get x and y coordinates for the given resolution.

class satpy.readers.mviri_l1b_fiduceo_nc.FiduceoMviriBase(filename, filename_info, filetype_info, mask_bad_quality=False)[source]

Bases: BaseFileHandler

Baseclass for FIDUCEO MVIRI file handlers.

Initialize the file handler.

Parameters:

mask_bad_quality – Mask VIS pixels with bad quality, that means any quality flag except “ok”. If you need more control, use the quality_pixel_bitmask and data_quality_bitmask datasets.

_calibrate(ds, channel, calibration)[source]

Calibrate the given dataset.

abstract _calibrate_vis(ds, channel, calibration)[source]

Calibrate VIS channel. To be implemented by subclasses.

_cleanup_coords(ds)[source]

Cleanup dataset coordinates.

Y/x coordinates have been useful for interpolation so far, but they only contain row/column numbers. Drop these coordinates so that Satpy can assign projection coordinates upstream (based on the area definition).

_get_acq_time_uncached(resolution)[source]

Get scanline acquisition time for the given resolution.

Note that the acquisition time does not increase monotonically with the scanline number due to the scan pattern and rectification.

_get_angles_uncached(name, resolution)[source]

Get angle dataset.

Files provide angles (solar/satellite zenith & azimuth) at a coarser resolution. Interpolate them to the desired resolution.

_get_calib_coefs()[source]

Get calibration coefficients for all channels.

Note: Only coefficients present in both file types.

_get_channel(name, resolution, calibration)[source]

Get and calibrate channel data.

_get_orbital_parameters()[source]

Get the orbital parameters.

_get_other_dataset(name)[source]

Get other datasets such as uncertainties.

_get_ssp(coord)[source]
_get_ssp_lonlat()[source]

Get longitude and latitude at the subsatellite point.

Easy FCDR files provide satellite position at the beginning and end of the scan. This method computes the mean of those two values. In the full FCDR the information seems to be missing.

Returns:

Subsatellite longitude and latitude

_update_attrs(ds, info)[source]

Update dataset attributes.

get_area_def(dataset_id)[source]

Get area definition of the given dataset.

get_dataset(dataset_id, dataset_info)[source]

Get the dataset.

nc_keys = {'IR': 'count_ir', 'WV': 'count_wv'}
class satpy.readers.mviri_l1b_fiduceo_nc.FiduceoMviriEasyFcdrFileHandler(filename, filename_info, filetype_info, mask_bad_quality=False)[source]

Bases: FiduceoMviriBase

File handler for FIDUCEO MVIRI Easy FCDR.

Initialize the file handler.

Parameters:

mask_bad_quality – Mask VIS pixels with bad quality, that means any quality flag except “ok”. If you need more control, use the quality_pixel_bitmask and data_quality_bitmask datasets.

_calibrate_vis(ds, channel, calibration)[source]

Calibrate VIS channel.

Easy FCDR provides reflectance only, no counts or radiance.

nc_keys = {'IR': 'count_ir', 'VIS': 'toa_bidirectional_reflectance_vis', 'WV': 'count_wv'}
class satpy.readers.mviri_l1b_fiduceo_nc.FiduceoMviriFullFcdrFileHandler(filename, filename_info, filetype_info, mask_bad_quality=False)[source]

Bases: FiduceoMviriBase

File handler for FIDUCEO MVIRI Full FCDR.

Initialize the file handler.

Parameters:

mask_bad_quality – Mask VIS pixels with bad quality, that means any quality flag except “ok”. If you need more control, use the quality_pixel_bitmask and data_quality_bitmask datasets.

_calibrate_vis(ds, channel, calibration)[source]

Calibrate VIS channel.

_get_calib_coefs()[source]

Add additional VIS coefficients only present in full FCDR.

nc_keys = {'IR': 'count_ir', 'VIS': 'count_vis', 'WV': 'count_wv'}
class satpy.readers.mviri_l1b_fiduceo_nc.IRWVCalibrator(coefs)[source]

Bases: object

Calibrate IR & WV channels.

Initialize the calibrator.

Parameters:

coefs – Calibration coefficients.

_calibrate_rad_bt(counts, calibration)[source]

Calibrate counts to radiance or brightness temperature.

_counts_to_radiance(counts)[source]

Convert IR/WV counts to radiance.

Reference: [PUG], equations (4.1) and (4.2).

_radiance_to_brightness_temperature(rad)[source]

Convert IR/WV radiance to brightness temperature.

Reference: [PUG], equations (5.1) and (5.2).

calibrate(counts, calibration)[source]

Calibrate IR/WV counts to the given calibration.

class satpy.readers.mviri_l1b_fiduceo_nc.Interpolator[source]

Bases: object

Interpolate datasets to another resolution.

static interp_acq_time(time2d, target_y)[source]

Interpolate scanline acquisition time to the given coordinates.

The files provide timestamps per pixel for the low resolution channels (IR/WV) only.

  1. Average values in each line to obtain one timestamp per line.

  2. For the VIS channel duplicate values in y-direction (as advised by [PUG]).

Note that the timestamps do not increase monotonically with the line number in some cases.

Returns:

Mean scanline acquisition timestamps

static interp_tiepoints(ds, target_x, target_y)[source]

Interpolate dataset between tiepoints.

Uses linear interpolation.

FUTURE: [PUG] recommends cubic spline interpolation.

Parameters:
  • ds – Dataset to be interpolated

  • target_x – Target x coordinates

  • target_y – Target y coordinates

satpy.readers.mviri_l1b_fiduceo_nc.MVIRI_FIELD_OF_VIEW = 18.0

[Handbook] section 5.3.2.1.

class satpy.readers.mviri_l1b_fiduceo_nc.Navigator[source]

Bases: object

Navigate MVIRI images.

_get_factors_offsets(im_size)[source]

Determine line/column offsets and scaling factors.

_get_proj_params(im_size, projection_longitude)[source]

Get projection parameters for the given settings.

get_area_def(im_size, projection_longitude)[source]

Create MVIRI area definition.

class satpy.readers.mviri_l1b_fiduceo_nc.VISCalibrator(coefs, solar_zenith_angle=None)[source]

Bases: object

Calibrate VIS channel.

Initialize the calibrator.

Parameters:
  • coefs – Calibration coefficients.

  • solar_zenith_angle (optional) – Solar zenith angle. Only required for calibration to reflectance.

_calibrate_rad_refl(counts, calibration)[source]

Calibrate counts to radiance or reflectance.

_counts_to_radiance(counts)[source]

Convert VIS counts to radiance.

Reference: [PUG], equations (7) and (8).

_radiance_to_reflectance(rad)[source]

Convert VIS radiance to reflectance factor.

Note: Produces huge reflectances in situations where both radiance and solar zenith angle are small. Maybe the corresponding uncertainties can be used to filter these cases before calculating reflectances.

Reference: [PUG], equation (6).

calibrate(counts, calibration)[source]

Calibrate VIS counts.

static refl_factor_to_percent(refl)[source]

Convert reflectance factor to percent.

update_refl_attrs(refl)[source]

Update attributes of reflectance datasets.

class satpy.readers.mviri_l1b_fiduceo_nc.VisQualityControl(mask)[source]

Bases: object

Simple quality control for VIS channel.

Initialize the quality control.

check()[source]

Check VIS channel quality and issue a warning if it’s bad.

mask(ds)[source]

Mask VIS pixels with bad quality.

Pixels are considered bad quality if the “quality_pixel_bitmask” is everything else than 0 (no flag set).

satpy.readers.mviri_l1b_fiduceo_nc.is_high_resol(resolution)[source]

Identify high resolution channel.