A Python library for working CAAML.XML files from SnowPilot
Project description
SnowPylot
A Python library for working with CAAML snow profile data from SnowPilot.org.
Features
- Parse CAAML.xml files from SnowPilot.org
- Access information about the snow pit (pit ID, date, location, snow profile, stability test results, etc.)
- Work with snow layers and grain types
- Access stability test results
- Handle whumpf observations
Installation
pip install snowpylot
# Note: Please clone the repo for now
or clone the repo:
git clone https://github.com/connellymk/snowpylot.git
License
This project is licensed under the MIT License - see the LICENSE file for details.
Usage
from snowpylot import caaml_parser
# Parse a CAAML file
snowpit = caaml_parser("path/to/snowpit.caaml.xml")
This documentation provides a comprehensive overview of the SnowPit object structure and how to access its various components. The nested structure allows for logical organization of the data while maintaining easy access to all information through dot notation.
Specific examples of how to access and use the data are available in the demos directory.
SnowPit Object Structure
The SnowPit object is the main container for all snow pit data. It consists of four main components:
1. Core Info (snowpit.coreInfo)
Basic information about the snow pit:
pitID- Unique identifier (ex. pitID = snowpit.coreInfo.pitID)pitName- Name of the pitdate- Date of observationcomment- General commentscaamlVersion- Version of CAAML schema useduser- User informationlocation- Location informationweatherConditions- Weather conditions
User Info (snowpit.coreInfo.user)
operationID- ID of the operation (ex. operationID = snowpit.coreInfo.user.operationID)operationName- Name of the operationprofessional- Boolean indicating if user is professionaluserID- User identifierusername- SnowPilot username of the user
Location Info (snowpit.coreInfo.location)
latitude- Decimal degrees (ex. lat = snowpit.coreInfo.location.latitude)longitude- Decimal degreeselevation- [value, units]aspect- Slope aspectslopeAngle- [value, units]country- Country nameregion- Region namepitNearAvalanche- BooleanpitNearAvalancheLocation- Location description if near avalanche
Weather Conditions (snowpit.coreInfo.weatherConditions)
skyCond- Sky conditions code (ex. skyCond = snowpit.coreInfo.weatherConditions.skyCond)skyCond_Desc- Sky conditions descriptionprecipTI- Precipitation type and intensity codeprecipTI_Desc- Precipitation descriptionairTempPres- [temperature, units]windSpeed- Wind speed codewindSpeed_Desc- Wind speed descriptionwindDir- Wind direction
2. Snow Profile (snowpit.snowProfile)
Contains layer data and measurements:
Profile Info
measurementDirection- Direction of measurements (ex. measDir = snowpit.snowProfile.measurementDirection)profileDepth- [depth, units]hS- Total snow height [value, units]
Layers (snowpit.snowProfile.layers)
(ex. layers_list = snowpit.snowProfile.layers)
List of Layer objects, each containing:
depthTop- [depth, units] (ex. depthTop_layer1 = snowpit.snowProfile.layers[0].depthTop)thickness- [thickness, units]hardness- Hand hardness codehardnessTop- Top of layer hardnesshardnessBottom- Bottom of layer hardnesswetness- Wetness codewetness_Desc- Wetness descriptionlayerOfConcern- Boolean
Grain Info (layer.grainFormPrimary or layer.grainFormSecondary)
grainForm- Grain form code (ex. primaryGrainForm = snowpit.snowProfile.layers[0].grainFormPrimary.grainForm)grainSizeAvg- [size, units]grainSizeMax- [size, units]basicGrainClass_code- Basic grain type codebasicGrainClass_name- Basic grain type namesubGrainClass_code- Detailed grain type codesubGrainClass_name- Detailed grain type name
Temperature Profile (snowpit.snowProfile.tempProfile)
List of temperature observations, each containing:
depth- [depth, units] (ex. depth1 = snowpit.snowProfile.tempProfile[0].depth)snowTemp- [temperature, units]
Density Profile (snowpit.snowProfile.densityProfile)
List of density observation, each containing:
depthTop- [depth, units] (ex. depthTop1 = snowpit.snowProfile.densityProfile[0].depthTop)thickness- [thickness, units]density- [density, units]
3. Stability Tests (snowpit.stabilityTests)
Contains lists of different stability test results:
ECT- Extended Column Test (ex. ECTs_list = snowpit.stabilityTests.ECT)CT- Compression TestRBlock- Rutschblock TestPST- Propagation Saw Test
Extended Column Test (snowpit.stabilityTests.ECT) is a list of ExtColumnTest objects, each containing:
depthTop- [depth, units] (ex. ECT1_depthTop = snowpit.stabilityTests.ECT[0].depthTop)testScore- Test result codepropogation- BooleannumTaps- Number of tapscomment- Test comments
Compression Test (snowpit.stabilityTests.CT) is a list of ComprTest objects, each containing:
depthTop- [depth, units] (ex. CT1_depthTop = snowpit.stabilityTests.CT[0].depthTop)fractureCharacter- Fracture character codetestScore- Test result codecomment- Test comments
Rutschblock Test (snowpit.stabilityTests.RBlock) is a list of RBlockTest objects, each containing:
depthTop- [depth, units] (ex. RBlock1_depthTop = snowpit.stabilityTests.RBlock[0].depthTop)fractureCharacter- Fracture character codereleaseType- Release type codetestScore- Test result codecomment- Test comments
Propagation Saw Test (snowpit.stabilityTests.PST) is a list of PropSawTest objects, each containing:
depthTop- [depth, units] (ex. PST1_depthTop = snowpit.stabilityTests.PST[0].depthTop)fractureProp- Propagation resultcutLength- [length, units]columnLength- [length, units]comment- Test comments
4. Whumpf Data (snowpit.whumpfData)
Custom SnowPilot data about collapsing weak layers:
whumpfCracking- Presence of whumpf with cracking (ex. whumpfCracking = snowpit.whumpfData.whumpfCracking)whumpfNoCracking- Presence of whumpf without crackingcrackingNoWhumpf- Presence of cracking without whumpfwhumpfNearPit- Whumpf location relative to pitwhumpfDepthWeakLayer- Depth of weak layerwhumpfTriggeredRemoteAva- If whumpf triggered remote avalanchewhumpfSize- Size of the whumpf
Resources:
https://github.com/SnowpitData/AvscienceServer
http://caaml.org/Schemas/V4.2/Doc/#complexType_RescuedByBaseType_Link0BC1FC30
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snowpylot-1.0.3.tar.gz.
File metadata
- Download URL: snowpylot-1.0.3.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df5357b18a343be21d84fb88d9133b136f7726a308f5f69aad1d8e8ef1d7811b
|
|
| MD5 |
d33ab184996aaf2979d7691d92fed4ea
|
|
| BLAKE2b-256 |
dbb02639000c132211312af72ff46cbce4f5db1521b9f9f0872cc570485e5242
|
File details
Details for the file snowpylot-1.0.3-py3-none-any.whl.
File metadata
- Download URL: snowpylot-1.0.3-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
244df1c709893889e1967413fced58d923c13340d0fc0262606ad0bafc89353e
|
|
| MD5 |
d833f69ac0aa3759a71c38356fe1247b
|
|
| BLAKE2b-256 |
e656cd2ccaff528a69c829d3506224ecdd76793f18b9826477587d3758a6198b
|