Skip to content

Instantly share code, notes, and snippets.

View kgraaf's full-sized avatar

Kevin Graaf kgraaf

  • @iridl, Columbia University
  • New York, NY
View GitHub Profile
@kgraaf
kgraaf / convert.py
Created June 2, 2023 08:34
Example data conversion script
import xarray as xr
import pandas as pd
import numpy as nd
# read in csv to pandas dataframe. we convert
# the excel file to a csv beforehand
df = pd.read_csv("Leribe 1956 - 2022 Jul.csv")
# get just the Year, Month1, and Day columns
dates = df[['Year','Month1','Day']]
@kgraaf
kgraaf / climatology_set.py
Last active June 2, 2023 10:18
Daily, Dekadal, Monthly Climatology
from maproom import Maproom
import xarray as xr
from pingrid import CMAPS
mr = Maproom(
title = "Climatology Maproom",
prefix = "example",
)
mr.controls.group("Climatology")
@kgraaf
kgraaf / rfe.py
Created May 30, 2023 15:06
Rfe Maproom
from maproom import Maproom
import xarray as xr
rfe = xr.open_dataset("Rfe_2011_2020.nc")['precip']
mr = Maproom(
title = "Rainfall Climatology",
prefix = "rfe",
)
@kgraaf
kgraaf / clim.py
Created May 30, 2023 13:47
Simple Climatology app
from maproom import Maproom
import xarray as xr
air = xr.tutorial.load_dataset("air_temperature")['air']
mr = Maproom(
title = "Climatology",
prefix = "clim",
)