Quick Start

Quick Start

Get BioSNICAR running in a few minutes. There are two ways to use it: the web app (no installation required) or the Python package (full control).


Web app

For a quick look at BioSNICAR without writing code, use the deployed Streamlit app:

bit.ly/bio-snicar

Set input parameters on the left panel and the spectral albedo plot updates automatically. You can download the data as CSV.

BioSNICAR web application

The app covers the most common use cases but has some restrictions (no multi-layer, limited impurity types). For full control, use the Python package.


Install the Python package

Requirements

  • Python 3.8+
  • A fresh virtual environment is recommended

Installation

git clone https://github.com/jmcook1186/biosnicar-py.git
cd biosnicar-py
pip install -r requirements.txt
pip install -e .

Note: If you cloned the repository before March 2026, you need to delete your local clone and re-clone — the git history was rewritten to reduce the download size from ~875 MB to ~170 MB. No source code or data was lost.

Docker (alternative)

If you use VS Code and Docker, the repository includes a devcontainer config. Install the Remote Containers extension and open the repo in a container.


Your first simulation

One-line forward model

from biosnicar import run_model
 
outputs = run_model()
print(f"Broadband albedo: {outputs.BBA:.4f}")

This runs with all default settings (clean snow, solar zenith 50°) and returns an Outputs object with spectral and broadband albedo.

Override parameters

Pass keyword arguments to change any input parameter:

outputs = run_model(solzen=50, rds=1000, rho=600)
print(f"BBA: {outputs.BBA:.4f}")

Add impurities

clean = run_model(solzen=50, rds=1000)
dirty = run_model(solzen=50, rds=1000, black_carbon=5000, glacier_algae=50000)
 
print(f"Clean ice BBA:      {clean.BBA:.4f}")
print(f"With impurities:    {dirty.BBA:.4f}")
print(f"Albedo reduction:   {clean.BBA - dirty.BBA:.4f}")

How impurities reduce spectral albedo — clean vs black carbon vs algae

Multi-layer ice column

outputs = run_model(
    solzen=50,
    layer_type=[1, 1, 1, 1, 1],
    dz=[0.02, 0.05, 0.05, 0.05, 0.83],
    rds=[800, 900, 1000, 1100, 1200],
    rho=[500, 600, 700, 750, 800],
    glacier_algae=[40000, 10000, 0, 0, 0],
)
print(f"5-layer BBA: {outputs.BBA:.4f}")

Access spectral output

import numpy as np
 
outputs = run_model(solzen=50, rds=500)
albedo = np.array(outputs.albedo)
wavelengths = np.arange(0.205, 4.999, 0.01)
 
print(f"Albedo at 0.5 um:  {albedo[29]:.4f}")
print(f"Albedo at 1.0 um:  {albedo[79]:.4f}")
print(f"Albedo at 1.5 um:  {albedo[129]:.4f}")

Map to satellite bands

Chain .to_platform() to convert 480-band output to satellite or climate model bands:

s2 = run_model(solzen=50, rds=1000).to_platform("sentinel2")
print(f"Sentinel-2 B3 (green): {s2.B3:.3f}")
print(f"NDSI: {s2.NDSI:.3f}")
 
cesm = run_model(solzen=50, rds=1000).to_platform("cesm2band")
print(f"CESM VIS: {cesm.vis:.4f}, NIR: {cesm.nir:.4f}")

What’s next?

  • Fundamentals — understand how the model works and what each parameter means
  • Remote Sensing — use satellite band convolution and inverse retrieval
  • Fast Emulator — speed up simulations 50,000x with the neural network surrogate
  • Examples — worked examples covering the full workflow