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
@nocollier
nocollier / land_area_variance.py
Created September 24, 2025 20:03
An analysis on the variance of land area in CMIP6 models
"""
What kind of land area spread is there among CMIP6 models?
This analysis will remove some models:
- For no 'areacella': EC-Earth3-LR, FGOALS-f3-L, NESM3
- For anomalously low values: EC-Earth3, EC-Earth3-Veg, EC-Earth3P, EC-Earth3P-HR
land_area relative_error [%]
count 74
mean 1.489046e+14 -0.064018