A project to access the database holding data from the NASA SnowEx campaign

SnowEx, updated 🕥 2023-03-01 18:57:19

==================== Welcome to snowexsql ====================

.. image:: https://readthedocs.org/projects/snowexsql/badge/?version=latest :target: https://snowexsql.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

.. image:: https://img.shields.io/github/workflow/status/SnowEx/snowexsql/snowexsql :target: https://github.com/SnowEx/snowexsql/actions/workflows/main.yml :alt: Testing Status

.. image:: https://img.shields.io/pypi/v/snowexsql.svg :target: https://pypi.org/project/snowexsql/ :alt: Code Coverage

.. image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/micahjohnson150/2034019acc40a963bd02d2fcbb31c5a9/raw/snowexsql__heads_master.json :alt: Code Coverage

Database access and tools for using the SnowEx database_. This tool is simply a client for accessing the database using python

.. _SnowEx database: https://www.github.com/SnowEx/snowex_db

WARNING - This is under active development in preparation for SnowEx Hackweek. Use at your own risk. Data will change as it is QA/QC'd and the end goal is for all data in this database to be pulled from NSIDC. The goal is for this to become a community database open to all.


  • SnowEx Hackweek 2022

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7618102.svg :target: https://doi.org/10.5281/zenodo.7618102


  • Database access for SnowEx Database
  • Analysis tools
  • Useful conversions to pandas and geopandas
  • Lots of examples_

.. _examples: https://snowexsql.readthedocs.io/en/latest/examples.html


If you are just planning on using the database, then only install the python package instructions below.

I just want to use it

Install using pip:

.. code-block::

pip install snowexsql

I want to contribute!

Install the python package by:

.. code-block:: bash

python3 setup.py install

If you are planning on running the tests or building the docs below also run:

.. code-block:: bash

pip install -r requirements_dev.txt

If you are using conda you may need to reinstall the following using conda:

  • Jupyter notebook
  • nbconvert


Quickly test your installation by running:

.. code-block:: bash


The goal of this project is to have high fidelity in data interpretation/submission to the database. To see the current test coverage run:

.. code-block:: bash

make coverage


There is a whole host of resources for users in the documentation. It has been setup for you to preview in your browser.

In there you will find:

  • Examples of database use
  • Database structure
  • API to the python package snowexsql
  • Links to other resources
  • Notes about the data uploaded
  • And more!

To see the documentation in your browser:

Warning: To see the examples/gallery, the snowex db needs to be up. Otherwise they will be left with the last image submitted to GitHub.

.. code-block:: bash

make docs


drop python 3.7 support at EOL in June 2023

opened on 2023-03-01 18:26:50 by micahjohnson150

Some of our tests rely on python 3.7 which EOL in June 2023. When we do this we should update ipython from 7.X to 8.X

Updates for the new database

opened on 2022-07-06 17:52:35 by micahjohnson150

The following things need to be fixed with the onset of the new more broad database

  • [ ] Update docs about spatial and timezones of database
  • [ ] Update examples to limit the queries to site_name == 'Grand Mesa'
  • [ ] Add an example on ST_Transform given now there are multiple projections

typo in Cheat Sheet

opened on 2022-06-28 23:03:21 by meganmason

Few instances of PointsData vs. PointData that might cause confusion. See the Querying table for .limit() and .count() code snippets in the Cheat Sheet.

Need to examine the timezones more

opened on 2021-11-19 18:12:41 by micahjohnson150

Tests are passing and failing with different tz offsets. We will need to look at this more closely.

Duplicate density profile data?

opened on 2021-09-01 15:51:08 by micahjohnson150

@micah-prime found this issue using the following query.

``` from snowexsql.data import LayerData from snowexsql.db import get_db from snowexsql.conversions import query_to_geopandas from datetime import date engine, session = get_db(db_name)

qry = session.query(LayerData) qry = qry.filter(LayerData.date == date(2020, 2, 8)) qry = qry.filter(LayerData.site_id =="6N16") qry = qry.filter(LayerData.type=='density')

df = query_to_geopandas(qry, engine) ``` Produces a data frame that has the density profile twice where one has the value AND samples A,B,C and the other only has the value.

requirements.txt--> fiona?

opened on 2021-07-14 14:26:27 by annavalentine

in trying to install snowexsql from cmd line, installation failed due to "A GDAL API version must be specified..", however, this issue was solved by installing fiona. Upon updating the requirements.txt for the microstructure project, everything installs when fiona is a dependency.


SnowEx Hackweek 2022 release 2022-07-06 20:08:38

Release corresponding to the library version used in tutorials for the SnowEx Hackweek 2022


research-tool science snow