Skip to content

Instantly share code, notes, and snippets.

@steph-ben
steph-ben / xgrib.md
Last active December 5, 2023 11:56
Xarray & GRIBs > Performances improvements
@steph-ben
steph-ben / expose_wms.py
Created January 24, 2023 22:36
Expose dataset as WMS
import fsspec
import xarray as xr
import xpublish
from xpublish.routers import base_router, zarr_router
from xpublish_wms import cf_wms_router
fp = "arpege.json"
fs = fsspec.filesystem("reference", fo=str(fp))
m = fs.get_mapper("")
@steph-ben
steph-ben / kerchunker.py
Created January 24, 2023 22:36
Kerchunk remote http url
import shutil
from pathlib import Path
import xarray as xr
import fsspec
import ujson
from kerchunk.grib2 import scan_grib
from kerchunk.combine import MultiZarrToZarr
@steph-ben
steph-ben / sync_m3u.py
Last active September 25, 2018 14:30
Put relative path in mp3u music playlists
#!/usr/bin/env python
"""
Put relative path in mp3u music playlists
"""
import os
import shutil
PLAYLIST_BASE_DIR = '/home/cloud/steph/files/Musique/'
SOURCE_BASEPATH = 'C:\\Bench\\cloud\\Musique\\'