File size: 2,697 Bytes
ff5b2f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# ERA5数据集配置示例
model:
  start_epoch: 0
  max_epoch: 100
  lr: 1E-3
  num_blocks: 8
  patch_size: [8, 8]
  patience: 50 
  checkpoint_dir: "./data/checkpoints"

 # 整个数据读取流程
datapipe:
  name: "ERA5"
  task: "weather_forecasting"

  # dataset设定
  dataset:
    type: "hdf5"
    data_dir: './data/' # "$ONESCIENCE_DATASETS_DIR/ERA5/newh5/" 
    
    train_time: [1951, 1952]
    val_time: [1953]
    test_time: [1954]
    img_size: [721, 1440]
    verbose: true
    cache: false
    # 气象变量

    channels: ['10m_u_component_of_wind', '10m_v_component_of_wind', '2m_temperature', 'surface_pressure',
               'mean_sea_level_pressure', 'total_column_water_vapour', # 6 surface
               'u_component_of_wind_1000',
               'v_component_of_wind_1000',

               'temperature_850',
               'u_component_of_wind_850',
               'v_component_of_wind_850',
               'geopotential_850',
               'relative_humidity_850',

               'temperature_500',
               'u_component_of_wind_500',
               'v_component_of_wind_500',
               'geopotential_500',
               'relative_humidity_500',
               
               'geopotential_50',
               ]

    variables:
      - "u10"        # 10m U wind component
      - "v10"        # 10m V wind component
      - "t2m"        # 2m temperature
      - "msl"        # Mean sea level pressure
      - "z500"       # Geopotential at 500 hPa
      - "t850"       # Temperature at 850 hPa
    
    # 时间配置
    time_range: ["2000-01-01", "2020-12-31"]
    time_steps: 1
    time_res: 6
    
    # 空间配置
    spatial_resolution: [0.25, 0.25]
    
    # 采样配置
    num_samples: -1  # -1 表示使用全部数据
    shuffle: true
    random_seed: 42
    
    # 领域特定配置
    extra:
      levels: [500, 850, 1000]
      lat_range: [-90, 90]
      lon_range: [0, 360]
  
  # 数据转换配置
  transforms:
    - type: "Normalize"
      params:
        mean: [0.0, 0.0, 288.0, 101325.0, 50000.0, 270.0]
        std: [5.0, 5.0, 15.0, 1000.0, 5000.0, 10.0]
        keys: ["input", "target"]
    
    - type: "ToTensor"
      params:
        keys: null  # null表示转换所有numpy数组
  
  # 其他配置


  # DataLoader配置
  dataloader:
    mask_dtype: "float32"
    batch_size: 4
    num_workers: 1
    pin_memory: true
    drop_last: true
    shuffle: false  # 使用sampler时设为false
    prefetch_factor: 2
    persistent_workers: true
  
  # 分布式配置
  distributed:
    enabled: true
    sampler: "DistributedSampler"
    rank: 0
    world_size: 4
    shuffle: true
    seed: 42
    drop_last: true