Search NASASearch

SEARCH · Search NASA

Results for “python”

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 55 records · Page 3

python-regionalizer

A Python module and Jupyter Notebook for data regionalization (i.e., discretizing data to county or community levels).

LCA; data processing

Python-EPICS RF Conditioning Automatic Control System at the Spallation Neutron Source

The RF Test Facility (RFTF) at the Spallation Neutron Source (SNS) is used for the conditioning of RF compo-nents such as ceramic vacuum windows and power cou-plers prior to their installation in the H- ion linear accel-erator. This process exposes components to high-power RF fields and thermal cycling to improve performance and remove surface impurities. To automate and optimize this process, a Python-based EPICS control system was developed alongside targeted hardware upgrades. The system enables real-time monitoring and control of RF power levels, temperature, and vacuum pressure. A user-friendly graphical interface was implemented using CS-Studio (Phoebus), allowing operators to adjust parameters and collect data efficiently. The system integrates a High-Power Protection Module (HPM) for interlocks based on vacuum and arc detection, ensuring safe operation. These upgrades have significantly improved the efficiency, accuracy, and safety of RF conditioning at the SNS RFTF. This paper describes the updated RF conditioning sys-tem, highlighting the software and hardware develop-ments and their application in support of the Proton Pow-er Upgrade (PPU) project.

Lee, Sung-Woo [ORNL] (ORCID:000000030915835X)

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

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

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

Virtual Engineering: Python framework for engineering process design

Virtual Engineering (VE) is a Python software framework designed to accelerate the research and development of engineering processes that are fundamentally defined by multiple unit operations executed in series. VE supports a wide variety of different multi-physics models and integrates them to simulate a complete end-to-end process. To automate the execution of this model sequence, VE provides (i) a robust method to communicate between models, (ii) a high-level, user-friendly interface to set model parameters and enable optimization, and (iii) an overall model-agnostic approach that allows new computational units to be swapped in and out of workflows. Although the VE framework was developed to support the biochemical conversion of biomass to fuel, we have designed each component to easily accommodate new domains and unit models.

09 BIOMASS FUELS

Pore2Chip: All-in-one python tool for soil microstructure analysis and micromodel design

The Pore2Chip Python package is designed to create 2D micromodels using extracted data from 3D X-ray computed tomography (XCT) images. This package helps analyze soil structure and function, allowing for the investigation of hydro-biogeochemical processes that impact mineral extraction and reactivity, oxygen concentrations, and nutrient availability in disturbed or managed soils. Key metrics encompass pore size distributions, pore throat size distributions, and connectivity (pore coordination numbers). The final output is a 2D scalable SVG design representing a core or aggregate. Designs can be fabricated with methods such as laser etching, 3D printing, and photolithography.

lab-on-chip

pyTCR: A tropical cyclone rainfall model for python

pyTCR is a climatology software package developed in the Python programming language. It integrates the capabilities of several legacy physical models and increases computational efficiency to allow rapid estimation of tropical cyclone (TC) rainfall consistent with the large-scale environment. Specifically, pyTCR implements a horizontally distributed and vertically integrated model [Zhu et al., 2013] for simulating rainfall driven by TCs. Along storm tracks, rainfall is estimated by computing the cross-boundary-layer, upward water vapor transport caused by different mechanisms including frictional convergence, vortex stretching, large-scale baroclinic effect (i.e., wind shear), topographic forcing, and radiative cooling [Lu et al., 2018]. The package provides essential functionalities for modeling and interpreting spatio-temporal TC rainfall data. pyTCR requires a limited number of model input parameters, making it a convenient and useful tool for analyzing rainfall mechanisms driven by TCs. To sample rare (most intense) rainfall events that are often of great societal interest, pyTCR adapts and leverages outputs from a statistical-dynamical TC downscaling model [Lin et al., 2023] capable of rapidly generating a large number of synthetic TCs given a certain climate. As a result, pyTCR significantly reduces computational effort and improves the efficiency in capturing extreme TC rainfall events at the tail of the distributions from limited datasets. Furthermore, the TC downscaling model is forced entirely by large-scale environmental conditions from reanalysis data or coupled General Circulation Models (GCMs), simplifying the projection of TC-induced rainfall and wind speed under future climate using pyTCR. Finally, pyTCR can be coupled with hydrological and wind models to assess risks associated with independent and compound events (e.g., storm surges and freshwater flooding).

54 ENVIRONMENTAL SCIENCES

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,

PyDislocDyn: A Python code for calculating dislocation drag and other crystal properties

PyDislocDyn is a suite of python programs designed to perform various calculations for dislocation dynamics in the continuum limit. In particular, one of its main purposes is to calculate dislocation drag from phonon wind. Additional features include the averaging of elastic constants for polycrystals, the calculation of the dislocation field including its limiting velocities, and the calculation of dislocation self-energy and line tension.

36 MATERIALS SCIENCE

Raptor: A Python Library for Porosity Predictions in Additive Manufacturing

Raptor is an efficient Python library for simulating stochastic lack-of-fusion (sLoF) defects in additive manufacturing (AM) processes. These defects arise from stochastic variations in the melt pool boundary leading to undermelting from insufficient overlap between adjacent melt pools or successive layers (Grasso & Colosimo, 2017; Khairallah et al., 2016). Performance variability of AM parts is a pressing challenge in qualification and certification of AM parts; this is in part due to the poorly understood formation rate and statistics of sLoF defects. Raptor is designed to capture the explicit morphologies of sLoF defects and their statistics to accelerate qualification and certification efforts of AM parts in critical applications.

Subraveti, Vamsi [Vanderbilt University]

A Python Script to Read MCNP6.3 Surface-Source Files

This report provides a Python script to read an MCNP ® surface source file created with the SSW card with SYM = 0 (i.e., the default symmetry treatment). For background: the general format of an MCNP surface-source file is described in; however, that document did not provide coding and/or a tool to interrogate such files. The current format will not be given in this document other than through the record-read statements necessary for the script to function. The reader capability in this report is augmented with the ability to directly write a couple demonstrative outputs: 1. A comma-separated value (CSV) file containing particle phase-space state information and 2. A Matplotlib histogram of the energy distribution of the particles. This report also describes accompanying verification work that shows the script performing as required with MCNP6.2, MCNP6.3, and (expected) MCNP6.4 surface-source files. However, users of the enclosed script must still verify that the script is behaving correctly for their own work.

97 MATHEMATICS AND COMPUTING

Peregrine Software Development: Report on the Code Conversion From Python to C++

This work package seeks to convert the Peregrine software tool from its original Python implementation to a production version based on the C++ language. Peregrine is a powerful research platform with a multitude of advanced data analytics and data visualization functionalities. Developed by scientists to explore multimodal and multidimensional data related to the production of components using powder bed additive manufacturing processes, the tool implements state-of-the-art algorithms to assist machine users in making build or part quality determinations. Given that Peregrine is data-intensive, the goal of this conversion is to enhance the tool’s flexibility and interactivity and reduce the number of code dependencies to facilitate its deployment as part of the ongoing technology transfer campaign. This brief document provides an overview of Peregrine’s functionalities and capabilities, along with a detailed description of the core functionalities that have been implemented to date in the new C++ version. This document serves as a development update at the end of the first year of the ongoing conversion and will be regularly updated as progress continues.

97 MATHEMATICS AND COMPUTING

SULI Deliverables Using: Python-B1500 [Slides]

A new electrical setup for testing ECRAM devices is described in this presentation. This presentation details the background of ECRAM devices, how the B1500 is used to program ECRAM devices, and the python GUI that was created for controlling the B1500. ECRAM devices are a form of non-volatile memory. The stored data is the resistance between two of the terminals on the device. Using only the B1500, the ECRAM devices can be programmed and the state read out. This creates a simple, logical testing setup. The overall setup was successful, ECRAM devices could easily be programmed and measured. However, there is still room for improvement. Specifically, in the creation of an automated “Program” feature and a “Data Collection” feature. These features will require additional advances in the understanding of ECRAM devices but will greatly automate and improve the current data collection and application of ECRAM devices.

42 ENGINEERING

De-Risking Exploration for Geothermal Plays in Magmatic Environments Through Open-Source Tools: An Open-Source Python Framework for 2D and 3D Play Fairway Analysis

The De-Risking Exploration for Geothermal Plays in Magmatic Environments (DEEPEN) project seeks to accelerate superhot geothermal development by reducing exploration risk through advanced open-source modeling tools. This work presents a novel Python-based framework, geoPFA, for conducting 2D and 3D play fairway analysis (PFA) tailored to superhot geothermal systems. Building on previous methodologies, the framework integrates thermo-hydro-mechanical-chemical simulation outputs from TReactMech, resulting in improved representation of subsurface properties that are critical to superhot resource producibility. The workflow has been applied to the Nesjavellir field in Iceland, a candidate site for the third Iceland Deep Drilling Project's superhot production scenarios. This application demonstrates the value of modular, transparent, and extensible workflows for integrating geological, geophysical, and simulation-derived datasets in high-enthalpy environments. Preliminary results indicate favorable zones consistent with known hydrothermal activity and suggest possible upflow from the Hengill volcanic system. The geoPFA library is publicly available, offering a scalable and reproducible approach to geothermal exploration across varied geological contexts.

15 GEOTHERMAL ENERGY

geoPFA: A Python-Based Open-Source Software for 3D Geothermal PFA

This work presents a novel Python-based framework, geoPFA, for conducting 3D play fairway analysis (PFA) tailored to superhot geothermal systems. The workflow has been applied to the Nesjavellir field in Iceland, a candidate site for the third Iceland Deep Drilling Project's superhot production scenarios. This application demonstrates the value of modular, transparent, and extensible workflows for integrating geological, geophysical, and simulation-derived datasets in high-enthalpy environments. Preliminary results indicate favorable zones consistent with known hydrothermal activity. The geoPFA library will soon be publicly available, offering a scalable and reproducible approach to geothermal exploration across varied geological contexts.

15 GEOTHERMAL ENERGY

Mahakala: A Python-based Modular Ray-tracing and Radiative Transfer Algorithm for Curved Spacetimes

We introduce Mahakala, a Python-based, modular, radiative ray-tracing code for curved spacetimes. We employ Google's JAX framework for accelerated automatic differentiation, which can efficiently compute Christoffel symbols directly from the metric, allowing the user to easily and quickly simulate photon trajectories through non-Kerr spacetimes. JAX also enables Mahakala to run in parallel on both CPUs and GPUs. Mahakala natively uses the Cartesian Kerr–Schild coordinate system, which avoids numerical issues caused by the pole in spherical coordinate systems. We demonstrate Mahakala's capabilities by simulating 1.3 mm wavelength images (the wavelength of Event Horizon Telescope observations) of general relativistic magnetohydrodynamic simulations of low-accretion rate supermassive black holes. The modular nature of Mahakala allows us to quantitatively explore how different regions of the flow influence different image features. We show that most of the emission seen in 1.3 mm images originates close to the black hole and peaks near the photon orbit. We also quantify the relative contribution of the disk, forward jet, and counterjet to 1.3 mm images.

79 ASTRONOMY AND ASTROPHYSICS