JasonXF commited on
Commit
f7e3f8f
·
verified ·
1 Parent(s): 27c4d4d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -64
README.md CHANGED
@@ -40,7 +40,6 @@ MDOF/
40
  └── Data/
41
  └── fno/
42
  ├── Blg_F6_18m_IM7_st0.h5.h5 # Floor acc. response
43
- └── ...
44
  ```
45
 
46
  ### Ground Motion File (`GMs_knet_3474_AF_57.h5`)
@@ -65,69 +64,7 @@ Each file stores the simulated structural response for all GM × scale combinati
65
 
66
  ## Loading
67
 
68
- ### Option 1 Direct HDF5 access (h5py)
69
-
70
- ```python
71
- import h5py
72
- import numpy as np
73
-
74
- GM_FILE = "path/to/MDOF/All_GMs/GMs_knet_3474_AF_57.h5"
75
-
76
- with h5py.File(GM_FILE, "r") as f:
77
- # Load ground motion i=0, amplitude factor j=0
78
- gm = f["gm_0/af_0/data"][:] # shape (3000,)
79
- pga = f["gm_0/af_0/pga"][()]
80
-
81
- print(f"GM shape: {gm.shape}, PGA: {pga:.4f} m/s²")
82
- ```
83
-
84
- ```python
85
- import h5py
86
- import numpy as np
87
-
88
- BLG_FILE = "path/to/MDOF/knet-250/Data/fno/building_0001.h5"
89
-
90
- with h5py.File(BLG_FILE, "r") as f:
91
- # Floor acceleration response for GM i=0, AF j=0
92
- floor_acc = f["response/gm_0/af_0/floor_acc"][:] # (n_floors, 3000)
93
- damage_state = f["building/damage_state/gm_0/af_0"][()]
94
-
95
- print(f"Floor acc shape: {floor_acc.shape}, Damage state: {damage_state}")
96
- ```
97
-
98
- ### Option 2 — PyTorch Dataset (recommended for training)
99
-
100
- Clone the [SeismicFNO](https://github.com/HKUJasonJiang/Seismic-FNO) repository and use `DynamicDataset`:
101
-
102
- ```python
103
- import numpy as np
104
- from torch.utils.data import DataLoader
105
- from module.dataprep_v2 import DynamicDataset
106
-
107
- GM_FILE = "path/to/MDOF/All_GMs/GMs_knet_3474_AF_57.h5"
108
- BUILDING_DIR = "path/to/MDOF/knet-250/Data/fno/"
109
-
110
- # Full dataset (all 3474 × 57 combinations)
111
- dataset = DynamicDataset(
112
- gm_file_path = GM_FILE,
113
- building_files_dir = BUILDING_DIR,
114
- )
115
-
116
- # Or pass a pre-computed index array for train/val/test splits
117
- rng = np.random.default_rng(42)
118
- indices = rng.permutation(len(dataset))
119
- train_ds = DynamicDataset(GM_FILE, BUILDING_DIR, gm_indices=indices[:int(0.7 * len(indices))])
120
-
121
- loader = DataLoader(train_ds, batch_size=64, shuffle=True, num_workers=4)
122
-
123
- # Each batch: (gm, building_attributes, floor_acc_response, damage_state)
124
- gm, attr, resp, ds = next(iter(loader))
125
- print(gm.shape, resp.shape) # (64, 3000, 1), (64, 3000, 1)
126
- ```
127
-
128
- ## Citation
129
-
130
- If you use this dataset, please cite the K-NET strong-motion network and the associated SeismicFNO paper (forthcoming).
131
 
132
  ## License
133
 
 
40
  └── Data/
41
  └── fno/
42
  ├── Blg_F6_18m_IM7_st0.h5.h5 # Floor acc. response
 
43
  ```
44
 
45
  ### Ground Motion File (`GMs_knet_3474_AF_57.h5`)
 
64
 
65
  ## Loading
66
 
67
+ Refer to github repo and codes.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  ## License
70