eumetsat module
EUMETSAT module
Tools for interacting with EUMETSAT Data Store and Data Tailor products.
This module provides high-level utilities to authenticate, download, customise, and visualise EUMETSAT satellite data (e.g., MTG-FCI, Metop, MSG). It builds on the official EUMDAC Python client and offers additional helper routines suited for scientific workflows.
The main features include:
Authentication with the EUMETSAT Data Store using locally stored credentials (
get_token),Requesting and monitoring Data Tailor customisations (
customisation),Downloading satellite files over a specified time window (
download_data),Plotting Atmospheric Motion Vectors (AMVs) from Level-2 products (
plot_amvs),Visualising radiance fields from FCI Level-1/Level-2 datasets (
plot_radiance),General helper tools to facilitate EUMETSAT data processing within VisuSat.
This module centralizes all interactions with EUMETSAT services to ensure consistent, robust, and reproducible satellite data workflows.
- visusat.eumetsat.customisation(product, chain)
Request and download a customised EUMETSAT product using the EUMDAC Data Tailor API.
This function submits a customisation request to the EUMETSAT Data Tailor Web Services using the EUMDAC Python client. It monitors the job until completion, handles possible error states, and downloads all generated output files to the local data directory.
- Parameters:
product (eumdac.DataItem) – The EUMETSAT product to customise. This is typically obtained via a search in the EUMETSAT Data Store client.
chain (eumdac.tailor_models.Chain) – Data Tailor processing chain describing the desired customisation (e.g., spatial subset, spectral bands selection, projection, etc.).
- Returns:
- A tuple containing:
The path to the last downloaded file.
The
Customisationobject returned by the Data Tailor Web Service.
- Return type:
tuple of (str, eumdac.Customisation)
- visusat.eumetsat.download_custom_products(products, chain, directory)
Download a series of EUMETSAT products according to a specific Data Tailor chain.
- Parameters:
products (List[eumdac.products]) – List of EUMETSAT products.
chain (datetime) – Data tailor chain for customisation.
directory (str) – Output directory for generated files.
Example
Download series of MTG FCI L1c HighRes effective radiance (requires EUMETSAT Data Store credentials):
>>> import eumdac >>> from datetime import datetime >>> from visusat.eumetsat import get_token >>> token = get_token() >>> datastore = eumdac.DataStore(token) >>> collection = datastore.get_collection(required_collection) >>> start = datetime(2025, 10, 22, 12, 00) >>> end = datetime(2025, 10, 22, 18, 00) >>> products = collection.search(dtstart=start, dtend=end) >>> chain = eumdac.tailor_models.Chain( >>> product="FCIL1HRFI", >>> format="geotiff", >>> filter={"bands": ["vis_06_hr_effective_radiance"]}, >>> projection="geographic", >>> roi="western_europe") >>> directory = "./test" >>> download_custom_products(products, chain, directory)
- visusat.eumetsat.get_token(credentials_path=PosixPath('/home/docs/.config/visusat/id_EUMETSAT.json'))
Retrieve an EUMETSAT Data Store access token using local credentials.
The function reads a JSON file containing the consumer key and secret, and returns a valid
eumdac.AccessTokenobject for authenticating with the EUMETSAT Data Store (EUMDAC).- Returns:
A valid authentication token for accessing EUMETSAT Data Store products.
- Return type:
eumdac.AccessToken
- visusat.eumetsat.load_data(collection_id, start_time, end_time, first=False, output_file=None)
Download EUMETSAT satellite Data via the EUMDAC API.
- Parameters:
collection_id (str) – Identifier of the desired collection, as listed in the EUMETSAT Data Store.
start_time (datetime) – Start ot the requested time period.
end_time (datetime) – End of the requested time period.
last (bool, optional) – If True, only download the most recent file within the time period. Defaults to False.
output_file (str, optional) – Specific output file path. Only valid if a single file is produced. Ignored when multiple files are downloaded.
- Returns:
Paths of the downloaded files.
- Return type:
list of str
- visusat.eumetsat.plot_amvs(filename, product, box=None, outfile=None, savefig=True, display=False)
Plot Atmospheric Motion Vectors (AMVs) from an EUMETSAT AMV NetCDF product.
This function loads the AMV dataset, extracts the zonal (u) and meridional (v) wind components, and visualises them as scatter plots on a map using a Plate Carrée projection. Two subplots are generated: one for the zonal component and one for the meridional component. A zoomed domain can be specified via the
boxargument.- Parameters:
filename (str or path-like) – Path to the input NetCDF file containing AMVs.
product (object) – EUMETSAT product metadata object. Must contain
collection_idanddescriptionattributes.box (list of float, optional) – Geographic subset defined as
[lon_min, lon_max, lat_min, lat_max]. If provided, the map will zoom into this region. Defaults to None.outfile (str or path-like, optional) – Output filename for the generated PNG figure. If None, a default name is automatically constructed based on the input file. Defaults to None.
savefig (bool, optional) – If True, save the figure to
outfile. Defaults to True.display (bool, optional) – If True, display the figure interactively using
plt.show(). Not recommended when processing many files. Defaults to False.
- Returns:
The function generates and optionally saves a figure, but does not return an object.
- Return type:
None
- visusat.eumetsat.plot_radiances(filename, collection_id, *, outfile=None, savefig=True, display=False)
Plot mean radiance fields from an EUMETSAT FCI AllSkyRadiance NetCDF product.
This function loads an FCI AllSkyRadiance dataset and visualises the radiance distribution across the six AllSky categories for a given spectral channel. Each category is displayed as a separate subplot. The function supports automatic output naming and optional file saving or on-screen display.
- Parameters:
filename (str or path-like) – Path to the input NetCDF file containing
radiance_meandata.collection_id (str) – EUMETSAT collection identifier from which the dataset was retrieved. Used to determine the default output directory.
outfile (str or path-like, optional) – Output filename for saving the generated figure. If None, a filename is automatically constructed based on the input file. Defaults to None.
savefig (bool, optional) – If True, save the figure to
outfile. Defaults to True.display (bool, optional) – If True, display the figure with
plt.show(). Defaults to False.
- Returns:
The function creates and optionally saves a figure but does not return any object.
- Return type:
None