Skip to content

Commit faf5b5a

Browse files
committed
unit
1 parent da8c4bb commit faf5b5a

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ rm tmp1.nc tmp2.nc
5252

5353
After the data interpolation is completed, you can refer to the [demo.ipynb](https://github.com/OpenEarthLab/ORCA-DL/blob/main/demo.ipynb) to run ORCA-DL.
5454

55+
**Note: you need to unify the units before using our statistics to normalize the data. See [demo.ipynb](https://github.com/OpenEarthLab/ORCA-DL/blob/main/demo.ipynb).**
56+
5557
## 📋 Updates
5658

5759
- Training data and code are coming soon.

demo.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@
3939
" 'mean': {v: np.load(f\"./stat/mean/{v}.npy\") for v in variables},\n",
4040
" 'std': {v: np.load(f\"./stat/std/{v}.npy\") for v in variables}\n",
4141
"}\n",
42+
"## Note: the unit for temperatue is °C, salinity is g/kg, current is m/s, ssh is m, wind stress is N/m²\n",
4243
"\n",
4344
"# load data\n",
4445
"month = 0 # the corresponding statistical values ​​for each month are different\n",
4546
"ocean_vars = []\n",
4647
"atmo_vars = []\n",
4748
"for v in variables[:-2]:\n",
4849
" ds = xr.open_dataset(f\"./example_data/{v}.nc\")\n",
50+
" # Important: the units of input data should be consistent with the units of the statistical values\n",
4951
" normed_data = (ds[v].values - stat['mean'][v][month]) / stat['std'][v][month]\n",
5052
" ocean_vars.append(normed_data if len(normed_data.shape) == 3 else normed_data[None])\n",
5153
"for v in variables[-2:]:\n",

model/utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,4 @@ def __call__(self):
153153
mask = mask.reshape((self.rand_size[0], self.rand_size[1]))
154154
mask = mask.repeat_interleave(self.scale[0], dim=0).repeat_interleave(self.scale[1], dim=1)
155155

156-
return mask
157-
158-
159-
160-
161-
162-
156+
return mask

0 commit comments

Comments
 (0)