Skip to main content

Download, Preprocessing, and Visualization code for climate resilience data.

Project description

lbnl-climate-resilience

pip package


Download Examples

This file requires a download_params.yml file to specify the download configurations.

We cannot directly download the data from the Google Earth Engine directly onto the local machine. So the best option is to download to the drive and then download that data to the local drive.


Preprocess Examples

The preprocessing functions will expect that the local data drive contains the downloaded data.

If the data is on drive, the drive needs to be mounted. This is easier to do in a google colab session. Once the drive is mounted, the path of the mounted drive can be used with the functions as normal.

Expected file and directory structure:

The input file and directory structure for functions calculate_Nth_percentile(), calculate_pr_count_amount(), and calculate_temporal_mean() in the preprocessing code should be as follows:

datadir
├── scenario1_variable1_ensemble
│   ├── name1_state1_scenario1_variable1.csv
│   └── name2_state2_scenario1_variable1.csv
├── scenario1_variable2_ensemble
│   ├── name1_state1_scenario1_variable2.csv
│   └── name2_state2_scenario1_variable2.csv
├── scenario2_variable1_ensemble
│   ├── name1_state1_scenario2_variable1.csv
│   └── name2_state2_scenario2_variable1.csv
└── scenario2_variable2_ensemble
    ├── name1_state1_scenario2_variable2.csv
    └── name2_state2_scenario2_variable2.csv

Visualization Examples

The visualization code will be easier to be used in a notebook as inline visualizations can be used.

Map visualization notebook

Below is a screenshot of the interactive map with the sites marked.

Map

Map Colorbar

Box plot visualization notebook

Below is a screenshot of boxplot of annual precipitation in different regions of the United States.

Boxplot

Library Features:

Downloader

  1. Class SiteDownloader member functions: 1.1. download_model_average_daily() 1.2. download_historical_daily() 1.3. download_historical_monthly() 1.4. download_samples()

Preprocessing functions

  1. calculate_Nth_percentile()
  2. calculate_pr_count_amount()
  3. calculate_temporal_mean()
  4. get_climate_ensemble()
  5. get_per_year_stats()
  6. get_sub_period_stats()

Vizualization functions

  1. plot_map()
  2. plot_histogram()
  3. plot_boxplots()

Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

climate-resilience-0.2.8.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

climate_resilience-0.2.8-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file climate-resilience-0.2.8.tar.gz.

File metadata

  • Download URL: climate-resilience-0.2.8.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for climate-resilience-0.2.8.tar.gz
Algorithm Hash digest
SHA256 35fc7d7793fa9698bcc3d2279a06924d5f20778912fa0d3528e1cff04848e391
MD5 6e44874ea71965a8b5baea8744457836
BLAKE2b-256 30d3c212bd51a7606733cf4a42f579b4a6f9b81619f30e73ac64a52a89331d4c

See more details on using hashes here.

File details

Details for the file climate_resilience-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: climate_resilience-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for climate_resilience-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 271fdac555da7d163ffb3ca408588fac79829fc04153cc7149b9c1fb7b0e3c5f
MD5 6269b7dfc252cbb0e37696d8abae01d5
BLAKE2b-256 df366b9bafc48a87f64085879f10213384504e4aae8671349ec01d9c7ec584cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page