Skip to content

PyAPS三次下载数据失败 #46

@2511250589

Description

@2511250589

The following table describes the procedure:
******************** step - correct_troposphere ******************** Atmospheric correction using Weather Re-analysis dataset (PyAPS, Jolivet et al., 2011) Weather Re-analysis dataset: ERA5 tropo_pyaps3.py -f /root/work113/Stacks/mintpy/timeseries.h5 --model ERA5 -g /root/work113/Stacks/mintpy/inputs/geometryRadar.h5 -w /root/weather_data/ERA5 weather model: ERA5 - dry (hydrostatic) and wet delay weather directory: /root/weather_data/ERA5 output tropospheric delay time-series file: /root/work113/Stacks/mintpy/inputs/ERA5.h5 output corrected displacement time-series file: /root/work113/Stacks/mintpy/timeseries_ERA5.h5 read dates/time info from file: /root/work113/Stacks/mintpy/timeseries.h5 time of cloest available product: 10:00 UTC -------------------------------------------------------------------------------- Download global atmospheric model files... update mode: ON output file: /root/work113/Stacks/mintpy/inputs/ERA5.h5 1) output file either do NOT exist or is NOT newer than all GRIB files. run or skip: run -------------------------------------------------- downloading weather model data using PyAPS ... number of grib files to download: 24 -------------------------------------------------- filedir:/root/weather_data/ERA5/ERA5 INFO: You are using the latest ECMWF platform for downloading datasets: https://cds.climate.copernicus.eu/api url is None key is None url is None or key is None key;276bec02-357f-4d1d-85b1-33658fa1ec9b url:https://cds.climate.copernicus.eu/api url is None key is None url is None or key is None key;276bec02-357f-4d1d-85b1-33658fa1ec9b url:https://cds.climate.copernicus.eu/api 2025-02-24 13:51:43,991 INFO [2024-09-26T00:00:00] Watch our [Forum](https://forum.ecmwf.int/) for Announcements, news and other discussed topics. 2025-02-24 13:51:43,992 WARNING [2024-06-16T00:00:00] CDS API syntax is changed and some keys or parameter names may have also changed. To avoid requests failing, please use the "Show API request code" tool on the dataset Download Form to check you are using the correct syntax for your API request. Downloading 1 of 24: /root/weather_data/ERA5/ERA5/ERA5_N30_N40_E110_E120_20220104_10.grb {'product_type': ['reanalysis'], 'variable': ['geopotential', 'temperature', 'specific_humidity'], 'year': ['2022'], 'month': ['01'], 'day': ['04'], 'time': ['10:00'], 'pressure_level': ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000'], 'data_format': 'grib', 'area': [40, 110, 30, 120]} WARNING: the 1 attempt to download failed, retry it. filedir:/root/weather_data/ERA5/ERA5 INFO: You are using the latest ECMWF platform for downloading datasets: https://cds.climate.copernicus.eu/api url is None key is None url is None or key is None key;276bec02-357f-4d1d-85b1-33658fa1ec9b url:https://cds.climate.copernicus.eu/api url is None key is None url is None or key is None key;276bec02-357f-4d1d-85b1-33658fa1ec9b url:https://cds.climate.copernicus.eu/api 2025-02-24 13:51:44,779 INFO [2024-09-26T00:00:00] Watch our [Forum](https://forum.ecmwf.int/) for Announcements, news and other discussed topics. 2025-02-24 13:51:44,783 WARNING [2024-06-16T00:00:00] CDS API syntax is changed and some keys or parameter names may have also changed. To avoid requests failing, please use the "Show API request code" tool on the dataset Download Form to check you are using the correct syntax for your API request. Downloading 1 of 24: /root/weather_data/ERA5/ERA5/ERA5_N30_N40_E110_E120_20220104_10.grb {'product_type': ['reanalysis'], 'variable': ['geopotential', 'temperature', 'specific_humidity'], 'year': ['2022'], 'month': ['01'], 'day': ['04'], 'time': ['10:00'], 'pressure_level': ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000'], 'data_format': 'grib', 'area': [40, 110, 30, 120]} WARNING: the 2 attempt to download failed, retry it. filedir:/root/weather_data/ERA5/ERA5 INFO: You are using the latest ECMWF platform for downloading datasets: https://cds.climate.copernicus.eu/api url is None key is None url is None or key is None key;276bec02-357f-4d1d-85b1-33658fa1ec9b url:https://cds.climate.copernicus.eu/api url is None key is None url is None or key is None key;276bec02-357f-4d1d-85b1-33658fa1ec9b url:https://cds.climate.copernicus.eu/api 2025-02-24 13:51:45,563 INFO [2024-09-26T00:00:00] Watch our [Forum](https://forum.ecmwf.int/) for Announcements, news and other discussed topics. 2025-02-24 13:51:45,566 WARNING [2024-06-16T00:00:00] CDS API syntax is changed and some keys or parameter names may have also changed. To avoid requests failing, please use the "Show API request code" tool on the dataset Download Form to check you are using the correct syntax for your API request. Downloading 1 of 24: /root/weather_data/ERA5/ERA5/ERA5_N30_N40_E110_E120_20220104_10.grb {'product_type': ['reanalysis'], 'variable': ['geopotential', 'temperature', 'specific_humidity'], 'year': ['2022'], 'month': ['01'], 'day': ['04'], 'time': ['10:00'], 'pressure_level': ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000'], 'data_format': 'grib', 'area': [40, 110, 30, 120]} ************************************************** WARNING: downloading failed for 3 times, stop trying and continue. ************************************************** -------------------------------------------------------------------------------- Calculate tropospheric delay and write to HDF5 file... update mode: ON output file: /root/work113/Stacks/mintpy/inputs/ERA5.h5 1) output file either do NOT exist or is NOT newer than all GRIB files. run or skip: run open geometry file: geometryRadar.h5 reading incidenceAngle data from file: /root/work113/Stacks/mintpy/inputs/geometryRadar.h5 ... reading height data from file: /root/work113/Stacks/mintpy/inputs/geometryRadar.h5 ... reading latitude data from file: /root/work113/Stacks/mintpy/inputs/geometryRadar.h5 ... reading longitude data from file: /root/work113/Stacks/mintpy/inputs/geometryRadar.h5 ... -------------------------------------------------- create HDF5 file: /root/work113/Stacks/mintpy/inputs/ERA5.h5 with w mode create dataset : date of |S1 in size of (0,) with compression = None create dataset : timeseries of <class 'numpy.float32'> in size of (0, 914, 1322) with compression = None close HDF5 file: /root/work113/Stacks/mintpy/inputs/ERA5.h5 -------------------------------------------------- calculating absolute delay for each date using PyAPS (Jolivet et al., 2011; 2014) ... number of grib files used: 0 Traceback (most recent call last): File "/root/tools/miniconda3/envs/insar/bin/smallbaselineApp.py", line 10, in <module> sys.exit(main()) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/cli/smallbaselineApp.py", line 209, in main run_smallbaselineApp(inps) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/smallbaselineApp.py", line 1155, in run_smallbaselineApp app.run(steps=inps.runSteps) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/smallbaselineApp.py", line 935, in run self.run_tropospheric_delay_correction(sname) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/smallbaselineApp.py", line 682, in run_tropospheric_delay_correction mintpy.cli.tropo_pyaps3.main(iargs) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/cli/tropo_pyaps3.py", line 166, in main run_tropo_pyaps3(inps) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/tropo_pyaps3.py", line 742, in run_tropo_pyaps3 calc_delay_timeseries(inps) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/tropo_pyaps3.py", line 672, in calc_delay_timeseries prog_bar = ptime.progressBar(maxValue=num_date, print_msg=~inps.verbose) File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/objects/progress.py", line 84, in __init__ self.reset() File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/objects/progress.py", line 90, in reset self.update_amount(0) # Build progress bar string File "/root/tools/miniconda3/envs/insar/lib/python3.10/site-packages/mintpy/objects/progress.py", line 109, in update_amount percentDone = (diffFromMin / float(self.span)) * 100.0 ZeroDivisionError: float division by zero


I had no problem downloading manually

import cdsapi

创建CDS API客户端

c = cdsapi.Client()

定义下载参数

years = ['2023']
months = ['12']
days = ['01']
times = ['10:00']
area = [40, 110, 30, 120] # 区域 [北, 西, 南, 东]
pressure_levels = ['1', '2', '3', '5', '7', '10', '20', '30', '50', '70', '100', '125', '150', '175', '200', '225', '250', '300', '350', '400', '450', '500', '550', '600', '650', '700', '750', '775', '800', '825', '850', '875', '900', '925', '950', '975', '1000']
variables = ['geopotential', 'temperature', 'specific_humidity']
product_type = 'reanalysis'
data_format = 'grib'

循环下载每个日期的数据

for year in years:
for month in months:
for day in days:
for time in times:
# 构建文件名
filename = f'ERA5_N30_N40_E110_E120_{year}{month}{day}_{time.replace(":", "")}.grb'
print(f'Downloading {filename}...')

            # 发起下载请求
            c.retrieve(
                'reanalysis-era5-pressure-levels',
                {
                    'product_type': product_type,
                    'variable': variables,
                    'year': year,
                    'month': month,
                    'day': day,
                    'time': time,
                    'pressure_level': pressure_levels,
                    'format': data_format,
                    'area': area,
                },
                filename
            )

            print(f'{filename} downloaded successfully.')

But we can't identify his location

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions