I hereby claim:
- I am raphaeldussin on github.
- I am raphaeldussin (https://keybase.io/raphaeldussin) on keybase.
- I have a public key ASDelxZLvjXQhqoc0gM86v23mA7H7Z3QzcvuWKWvo51O0Ao
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| import numpy as np | |
| import sys | |
| # playing with input files from tutorial_global_oce_latlon | |
| filein = 'lev_t.bin' | |
| # MITgcm likes its binary in big endian, float ('>f') or double ('>d') | |
| raw = np.fromfile(filein, dtype='>f') |
| #!/usr/bin/env python | |
| import numpy as np | |
| import struct | |
| def write_new_data(data,fileout): | |
| fid = open(fileout, "wb") | |
| flatdata = data.flatten() | |
| for kk in np.arange(len(flatdata)): | |
| tmp = struct.pack('>d',flatdata[kk]) |
I hereby claim:
To claim this, I am signing this object:
| # this works with the laptop's keyboard fine: | |
| >>> more /etc/default/keyboard | |
| # KEYBOARD CONFIGURATION FILE | |
| # Consult the keyboard(5) manual page. | |
| XKBMODEL="macintosh" | |
| XKBLAYOUT="fr" |
| pic_start = cftime.num2date(0, 'days since 0001-01-01') | |
| pic_end = cftime.num2date(1200*365.25, 'days since 0001-01-01') | |
| plt.figure(figsize=[8,6]) | |
| ax1 = plt.subplot(211) | |
| plt.plot(ds_nadw_CM4_piC['time'], ds_nadw_CM4_piC['vol_nadw_atl'], 'k') | |
| ax1.set_xlim([pic_start, pic_end]) | |
| ax2 = plt.subplot(212) | |
| plt.plot(ds_nadw_CESM2_piC['time'], ds_nadw_CESM2_piC['vol_nadw_atl'], 'r') | |
| ax2.set_xlim([pic_start, pic_end]) |
| # this is a wrong & stupid computation, just here for example | |
| pt = xr.apply_ufunc(gsw.pt0_from_t, ds.so, ds.thetao, ds.z_l, dask='parallelized', output_dtypes=[ds.so.dtype]) |
| #!/usr/bin/env python | |
| # useful ref: | |
| # http://xarray.pydata.org/en/stable/examples/ROMS_ocean_model.html | |
| import xarray as xr | |
| import glob | |
| # list of files to convert |
| #!/bin/bash | |
| #SBATCH -n 240 | |
| #SBATCH -J MOM6 | |
| #SBATCH --error=MOM6.err | |
| #SBATCH --output=MOM6.out | |
| #SBATCH --exclusive | |
| njobs=40 | |
| #--------------------------------- system settings ----- --------------------------- |
| #!/bin/bash | |
| # for PPAN, replace gfdl-ws by gfdl | |
| git clone https://github.com/NOAA-GFDL/FRE-NCtools | |
| pushd FRE-NCtools | |
| here=$(pwd) | |
| export CONFIG_SITE=${here}/site-configs/gfdl-ws/config.site | |
| source ${here}/site-configs/gfdl-ws/env.sh |
| def remove_all_small_variables(ds): | |
| """ remove all the variables that have less than 3 dimensions | |
| Parameters: | |
| ds (xarray.Dataset): ROMS dataset | |
| """ | |
| for v in ds.variables: | |
| if v not in ['Cs_r', 'Cs_w', 'hc', 'Vtransform', 'ocean_time']: | |
| ds = ds.drop_vars(v) if len(ds[v].dims) < 3 else ds | |
| return ds |