본문 바로가기

Error and Solve

[에러 해결] ERA5 dataset 다운 받을 때 API 설정 때 404 에러가 뜨면 / api url을 변경해야 한다

반응형

 

 

 

 

climate ERA5 데이터셋 활용

 

import cdsapi

dataset = "reanalysis-era5-single-levels"
request = {
    "product_type": ["reanalysis"],
    "data_format": "grib",
    "download_format": "unarchived"
}

client = cdsapi.Client()
client.retrieve(dataset, request).download()

 

 

climate dataset을 다운받으려고 했다

 

위와 같은 코드를 활용하면 되는데, 계속 404 url 에러가 났다 

 

 

 

https://microsoft.github.io/aurora/example_era5.html

 

Example: Predictions for ERA5 — Aurora: A Foundation Model of the Atmosphere

Example: Predictions for ERA5 In this example, we will download ERA5 data for 1 Jan 2023 at 0.25 degrees resolution and run Aurora on this data. The fine-tuned version of Aurora specifically only works with IFS HRES T0, so we use the non-fine-tuned version

microsoft.github.io

 

 

위 링크의 Downloading the Data를 따라 

url, key 모두 설정 제대로 했음에도, 404 에러가 계속 떴다.

 

 

 

 

 

해결: url 이 잘못됐었다

 

https://cds.climate.copernicus.eu/how-to-api

 

Climate Data Store

Once the CDS API client is installed, it can be used to request data from the datasets listed in the CDS, ADS, ECDS and CEMS Early Warning DS catalogues. One must agree to the Terms of Use of a dataset before downloading any data out of it. This step must

cds.climate.copernicus.eu

 

API url이 바뀌었다 

 

beta 라는 단어를 제외한 url를 설정해야, api가 오류 없이 다운로드할 수 있었다.

 

 

 

 

 

다운 받을 때 warning도 해제하면 좋다 

 

치명적인 오류가 아니지만, warning으로 인해 코드 과정을 track할 수 없는게 아쉬우므로 warning을 해제한다 

 

 

import urllib3

urllib3.disable_warnings()

 

이 코드만 추가하면 된다. 

 

 

 

 

 

 

 

최종 코드 

 

import cdsapi
import urllib3

urllib3.disable_warnings()
dataset = "reanalysis-era5-single-levels"
request = {
    "product_type": ["reanalysis"],
    "data_format": "grib",
    "download_format": "unarchived"
}

client = cdsapi.Client()
client.retrieve(dataset, request).download()

 

 


 

Reference

 

https://cds.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=download#download_format

 

ERA5 hourly data on single levels from 1940 to present

ERA5 is the fifth generation ECMWF reanalysis for the global climate and weather for the past 8 decades. Data is available from 1940 onwards. ERA5 replaces the ERA-Interim reanalysis. Reanalysis combines model data with observations from across the world i

cds.climate.copernicus.eu

 

 

https://cds.climate.copernicus.eu/how-to-api

 

Climate Data Store

Once the CDS API client is installed, it can be used to request data from the datasets listed in the CDS, ADS, ECDS and CEMS Early Warning DS catalogues. One must agree to the Terms of Use of a dataset before downloading any data out of it. This step must

cds.climate.copernicus.eu

 

 

https://microsoft.github.io/aurora/example_era5.html

 

Example: Predictions for ERA5 — Aurora: A Foundation Model of the Atmosphere

Example: Predictions for ERA5 In this example, we will download ERA5 data for 1 Jan 2023 at 0.25 degrees resolution and run Aurora on this data. The fine-tuned version of Aurora specifically only works with IFS HRES T0, so we use the non-fine-tuned version

microsoft.github.io

 

 

 

https://github.com/microsoft/aurora

 

GitHub - microsoft/aurora: Implementation of the Aurora model for Earth system forecasting

Implementation of the Aurora model for Earth system forecasting - microsoft/aurora

github.com

 

 

반응형