# Descargar datos del índice de peligro de incendios
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
```
for year in range(2002,2023):
for year in range(2002,2023):
target_file = LABELDIR + f'{year}.nc'
target_file = LABELDIR + f'{year}.nc'
c = cdsapi.Client()
c = cdsapi.Client()
c.retrieve(
c.retrieve(
'cems-fire-historical-v1',
'cems-fire-historical-v1',
{
{
'product_type': 'reanalysis',
'product_type': 'reanalysis',
'variable': 'fire_danger_index',
'variable': 'fire_danger_index',
'dataset_type': 'consolidated_dataset',
'dataset_type': 'consolidated_dataset',
'system_version': '4_1',
'system_version': '4_1',
'year': '2002',
'year': '2002',
'month': [
'month': [
'01', '02', '12',
'01', '02', '12',
],
],
'day': [
'day': [
'01', '02', '03',
'01', '02', '03',
'04', '05', '06',
'04', '05', '06',
'07', '08', '09',
'07', '08', '09',
'10', '11', '12',
'10', '11', '12',
'13', '14', '15',
'13', '14', '15',
'16', '17', '18',
'16', '17', '18',
'19', '20', '21',
'19', '20', '21',
'22', '23', '24',
'22', '23', '24',
'25', '26', '27',
'25', '26', '27',
'28', '29', '30',
'28', '29', '30',
'31',
'31',
],
],
'area': [
'area': [
-20, -79, -57,
-20, -79, -57,
-43,
-43,
],
],
'grid': '0.25/0.25',
'grid': '0.25/0.25',
'format': 'netcdf',
'format': 'netcdf',
},
},
target_file)
target_file)
```
```
%% Output
%% Output
2023-07-28 12:15:49,638 INFO Welcome to the CDS
2023-07-28 12:15:49,638 INFO Welcome to the CDS
2023-07-28 12:15:49,639 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:49,639 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:49,854 INFO Request is completed
2023-07-28 12:15:49,854 INFO Request is completed
2023-07-28 12:15:49,855 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2019.nc (7.4M)
2023-07-28 12:15:49,855 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2019.nc (7.4M)
2023-07-28 12:15:52,491 INFO Download rate 2.8M/s
2023-07-28 12:15:52,491 INFO Download rate 2.8M/s
2023-07-28 12:15:53,197 INFO Welcome to the CDS
2023-07-28 12:15:53,197 INFO Welcome to the CDS
2023-07-28 12:15:53,199 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:53,199 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:53,439 INFO Request is completed
2023-07-28 12:15:53,439 INFO Request is completed
2023-07-28 12:15:53,440 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2020.nc (7.4M)
2023-07-28 12:15:53,440 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2020.nc (7.4M)
2023-07-28 12:15:54,590 INFO Download rate 6.5M/s
2023-07-28 12:15:54,590 INFO Download rate 6.5M/s
2023-07-28 12:15:54,976 INFO Welcome to the CDS
2023-07-28 12:15:54,976 INFO Welcome to the CDS
2023-07-28 12:15:54,977 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:54,977 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:55,220 INFO Request is completed
2023-07-28 12:15:55,220 INFO Request is completed
2023-07-28 12:15:55,221 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2021.nc (7.4M)
2023-07-28 12:15:55,221 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2021.nc (7.4M)
2023-07-28 12:15:56,690 INFO Download rate 5.1M/s
2023-07-28 12:15:56,690 INFO Download rate 5.1M/s
2023-07-28 12:15:57,082 INFO Welcome to the CDS
2023-07-28 12:15:57,082 INFO Welcome to the CDS
2023-07-28 12:15:57,083 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:57,083 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/cems-fire-historical-v1
2023-07-28 12:15:57,301 INFO Request is completed
2023-07-28 12:15:57,301 INFO Request is completed
2023-07-28 12:15:57,302 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2022.nc (7.4M)
2023-07-28 12:15:57,302 INFO Downloading https://download-0004-clone.copernicus-climate.eu/cache-compute-0004/cache/data0/adaptor.mars.external-1690558130.304354-9896-9-762d05cd-253d-467d-99ae-08ef92f88bbd.nc to fire_danger/2022.nc (7.4M)