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:
[Handbook] MFG User Handbook
[PUG] FIDUCEO MVIRI FCDR Product User Guide
- 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.
- _reassign_coords(ds)[source]
Re-assign coordinates.
For some reason xarray doesn’t assign coordinates to all high resolution data variables.
- property attrs
Exposes dataset attributes.
- 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
anddata_quality_bitmask
datasets.
- 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_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
- 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
anddata_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
anddata_quality_bitmask
datasets.
- 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).
- 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.
Average values in each line to obtain one timestamp per line.
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
- satpy.readers.mviri_l1b_fiduceo_nc.MVIRI_FIELD_OF_VIEW = 18.0
[Handbook] section 5.3.2.1.
Bases:
object
Navigate MVIRI images.
Determine line/column offsets and scaling factors.
Get projection parameters for the given settings.
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.
- _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).