Search NASA⌕ Search

SEARCH · Search NASA

Results for “Python Package”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 19 records

Pypromice: A Python Package for Processing Automated Weather Station Data

The pypromice Python package is for processing and handling observation datasets from automated weather stations (AWS). It is primarily aimed at users of AWS data from the Geological Survey of Denmark and Greenland (GEUS), which collects and distributes in situ weather station observations to the cryospheric science research community. Functionality in pypromice is primarily handled using two key open-source Python packages, xarray (Hoyer & Hamman, 2017) and pandas (The pandas development team, 2020). A defined processing workflow is included in pypromice for transforming original AWS observations (Level 0, L0) to a usable, CF-convention-compliant dataset (Level 3, L3) (Figure 1). Intermediary processing levels (L1,L2) refer to key stages in the workflow, namely the conversion of variables to physical measurements and variable filtering (L1), cross-variable corrections and user-defined data flagging and fixing (L2), and derived variables (L3). Information regarding the station configuration is needed to perform the processing, such as instrument calibration coefficients and station type (one-boom tripod or two-boom mast station design, for example), which are held in a toml configuration file. Two example configuration files are provided with pypromice , which are also used in the package’s unit tests. More detailed documentation of the AWS design, instrumentation, and processing steps are described in Fausto et al. (2021).

pypromice↗

Polarbrdf: A General Purpose Python Package for Visualization Quantitative Analysis of Multi-Angular Remote Sensing Measurements

The Bidirectional Reflectance Distribution Function (BRDF) is a fundamental concept for characterizing the reflectance property of a surface, and helps in the analysis of remote sensing data from satellite, airborne and surface platforms. Multi-angular remote sensing measurements are required for the development and evaluation of BRDF models for improved characterization of surface properties. However, multi-angular data and the associated BRDF models are typically multidimensional involving multi-angular and multi-wavelength information. Effective visualization of such complex multidimensional measurements for different wavelength combinations is presently somewhat lacking in the literature, and could serve as a potentially useful research and teaching tool in aiding both interpretation and analysis of BRDF measurements. This article describes a newly developed software package in Python (PolarBRDF) to help visualize and analyze multi-angular data in polar and False Color Composite (FCC) forms. PolarBRDF also includes functionalities for computing important multi-angular reflectance/albedo parameters including spectral albedo, principal plane reflectance and spectral reflectance slope. Application of PolarBRDF is demonstrated using various case studies obtained from airborne multi-angular remote sensing measurements using NASA's Cloud Absorption Radiometer (CAR). Our visualization program also provides functionalities for untangling complex surface/atmosphere features embedded in pixel-based remote sensing measurements, such as the FCC imagery generation of BRDF measurements of grasslands in the presence of wild fire smoke and clouds. Furthermore, PolarBRDF also provides quantitative information of the angular distribution of scattered surface/atmosphere radiation, in the form of relevant BRDF variables such as sunglint, hotspot and scattering statistics.

CAR↗

Functionality of the Python Packages for the HERMES Mission

The Heliophysics Environmental and Radiation Measurement Experiment Suite (HERMES) is a set of four instruments that will fly on the Lunar Gateway, an orbital outpost which will support Artemis lunar operations. HERMES will focus on understanding the causes of space-weather variability as driven by the Sun and modulated by the magnetosphere. In this talk, we will discuss the open source approach of the HERMES Science Operation Center (SOC) team being implemented in a number of Python packages which all work together. We will describe the core package which contains Python interfaces for the loading, calibrating, plotting, validating, and saving of measurement data through Common Data Format (CDF) files making use of pycdf provided by spacepy. Each instrument also has a Python package developed using a package template and will provide specific calibration and processing functionality to each instrument. The packages make extensive use of the scientific Python ecosystem and maintain compatibility with PyHC standards. The abstraction of intricate, high heritage data formats, such as CDF files, in Python enables easier analysis and opens doors for greater participation in heliophysics science.

hermes↗

G2Aero: A Python package for separable shape tensors

G2Aero is a Python package for the design and deformation of discrete planar curves and tubular surfaces using a geometric data-driven approach. G2Aero utilizes a topology of product manifolds: the Grassmannian, $\mathcal{G}$($\mathcal{n}$, 2) - the set of 2-dimensional subspaces in $\mathbb{R}$ $\mathcal{n}$ - and the symmetric positive-definite (SPD) manifold, $\mathcal{S}^{2}_{++}$ - the set of 2x2 SPD matrices. The package provides a novel framework for representing separable deformations to shapes, which consist of stretching, scaling, rotating, and translating - also known as affine deformations - and a set of complementary deformations - which we refer to as undulation-type deformations. We focus on airfoil and blade design applications to emphasize the utility of the methods in an environment where the separation of affine and undulation-type deformations is critical. Notable functionalities of the framework for blade design include: 1) generating novel 2D (airfoil) shapes informed by a database of physically relevant airfoils, 2) building 3D blades by interpolating sequences of 2D airfoil cross-sections, and 3) generating blades with consistent perturbations along the blade span. We discuss the framework and provide examples in the context of wind energy applications, specifically wind turbine blade design. Figure 1 shows the wire frame obtained by interpolating airfoils defining the IEA 15-MW wind turbine blade and applying affine transformations corresponding to twist, chordal scaling, and bending. This, and all other figures in the paper, can be reproduced following examples and referencing supporting documentation provided in the G2Aero package.

97 MATHEMATICS AND COMPUTING↗

popclass: A Python Package for Classifying Microlensing Events

popclass is a Python package that provides a flexible, probabilistic framework for classifying the lens of a gravitational microlensing event. Gravitational microlensing occurs when a massive foreground object (e.g., a star, white dwarf or black hole) passes in front of and lenses the light from a distant background source. This causes an apparent brightening, and shift in position, of the background source. In most cases, characteristics of the microlensing signal do not contain enough information to definitively identify the lens type. Different lens types lie in different but overlapping regions of the characteristics of the microlensing signal. For example, black holes tend to be more massive than stars and therefore cause microlensing signals that are longer. Current Galactic simulations enable us to predict where different lens types lie in the observational space and can therefore be used to classify events (e.g., Lam et al., 2020). popclass allows the user to match the characteristics of a microlensing signal with a simulation of the Galaxy to calculate lens type probabilities for the event (see Figure 1). Constraints on any microlensing signal properties and any Galactic model can be used. popclass comes with an interface to ArviZ (Kumar et al., 2019) and PyMultiNest (Buchner et al., 2014) for microlensing signal constraints, as well as pre-loaded Galactic models, plotting functionality, and methods to quantify the classification uncertainty. The probabilistic framework for popclass was developed in Perkins et al. (2024), used in Fardeen et al. (2024) and has been applied to classifying events in Kaczmarek et al. (2025).

97 MATHEMATICS AND COMPUTING↗

solposx: A Python package for determining solar position and atmospheric refraction

solposx is a Python package of reference algorithms for calculating the sun’s position and atmospheric refraction. The package includes 11 solar position algorithms and 6 refraction models from the past 50 years. All functions follow a standardized design pattern, making it easy to compare different algorithms. The provided algorithm implementations have been thoroughly vetted, making the package a valuable research tool and a reliable reference for implementing solar position algorithms in other programming languages or applications.

Jensen, Adam R. [Technical University of Denmark, ↗

GPAW: An open Python package for electronic structure calculations

We review the GPAW open-source Python package for electronic structure calculations. GPAW is based on the projector-augmented wave method and can solve the self-consistent density functional theory (DFT) equations using three different wave-function representations, namely real-space grids, plane waves, and numerical atomic orbitals. The three representations are complementary and mutually independent and can be connected by transformations via the real-space grid. This multi-basis feature renders GPAW highly versatile and unique among similar codes. By virtue of its modular structure, the GPAW code constitutes an ideal platform for the implementation of new features and methodologies. Moreover, it is well integrated with the Atomic Simulation Environment (ASE), providing a flexible and dynamic user interface. In addition to ground-state DFT calculations, GPAW supports many-body GW band structures, optical excitations from the Bethe–Salpeter Equation, variational calculations of excited states in molecules and solids via direct optimization, and real-time propagation of the Kohn–Sham equations within time-dependent DFT. A range of more advanced methods to describe magnetic excitations and non-collinear magnetism in solids are also now available. In addition, GPAW can calculate non-linear optical tensors of solids, charged crystal point defects, and much more. Recently, support for graphics processing unit (GPU) acceleration has been achieved with minor modifications to the GPAW code thanks to the CuPy library. We end the review with an outlook, describing some future plans for GPAW.

37 INORGANIC, ORGANIC, PHYSICAL, AND ANALYTICAL CH↗

Eliater: a Python package for estimating outcomes of perturbations in biomolecular networks

We introduce Eliater, a Python package for estimating the effect of perturbation of an upstream molecule on a downstream molecule in a biomolecular network. The estimation takes as input a biomolecular network, observational biomolecular data, and a perturbation of interest, and outputs an estimated quantitative effect of the perturbation. We showcase the functionalities of Eliater in a case study of Escherichia coli transcriptional regulatory network.

59 BASIC BIOLOGICAL SCIENCES↗

JetNet: A Python package for accessing open datasets and benchmarking machine learning methods in high energy physics

JetNet is a Python package that aims to increase accessibility and reproducibility for machinelearning (ML) research in high energy physics (HEP), primarily related to particle jets. Basedon the popular PyTorch ML framework, it provides easy-to-access and standardized interfacesfor multiple heterogeneous HEP datasets and implementations of evaluation metrics, lossfunctions, and more general utilities relevant to HEP.

97 MATHEMATICS AND COMPUTING↗

xCDAT: A Python Package for Simple and Robust Analysis of Climate Data

xCDAT (Xarray Climate Data Analysis Tools) is an open-source Python package that extends Xarray (Hoyer & Hamman, 2017) for climate data analysis on structured grids. xCDAT streamlines analysis of climate data by exposing common climate analysis operations through a set of straightforward APIs. Some of xCDAT’s key features include spatial averaging, temporal averaging, and regridding. These features are inspired by the Community Data Analysis Tools (CDAT) library (Dean N. Williams et al., 2009) (D. N. Williams, 2014) (Doutriaux et al., 2019) and leverage powerful packages in the Xarray ecosystem including xESMF (Zhuang et al., 2023), xgcm (Abernathey et al., 2022), and CF xarray (Cherian et al., 2023). To ensure general compatibility across various climate models, xCDAT operates on datasets that are compliant with the Climate and Forecast (CF) metadata conventions (Hassell et al., 2017).

54 ENVIRONMENTAL SCIENCES↗

AutoUncertainties: A Python Package for Uncertainty Propagation

Propagation of uncertainties is of great utility in the experimental sciences. While the rules of (linear) uncertainty propagation are straightforward, managing many variables with uncertainty information can quickly become complicated in large scientific software stacks. Often, this requires programmers to keep track of many variables and implement custom error propagation rules for each mathematical operator and function. The Python package AutoUncertainties, described here, provides a solution to this problem.

97 MATHEMATICS AND COMPUTING↗

Equilipy: a python package for calculating phase equilibria

The CALPHAD (CALculation of PHAse Diagram) approach (Nigel Saunders & Miodownik, 1998) provides predictions for thermodynamically stable phases in multicomponent-multiphase materials across a wide range of temperatures. Consequently, the CALPHAD calculations became an essential tool in materials and process design (Luo, 2015). Such design tasks frequently require navigating a high-dimensional space due to multiple components involved in the system. This increasing complexity demands high-throughput CALPHAD calculations, especially in the rapidly evolving field of alloy design. In response to the need, we developed Equilipy an open-source Python package designed for calculating phase equilibria of multicomponent-multiphase systems. Equilipy is specifically tailored for high-throughput CALPHAD calculations, offering parallel computations across multiple processors and nodes with the given NPT input conditions namely elemental compositions (N), pressure (P), and temperature (T). Equilipy utilizes the program structure and Gibbs energy functions from the Fortran-based program, Thermochimica (Piro et al., 2013), with incorporating a new Gibbs energy minimization algorithm. This algorithm, originally developed by Capitani and Brown in 1987 (Capitani & Brown, 1987), has been revised and implemented to enhance the stability and performance of calculations. The Fortran codes are precompiled and interfaced with Python via F2PY, ensuring high computation speed. Benchmark tests shown in Figure 1 demonstrate that Equilipy’s computation speed is comparable to those of established commercial software, TC-Python and PanPython. This result highlights its efficiency and potential applications in various scientific and industrial fields.

97 MATHEMATICS AND COMPUTING↗

DancePartner: Python Package to Mine Multiomics Relationship Networks from Literature and Databases

A goal of multi-omics experiments is to understand how mechanistic molecular biology is altered between conditions, typically a control group and experimental groups. Oftentimes this involves studying changes in biomolecule relationships (e.g. interactions, metabolic relationships) of several types of biomolecules (e.g. proteins, lipids, metabolites). Though several databases contain relationships between biomolecules, understudied species may have little to no relationship information in databases and thus must be mined from literature. There are several challenges to literature mining, including automated full-text extraction, duplicate biomolecule term collapsing, and implementing complex machine learning tools. To make relationship extraction more accessible to the community, a python package called DancePartner was developed to allow for the extraction of relationships from literature and databases, with functions to map biomolecule synonyms to standardized identifiers and visualize and characterize the resulting multi-omics network. Here, in this study, an example dataset involving Caenorhabditis elegans is presented, where relationships are mined from 1443 publications using DancePartner. These relationships are combined with relationships from KEGG, WikiPathways, UniProt, and LipidMaps, and visualized.

BERT↗

ncompare: A Python Package for Comparing netCDF Structures

Earth science researchers and data engineers have a common problem: they often need to compare data files to see what is different between them. A lot of time is spent developing code to test differences. When it comes to comparing multidimensional data file formats like netCDFs (Network Common Data Form), this is particularly challenging and time-consuming, since there is frequently a need to evaluate the differences between dimension sizes, variable structures, and variable attributes, especially for regression testing. Since netCDFs are widely used in Earth science — with climate models, oceanographic or atmospheric reanalyses, and observational data — improved means of evaluating netCDF files can help enable a wide range of applications. We have developed a reusable open source approach through `ncompare`, which is a Python package for comparing netCDF structures [[https://github.com/nasa/ncompare]]. The `ncompare` tool compares the structure of two Network Common Data Form (NetCDF) files at the command line. It facilitates rapid comparisons by generating a formatted display of the matching and non-matching groups, variables, and associated metadata between two NetCDF datasets. The user has the option to colorize the terminal output for ease of viewing, and `ncompare` can optionally save comparison reports in text, comma-separated value (CSV), and/or Microsoft Excel formats. Despite the availability of tools (such as ncmpidiff or nccmp) that compare the values of variables, there was not previously a readily available, Python-based tool for rapid visual comparisons of group and variable structures, attributes, and chunking. `ncompare` was developed at NASA’s Atmospheric Science Data Center (ASDC) and is a collaboration with NASA Openscapes [[https://nasa-openscapes.github.io]] mentors across 11 of NASA’s data centers. Openscapes’ overarching vision is to support scientific researchers using NASA Earthdata as they migrate their workflows to the cloud. Relevant links: - https://github.com/nasa/ncompare - https://github.com/pyOpenSci/software-submission/issues/146 - https://nasa-openscapes.github.io

Daniel Kaufman↗

An Open-Source Python Package for CFD Solution Verification

Informed decision-making using computational fluid dynamics (CFD) results requires quantifying the errors and uncertainties of a simulation. Verification, validation, and uncertainty quantification (VVUQ) methods were developed to address this need and have matured. However, these VVUQ analyses are often non-trivial and require CFD analysts and practitioners to have specific skill sets. This has led to the uneven adoption of VVUQ analyses, in part, based on the availability of software tools to aid CFD analysts and practitioners. Solution verification, a procedure to evaluate the accuracy of a simulation by estimating potential errors arising from the computational model and computing the uncertainties without comparing to results from a physical system, is one of the lagging VVUQ analyses as the absence of software has forced CFD analysts and practitioners to develop their own codes or piece together incomplete software from across the internet. This work presents an opensource Python package, CFDverify, to lower the barrier of entry and fill in the technological gap in solution verification. CFDverify also provides a streamlined framework to remove some potential errors in post-processing CFD results. The hope is that CFDverify can improve the quality and quantity of CFD solution verification in scientific and research studies and attract interest in developing a communal tool. This paper describes the design, features, and an example use of CFDverify.

Weinmeister, Justin [ORNL] (ORCID:0000000160090237↗

DRDMannTurb: A Python package for scalable, data-driven synthetic turbulence

Synthetic turbulence models (STMs) are used in wind engineering to generate realistic flow fields and are employed as inputs to industrial wind simulations. Examples include prescribing inlet conditions in large eddy simulations that model loads on wind turbines and tall buildings. We are interested in STMs capable of generating fluctuations based on prescribed second-moment statistics since such models can simulate environmental conditions that closely resemble on-site observations. To this end, the widely used Mann model (see Mann, 1994, 1998) is the inspiration for DRDMannTurb. The Mann model is described by three physical parameters: a magnitude parameter influencing the global variance of the wind field and corresponding to the Kolmogorov constant multiplied by the rate of viscous dissipation of the turbulent kinetic energy to the two-thirds, αϵ 2/3 , a turbulence length scale parameter L, and a nondimensional parameter Γ related to the lifetime of the eddies. A number of studies, as well as international standards (e.g., those by the International Electrotechnical Commission (IEC)), include recommended values for these three parameters with the goal of standardizing wind simulations according to observed energy spectra. Yet, having only three parameters, the Mann model faces limitations in accurately representing the diversity of observable spectra. This Python package enables users to extend the Mann model and more accurately fit field measurements through flexible neural network models of the eddy lifetime function. Following Keith et al. (2021), we refer to this class of models as Deep Rapid Distortion (DRD) models. DRDMannTurb also includes a general module implementing an efficient method for synthetic turbulence generation based on a domain decomposition technique. This technique is also described in Keith et al. (2021).

17 WIND ENERGY↗

STITCHES: a Python package to amalgamate existing Earth system model output into new scenario realizations

Understanding the interaction between humans and the Earth system is a computationally daunting task, with many possible approaches depending on resources available and questions of interest. For example, state-of-the-art impact models require decade-long time series of relatively high frequency, spatially resolved and often multiple variables representing climatic impact-drivers (Ruane et al., 2022). Most commonly these are derived from the outputs of detailed, computationally expensive Earth System Models (ESMs) run according to a standard, limited set of future scenarios, the latest being the SSP-RCPs run under CMIP6/ScenarioMIP (Eyring et al., 2016; O’Neill et al., 2016). At the time of writing, O’Neill et al. (2016) has been cited more than 1750 times and Eyring et al. (2016) more than 5000 times, highlighting the broad, general applications of this data. Often, however, impact modeling seeks to explore new scenarios that were not part of the ScenarioMIP protocol, and/or needs a larger set of initial condition ensemble members than are typically available to quantify the effects of ESM internal variability. In addition, the recognition that the human and Earth systems are fundamentally intertwined, and may feature potentially significant feedback loops, is making integrated, simultaneous modeling of the coupled human-Earth system increasingly necessary, if computationally challenging with most existing tools (Thornton et al., 2017). For impact modelers, climate model emulators can be the answer to meet both the needs of: 1) creating realizations for novel scenarios and 2) achieving a simplified, computationally tractable representation of ESM behavior in a coupled human-Earth system modeling framework. We proposed a new, comprehensive approach to such emulation of gridded, multivariate ESM outputs for novel scenarios without the computational cost of a full ESM, STITCHES (Tebaldi et al., 2022). The approach outlined in Tebaldi et al. (2022) should be extensible to future CMIP eras, although the STITCHES software at present is strictly focused on CMIP6/ScenarioMIP data hosted on Pangeo (https://gallery.pangeo.io/repos/pangeo-gallery/cmip6/). The corresponding STITCHES Python package uses existing archives of ESMs’ scenario experiments from CMIP6/ScenarioMIP to construct gridded, multivariate realizations of new scenarios provided by reduced complexity climate models (Hartin et al., 2015; Meinshausen et al., 2011; Smith et al., 2018), or to enrich existing initial condition ensembles. Its output provides the same characteristics as the emulated ESM output: multivariate (spanning potentially all variables that the ESM has saved), spatially resolved (down to the native grid of the ESM), and preserving the same high frequency as the original data. A new realization of multiple variables can be generated on the order of minutes with STITCHES, rather than the hours or sometimes days that ESMs require.

97 MATHEMATICS AND COMPUTING↗

pvplr-python: Python package implementation of PVplr for Performance Loss Rate (PLR) analysis

Due to software fragmentation, PV system modeling teams can be limited to language specific packages, preventing cross-sectional analysis of different modeling techniques and workflows. To this end, PVplr, a popular PV performance modeling R software package, has been ported to the Python programming language. To verify and test the robustness of the port, NSRDB data has been used to simulated PV installations at native resolution (~2 million Sites), with a variety of degradation rates, degradation patterns, and modules. Performance Ratios were calculated using the ported functions from pvplr-python and compared against Rdtools YoY values. Due to the complicated nature of degradation, a new metric has been proposed to quantify the performance loss of a system. The cumulative production loss, is the total amount of energy lost due to the degrading performance of the system. Cumulative production loss alleviates the problems with fitting linear functions to non-linear degradation. Cumulative Production loss was shown to better estimate the total lost revenue for non-linear degradation patterns. $XbX + UTC$ was found to most accurately predict the total lost revenue in simulated systems.

Kumar, Suraj↗