|
22 | 22 | "## The development environment setup\n", |
23 | 23 | "The tutorials use the [Python](https://www.python.org/) programming language and its libraries:\n", |
24 | 24 | "- [`earthkit`](https://earthkit.readthedocs.io/en/latest/) to speed up weather and climate science workflows\n", |
25 | | - "- [`ecmwf-opendata`](https://github.com/ecmwf/ecmwf-opendata)to download the ECMWF open data\n", |
| 25 | + "- [`ecmwf-opendata`](https://github.com/ecmwf/ecmwf-opendata) to download the ECMWF open data\n", |
26 | 26 | "- [`numpy`](https://pypi.org/project/numpy/c) for scientific computing of multi-dimensional arrays\n", |
27 | 27 | "- [`cfgrib`](https://pypi.org/project/cfgrib/) to map GRIB files to the netCDF\n", |
28 | 28 | "- [`requests`](https://pypi.org/project/requests/) (or urllib3, [`wget`](https://www.gnu.org/software/wget/manual/wget.html)) for sending HTTP requests\n", |
|
1019 | 1019 | "id": "14889769-196b-42cf-aeed-73de42bcef37", |
1020 | 1020 | "metadata": {}, |
1021 | 1021 | "source": [ |
1022 | | - "When you need to download a single field from a GRIB file, inspect the corresponding index file and look for the parameter of your interest. For example, to download only the 2m temperature at step=0h from the 00 UTC HRES forecast on 08 June 2025\n", |
1023 | | - "```\n", |
1024 | | - "{\"domain\": \"g\", \"date\": \"20250608\", \"time\": \"0000\", \"expver\": \"0001\", \"class\": \"od\", \"type\": \"fc\", \"stream\": \"oper\", \"step\": \"0\", \"levtype\": \"sfc\", \"param\": \"2t\", \"_offset\": 62556419, \"_length\": 660091}\n", |
1025 | | - "```\n", |
1026 | | - "use the values of `_offset` and `_length` keys and calculate the `start_bytes` and `end_bytes` (the `_offset` and `_length` values of a specific field are different for each forecast run!)\n", |
1027 | | - "```\n", |
1028 | | - "start_bytes = _offset = 62556419\n", |
1029 | | - "end_bytes = _offset + _length - 1 = 62556419 + 660091 - 1 = 63216509\n", |
1030 | | - "```\n", |
1031 | | - "\n", |
1032 | 1022 | "```\n", |
1033 | 1023 | "ROOT=\"https://data.ecmwf.int/forecasts\"\n", |
1034 | 1024 | "yyyymmdd=\"20250608\"\n", |
|
1064 | 1054 | "For more information, see [Access real-time open data with `wget`](https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS#ECMWFopendata:realtimeforecastsfromIFSandAIFS-Locations).\n", |
1065 | 1055 | ":::" |
1066 | 1056 | ] |
| 1057 | + }, |
| 1058 | + { |
| 1059 | + "cell_type": "markdown", |
| 1060 | + "id": "75f0f714-1d0c-4349-b7ca-caa0140e32c1", |
| 1061 | + "metadata": {}, |
| 1062 | + "source": [ |
| 1063 | + "### 4. The [`curl`](https://curl.se/) command-line tool\n", |
| 1064 | + "When you need to download a single field from a GRIB file, inspect the corresponding index file and look for the parameter of your interest. For example, to download only the 2m temperature at step=0h from the 00 UTC HRES forecast on 08 June 2025\n", |
| 1065 | + "```\n", |
| 1066 | + "{\"domain\": \"g\", \"date\": \"20250608\", \"time\": \"0000\", \"expver\": \"0001\", \"class\": \"od\", \"type\": \"fc\", \"stream\": \"oper\", \"step\": \"0\", \"levtype\": \"sfc\", \"param\": \"2t\", \"_offset\": 62556419, \"_length\": 660091}\n", |
| 1067 | + "```\n", |
| 1068 | + "use the values of `_offset` and `_length` keys and calculate the `start_bytes` and `end_bytes` (the `_offset` and `_length` values of a specific field are different for each forecast run!)\n", |
| 1069 | + "```\n", |
| 1070 | + "start_bytes = _offset = 62556419\n", |
| 1071 | + "end_bytes = _offset + _length - 1 = 62556419 + 660091 - 1 = 63216509\n", |
| 1072 | + "```\n", |
| 1073 | + "\n", |
| 1074 | + "```\n", |
| 1075 | + "ROOT=\"https://data.ecmwf.int/forecasts\"\n", |
| 1076 | + "yyyymmdd=\"20250608\"\n", |
| 1077 | + "HH=\"00\"\n", |
| 1078 | + "model=\"ifs\"\n", |
| 1079 | + "resol=\"0p25\"\n", |
| 1080 | + "stream=\"oper\"\n", |
| 1081 | + "step=\"0\"\n", |
| 1082 | + "U=\"h\"\n", |
| 1083 | + "type=\"fc\"\n", |
| 1084 | + "format=\"grib2\"\n", |
| 1085 | + "start_bytes=62556419\n", |
| 1086 | + "end_bytes=63216509\n", |
| 1087 | + "\n", |
| 1088 | + "curl --range \"$start_bytes-$end_bytes\" \"$ROOT/$yyyymmdd/$HH\"z\"/$model/$resol/$stream/$yyyymmdd$HH\"0000\"-$step$U-$stream-$type.$format\" --output 2t.grib2\n", |
| 1089 | + "```" |
| 1090 | + ] |
1067 | 1091 | } |
1068 | 1092 | ], |
1069 | 1093 | "metadata": { |
|
1082 | 1106 | "name": "python", |
1083 | 1107 | "nbconvert_exporter": "python", |
1084 | 1108 | "pygments_lexer": "ipython3", |
1085 | | - "version": "3.10.17" |
| 1109 | + "version": "3.12.3" |
1086 | 1110 | }, |
1087 | 1111 | "widgets": { |
1088 | 1112 | "application/vnd.jupyter.widget-state+json": { |
|
0 commit comments