### Install WeatherBench 2 and Dependencies Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Installs the WeatherBench 2 package and essential dependencies using pip. Ensure you have Python and pip installed before running this command. ```bash pip install weatherbench2 ``` -------------------------------- ### Example of Running Evaluation with Apache Beam in Python Source: https://weatherbench2.readthedocs.io/en/latest/evaluation Provides a commented-out example of how to run the evaluation using Apache Beam, which is recommended for larger datasets. It shows how to specify the Beam runner and input chunk sizes for distributed processing. ```python # evaluation.evaluate_with_beam( # data_config, # eval_configs, # runner='DirectRunner', # input_chunks={'time': 20}, # ) ``` -------------------------------- ### Install WeatherBench 2 using pip Source: https://weatherbench2.readthedocs.io/en/latest/evaluation Installs the WeatherBench 2 framework from its GitHub repository using pip. This command may sometimes trigger warnings regarding the Pandas version, but the installation should proceed correctly. ```shell # Pip might complain about the Pandas version. The notebook should still work as expected. !pip install git+https://github.com/google-research/weatherbench2.git ``` -------------------------------- ### Basic Data Loading Example Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Demonstrates how to load weather data using WeatherBench 2. This involves specifying the dataset and time range for data retrieval. ```python import weatherbench2 as wb2 data = wb2.load_data( dataset="era5", times=('2000-01-01', '2000-12-31') ) ``` -------------------------------- ### Setup WeatherBench Configuration in Python Source: https://weatherbench2.readthedocs.io/en/latest/evaluation Imports the necessary configuration module from the WeatherBench2 library to begin setting up evaluation parameters. This is the initial step before defining data or evaluation specifics. ```python from weatherbench2 import config ``` -------------------------------- ### Clone WeatherBench 2 Repository Source: https://weatherbench2.readthedocs.io/en/latest/index This command clones the WeatherBench 2 GitHub repository to your local machine. It's the first step to get started with the project. ```bash git clone git@github.com:google-research/weatherbench2.git ``` -------------------------------- ### Simple Linear Regression Forecasting Model Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation A basic example of a forecasting model using linear regression. This function takes historical data and predicts future values. ```python import weatherbench2 as wb2 import numpy as np def simple_linear_regression(data): # Placeholder for actual linear regression implementation # This function should take historical data and return predictions print("Running simple linear regression...") # Example: return a copy of the input data as a prediction return data.copy() ``` -------------------------------- ### Running a Forecasting Experiment Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Shows how to set up and run a forecasting experiment using a specified model and configuration. This involves defining parameters and executing the forecast. ```python import weatherbench2 as wb2 # Load data (assuming data is already loaded as shown in previous examples) data = wb2.load_data(dataset="era5", times=('2000-01-01', '2000-12-31')) # Define the forecasting model (e.g., using a predefined model or a custom one) model = wb2.models.LinearRegression( resolution=wb2.Resolution.T63, time_range=(0, 360) # Example time range in days ) # Run the forecasting experiment predictions = wb2.run_experiment( model=model, data=data, output_dir="./forecast_output" ) ``` -------------------------------- ### WeatherBench 2 Evaluation Script Example Source: https://weatherbench2.readthedocs.io/en/latest/command-line-scripts This example demonstrates how to execute the `evaluate.py` script with specific command-line arguments. It showcases a practical application of the script for running evaluations, likely involving setting paths to forecast and observation data, and potentially other configuration options. ```bash python evaluate.py \ ``` -------------------------------- ### Install WeatherBench 2 with GCP Requirements Source: https://weatherbench2.readthedocs.io/en/latest/index This command installs WeatherBench 2 along with optional requirements for launching jobs on Google Cloud Platform (GCP). ```bash pip install .[gcp] ``` -------------------------------- ### Data Handling and Preprocessing Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Details on loading and preprocessing weather data for use with forecasting models. This includes selecting datasets and specifying time periods. ```python import weatherbench2 as wb2 # Load data from a specific dataset (e.g., 'era5') for a given time range data = wb2.load_data( dataset="era5", times=("1980-01-01", "2014-12-31") ) # Data preprocessing steps would typically follow here, such as: # - Normalization # - Feature selection # - Splitting into training and validation sets ``` -------------------------------- ### Install WeatherBench 2 Source: https://weatherbench2.readthedocs.io/en/latest/index These commands install the WeatherBench 2 package using pip. The first command changes the directory to the cloned repository, and the second installs the package. An editable install is available for development. ```bash cd weatherbench2 pip install . ``` ```bash pip install -e . ``` -------------------------------- ### Configuration for a Forecasting Model Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Illustrates how to configure a forecasting model, specifying resolution, time range, and other relevant parameters. This configuration is used when initializing a model object. ```python from weatherbench2.models import Resolution # Example configuration for a model resolution = Resolution.T63 time_range = (0, 360) # Forecast for 360 days # This configuration would be passed to a model constructor, e.g.: # model = SomeModel(resolution=resolution, time_range=time_range) ``` -------------------------------- ### Open Zarr Dataset with xarray Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide Opens a Zarr dataset from a Google Cloud Storage (GCS) path using the xarray library. This function requires the xarray library to be installed and assumes access to the specified GCS bucket. ```python import xarray as xr xr.open_zarr('gs://weatherbench2/datasets/neuralgcm_deterministic/2020-240x121_equiangular_with_poles_conservative.zarr') ``` -------------------------------- ### Load Keisler Dataset with xarray Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide This snippet demonstrates how to open and load the Keisler dataset from a Zarr store located in Google Cloud Storage using the xarray library. It assumes xarray and dask are installed. The output will be a dask-backed xarray DataArray representing weather data. ```python xr.open_zarr('gs://weatherbench2/datasets/keisler/2020-360x181.zarr') ``` -------------------------------- ### Open Zarr Dataset with Xarray Source: https://weatherbench2.readthedocs.io/en/latest/data-guide This snippet demonstrates how to open a Zarr dataset from a Google Cloud Storage (GCS) path using the xarray library in Python. It assumes the necessary libraries are installed and credentials are configured. ```python import xarray as xr xr.open_zarr('gs://weatherbench2/datasets/ifs_ens/2018-2022-1440x721.zarr') ``` -------------------------------- ### Open Zarr Dataset with Xarray Source: https://weatherbench2.readthedocs.io/en/latest/data-guide Opens a dataset stored in Zarr format from a Google Cloud Storage path using the xarray library. This is a common method for accessing large, chunked datasets. It requires the xarray library to be installed. ```python import xarray as xr xr.open_zarr('gs://weatherbench2/datasets/hres/2016-2022-0012-1440x721.zarr') ``` -------------------------------- ### Evaluate ERA5 Forecasts vs ERA5 using Bash Source: https://weatherbench2.readthedocs.io/en/latest/_sources/official-evaluation This script demonstrates the setup for evaluating ERA5 forecasts against ERA5 observational data. It specifies the necessary paths for forecast data, observations, and climatology, along with output configurations. This example is incomplete as it lacks the full set of arguments. ```bash python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/era5-forecasts/2020-64x32_equiangular_conservative.zarr \ --obs_path=gs://weatherbench2/datasets/era5/1959-2022-6h-64x32_equiangular_conservative.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_64x32_equiangular_conservative.zarr \ ``` -------------------------------- ### Open ERA5 Zarr Dataset with xarray Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide Opens the ERA5 dataset stored in Zarr format from a Google Cloud Storage bucket using the xarray library. This is a common starting point for accessing and analyzing the WeatherBench 2 data. ```python xr.open_zarr('gs://weatherbench2/datasets/era5/1959-2023_01_10-wb13-6h-1440x721_with_derived_variables.zarr') ``` -------------------------------- ### Open ERA5 Forecasts with Xarray Source: https://weatherbench2.readthedocs.io/en/latest/data-guide Opens a specific ERA5 forecast dataset (2020-1440x721.zarr) from Google Cloud Storage using the xarray library. This function is used to load the forecast data for analysis. It requires the xarray library to be installed. ```python xr.open_zarr('gs://weatherbench2/datasets/era5-forecasts/2020-1440x721.zarr') ``` -------------------------------- ### Evaluate FUXI Forecasts (Python) Source: https://weatherbench2.readthedocs.io/en/latest/official-evaluation This Python script evaluates the FUXI forecast model. It configures paths for forecast, observation, and climatology data, along with output settings, input chunking, and evaluation criteria. This example also demonstrates specifying specific pressure levels for evaluation and including derived variables. ```python python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/fuxi/2020-64x32_equiangular_conservative.zarr \ --obs_path=gs://weatherbench2/datasets/era5/1959-2022-6h-64x32_equiangular_conservative.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_64x32_equiangular_conservative.zarr \ --output_dir=$OUTDIR/64x32/deterministic/ \ --output_file_prefix=fuxi_vs_era_2020_ \ --input_chunks=init_time=1 \ --fanout=27 \ --regions=all \ --eval_configs=deterministic,deterministic_temporal \ --evaluate_climatology=False \ --evaluate_persistence=False \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --levels=500,850 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure,10m_wind_speed,wind_speed \ --add_land_region=False \ --use_beam=True ``` -------------------------------- ### Open Zarr Dataset with Xarray in Python Source: https://weatherbench2.readthedocs.io/en/latest/data-guide Opens a Zarr dataset from a Google Cloud Storage (GCS) path using the xarray library. This is useful for loading large, chunked datasets for analysis. Ensure you have xarray and the necessary GCS connectors installed. ```python import xarray as xr dataset = xr.open_zarr('gs://weatherbench2/datasets/hres_t0/2016-2022-6h-1440x721.zarr') ``` -------------------------------- ### Displaying Coordinate Data Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation This snippet shows how to display the data associated with coordinates like 'latitude', 'level', and 'longitude'. It extracts preview data and associated metadata. ```html
  • level
    (level)
    int64
    50 100 150 200 ... 700 850 925 1000
    array([  50,  100,  150,  200,  250,  300,  400,  500,  600,  700,  850,  925,
           1000])
  • ``` ```html
  • longitude
    (longitude)
    float64
    0.0 5.625 11.25 ... 348.8 354.4
    array([  0.   ,   5.625,  11.25 ,  16.875,  22.5  ,  28.125,  33.75 ,  39.375,
            45.   ,  50.625,  56.25 ,  61.875,  67.5  ,  73.125,  78.75 ,  84.375,
            90.   ,  95.625, 101.25 , 106.875, 112.5  , 118.125, 123.75 , 129.375,
           135.   , 140.625, 146.25 , 151.875, 157.5  , 163.125, 168.75 , 174.375,
           180.   , 185.625, 191.25 , 196.875, 202.5  , 208.125, 213.75 , 219.375,
           225.   , 230.625, 236.25 , 241.875, 247.5  , 253.125, 258.75 , 264.375,
           270.   , 275.625, 281.25 , 286.875, 292.5  , 298.125, 303.75 , 309.375,
           315.   , 320.625, 326.25 , 331.875, 337.5  , 343.125, 348.75 , 354.375])
  • ``` -------------------------------- ### Open Zarr Archive with xarray Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide This code snippet demonstrates how to open a Zarr archive from a Google Cloud Storage bucket using the xarray library in Python. It assumes the 'xarray' library is installed. The function returns an xarray.Dataset object representing the data. ```python import xarray as xr # Open the Zarr archive from Google Cloud Storage dataset = xr.open_zarr('gs://weatherbench2/datasets/ifs_ens/2018-2022-1440x721.zarr') ``` -------------------------------- ### Pandas Index: longitude Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Provides the Pandas Index for the 'longitude' variable. This index includes floating-point values representing longitude coordinates, starting from 0.0 and increasing in increments. ```python PandasIndex(Index([ 0.0, 5.625, 11.25, 16.875, 22.5, 28.125, 33.75, 39.375, 45.0, 50.625, 56.25, 61.87499999999999, 67.5, 73.125, 78.75, 84.375, 90.0, 95.625, 101.25, 106.875, 112.5, 118.125, 123.74999999999999, 129.375, 135.0, 140.625, 146.25, 151.875, 157.5, 163.125, 168.75, 174.375, 180.0, ``` -------------------------------- ### Time Data Representation Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide Details the data representation for the 'time' dimension. This array contains datetime objects, showing timestamps for the data, including start and end dates for the year 2020. ```python array(['2020-01-01T00:00:00.000000000', '2020-01-01T12:00:00.000000000', ...]) ``` -------------------------------- ### Pandas TimedeltaIndex for Prediction Intervals in WeatherBench2 Source: https://weatherbench2.readthedocs.io/en/latest/data-guide This snippet illustrates the Pandas TimedeltaIndex for the 'prediction_timedelta' dimension in WeatherBench2. It defines various time intervals used for predictions, starting from 0 days. ```python PandasIndex(TimedeltaIndex([ '0 days 00:00:00', '0 days 06:00:00', '0 days 12:00:00', '0 days 18:00:00', '1 days 00:00:00', '1 days 06:00:00', '1 days 12:00:00', '1 days 18:00:00', '2 days 00:00:00', '2 days 06:00:00', '2 days 12:00:00', '2 days 18:00:00', '3 days 00:00:00', '3 days 06:00:00', '3 days 12:00:00', '3 days 18:00:00', '4 days 00:00:00', '4 days 06:00:00', '4 days 12:00:00', '4 days 18:00:00', '5 days 00:00:00', '5 days 12:00:00', '6 days 00:00:00', '6 days 12:00:00', '7 days 00:00:00', '7 days 12:00:00', '8 days 00:00:00', '8 days 12:00:00', '9 days 00:00:00', '9 days 12:00:00', '10 days 00:00:00'], dtype='timedelta64[ns]', name='prediction_timedelta', freq=None)) ``` -------------------------------- ### Pandas TimedeltaIndex Example Source: https://weatherbench2.readthedocs.io/en/latest/data-guide This code snippet displays a Pandas TimedeltaIndex, which is used to represent time differences. It's commonly employed in datasets to denote prediction lead times or intervals between forecasts. ```python from pandas import TimedeltaIndex prediction_timedelta = TimedeltaIndex([ '0 days 00:00:00', '0 days 12:00:00', '1 days 00:00:00', '1 days 12:00:00', '2 days 00:00:00', '2 days 12:00:00', '3 days 00:00:00', '3 days 12:00:00', '4 days 00:00:00', '4 days 12:00:00', '5 days 00:00:00', '5 days 12:00:00', '6 days 00:00:00', '6 days 12:00:00', '7 days 00:00:00', '7 days 12:00:00', '8 days 00:00:00', '8 days 12:00:00', '9 days 00:00:00', '9 days 12:00:00', '10 days 00:00:00', '10 days 12:00:00', '11 days 00:00:00', '11 days 12:00:00', '12 days 00:00:00', '12 days 12:00:00', '13 days 00:00:00', '13 days 12:00:00', '14 days 00:00:00', '14 days 12:00:00', '15 days 00:00:00' ], dtype='timedelta64[ns]', name='prediction_timedelta', freq=None)) ``` -------------------------------- ### Pandas DatetimeIndex Example Source: https://weatherbench2.readthedocs.io/en/latest/data-guide This code snippet shows a Pandas DatetimeIndex, which represents a sequence of dates and times. It's crucial for time-series analysis, marking specific points in time for weather observations or forecasts. ```python from pandas import DatetimeIndex time = DatetimeIndex([ '2020-01-01 00:00:00', '2020-01-01 12:00:00', '2020-01-02 00:00:00', '2020-01-02 12:00:00', '2020-01-03 00:00:00', '2020-01-03 12:00:00', '2020-01-04 00:00:00', '2020-01-04 12:00:00', '2020-01-05 00:00:00', '2020-01-05 12:00:00', '2020-12-31 00:00:00', '2020-12-31 12:00:00' ], dtype='datetime64[ns]', name='time', length=732, freq=None)) ``` -------------------------------- ### Access Pangu-Weather Model Information Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide This section provides information about the Pangu-Weather model, including its origin, GitHub repository link, and the locations of its datasets stored in Google Cloud Storage. It also lists the available data files for different resolutions and time periods. ```markdown ### Pangu-Weather We ran the [Pangu](https://www.nature.com/articles/s41586-023-06185-3) model using the code available on [GitHub](https://github.com/198808xc/Pangu-Weather). Location: [`gs://weatherbench2/datasets/pangu/`](https://console.cloud.google.com/storage/browser/weatherbench2/datasets/pangu/) Files: * `2018-2022_0012_0p25.zarr` * `2018-2022_0012_240x121_equiangular_with_poles_conservative.zarr` * `2018-2022_0012_64x32_equiangular_conservative.zarr` ``` -------------------------------- ### Evaluate Probabilistic Climatology vs. ERA5 (1440x721) Source: https://weatherbench2.readthedocs.io/en/latest/official-evaluation This command evaluates probabilistic climatology against ERA5 reanalysis data for a 1440x721 resolution. It specifies forecast, observation (ERA5), and climatology paths, along with output configurations. This example enables the evaluation of probabilistic climatology and sets the start and end years for the climatology period. It also configures input chunking, fanout, regions, and the list of variables. ```python python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/ens/2018-2022-1440x721.zarr \ --obs_path=gs://weatherbench2/datasets/era5/1959-2022-6h-1440x721.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_1440x721.zarr \ --output_dir=$OUTDIR/1440x721/probabilistic/ \ --output_file_prefix=climatology_vs_era_2020_ \ --input_chunks=init_time=1,lead_time=1 \ --fanout=27 \ --regions=all \ --eval_configs=probabilistic \ --evaluate_probabilistic_climatology=True \ --probabilistic_climatology_start_year=1990 \ --probabilistic_climatology_end_year=2019 \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,specific_humidity,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure,total_precipitation_6hr,total_precipitation_24hr,10m_wind_speed,wind_speed \ --use_beam=True ``` -------------------------------- ### Import Evaluation Functions in Python Source: https://weatherbench2.readthedocs.io/en/latest/evaluation Imports the necessary functions to run the evaluation process: `evaluate_in_memory` for smaller datasets and `evaluate_with_beam` for larger datasets using Apache Beam. ```python from weatherbench2.evaluation import evaluate_in_memory, evaluate_with_beam ``` -------------------------------- ### Import WeatherBench 2 Libraries Source: https://weatherbench2.readthedocs.io/en/latest/evaluation Imports essential libraries for using the WeatherBench 2 framework, including apache_beam, weatherbench2, and xarray. Importing apache_beam separately is noted as a workaround for potential TypingErrors. ```python import apache_beam # Needs to be imported separately to avoid TypingError import weatherbench2 import xarray as xr ``` -------------------------------- ### Define Time Index in Pandas Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide This code illustrates the creation of a Pandas DatetimeIndex, representing the time dimension of the dataset. It includes the start and end dates, the data type, and the name of the index. This is fundamental for time-series analysis. ```python PandasIndex(DatetimeIndex(['2020-01-01 00:00:00', '2020-01-01 12:00:00', '2020-01-02 00:00:00', '2020-01-02 12:00:00', '2020-01-03 00:00:00', '2020-01-03 12:00:00', '2020-01-04 00:00:00', '2020-01-04 12:00:00', '2020-01-05 00:00:00', '2020-01-05 12:00:00', ... '2020-12-27 00:00:00', '2020-12-27 12:00:00', '2020-12-28 00:00:00', '2020-12-28 12:00:00', '2020-12-29 00:00:00', '2020-12-29 12:00:00', '2020-12-30 00:00:00', '2020-12-30 12:00:00', '2020-12-31 00:00:00', '2020-12-31 12:00:00'], dtype='datetime64[ns]', name='time', length=732, freq=None)) ``` -------------------------------- ### Evaluate Pangu-HRES-Init vs. Analysis (Python) Source: https://weatherbench2.readthedocs.io/en/latest/official-evaluation This command evaluates the Pangu-HRES-Init model against analysis data, likely from HRES. It specifies paths for forecast, observation (analysis), land surface model datasets, and climatology. The evaluation focuses on deterministic and temporal configurations using Apache Beam. ```python python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/pangu_hres_init/2020_0012_0p25.zarr \ --obs_path=gs://weatherbench2/datasets/hres_t0/2016-2022-6h-1440x721.zarr \ --lsm_dataset=gs://weatherbench2/datasets/era5/1959-2022-6h-1440x721.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_1440x721.zarr \ --output_dir=$OUTDIR/1440x721/deterministic/ \ --output_file_prefix=pangu_hres_init_vs_analysis_2020_ \ --input_chunks=init_time=1,lead_time=1 \ --fanout=27 \ --regions=all \ --eval_configs=deterministic,deterministic_temporal \ --evaluate_climatology=False \ --evaluate_persistence=False \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,specific_humidity,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure \ --add_land_region=False \ --use_beam=True ``` -------------------------------- ### Pandas Indexing: Datetime Source: https://weatherbench2.readthedocs.io/en/latest/_sources/data-guide This snippet shows the creation of a Pandas DatetimeIndex. It represents a series of dates and times, starting from '2018-01-01 00:00:00' and including hourly and daily intervals. This index is useful for time-series data analysis. ```python PandasIndex(DatetimeIndex(['2018-01-01 00:00:00', '2018-01-01 12:00:00', '2018-01-02 00:00:00', '2018-01-02 12:00:00', '2018-01-03 00:00:00', '2018-01-03 12:00:00', '2018-01-04 00:00:00', '2018-01-04 12:00:00', '2018-01-05 00:00:00', '2018-01-05 12:00:00', ... '2022-12-27 00:00:00', '2022-12-27 12:00:00', '2022-12-28 00:00:00', '2022-12-28 12:00:00'], dtype='datetime64[ns]', name='time', freq=None)) ``` -------------------------------- ### Configure Data Paths Source: https://weatherbench2.readthedocs.io/en/latest/_sources/evaluation Defines the file paths for forecast data, observational data, and the output directory for evaluation results. This configuration is essential for specifying where the data resides and where the results should be saved. ```python paths = config.Paths( forecast=forecast_path, obs=obs_path, output_dir='./' # Directory to save evaluation results ) ``` -------------------------------- ### Pandas DatetimeIndex for Time in Python Source: https://weatherbench2.readthedocs.io/en/latest/data-guide This code snippet shows the 'time' index using Pandas DatetimeIndex. It represents daily and sub-daily timestamps starting from '2016-01-01 00:00:00'. This index is fundamental for time-series analysis and forecasting. ```python PandasIndex(DatetimeIndex(['2016-01-01 00:00:00', '2016-01-01 12:00:00', '2016-01-02 00:00:00', '2016-01-02 12:00:00', '2016-01-03 00:00:00', '2016-01-03 12:00:00', '2016-01-04 00:00:00', '2016-01-04 12:00:00', '2016-01-05 00:00:00', '2016-01-05 12:00:00', ... (truncated for brevity) '2023-01-06 00:00:00', '2023-01-06 12:00:00', '2023-01-07 00:00:00', '2023-01-07 12:00:00', '2023-01-08 00:00:00', '2023-01-08 12:00:00', '2023-01-09 00:00:00', '2023-01-09 12:00:00', '2023-01-10 00:00:00', '2023-01-10 12:00:00'], dtype='datetime64[ns]', name='time', freq=None)) ``` -------------------------------- ### Evaluate Forecasts with Specific Parameters (Shell) Source: https://weatherbench2.readthedocs.io/en/latest/official-evaluation This command line shows how to execute an evaluation script with various parameters. It includes settings for output file prefixes, input chunking, fanout, regions, evaluation configurations, time range, variables, and Beam usage. ```shell --output_file_prefix=era5-forecasts_vs_era_2020_ \ --input_chunks=init_time=1 \ --fanout=27 \ --regions=all \ --eval_configs=deterministic,deterministic_temporal \ --evaluate_climatology=False \ --evaluate_persistence=False \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,specific_humidity,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure,10m_wind_speed,wind_speed \ --use_beam=True ``` -------------------------------- ### PandasIndex for Time Series Data Source: https://weatherbench2.readthedocs.io/en/latest/data-guide This code demonstrates a Pandas DatetimeIndex for time series data, starting from '2016-01-01 00:00:00' with a frequency of 6 hours. It covers a significant period, suitable for climate analysis and model evaluation. ```python PandasIndex(DatetimeIndex(['2016-01-01 00:00:00', '2016-01-01 06:00:00', '2016-01-01 12:00:00', '2016-01-01 18:00:00', '2016-01-02 00:00:00', '2016-01-02 06:00:00', '2016-01-02 12:00:00', '2016-01-02 18:00:00', '2016-01-03 00:00:00', '2016-01-03 06:00:00', ... (10268 values total) '2023-01-08 12:00:00', '2023-01-08 18:00:00', '2023-01-09 00:00:00', '2023-01-09 06:00:00', '2023-01-09 12:00:00', '2023-01-09 18:00:00', '2023-01-10 00:00:00', '2023-01-10 06:00:00', '2023-01-10 12:00:00', '2023-01-10 18:00:00'], dtype='datetime64[ns]', name='time', length=10268, freq=None)) ``` -------------------------------- ### Evaluate Pangu-HRES-Init vs. ERA5 (Python) Source: https://weatherbench2.readthedocs.io/en/latest/official-evaluation This script evaluates the Pangu-HRES-Init model against ERA5 reanalysis data. It configures input and output paths, evaluation settings, and the specific variables to be analyzed. Apache Beam is used for efficient data processing. ```python python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/pangu_hres_init/2020_0012_0p25.zarr \ --obs_path=gs://weatherbench2/datasets/era5/1959-2022-6h-1440x721.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_1440x721.zarr \ --output_dir=$OUTDIR/1440x721/deterministic/ \ --output_file_prefix=pangu_hres_init_vs_era_2020_ \ --input_chunks=init_time=1,lead_time=1 \ --fanout=27 \ --regions=all \ --eval_configs=deterministic,deterministic_temporal \ --evaluate_climatology=False \ --evaluate_persistence=False \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,specific_humidity,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure \ --add_land_region=False \ --use_beam=True ``` -------------------------------- ### Evaluate Pangu-HRES Initialization Forecasts (Python) Source: https://weatherbench2.readthedocs.io/en/latest/official-evaluation This script evaluates forecasts from Pangu-HRES with specific initialization settings against ERA5 data. It configures the evaluation for the year 2020, specifying Zarr paths for forecasts and observations, climatology, and output settings. It also includes options for land region analysis. ```python python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/pangu_hres_init/2020_0012_240x121_equiangular_with_poles_conservative.zarr \ --obs_path=gs://weatherbench2/datasets/era5/1959-2022-6h-240x121_equiangular_with_poles_conservative.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_240x121_equiangular_with_poles_conservative.zarr \ --output_dir=$OUTDIR/240x121/deterministic/ \ --output_file_prefix=pangu_hres_init_vs_era_2020_ \ --input_chunks=init_time=1,lead_time=10 \ --fanout=27 \ --regions=all \ --eval_configs=deterministic,deterministic_temporal \ --evaluate_climatology=False \ --evaluate_persistence=False \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,specific_humidity,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure \ --add_land_region=False \ --use_beam=True ``` ```python python evaluate.py -- \ --forecast_path=gs://weatherbench2/datasets/pangu_hres_init/2020_0012_240x121_equiangular_with_poles_conservative.zarr \ --obs_path=gs://weatherbench2/datasets/hres_t0/2016-2022-6h-240x121_equiangular_with_poles_conservative.zarr \ --lsm_dataset=gs://weatherbench2/datasets/era5/1959-2022-6h-240x121_equiangular_with_poles_conservative.zarr \ --climatology_path=gs://weatherbench2/datasets/era5-hourly-climatology/1990-2019_6h_240x121_equiangular_with_poles_conservative.zarr \ --output_dir=$OUTDIR/240x121/deterministic/ \ --output_file_prefix=pangu_hres_init_vs_analysis_2020_ \ --input_chunks=init_time=1,lead_time=10 \ --fanout=27 \ --regions=all \ --eval_configs=deterministic,deterministic_temporal \ --evaluate_climatology=False \ --evaluate_persistence=False \ --time_start=2020-01-01 \ --time_stop=2020-12-31 \ --variables=geopotential,temperature,u_component_of_wind,v_component_of_wind,specific_humidity,2m_temperature,10m_u_component_of_wind,10m_v_component_of_wind,mean_sea_level_pressure \ --add_land_region=False \ --use_beam=True ```