{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import os" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "s = np.load('/home/X-neural-lam/data/tcwv05/samples/train/tcwv.npy')" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "split = 'test'\n", "root_path = '/home/X-neural-lam/data/tcwv05'\n", "data_path = os.path.join(root_path, 'samples',split)\n", "sin = np.load(os.path.join(data_path, 'sin_feature.npy'))\n", "cos = np.load(os.path.join(data_path, 'cos_feature.npy'))\n", "land_sea_mask = np.load(os.path.join(data_path, 'land_sea_mask.npy'))\n", "tcwv = np.load(os.path.join(data_path, 'tcwv.npy'))\n", "\n", "# sin = sin[:365*5,::4,::4]\n", "# cos = cos[:365*5,::4,::4]\n", "# tcwv = tcwv[:365*5,::4,::4]\n", "\n", "# land_sea_mask = land_sea_mask[::4,::4]\n", "\n", "sin = sin[:365]\n", "cos = sin[:365]\n", "tcwv = tcwv[:365,::4,::4]" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "np.save(os.path.join(data_path, 'sin_feature.npy'), sin)\n", "np.save(os.path.join(data_path, 'cos_feature.npy'), cos)\n", "np.save(os.path.join(data_path, 'land_sea_mask.npy'), land_sea_mask)\n", "np.save(os.path.join(data_path, 'tcwv.npy'), tcwv)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "# statics\n", "pos = np.load(os.path.join(root_path, 'static', 'pos_feature.npy'))\n", "pos = pos[:,::4,::4]\n", "np.save(os.path.join(root_path, 'static', 'pos_feature.npy'), pos)" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.18" } }, "nbformat": 4, "nbformat_minor": 2 }