...
 
Commits (3)
.ipynb_checkpoints
readme.md
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -44,27 +44,14 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1948\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/gfs1/work/shkifmwr/_TM/software/miniconda3_20180131/envs/py3_std/bin/ipython:34: FutureWarning: pd.rolling_sum is deprecated for ndarrays and will be removed in a future version\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"1948\n",
"1949\n",
"1950\n",
"1951\n",
......@@ -139,6 +126,7 @@
"fout15C10d=wdir+\"/DATA/15C10d_nfloats.nc\"\n",
"fout15C10d_no10C=wdir+\"/DATA/15C10d_no10C_nfloats.nc\"\n",
"fout10C=wdir+\"/DATA/10C_nfloats.nc\"\n",
"fout10C2y=wdir+\"/DATA/10C2y_nfloats.nc\"\n",
"\n",
"\n",
"year1=1948\n",
......@@ -147,6 +135,7 @@
"n15C=[]\n",
"n15C10d=[]\n",
"n10C=[]\n",
"n10C2y=[]\n",
"n15C10d_no10C=[]\n",
"\n",
"for year in range(year1,year2+1):\n",
......@@ -154,41 +143,48 @@
" ifile=wdir+\"/DATA/GS-\"+str(year)+\"/ariane_trajectories_qualitative.nc\"\n",
" ofile15C=wdir+\"/DATA/GS-\"+str(year)+\"/ariane_trajectories_qualitative_15C.nc\"\n",
" ofile10C=wdir+\"/DATA/GS-\"+str(year)+\"/ariane_trajectories_qualitative_10C.nc\"\n",
" ofile10C2y=wdir+\"/DATA/GS-\"+str(year)+\"/ariane_trajectories_qualitative_10C2y.nc\"\n",
" ofile15C10d=wdir+\"/DATA/GS-\"+str(year)+\"/ariane_trajectories_qualitative_15C10d.nc\"\n",
" ofile15C10d_no10C=wdir+\"/DATA/GS-\"+str(year)+\"/ariane_trajectories_qualitative_15C10d_no10C.nc\"\n",
"\n",
" data=xr.open_dataset(ifile)\n",
" #index15C=((data['traj_temp']<=15) & (data['nb_output'] < 73)).any('nb_output')\n",
" index10C=((data['traj_temp']<=10) & (data['nb_output'] < 73)).any('nb_output')\n",
" index15C10d=((rolling_sum(((data['traj_temp']<=15) & (data['nb_output'] < 73)).values,2)) == 2).any(axis=0) \n",
" index15C10d=xr.DataArray(index15C10d,dims=('ntraj'))\n",
" index15C10d_no10C=(index15C10d & ~index10C)\n",
" index10C2y=((data['traj_temp']<=10)).any('nb_output')\n",
" #index15C10d=((rolling_sum(((data['traj_temp']<=15) & (data['nb_output'] < 73)).values,2)) == 2).any(axis=0) \n",
" #index15C10d=xr.DataArray(index15C10d,dims=('ntraj'))\n",
" #index15C10d_no10C=(index15C10d & ~index10C)\n",
" \n",
" #data15C=data.where(index15C,drop=True)\n",
" #data10C=data.where(index10C,drop=True)\n",
" data10C=data.where(index10C,drop=True)\n",
" data10C2y=data.where(index10C2y,drop=True)\n",
" #data15C10d=data.where(index15C10d,drop=True)\n",
" data15C10d_no10C=data.where(index15C10d_no10C,drop=True)\n",
" #data15C10d_no10C=data.where(index15C10d_no10C,drop=True)\n",
" \n",
" #n15C+=[index15C.sum().values]\n",
" #n15C10d+=[index15C10d.sum().values]\n",
" #n10C+=[index10C.sum().values]\n",
" n15C10d_no10C+=[index15C10d_no10C.sum().values]\n",
" n10C+=[index10C.sum().values]\n",
" n10C2y+=[index10C2y.sum().values]\n",
" #n15C10d_no10C+=[index15C10d_no10C.sum().values]\n",
" \n",
" #Save to file\n",
" #data15C.to_netcdf(ofile15C)\n",
" #data15C10d.to_netcdf(ofile15C10d)\n",
" #data10C.to_netcdf(ofile10C)\n",
" data15C10d_no10C.to_netcdf(ofile15C10d_no10C)\n",
" data10C.to_netcdf(ofile10C)\n",
" data10C2y.to_netcdf(ofile10C2y)\n",
" #data15C10d_no10C.to_netcdf(ofile15C10d_no10C)\n",
"\n",
"#ds15C = xr.Dataset({'ntraj': (['year'], n15C)},coords={'year':np.arange(year1,year2+1)})\n",
"#ds15C10d = xr.Dataset({'ntraj': (['year'], n15C10d)},coords={'year':np.arange(year1,year2+1)})\n",
"ds15C10d_no10C = xr.Dataset({'ntraj': (['year'], n15C10d_no10C)},coords={'year':np.arange(year1,year2+1)})\n",
"#ds15C10d_no10C = xr.Dataset({'ntraj': (['year'], n15C10d_no10C)},coords={'year':np.arange(year1,year2+1)})\n",
"#ds10C = xr.Dataset({'ntraj': (['year'], n10C)},coords={'year':np.arange(year1,year2+1)})\n",
"ds10C2y = xr.Dataset({'ntraj': (['year'], n10C2y)},coords={'year':np.arange(year1,year2+1)})\n",
"\n",
"#ds15C.to_netcdf(fout15C)\n",
"#ds15C10d.to_netcdf(fout15C10d)\n",
"ds15C10d_no10C.to_netcdf(fout15C10d_no10C)\n",
"#ds10C.to_netcdf(fout10C)"
"#ds15C10d_no10C.to_netcdf(fout15C10d_no10C)\n",
"#ds10C.to_netcdf(fout10C)\n",
"ds10C2y.to_netcdf(fout10C2y)"
]
}
],
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.