Skip to content

Instantly share code, notes, and snippets.

View nocollier's full-sized avatar

Nathan Collier nocollier

  • Oak Ridge National Laboratory
  • Tennessee
View GitHub Profile
@nocollier
nocollier / concept.py
Last active January 26, 2024 20:08
A proof of concept REST API for ESGF based on FastAPI
"""A REST API for Globus-based searches that mimics esg-search.
This API is so that community tools that are based on the esg-search RESTful API need
not change to be compatible with the new Globus indices. If you are designing a new
project, you should look to use the globus-sdk directly and this is only a small wrapper
around the `post_search` functionality.
The standalone script does not need installed. You will need FastAPI on which it is
based and the Globus sdk.
@nocollier
nocollier / ilambify_time.py
Last active May 2, 2024 23:40
Clean up the time encoding of a dataset to use the ilamb default
from pathlib import Path
from typing import Union
import numpy as np
import xarray as xr
from cftime import DatetimeNoLeap
COMPRESS_FILES = True