aemetxfb.obs
Observations module.
- aemetxfb.obs.get_chem_previous_day(output_path, loc, prod)[source]
Download a chemical observation image from AEMet for the previous day.
Downloads a GIF image showing chemical composition data from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
The data corresponds to the previous day’s measurements.
- Parameters:
output_path (str | pathlib.Path) – Path where the GIF file will be saved. Must have
.gifextension.loc (str) – Location name. Valid values:
Badajoz,Girona,Guadalajara,Huelva,Lleida,Mahon,Asturias,Coruna,Lugo,Zamora,Toledo,Granada,Valencia.prod (str) –
Product type. Valid values:
'o': Ozono superficial (Ozone surface)'n': Dióxido y monóxido de nitrógeno (Nitrogen oxides)'s': Dióxido de azufre (Sulfur dioxide)'r': Radiación solar (Solar radiation)
- Returns:
Path to the downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathdoesn’t have.gifextension, or iflocorprodare invalid.RuntimeError – If the download fails.
See also
get_chem_todayDownload current chemical observation.
get_chem_previous_monthDownload chemical observation for the previous month.
ExternalExamples
>>> get_chem_previous_day("kaka/test.gif", "Lleida", "o") 'kaka/test.gif'
- aemetxfb.obs.get_chem_previous_month(output_path, loc)[source]
Download a chemical observation image from AEMet for the previous month.
Downloads a GIF image showing chemical composition data from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
The data corresponds to the previous month’s measurements and shows the evolution of ozone and nitrogen dioxide.
- Parameters:
output_path (str | pathlib.Path) – Path where the GIF file will be saved. Must have
.gifextension.loc (str) – Location name. Valid values:
Badajoz,Girona,Guadalajara,Huelva,Lleida,Mahon,Asturias,Coruna,Lugo,Zamora,Toledo,Granada,Valencia.
- Returns:
Path to the downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathdoesn’t have.gifextension, or iflocis invalid.RuntimeError – If the download fails.
See also
get_chem_todayDownload current chemical observation.
get_chem_previous_dayDownload chemical observation for the previous day.
ExternalExamples
>>> get_chem_previous_month("kaka/test.gif", "Lleida") 'kaka/test.gif'
- aemetxfb.obs.get_chem_today(output_path, loc, prod)[source]
Download a chemical observation image from AEMet.
Downloads a GIF image showing chemical composition data from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
- Parameters:
output_path (str | pathlib.Path) – Path where the GIF file will be saved. Must have
.gifextension.loc (str) – Location name. Valid values:
Badajoz,Girona,Guadalajara,Huelva,Lleida,Mahon,Asturias,Coruna,Lugo,Zamora,Toledo,Granada,Valencia.prod (str) –
Product type. Valid values:
'o': Ozono superficial (Ozone surface)'n': Dióxido y monóxido de nitrógeno (Nitrogen oxides)'s': Dióxido de azufre (Sulfur dioxide)'r': Radiación solar (Solar radiation)
- Returns:
Path to the downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathdoesn’t have.gifextension, or iflocorprodare invalid.RuntimeError – If the download fails.
See also
get_chem_previous_dayDownload chemical observation for the previous day.
get_chem_previous_monthDownload chemical observation for the previous month.
ExternalExamples
>>> get_chem_today("kaka/test.gif", "Lleida", "o") 'kaka/test.gif' >>> get_chem_today("kaka/test.gif", "Invalid", "o") Traceback (most recent call last): ... ValueError: Invalid location: Invalid...
- aemetxfb.obs.get_daily_summary(station_id)[source]
Fetch daily summary data for a given station.
- Parameters:
station_id (str) – Meteorological station ID (e.g.,
"C619Y"for La Aldea).- Returns:
Daily summary data for the current day. Columns are converted to appropriate types:
"Estación"and"Provincia":strNumeric columns (
Temperatura máxima,Racha, etc.):float64"Datos hasta":datetime.timeTime-related columns:
datetime.time
- Return type:
pd.DataFrame
- Raises:
ValueError – If
station_idis empty orNone.RuntimeError – If data cannot be fetched or parsed.
See also
get_previous_daily_summariesFetch previous days’ summaries.
get_last_24hFetch hourly data for the last 24 hours.
External
- aemetxfb.obs.get_last_24h(station_id)[source]
Fetch hourly weather data for the last 24 hours from a given station.
- Parameters:
station_id (str) – Meteorological station ID (e.g.,
"B662X"for Binissalem).- Returns:
Weather data for the last 24 hours. Columns are converted to appropriate types:
"Fecha y hora oficial":datetime64[ns]Numeric columns (
Temperatura,Velocidad del viento, etc.):float64"Dirección del viento"and"Dirección de racha":str
- Return type:
pd.DataFrame
- Raises:
ValueError – If
station_idis empty orNone.RuntimeError – If data cannot be fetched or parsed.
See also
get_daily_summaryFetch daily summary data for a station.
get_previous_daily_summariesFetch previous daily summary data.
External
- aemetxfb.obs.get_lightning_latest(output_path)[source]
Download latest lightning data from AEMet.
Downloads the latest lightning data (cloud-to-ground discharges) from AEMet. The data is provided in Geotiff format compressed in a .tar.gz file.
The lightning maps display:
Blue dots for negative discharges
Red dots for positive discharges
The data covers the last 24 hours and excludes discharges over French and Portuguese terrestrial zones. Time zones:
Peninsular Spain and Balearic Islands: UTC+1 (winter) / UTC+2 (summer)
Canary Islands: UTC (winter) / UTC+1 (summer)
- Parameters:
output_path (str | pathlib.Path) – Full path to the output
.tar.gzfile. Parent directories will be created if needed.- Raises:
ValueError – If
output_pathdoes not end with.tar.gz.RuntimeError – If data cannot be fetched or file cannot be saved.
- Return type:
None
See also
ExternalExamples
>>> get_lightning_latest("kaka/lightning_data.tar.gz")
- aemetxfb.obs.get_previous_daily_summaries(station_id)[source]
Fetch previous daily summary data for a given station.
- Parameters:
station_id (str) – Meteorological station ID (e.g.,
"C619Y"for La Aldea).- Returns:
Previous daily summary data. Columns are converted to appropriate types:
"Fecha y hora oficial":datetime64[ns]Numeric columns (
Temperatura máxima,Racha, etc.):float64Time-related columns:
datetime.time
- Return type:
pd.DataFrame
- Raises:
ValueError – If
station_idis empty orNone.RuntimeError – If data cannot be fetched or parsed.
See also
get_daily_summaryFetch current day summary data.
get_last_24hFetch hourly data for the last 24 hours.
External
- aemetxfb.obs.get_radar_PI_IB_refl_24h(output_path, period=0, prefix='')[source]
Download radar reflectivity images (composite for Iberian Peninsula and Balearic islands).
Downloads the latest 10 minutes composite of radar reflectivity images from AEMet for the last 24h depending on the selected period. The available image format is PNG. The images correspond to the lowest radar elevation scan (0.5° above horizontal). Reflectivity values are displayed in decibels (dBZ) with the color scale:
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
The timestamp is rounded to the nearest 10-minute interval (00, 10, 20, …, 50 minutes).
This function also retrieves the radar bounds (bounding box coordinates) in JSON format and saves them to a file with the same name as the PNG but with
.jsonextension.- Parameters:
output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 24. A value of 0 (default) retrieves the latest available image and JSON data. Default is 0.
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}". Default is “”.
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_PI_IB_refl_4hDownload composite reflectivity (last 4h).
get_radar_regional_reflectivity_4hDownload regional reflectivity.
External
- aemetxfb.obs.get_radar_PI_IB_refl_4h(output_path)[source]
Download radar reflectivity images (composite for Iberian Peninsula and Balearic islands).
Downloads the latest 10 minutes composite of radar reflectivity images from AEMet for the last 4h. The available image format is geotiff. The images correspond to the lowest radar elevation scan (0.5° above horizontal).
Reflectivity values are displayed in decibels (dBZ) with the color scale:
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
- Parameters:
output_path (str | pathlib.Path) – Full path to the output
.tar.gzfile. Parent directories will be created if needed.- Raises:
ValueError – If
output_pathdoes not end with.tar.gzor is empty/None.RuntimeError – If data cannot be fetched or file cannot be saved.
- Return type:
None
See also
External
- aemetxfb.obs.get_radar_regional_accumprec1_24h(radar, output_path, period=0, prefix='')[source]
Download regional radar accumulated precipitation 1h images (RN1.1HR_CAPPI product) for the last 24 hours.
Downloads regional radar accumulated precipitation images from AEMet for the last 24 hours depending on the selected period. The available image format is PNG. The images correspond to the accumulated precipitation in 1h in mm.
Values are displayed in millimeters (mm) with the color scale:
Color
Range(mm)
#001eff
0.5-1
#0064ff
1-2
#0087ff
2-4
#00b4ff
4-8
#438323
8-16
#00d200
16-32
#ffbb00
32-64
#ff7f00
64-128
#ff0000
128-256
#ff00ff
>256
The timestamp corresponds to hourly data (hours in point).
This function also retrieves the radar bounds (bounding box coordinates) in JSON format and saves them to a file with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 24. A value of 0 (default) retrieves the latest available image and JSON data. Default is 0.
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}". Default is “”.
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 24, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_reflectivity_4hDownload reflectivity images.
get_radar_regional_accumprec6_36hDownload 6h precipitation accumulation.
External
- aemetxfb.obs.get_radar_regional_accumprec6_36h(radar, output_path, period=0, prefix='')[source]
Download regional radar accumulated precipitation 6h images (RNN.6HR_CAPPI product) for the last 36 hours.
Downloads regional radar accumulated precipitation images from AEMet for the last 36 hours depending on the selected period. The available image format is PNG. The images correspond to the accumulated precipitation in 6h in mm.
Values are displayed in millimeters (mm) with the color scale:
Color
Range(mm)
#001eff
0.5-1
#0064ff
1-2
#0087ff
2-4
#00b4ff
4-8
#438323
8-16
#00d200
16-32
#ffbb00
32-64
#ff7f00
64-128
#ff0000
128-256
#ff00ff
>256
The timestamp corresponds to data every 6 hours (hours in point: 00, 06, 12, 18).
This function also retrieves the radar bounds (bounding box coordinates) in JSON format and saves them to a file with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 36. A value of 0 (default) retrieves the latest available image and JSON data. Default is 0.
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}". Default is “”.
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 36, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_accumprec1_24hDownload 1h precipitation accumulation.
get_radar_regional_reflectivity_4hDownload reflectivity images.
External
- aemetxfb.obs.get_radar_regional_echotop_4h(radar, output_path, period=0, prefix='')[source]
Download regional radar echotop images (TOP.12DBZ_240) for the last 4 hours.
Downloads regional radar echotop images from AEMet for the last 4 hours depending on the selected period. The available image format is PNG. Images correspond to the echotop height for a reflectivity > 12 dBZ.
Echotop values are displayed in kilometers (km) above ground. The timestamp is rounded to the nearest 10-minute interval (00, 10, 20, …, 50 minutes).
Color
Range(km)
#0000fc
1-2
#0082ff
2-3
#00beff
3-4
#00ffff
4-5
#438323
5-6
#96c800
6-7
#00fa00
7-8
#ffff00
8-10
#ffaa00
10-12
#ff6b00
12-14
#fc0000
14-16
#c80050
16-20
#820a6e
>20
Also retrieves radar bounds (bounding box coordinates) in JSON format and saves them with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 4. Default is 0 (latest available image only).
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}".
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 4, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_reflectivity_4hDownload reflectivity images.
get_radar_regional_accumprec1_24hDownload 1h precipitation accumulation.
External
- aemetxfb.obs.get_radar_regional_latest(output_path)[source]
Download the latest regional radar images.
Downloads the latest 10 minutes regional radar data available. The available image format is geotiff. This information could be outdated if the radar is not working.
PPI.Z images correspond to the lowest radar elevation scan (0.5° above horizontal). Reflectivity values are displayed in decibels (dBZ).
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
TOP.12DBZ images correspond to the echotop height for reflectivity > 12 dBZ, displayed in kilometers (km).
Color
Range(km)
#0000fc
1-2
#0082ff
2-3
#00beff
3-4
#00ffff
4-5
#438323
5-6
#96c800
6-7
#00fa00
7-8
#ffff00
8-10
#ffaa00
10-12
#ff6b00
12-14
#fc0000
14-16
#c80050
16-20
#820a6e
>20
RN1.1HR and RNN.6HR images show accumulated precipitation in 1h and 6h respectively, displayed in millimeters (mm).
Color
Range(mm)
#001eff
0.5-1
#0064ff
1-2
#0087ff
2-4
#00b4ff
4-8
#438323
8-16
#00d200
16-32
#ffbb00
32-64
#ff7f00
64-128
#ff0000
128-256
#ff00ff
>256
- Parameters:
output_path (str | pathlib.Path) – Full path to the output
.tar.gzfile. Parent directories will be created if needed.- Raises:
ValueError – If
output_pathdoes not end with.tar.gzor is empty/None.RuntimeError – If data cannot be fetched or file cannot be saved.
- Return type:
None
See also
get_radar_regional_reflectivity_4hDownload regional reflectivity images.
get_radar_regional_echotop_4hDownload regional echotop images.
External
- aemetxfb.obs.get_radar_regional_reflectivity_4h(radar, output_path, period=0, prefix='')[source]
Download regional radar reflectivity images (PPI.Z_005_240) for the last 4 hours.
Downloads regional radar reflectivity images from AEMet for the last 4 hours depending on the selected period. The available image format is PNG. Images correspond to the lowest radar elevation scan (0.5° above horizontal).
Reflectivity values are displayed in decibels (dBZ). The timestamp is rounded to the nearest 10-minute interval (00, 10, 20, …, 50 minutes).
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
Also retrieves radar bounds (bounding box coordinates) in JSON format and saves them with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 4. Default is 0 (latest available image only).
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}".
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 4, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_echotop_4hDownload echotop images.
get_radar_regional_accumprec1_24hDownload 1h precipitation accumulation.
External
- aemetxfb.obs.get_UVI_previous_day()[source]
Download UVI (Ultraviolet Index) data for the previous day from AEMet.
Fetches UVI observation data from the AEMet website, parsing the HTML table that contains hourly UVI values for multiple stations.
- Returns:
DataFrame with:
Station names as rows (index)
Hours 07-22 as columns
MAXcolumn with maximum UVI for each station
- Return type:
pd.DataFrame
- Raises:
RuntimeError – If the data cannot be fetched or parsed.
See also
get_UVI_previous_day_imgDownload UVI observation image.
get_ozone_previous_dayDownload ozone data table.
ExternalExamples
>>> df = get_UVI_previous_day() >>> print(df.head()) 07 08 09 10 ... 21 22 MAX A Coruña 0 0 0 1 ... 0 0 5.0 Almería 0 0 0 1 ... 0 0 6.0
- aemetxfb.obs.get_UVI_previous_day_img(output_path, loc)[source]
Download UVI (Ultraviolet Index) observation image from AEMet.
Downloads the UVI observation image for the previous day from AEMet observation stations. The image shows the UVI values graphically.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – UVI location. Valid values:
Coruna,Almeria,Badajoz,Barcelona,Caceres,Cadiz,CReal,Cordoba,Granada,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Igueldo,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_UVI_previous_dayDownload UVI data table for the previous day.
get_UVI_running_year_imgDownload UVI running year image.
get_radiation_radDownload solar radiation images.
ExternalExamples
>>> get_UVI_previous_day_img("data/uvi/madrid.png", "Madrid-CRN") 'data/uvi/madrid.png'
- aemetxfb.obs.get_UVI_running_year_img(output_path, loc)[source]
Download UVI (Ultraviolet Index) running year image from AEMet.
Downloads the UVI running year image from AEMet observation stations. The image shows the UVI values graphically for the current year.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – UVI location. Valid values:
Coruna,Almeria,Badajoz,Barcelona,Caceres,Cadiz,CReal,Cordoba,Granada,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Igueldo,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_UVI_previous_day_imgDownload UVI observation image.
get_UVI_previous_dayDownload UVI data table.
ExternalExamples
>>> get_UVI_running_year_img("data/uvi/anual_madrid.png", "Madrid-CRN") 'data/uvi/anual_madrid.png'
- aemetxfb.obs.get_ozone_previous_day()[source]
Download ozone data for the previous day from AEMet.
Fetches ozone observation data from the AEMet website, parsing the HTML table that contains ozone values for multiple stations.
- Returns:
DataFrame with:
Station names as rows (index)
"Ozono (UD)"column with ozone values
- Return type:
pd.DataFrame
- Raises:
RuntimeError – If the data cannot be fetched or parsed.
See also
get_ozone_running_yearDownload ozone running year image.
get_ozone_soundingDownload ozone sounding image.
get_UVI_previous_dayDownload UVI data table.
ExternalExamples
>>> df = get_ozone_previous_day() >>> print(df.head()) Ozono (UD) A Coruña 45.0 Madrid 52.0
- aemetxfb.obs.get_ozone_running_year(output_path, loc)[source]
Download ozone running year image from AEMet.
Downloads the ozone running year image from AEMet observation stations. The image shows the ozone values graphically for the current year.
- Parameters:
output_path (str | pathlib.Path) – Path where the image will be saved (must have
.pngextension).loc (str) – Ozone location. Valid values:
Coruna,Izana,Madrid-CRN,Arenosillo,Murcia,Tenerife,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name oroutput_pathdoesn’t have.pngextension.
See also
get_ozone_soundingDownload ozone sounding image.
get_ozone_previous_dayDownload ozone data table.
ExternalExamples
>>> get_ozone_running_year("kaka/output.png", "Madrid-CRN") 'kaka/output.png' >>> get_ozone_running_year("kaka/output.txt", "Madrid-CRN") Traceback (most recent call last): ... ValueError: output_path must have .png extension...
- aemetxfb.obs.get_ozone_sounding(output_path, loc)[source]
Download ozone sounding image from AEMet.
Downloads the ozone sounding image from AEMet observation stations. The image shows the ozone sounding data graphically.
- Parameters:
output_path (str | pathlib.Path) – Path where the image will be saved (must have
.pngextension).loc (str) – Ozone sounding location. Valid values:
BarajasMad,BotanicoTfe.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name oroutput_pathdoesn’t have.pngextension.
See also
get_ozone_running_yearDownload ozone running year image.
get_ozone_previous_dayDownload ozone data table.
ExternalExamples
>>> get_ozone_sounding("kaka/output.png", "BarajasMad") 'kaka/output.png'
- aemetxfb.obs.get_radiation_ir(output_path, loc)[source]
Download infrared radiation observation images from AEMet.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – Radiation location. Valid values:
Coruna,Badajoz,Caceres,Cordoba,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_radiation_radDownload solar radiation images.
get_UVI_previous_day_imgDownload UVI observation images.
ExternalExamples
>>> get_radiation_ir("data/ir/madrid.png", "Madrid-CRN") 'data/ir/madrid.png'
- aemetxfb.obs.get_radiation_rad(output_path, loc)[source]
Download solar radiation observation images from AEMet.
Downloads solar radiation images (global, direct, diffuse) from AEMet observation stations.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – Radiation location. Valid values:
Coruna,Almeria,Badajoz,Barcelona,Caceres,Cadiz,CReal,Cordoba,Granada,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Igueldo,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_radiation_irDownload infrared radiation images.
get_UVI_previous_day_imgDownload UVI observation images.
ExternalExamples
>>> get_radiation_rad("data/rad/madrid.png", "Madrid-CRN") 'data/rad/madrid.png' >>> get_radiation_rad("data/rad/madrid.txt", "Madrid-CRN") Traceback (most recent call last): ... ValueError: output_path must have .png extension... >>> get_radiation_rad("data/rad/madrid.png", "Invalid") Traceback (most recent call last): ... ValueError: Invalid location 'Invalid'...
- aemetxfb.obs.get_satellite_IR_24h(output_path, period=0, prefix='')[source]
Download processed Meteosat infrared satellite images.
The images are downloaded in GIF format from AEMet’s website.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and the N previous hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}".
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_VIS_24hDownload visible channel images.
get_satellite_global_24hDownload global satellite images.
ExternalExamples
>>> get_satellite_IR_24h("kaka", period=0) ['kaka/satellite_IR_...gif'] >>> get_satellite_IR_24h("kaka", period=25) Traceback (most recent call last): ... ValueError: period must be between 0 and 24
- aemetxfb.obs.get_satellite_VIS_24h(output_path, period=0, prefix='')[source]
Download Meteosat visible channel satellite images.
The images are downloaded in JPEG format from AEMet’s website. Note that during nighttime hours, images may not be available (HTTP 404).
- Parameters:
output_path (str | Path) – Directory path where the downloaded JPEG images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and the N previous hours, skipping unavailable nighttime images. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_global_24hDownload global satellite images.
External
- aemetxfb.obs.get_satellite_global_24h(output_path, period=0, prefix='')[source]
Download infrared satellite images from Meteosat, GOES, and Himawari.
The images are downloaded in GIF format from AEMet’s website. Images are available every 3 hours.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 3 hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_VIS_24hDownload visible channel images.
External
- aemetxfb.obs.get_satellite_globe_0_24h(output_path, period=0, prefix='')[source]
Download infrared satellite images of the Earth visible from Meteosat at 0° longitude.
The images are downloaded in GIF format from AEMet’s website. Images are available every 3 hours.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 3 hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_globe_415_24hDownload images from Meteosat at 41.5° longitude.
External
- aemetxfb.obs.get_satellite_globe_415_24h(output_path, period=0, prefix='')[source]
Download infrared satellite images of the Earth visible from Meteosat at 41.5° longitude.
The images are downloaded in GIF format from AEMet’s website. Images are available every 3 hours.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 3 hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_globe_0_24hDownload images from Meteosat at 0° longitude.
External
- aemetxfb.obs.get_satellite_airmasses_24h(output_path, period=0, prefix='')[source]
Download RGB composite satellite images showing air mass characteristics.
The images are downloaded in JPEG format from AEMet’s website. These RGB composites combine multiple Meteosat operational channels at 0°N 0°W to provide information about air mass properties and cloud characteristics.
- Parameters:
output_path (str | Path) – Directory path where the downloaded JPEG images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 1 hour. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_global_24hDownload global satellite images.
External
- aemetxfb.obs.get_satellite_NDVI(output_path)[source]
Download NDVI (Normalized Difference Vegetation Index) satellite image.
The image is downloaded in GIF format from AEMet’s website. This NDVI image is derived from NASA’s MOD13A1 product, using MODIS data from the Terra and Aqua satellites. It shows vegetation development with a resolution of 500 m, updated every 16 days.
- Parameters:
output_path (str | Path) – Full path where the downloaded GIF image will be saved. Must have a
.gifextension. Parent directories will be created if they do not exist.- Returns:
Path to downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathis empty orNone, or if it does not have a.gifextension.RuntimeError – If data cannot be fetched or file cannot be saved.
Examples
>>> get_satellite_NDVI("data/ndvi_image.gif") 'data/ndvi_image.gif'
- aemetxfb.obs.get_satellite_SST(output_path)[source]
Download Sea Surface Temperature (SST) satellite image.
The image is downloaded in GIF format from AEMet’s website. This SST image is generated based on the “Global Metop Sea Surface Temperature” product developed by OSI SAF (Ocean and Sea Ice Satellite Application Facility) of EUMETSAT, the center dedicated to satellite ocean and sea ice applications. The image has a resolution of 0.05° and is updated daily, showing temperature values with a maximum age of 48 hours.
- Parameters:
output_path (str | Path) – Full path where the downloaded GIF image will be saved. Must have a
.gifextension. Parent directories will be created if they do not exist.- Returns:
Path to downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathis empty orNone, or if it does not have a.gifextension.RuntimeError – If data cannot be fetched or file cannot be saved.
Examples
>>> get_satellite_SST("data/sst_image.gif") 'data/sst_image.gif'
Submodules
aemetxfb.obs.chem
Chemical observation module for AEMet data.
This module provides functions to download chemical composition data from the Spanish national weather service (AEMet). The data comes from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
Data is updated hourly. The available products correspond to:
'o': Ozono superficial (Ozone surface)'n': Dióxido y monóxido de nitrógeno (Nitrogen oxides)'s': Dióxido de azufre (Sulfur dioxide)'r': Radiación solar (Solar radiation)
Locations and their corresponding monitoring stations:
"Badajoz": Barcarrota (Badajoz)"Girona": Cabo de Creus (Girona)"Guadalajara": Campisábalos (Guadalajara)"Huelva": Doñana (Huelva)"Lleida": Els Torms (Lleida)"Mahon": Mahón (Illes Balears)"Asturias": Niembro-Llanes (Asturias)"Coruna": Noia (A Coruña)"Lugo": O Saviñao (Lugo)"Zamora": Peñausende (Zamora)"Toledo": San Pablo de los Montes (Toledo)"Granada": Víznar (Granada)"Valencia": Zarra (Valencia)
See also: https://www.aemet.es/es/eltiempo/observacion/contaminacionfondo/ayuda
- aemetxfb.obs.chem.get_chem_today(output_path, loc, prod)[source]
Download a chemical observation image from AEMet.
Downloads a GIF image showing chemical composition data from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
- Parameters:
output_path (str | pathlib.Path) – Path where the GIF file will be saved. Must have
.gifextension.loc (str) – Location name. Valid values:
Badajoz,Girona,Guadalajara,Huelva,Lleida,Mahon,Asturias,Coruna,Lugo,Zamora,Toledo,Granada,Valencia.prod (str) –
Product type. Valid values:
'o': Ozono superficial (Ozone surface)'n': Dióxido y monóxido de nitrógeno (Nitrogen oxides)'s': Dióxido de azufre (Sulfur dioxide)'r': Radiación solar (Solar radiation)
- Returns:
Path to the downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathdoesn’t have.gifextension, or iflocorprodare invalid.RuntimeError – If the download fails.
See also
get_chem_previous_dayDownload chemical observation for the previous day.
get_chem_previous_monthDownload chemical observation for the previous month.
ExternalExamples
>>> get_chem_today("kaka/test.gif", "Lleida", "o") 'kaka/test.gif' >>> get_chem_today("kaka/test.gif", "Invalid", "o") Traceback (most recent call last): ... ValueError: Invalid location: Invalid...
- aemetxfb.obs.chem.get_chem_previous_day(output_path, loc, prod)[source]
Download a chemical observation image from AEMet for the previous day.
Downloads a GIF image showing chemical composition data from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
The data corresponds to the previous day’s measurements.
- Parameters:
output_path (str | pathlib.Path) – Path where the GIF file will be saved. Must have
.gifextension.loc (str) – Location name. Valid values:
Badajoz,Girona,Guadalajara,Huelva,Lleida,Mahon,Asturias,Coruna,Lugo,Zamora,Toledo,Granada,Valencia.prod (str) –
Product type. Valid values:
'o': Ozono superficial (Ozone surface)'n': Dióxido y monóxido de nitrógeno (Nitrogen oxides)'s': Dióxido de azufre (Sulfur dioxide)'r': Radiación solar (Solar radiation)
- Returns:
Path to the downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathdoesn’t have.gifextension, or iflocorprodare invalid.RuntimeError – If the download fails.
See also
get_chem_todayDownload current chemical observation.
get_chem_previous_monthDownload chemical observation for the previous month.
ExternalExamples
>>> get_chem_previous_day("kaka/test.gif", "Lleida", "o") 'kaka/test.gif'
- aemetxfb.obs.chem.get_chem_previous_month(output_path, loc)[source]
Download a chemical observation image from AEMet for the previous month.
Downloads a GIF image showing chemical composition data from the Spanish EMEP/VAG/CAMP network dedicated to the observation of atmospheric chemical composition at regional scale, away from contaminant sources.
The data corresponds to the previous month’s measurements and shows the evolution of ozone and nitrogen dioxide.
- Parameters:
output_path (str | pathlib.Path) – Path where the GIF file will be saved. Must have
.gifextension.loc (str) – Location name. Valid values:
Badajoz,Girona,Guadalajara,Huelva,Lleida,Mahon,Asturias,Coruna,Lugo,Zamora,Toledo,Granada,Valencia.
- Returns:
Path to the downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathdoesn’t have.gifextension, or iflocis invalid.RuntimeError – If the download fails.
See also
get_chem_todayDownload current chemical observation.
get_chem_previous_dayDownload chemical observation for the previous day.
ExternalExamples
>>> get_chem_previous_month("kaka/test.gif", "Lleida") 'kaka/test.gif'
aemetxfb.obs.lightning
Module to get lightning data from AEMet API.
See also: https://www.aemet.es/es/eltiempo/observacion/rayos/ayuda
- aemetxfb.obs.lightning.get_lightning_latest(output_path)[source]
Download latest lightning data from AEMet.
Downloads the latest lightning data (cloud-to-ground discharges) from AEMet. The data is provided in Geotiff format compressed in a .tar.gz file.
The lightning maps display:
Blue dots for negative discharges
Red dots for positive discharges
The data covers the last 24 hours and excludes discharges over French and Portuguese terrestrial zones. Time zones:
Peninsular Spain and Balearic Islands: UTC+1 (winter) / UTC+2 (summer)
Canary Islands: UTC (winter) / UTC+1 (summer)
- Parameters:
output_path (str | pathlib.Path) – Full path to the output
.tar.gzfile. Parent directories will be created if needed.- Raises:
ValueError – If
output_pathdoes not end with.tar.gz.RuntimeError – If data cannot be fetched or file cannot be saved.
- Return type:
None
See also
ExternalExamples
>>> get_lightning_latest("kaka/lightning_data.tar.gz")
aemetxfb.obs.masts
Module to get observation data from AEMet API masts/stations.
See also: https://www.aemet.es/es/eltiempo/observacion/ultimosdatos/ayuda
- aemetxfb.obs.masts.get_last_24h(station_id)[source]
Fetch hourly weather data for the last 24 hours from a given station.
- Parameters:
station_id (str) – Meteorological station ID (e.g.,
"B662X"for Binissalem).- Returns:
Weather data for the last 24 hours. Columns are converted to appropriate types:
"Fecha y hora oficial":datetime64[ns]Numeric columns (
Temperatura,Velocidad del viento, etc.):float64"Dirección del viento"and"Dirección de racha":str
- Return type:
pd.DataFrame
- Raises:
ValueError – If
station_idis empty orNone.RuntimeError – If data cannot be fetched or parsed.
See also
get_daily_summaryFetch daily summary data for a station.
get_previous_daily_summariesFetch previous daily summary data.
External
- aemetxfb.obs.masts.get_daily_summary(station_id)[source]
Fetch daily summary data for a given station.
- Parameters:
station_id (str) – Meteorological station ID (e.g.,
"C619Y"for La Aldea).- Returns:
Daily summary data for the current day. Columns are converted to appropriate types:
"Estación"and"Provincia":strNumeric columns (
Temperatura máxima,Racha, etc.):float64"Datos hasta":datetime.timeTime-related columns:
datetime.time
- Return type:
pd.DataFrame
- Raises:
ValueError – If
station_idis empty orNone.RuntimeError – If data cannot be fetched or parsed.
See also
get_previous_daily_summariesFetch previous days’ summaries.
get_last_24hFetch hourly data for the last 24 hours.
External
- aemetxfb.obs.masts.get_previous_daily_summaries(station_id)[source]
Fetch previous daily summary data for a given station.
- Parameters:
station_id (str) – Meteorological station ID (e.g.,
"C619Y"for La Aldea).- Returns:
Previous daily summary data. Columns are converted to appropriate types:
"Fecha y hora oficial":datetime64[ns]Numeric columns (
Temperatura máxima,Racha, etc.):float64Time-related columns:
datetime.time
- Return type:
pd.DataFrame
- Raises:
ValueError – If
station_idis empty orNone.RuntimeError – If data cannot be fetched or parsed.
See also
get_daily_summaryFetch current day summary data.
get_last_24hFetch hourly data for the last 24 hours.
External
aemetxfb.obs.radar
Module to get radar data from AEMet API.
This module provides functions to download regional and composite radar images from AEMet, including reflectivity, echotop, and precipitation accumulation data.
Regional radars are located across Spain and the Balearic Islands, providing high-resolution radar coverage. Available products include:
PPI.Z_005_240: Reflectivity at lowest elevation (0.5°)TOP.12DBZ_240: Echotop height for reflectivity > 12 dBZRN1.1HR_CAPPI: Accumulated precipitation in 1 hourRNN.6HR_CAPPI: Accumulated precipitation in 6 hours
See also: https://www.aemet.es/es/eltiempo/observacion/radar/ayuda
- aemetxfb.obs.radar.get_radar_PI_IB_refl_4h(output_path)[source]
Download radar reflectivity images (composite for Iberian Peninsula and Balearic islands).
Downloads the latest 10 minutes composite of radar reflectivity images from AEMet for the last 4h. The available image format is geotiff. The images correspond to the lowest radar elevation scan (0.5° above horizontal).
Reflectivity values are displayed in decibels (dBZ) with the color scale:
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
- Parameters:
output_path (str | pathlib.Path) – Full path to the output
.tar.gzfile. Parent directories will be created if needed.- Raises:
ValueError – If
output_pathdoes not end with.tar.gzor is empty/None.RuntimeError – If data cannot be fetched or file cannot be saved.
- Return type:
None
See also
External
- aemetxfb.obs.radar.get_radar_regional_latest(output_path)[source]
Download the latest regional radar images.
Downloads the latest 10 minutes regional radar data available. The available image format is geotiff. This information could be outdated if the radar is not working.
PPI.Z images correspond to the lowest radar elevation scan (0.5° above horizontal). Reflectivity values are displayed in decibels (dBZ).
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
TOP.12DBZ images correspond to the echotop height for reflectivity > 12 dBZ, displayed in kilometers (km).
Color
Range(km)
#0000fc
1-2
#0082ff
2-3
#00beff
3-4
#00ffff
4-5
#438323
5-6
#96c800
6-7
#00fa00
7-8
#ffff00
8-10
#ffaa00
10-12
#ff6b00
12-14
#fc0000
14-16
#c80050
16-20
#820a6e
>20
RN1.1HR and RNN.6HR images show accumulated precipitation in 1h and 6h respectively, displayed in millimeters (mm).
Color
Range(mm)
#001eff
0.5-1
#0064ff
1-2
#0087ff
2-4
#00b4ff
4-8
#438323
8-16
#00d200
16-32
#ffbb00
32-64
#ff7f00
64-128
#ff0000
128-256
#ff00ff
>256
- Parameters:
output_path (str | pathlib.Path) – Full path to the output
.tar.gzfile. Parent directories will be created if needed.- Raises:
ValueError – If
output_pathdoes not end with.tar.gzor is empty/None.RuntimeError – If data cannot be fetched or file cannot be saved.
- Return type:
None
See also
get_radar_regional_reflectivity_4hDownload regional reflectivity images.
get_radar_regional_echotop_4hDownload regional echotop images.
External
- aemetxfb.obs.radar.get_radar_regional_reflectivity_4h(radar, output_path, period=0, prefix='')[source]
Download regional radar reflectivity images (PPI.Z_005_240) for the last 4 hours.
Downloads regional radar reflectivity images from AEMet for the last 4 hours depending on the selected period. The available image format is PNG. Images correspond to the lowest radar elevation scan (0.5° above horizontal).
Reflectivity values are displayed in decibels (dBZ). The timestamp is rounded to the nearest 10-minute interval (00, 10, 20, …, 50 minutes).
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
Also retrieves radar bounds (bounding box coordinates) in JSON format and saves them with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 4. Default is 0 (latest available image only).
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}".
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 4, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_echotop_4hDownload echotop images.
get_radar_regional_accumprec1_24hDownload 1h precipitation accumulation.
External
- aemetxfb.obs.radar.get_radar_regional_echotop_4h(radar, output_path, period=0, prefix='')[source]
Download regional radar echotop images (TOP.12DBZ_240) for the last 4 hours.
Downloads regional radar echotop images from AEMet for the last 4 hours depending on the selected period. The available image format is PNG. Images correspond to the echotop height for a reflectivity > 12 dBZ.
Echotop values are displayed in kilometers (km) above ground. The timestamp is rounded to the nearest 10-minute interval (00, 10, 20, …, 50 minutes).
Color
Range(km)
#0000fc
1-2
#0082ff
2-3
#00beff
3-4
#00ffff
4-5
#438323
5-6
#96c800
6-7
#00fa00
7-8
#ffff00
8-10
#ffaa00
10-12
#ff6b00
12-14
#fc0000
14-16
#c80050
16-20
#820a6e
>20
Also retrieves radar bounds (bounding box coordinates) in JSON format and saves them with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 4. Default is 0 (latest available image only).
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}".
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 4, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_reflectivity_4hDownload reflectivity images.
get_radar_regional_accumprec1_24hDownload 1h precipitation accumulation.
External
- aemetxfb.obs.radar.get_radar_regional_accumprec1_24h(radar, output_path, period=0, prefix='')[source]
Download regional radar accumulated precipitation 1h images (RN1.1HR_CAPPI product) for the last 24 hours.
Downloads regional radar accumulated precipitation images from AEMet for the last 24 hours depending on the selected period. The available image format is PNG. The images correspond to the accumulated precipitation in 1h in mm.
Values are displayed in millimeters (mm) with the color scale:
Color
Range(mm)
#001eff
0.5-1
#0064ff
1-2
#0087ff
2-4
#00b4ff
4-8
#438323
8-16
#00d200
16-32
#ffbb00
32-64
#ff7f00
64-128
#ff0000
128-256
#ff00ff
>256
The timestamp corresponds to hourly data (hours in point).
This function also retrieves the radar bounds (bounding box coordinates) in JSON format and saves them to a file with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 24. A value of 0 (default) retrieves the latest available image and JSON data. Default is 0.
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}". Default is “”.
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 24, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_reflectivity_4hDownload reflectivity images.
get_radar_regional_accumprec6_36hDownload 6h precipitation accumulation.
External
- aemetxfb.obs.radar.get_radar_regional_accumprec6_36h(radar, output_path, period=0, prefix='')[source]
Download regional radar accumulated precipitation 6h images (RNN.6HR_CAPPI product) for the last 36 hours.
Downloads regional radar accumulated precipitation images from AEMet for the last 36 hours depending on the selected period. The available image format is PNG. The images correspond to the accumulated precipitation in 6h in mm.
Values are displayed in millimeters (mm) with the color scale:
Color
Range(mm)
#001eff
0.5-1
#0064ff
1-2
#0087ff
2-4
#00b4ff
4-8
#438323
8-16
#00d200
16-32
#ffbb00
32-64
#ff7f00
64-128
#ff0000
128-256
#ff00ff
>256
The timestamp corresponds to data every 6 hours (hours in point: 00, 06, 12, 18).
This function also retrieves the radar bounds (bounding box coordinates) in JSON format and saves them to a file with the same name as the PNG but with
.jsonextension.- Parameters:
radar (str) – Regional radar identifier (e.g.,
"NJR","TJV"). Must be one of the available radars inregional_radarstuple.output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 36. A value of 0 (default) retrieves the latest available image and JSON data. Default is 0.
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}". Default is “”.
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
radaris not inregional_radars,periodis not between 0 and 36, oroutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_regional_accumprec1_24hDownload 1h precipitation accumulation.
get_radar_regional_reflectivity_4hDownload reflectivity images.
External
- aemetxfb.obs.radar.get_radar_PI_IB_refl_24h(output_path, period=0, prefix='')[source]
Download radar reflectivity images (composite for Iberian Peninsula and Balearic islands).
Downloads the latest 10 minutes composite of radar reflectivity images from AEMet for the last 24h depending on the selected period. The available image format is PNG. The images correspond to the lowest radar elevation scan (0.5° above horizontal). Reflectivity values are displayed in decibels (dBZ) with the color scale:
Color
Range(dBZ)
#0000fc
12-18
#0094fc
18-24
#00fcfc
24-30
#438323
30-36
#00c000
36-42
#00ff00
42-48
#ffff00
48-54
#ffbb00
54-60
#ff7f00
60-66
#ff0000
66-72
#c8005a
72-150
The timestamp is rounded to the nearest 10-minute interval (00, 10, 20, …, 50 minutes).
This function also retrieves the radar bounds (bounding box coordinates) in JSON format and saves them to a file with the same name as the PNG but with
.jsonextension.- Parameters:
output_path (str | pathlib.Path) – Directory path where the downloaded PNG and JSON files will be saved.
period (int, optional) – Number of hours to go back from the latest available data. Must be between 0 and 24. A value of 0 (default) retrieves the latest available image and JSON data. Default is 0.
prefix (str, optional) – String to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{original_remote_filename}". Default is “”.
- Returns:
Dictionary with two keys:
"png"and"json", each containing a list of downloaded file paths.- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_radar_PI_IB_refl_4hDownload composite reflectivity (last 4h).
get_radar_regional_reflectivity_4hDownload regional reflectivity.
External
aemetxfb.obs.radiation
Module to download radiation observation images from AEMet API.
This module provides functions to download solar radiation, UVI (Ultraviolet Index), and ozone data from AEMet observation stations across Spain.
Available data types:
Global, direct, and diffuse solar radiation
Infrared radiation
UVI (Ultraviolet Index) values and images
Ozone measurements and sounding data
See also: https://www.aemet.es/es/eltiempo/observacion/radiacion/radiacion/ayuda
- aemetxfb.obs.radiation.get_radiation_rad(output_path, loc)[source]
Download solar radiation observation images from AEMet.
Downloads solar radiation images (global, direct, diffuse) from AEMet observation stations.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – Radiation location. Valid values:
Coruna,Almeria,Badajoz,Barcelona,Caceres,Cadiz,CReal,Cordoba,Granada,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Igueldo,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_radiation_irDownload infrared radiation images.
get_UVI_previous_day_imgDownload UVI observation images.
ExternalExamples
>>> get_radiation_rad("data/rad/madrid.png", "Madrid-CRN") 'data/rad/madrid.png' >>> get_radiation_rad("data/rad/madrid.txt", "Madrid-CRN") Traceback (most recent call last): ... ValueError: output_path must have .png extension... >>> get_radiation_rad("data/rad/madrid.png", "Invalid") Traceback (most recent call last): ... ValueError: Invalid location 'Invalid'...
- aemetxfb.obs.radiation.get_radiation_ir(output_path, loc)[source]
Download infrared radiation observation images from AEMet.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – Radiation location. Valid values:
Coruna,Badajoz,Caceres,Cordoba,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_radiation_radDownload solar radiation images.
get_UVI_previous_day_imgDownload UVI observation images.
ExternalExamples
>>> get_radiation_ir("data/ir/madrid.png", "Madrid-CRN") 'data/ir/madrid.png'
- aemetxfb.obs.radiation.get_UVI_previous_day_img(output_path, loc)[source]
Download UVI (Ultraviolet Index) observation image from AEMet.
Downloads the UVI observation image for the previous day from AEMet observation stations. The image shows the UVI values graphically.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – UVI location. Valid values:
Coruna,Almeria,Badajoz,Barcelona,Caceres,Cadiz,CReal,Cordoba,Granada,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Igueldo,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_UVI_previous_dayDownload UVI data table for the previous day.
get_UVI_running_year_imgDownload UVI running year image.
get_radiation_radDownload solar radiation images.
ExternalExamples
>>> get_UVI_previous_day_img("data/uvi/madrid.png", "Madrid-CRN") 'data/uvi/madrid.png'
- aemetxfb.obs.radiation.get_UVI_previous_day()[source]
Download UVI (Ultraviolet Index) data for the previous day from AEMet.
Fetches UVI observation data from the AEMet website, parsing the HTML table that contains hourly UVI values for multiple stations.
- Returns:
DataFrame with:
Station names as rows (index)
Hours 07-22 as columns
MAXcolumn with maximum UVI for each station
- Return type:
pd.DataFrame
- Raises:
RuntimeError – If the data cannot be fetched or parsed.
See also
get_UVI_previous_day_imgDownload UVI observation image.
get_ozone_previous_dayDownload ozone data table.
ExternalExamples
>>> df = get_UVI_previous_day() >>> print(df.head()) 07 08 09 10 ... 21 22 MAX A Coruña 0 0 0 1 ... 0 0 5.0 Almería 0 0 0 1 ... 0 0 6.0
- aemetxfb.obs.radiation.get_UVI_running_year_img(output_path, loc)[source]
Download UVI (Ultraviolet Index) running year image from AEMet.
Downloads the UVI running year image from AEMet observation stations. The image shows the UVI values graphically for the current year.
- Parameters:
output_path (str | pathlib.Path) – Full path where the image will be saved. Must have a
.pngextension. Parent directories will be created if they do not exist.loc (str) – UVI location. Valid values:
Coruna,Almeria,Badajoz,Barcelona,Caceres,Cadiz,CReal,Cordoba,Granada,Izana,Leon,Madrid-CRN,Malaga,Maspalomas,Arenosillo,Murcia,Palma,Navacerrada,Salamanca,Igueldo,Santander,Tenerife,Roquetas,Valencia,Valladolid,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name, or ifoutput_pathdoes not have a.pngextension.RuntimeError – If the image cannot be fetched or saved.
See also
get_UVI_previous_day_imgDownload UVI observation image.
get_UVI_previous_dayDownload UVI data table.
ExternalExamples
>>> get_UVI_running_year_img("data/uvi/anual_madrid.png", "Madrid-CRN") 'data/uvi/anual_madrid.png'
- aemetxfb.obs.radiation.get_ozone_running_year(output_path, loc)[source]
Download ozone running year image from AEMet.
Downloads the ozone running year image from AEMet observation stations. The image shows the ozone values graphically for the current year.
- Parameters:
output_path (str | pathlib.Path) – Path where the image will be saved (must have
.pngextension).loc (str) – Ozone location. Valid values:
Coruna,Izana,Madrid-CRN,Arenosillo,Murcia,Tenerife,Zaragoza.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name oroutput_pathdoesn’t have.pngextension.
See also
get_ozone_soundingDownload ozone sounding image.
get_ozone_previous_dayDownload ozone data table.
ExternalExamples
>>> get_ozone_running_year("kaka/output.png", "Madrid-CRN") 'kaka/output.png' >>> get_ozone_running_year("kaka/output.txt", "Madrid-CRN") Traceback (most recent call last): ... ValueError: output_path must have .png extension...
- aemetxfb.obs.radiation.get_ozone_sounding(output_path, loc)[source]
Download ozone sounding image from AEMet.
Downloads the ozone sounding image from AEMet observation stations. The image shows the ozone sounding data graphically.
- Parameters:
output_path (str | pathlib.Path) – Path where the image will be saved (must have
.pngextension).loc (str) – Ozone sounding location. Valid values:
BarajasMad,BotanicoTfe.
- Returns:
Full path to the downloaded image file.
- Return type:
- Raises:
ValueError – If
locis not a valid location name oroutput_pathdoesn’t have.pngextension.
See also
get_ozone_running_yearDownload ozone running year image.
get_ozone_previous_dayDownload ozone data table.
ExternalExamples
>>> get_ozone_sounding("kaka/output.png", "BarajasMad") 'kaka/output.png'
- aemetxfb.obs.radiation.get_ozone_previous_day()[source]
Download ozone data for the previous day from AEMet.
Fetches ozone observation data from the AEMet website, parsing the HTML table that contains ozone values for multiple stations.
- Returns:
DataFrame with:
Station names as rows (index)
"Ozono (UD)"column with ozone values
- Return type:
pd.DataFrame
- Raises:
RuntimeError – If the data cannot be fetched or parsed.
See also
get_ozone_running_yearDownload ozone running year image.
get_ozone_soundingDownload ozone sounding image.
get_UVI_previous_dayDownload UVI data table.
ExternalExamples
>>> df = get_ozone_previous_day() >>> print(df.head()) Ozono (UD) A Coruña 45.0 Madrid 52.0
aemetxfb.obs.satellite
Module to get satellite data from AEMet API.
This module provides functions to download Meteosat satellite imagery including infrared, visible, global, air masses, NDVI, and sea surface temperature data.
Available products:
Infrared (IR) channel images (hourly)
Visible (VIS) channel images (hourly, daytime only)
Global satellite images from Meteosat, GOES, Himawari (every 3 hours)
RGB air mass composite images
NDVI (Normalized Difference Vegetation Index)
Sea Surface Temperature (SST)
See also: * https://www.aemet.es/es/eltiempo/observacion/satelite/infra/ayuda * https://www.aemet.es/es/eltiempo/observacion/satelite/visible/ayuda * https://www.aemet.es/es/eltiempo/observacion/satelite/global/ayuda * https://www.aemet.es/es/eltiempo/observacion/satelite/masas/ayuda * https://www.aemet.es/es/eltiempo/observacion/satelite/pderiv/ayuda
- aemetxfb.obs.satellite.get_satellite_IR_24h(output_path, period=0, prefix='')[source]
Download processed Meteosat infrared satellite images.
The images are downloaded in GIF format from AEMet’s website.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and the N previous hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}".
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_VIS_24hDownload visible channel images.
get_satellite_global_24hDownload global satellite images.
ExternalExamples
>>> get_satellite_IR_24h("kaka", period=0) ['kaka/satellite_IR_...gif'] >>> get_satellite_IR_24h("kaka", period=25) Traceback (most recent call last): ... ValueError: period must be between 0 and 24
- aemetxfb.obs.satellite.get_satellite_VIS_24h(output_path, period=0, prefix='')[source]
Download Meteosat visible channel satellite images.
The images are downloaded in JPEG format from AEMet’s website. Note that during nighttime hours, images may not be available (HTTP 404).
- Parameters:
output_path (str | Path) – Directory path where the downloaded JPEG images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and the N previous hours, skipping unavailable nighttime images. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_global_24hDownload global satellite images.
External
- aemetxfb.obs.satellite.get_satellite_global_24h(output_path, period=0, prefix='')[source]
Download infrared satellite images from Meteosat, GOES, and Himawari.
The images are downloaded in GIF format from AEMet’s website. Images are available every 3 hours.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 3 hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_VIS_24hDownload visible channel images.
External
- aemetxfb.obs.satellite.get_satellite_globe_0_24h(output_path, period=0, prefix='')[source]
Download infrared satellite images of the Earth visible from Meteosat at 0° longitude.
The images are downloaded in GIF format from AEMet’s website. Images are available every 3 hours.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 3 hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_globe_415_24hDownload images from Meteosat at 41.5° longitude.
External
- aemetxfb.obs.satellite.get_satellite_globe_415_24h(output_path, period=0, prefix='')[source]
Download infrared satellite images of the Earth visible from Meteosat at 41.5° longitude.
The images are downloaded in GIF format from AEMet’s website. Images are available every 3 hours.
- Parameters:
output_path (str | Path) – Directory path where the downloaded GIF images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 3 hours. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_globe_0_24hDownload images from Meteosat at 0° longitude.
External
- aemetxfb.obs.satellite.get_satellite_airmasses_24h(output_path, period=0, prefix='')[source]
Download RGB composite satellite images showing air mass characteristics.
The images are downloaded in JPEG format from AEMet’s website. These RGB composites combine multiple Meteosat operational channels at 0°N 0°W to provide information about air mass properties and cloud characteristics.
- Parameters:
output_path (str | Path) – Directory path where the downloaded JPEG images will be saved.
period (int, optional) – Number of hours to go back from the latest available data (0-24). Value 0 downloads only the latest available image. Value N downloads the latest image and images up to N hours back, downloading every 1 hour. Default is 0.
prefix (str, optional) – Optional prefix to prepend to downloaded filenames. If provided, files will be named as
"{output_path}/{prefix}_{remote_filename}". Default is “”.
- Returns:
List of paths to downloaded files.
- Return type:
- Raises:
ValueError – If
periodis not between 0 and 24, or ifoutput_pathis empty orNone.RuntimeError – If data cannot be fetched or file cannot be saved.
See also
get_satellite_IR_24hDownload infrared channel images.
get_satellite_global_24hDownload global satellite images.
External
- aemetxfb.obs.satellite.get_satellite_NDVI(output_path)[source]
Download NDVI (Normalized Difference Vegetation Index) satellite image.
The image is downloaded in GIF format from AEMet’s website. This NDVI image is derived from NASA’s MOD13A1 product, using MODIS data from the Terra and Aqua satellites. It shows vegetation development with a resolution of 500 m, updated every 16 days.
- Parameters:
output_path (str | Path) – Full path where the downloaded GIF image will be saved. Must have a
.gifextension. Parent directories will be created if they do not exist.- Returns:
Path to downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathis empty orNone, or if it does not have a.gifextension.RuntimeError – If data cannot be fetched or file cannot be saved.
Examples
>>> get_satellite_NDVI("data/ndvi_image.gif") 'data/ndvi_image.gif'
- aemetxfb.obs.satellite.get_satellite_SST(output_path)[source]
Download Sea Surface Temperature (SST) satellite image.
The image is downloaded in GIF format from AEMet’s website. This SST image is generated based on the “Global Metop Sea Surface Temperature” product developed by OSI SAF (Ocean and Sea Ice Satellite Application Facility) of EUMETSAT, the center dedicated to satellite ocean and sea ice applications. The image has a resolution of 0.05° and is updated daily, showing temperature values with a maximum age of 48 hours.
- Parameters:
output_path (str | Path) – Full path where the downloaded GIF image will be saved. Must have a
.gifextension. Parent directories will be created if they do not exist.- Returns:
Path to downloaded file (same as
output_path).- Return type:
- Raises:
ValueError – If
output_pathis empty orNone, or if it does not have a.gifextension.RuntimeError – If data cannot be fetched or file cannot be saved.
Examples
>>> get_satellite_SST("data/sst_image.gif") 'data/sst_image.gif'