Compute
Compute on demand
When the ready-made products don’t fit, compute your own. Choose input data, an index and its settings, a region and a destination. You get a script that runs on your own computer or server, with your own credentials.
PreviewGenerated scripts use the climate_indices command and package names. Previews draw on a demonstration sample.
Run it
The command line is the fastest path today: it splits the grid across your CPU cores using shared memory.
# 1. Get the inputs from NOAA's public bucket (no AWS account needed)
mkdir -p data out
aws s3 cp --no-sign-request s3://noaa-nclimgrid-monthly-pds/nclimgrid_prcp.nc data/
aws s3 cp --no-sign-request s3://noaa-nclimgrid-monthly-pds/nclimgrid_tavg.nc data/
# 2. Cut out your region
python - <<'EOF'
import xarray as xr
for name in ["prcp", "tavg"]:
ds = xr.open_dataset(f"data/nclimgrid_{name}.nc")
ds.sel(lat=slice(31.0, 37.0), lon=slice(-104.0, -94.0)).to_netcdf(f"data/region_{name}.nc")
EOF
# 3. Install climate_indices 3.0 from PyPI (a separate library that Earthflux imports)
pip install "climate-indices>=3.0.0"
# 4. Compute, splitting the grid across all CPU cores
process_climate_indices --index spei \
--periodicity monthly \
--scales 3 12 24 \
--netcdf_precip data/region_prcp.nc --var_name_precip prcp \
--netcdf_temp data/region_tavg.nc --var_name_temp tavg \
--calibration_start_year 1991 --calibration_end_year 2020 \
--output_file_base out/earthflux \
--multiprocessing all
Preview
A quick look at what the result will show, drawn from the demonstration sample rather than computed from your settings.
SPEI-3, gamma
Loading
Loading index data
- Extremely dry≤ −2.0
- Severely dry−2.0 to −1.5
- Moderately dry−1.5 to −1.0
- Near normal−1.0 to 1.0
- Moderately wet1.0 to 1.5
- Very wet1.5 to 2.0
- Extremely wet≥ 2.0