Search NASA⌕ Search

SEARCH · Search NASA

Results for “python code”

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 937 records · Page 52

Introducing GPU Acceleration into the Python-Based Simulations of Chemistry Framework

We introduce the first version of GPU4P Y SCF, a module that provides GPU acceleration of methods in P Y SCF. As a core functionality, this provides a GPU implementation of two-electron repulsion integrals (ERIs) for contracted basis sets comprising up to g functions using the Rys quadrature. As an illustration of how this can accelerate a quantum chemistry workflow, we describe how to use the ERIs efficiently in the integral-direct Hartree–Fock build and nuclear gradient construction. Benchmark calculations show a significant speedup of 2 orders of magnitude with respect to the multithreaded CPU Hartree–Fock code of P Y SCF and the performance comparable to other open-source GPU-accelerated quantum chemical packages, including GAMESS and QUICK, on a single NVIDIA A100 GPU.

37 INORGANIC, ORGANIC, PHYSICAL, AND ANALYTICAL CH↗

Enhancing Monte Carlo Workflows for Nuclear Reactor Analysis with Metamodel-Driven Modeling

Monte Carlo codes are essential components of many reactor physics simulation workflows as high-fidelity continuous-energy neutron transport solvers. Among Monte Carlo radiation transport codes, MCNP is particularly notable due to its diverse simulation capabilities, large user base, and long validation history. Despite being a powerful simulation tool, MCNP provides limited capabilities to allow automated execution, model transformation, or support for user-defined logic and abstractions that limit its compatibility with modern workflows. Here, to better integrate MCNP into a modern scientific workflow, we have developed an intuitive yet full-featured MCNP Application Program Interface (API) in Python, named MCNPy, which provides a specialized set of classes for MCNP input development. Moreover, to guarantee that our reading, writing, and modeling capabilities remain self-consistent (and to render the huge scope of the MCNP API manageable), we have adopted a strategy of model-driven software development in which a generalized model of the MCNP input format has been created. From this generalized model, or “metamodel,” problem-specific implementations such as an engine for input validation or a codebase for programmatic operations may be automatically generated. Since MCNPy primarily acts as a Python front-end to the underlying Java API that directly interfaces with the metamodel, it is intrinsically linked to the metamodel and thus remains maintainable. With MCNPy, users can programmatically read, write, and modify any syntactically valid MCNP input file regardless of its origin. These capabilities allow users to automate complicated tasks like design optimization and model translation for nuclear systems. As examples, this work demonstrates the use of MCNPy to find the critical radius of a plutonium sphere and to translate a 9000+ line MCNP input file into a corresponding OpenMC model.

22 GENERAL STUDIES OF NUCLEAR REACTORS↗

SU-E-T-465: Implementation of An Automated Collision Detection Program Using Open Source Software for the Pinnacle Treatment Planning System

Purpose: Potential collisions between the gantry head and the patient or table assembly are difficult to detect in most treatment planning systems. We have developed and implemented a novel software package for the representation of potential gantry collisions with the couch assembly at the time of treatment planning. Methods: Physical dimensions of the Varian Edge linear accelerator treatment head were measured and reproduced using the Visual Python display package. A script was developed for the Pinnacle treatment planning system to generate a file with the relevant couch, gantry, and isocenter positions for each beam in a planning trial. A python program was developed to parse the information from the TPS and produce a representative model of the couch/gantry system. Using the model and the Visual Python libraries, a rendering window is generated for each beam that allows the planner to evaluate the possibility of a collision. Results: Comparison against heuristic methods and direct verification on the machine validated the collision model generated by the software. Encounters of <1 cm between the gantry treatment head and table were visualized as collisions in our virtual model. Visual windows were created depicting the angle of collision for each beam, including the anticipated table coordinates. Visual rendering of a 6 arc trial with multiple couch positions was completed in under 1 minute, with network bandwidth being the primary bottleneck. Conclusion: The developed software allows for quick examination of possible collisions during the treatment planning process and helps to prevent major collisions prior to plan approval. The software can easily be implemented on future planning systems due to the versatility and platform independence of the Python programming language. Further integration of the software with the treatment planning system will allow the possibility of patient-gantry collision detection for a range of treatment machines.

60 APPLIED LIFE SCIENCES↗

JAXtronomy: A JAX port of lenstronomy

Gravitational lensing is a phenomenon where light bends around massive objects, resulting in distorted images seen by an observer. Studying gravitationally lensed systems provides insights into cosmology and astrophysics, including constraints of the expansion rate of the Universe and the distribution of dark matter. Thus, we introduce JAXtronomy, a re-implementation of the gravitational lensing software package lenstronomy (Birrer, 2021; Birrer & Amara, 2018) using JAX (Bradbury et al., 2018). JAX is a Python library that uses an accelerated linear algebra (XLA) compiler to improve the performance of computing software. Our core design principle of JAXtronomy is to maintain an identical API to that of lenstronomy. The main JAX features utilized in JAXtronomy are just-in-time compilation, which can lead to significant reductions in execution time, and automatic differentiation, which allows for the implementation of gradient-based algorithms that were previously impossible. Additionally, JAX allows code to be run on GPUs or parallelized across CPU cores, further boosting the performance of JAXtronomy.

astronomy↗

ARM Data-Oriented Metrics and Diagnostics Package for Climate Model Evaluation

A Python-based metrics and diagnostics package is currently being developed by the U.S. Department of Energy (DOE) Atmospheric Radiation Measurement (ARM) Infrastructure Team at Lawrence Livermore National Laboratory (LLNL) to facilitate the use of long-term, high-frequency measurements from the ARM Facility in evaluating the regional climate simulation of clouds, radiation, and precipitation. This metrics and diagnostics package computes climatological means of targeted climate model simulation and generates tables and plots for comparing the model simulation with ARM observational data. The Coupled Model Intercomparison Project (CMIP) model data sets are also included in the package to enable model intercomparison as demonstrated in Zhang et al. (2017). The mean of the CMIP model can serve as a reference for individual models. Basic performance metrics are computed to measure the accuracy of mean state and variability of climate models. The evaluated physical quantities include cloud fraction, temperature, relative humidity, cloud liquid water path, total column water vapor, precipitation, sensible and latent heat fluxes, and radiative fluxes, with plan to extend to more fields, such as aerosol and microphysics properties. Process-oriented diagnostics focusing on individual cloud- and precipitation-related phenomena are also being developed for the evaluation and development of specific model physical parameterizations. The version 1.0 package is designed based on data collected at ARM’s Southern Great Plains (SGP) Research Facility, with the plan to extend to other ARM sites. The metrics and diagnostics package is currently built upon standard Python libraries and additional Python packages developed by DOE (such as CDMS and CDAT). The ARM metrics and diagnostic package is available publicly with the hope that it can serve as an easy entry point for climate modelers to compare their models with ARM data. In this report, we first present the input data, which constitutes the core content of the metrics and diagnostics package in section 2, and a user's guide documenting the workflow/structure of the version 1.0 codes, and including step-by-step instruction for running the package in section 3.

54 ENVIRONMENTAL SCIENCES↗

Easy_PERT: a Python tool for writing PERT cards and parsing PERT card results [Slides]

This presentation begins by providing an overview of the PERT card. The PERT card uses differential operator method to compute first- and second-order tally variations due to density, composition, and reaction cross-sections. It is possible to have multiple PERT cards in one MCNP input deck to study tally variations for several sets of nuclides, reactions, and energy ranges. Furthermore, the METHOD option tells MCNP to calculate either the perturbed tally (METHOD=-1, -2, -3) or the change in the unperturbed tally (METHOD=1, 2, 3). In summation, a powerful use-case for the MCNP code PERT card is that it facilitates calculating tally sensitivities to nuclear data. Writing PERT card entries and parsing output MCTAL files is tedious and error prone. however, Easy_PERT makes use of existing tools (Faust and MCNPTools) to handle writing PERT card entries and parsing the output MCTAL files. The PERT card is early in the development process and planned upcoming capabilities include calculating sensitivities and combining MCTAL files from separate runs into one JSON file.

73 NUCLEAR PHYSICS AND RADIATION PHYSICS↗

High-Resolution Gridded Level 3 Aerosol Optical Depth Data from MODIS

The state-of-art satellite observations of atmospheric aerosols over the last two decades from NASA's MODIS instruments have been extensively utilized in climate change and air quality research and applications. The operational algorithms now produce level 2 aerosol data at varying spatial resolutions (1, 3, and 10 km) and level 3 data at 1 degree. The local and global applications have been benefited from the coarse resolution gridded data sets (i.e., level 3, 1 degree), as it is easier to use since data volume is low and, several online and offline tools are readily available to access and analyze the data with minimal computing resources. At the same time, researchers who require data at much finer spatial scales have to go through a challenging process of obtaining, processing, and analyzing larger volumes of data sets that require high-end computing resources and coding skills. Therefore, we have created a high spatial resolution (HRG, 0.1x0.1 degree) daily and monthly aerosol optical depth (AOD) product by combining two MODIS operational algorithms, namely Deep Blue (DB) and Dark Target (DT). The new HRG AODs meets the accuracy requirements of level 2 AOD data and provide either the same or more spatial coverage on daily and monthly scales. The data sets are provided in daily and monthly files through open Ftp server with python scripts to read and map the data. The reduced data volume with an easy to use format and tools to access the data will encourage more users to utilize the data for research and applications.

aerosol↗

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↗

Validation of MCNP Critical Benchmark Models of PU-MET-FAST-016

A new centralized repository of high-quality MCNP models of critical benchmark experiments is currently under development at Los Alamos National Laboratory (LANL). The repository is the combined effort of the Nuclear Criticality Safety, Nuclear Data, and Monte Carlo code development/application organizations at LANL. The initial set of benchmark models in the repository are derived from the Whisper Suite provided with MCNP6.2 and are evaluated against the benchmark experiments described in the International Criticality Safety Benchmark Evaluation Project (ICSBEP) Handbook. The goal is to build a single LANL benchmark collection that is up to date with the latest ICSBEP revision, has a formal review and revision process, is contained in an open-source repository, and utilizes new Python tools for improved input and output file review. This paper describes the validation of the models associated with PU-MET-FAST-016, “Flooded 3X3X3 Arrays of 3-kg Plutonium (Pu) Metal Cylinders – Phase I”. In this critical experiment, twenty-seven 3-kg Pu metal cylinders with a height of 46.33 ± 0.15 mm and diameter of 65.25 ± 0.05 mm were arranged in a cubic array. The Pu cylinders were sealed in aluminum cans, and three cans were placed in each of nine perforated aluminum sleeves, as shown in Fig. 1. The nine sleeves were supported by an aluminum frame that allowed for control of the lateral spacing of the cylinders, both in the X and Y directions. The benchmark experiment measured thirteen configurations. Of these configurations, six were modeled using MCNP.

73 NUCLEAR PHYSICS AND RADIATION PHYSICS↗

Modeling of particle transport, neutrals and radiation in magnetically-confined plasmas with Aurora

In this work, we present Aurora, an open-source package for particle transport, neutrals and radiation modeling in magnetic confinement fusion plasmas. Aurora's modern multi-language interface enables simulations of 1.5D impurity transport within high-performance computing frameworks, particularly for the inference of particle transport coefficients. A user-friendly Python library allows simple interaction with atomic rates from the Atomic Data and Atomic Structure database as well as other sources. This enables a range of radiation predictions, both for power balance and spectroscopic analysis. We discuss here the superstaging approximation for complex ions, as a way to group charge states and reduce computational cost, demonstrating its wide applicability within the Aurora forward model and beyond. Aurora also facilitates neutral particle analysis, both from experimental spectroscopic data and other simulation codes. Leveraging Aurora's capabilities to interface SOLPS-ITER results, we demonstrate that charge exchange is unlikely to affect the total radiated power from the ITER core during high performance operation. Finally, we describe the ImpRad module in the one modeling framework for integrated task framework, developed to enable experimental analysis and transport inferences on multiple devices using Aurora.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

hippynn Python Package

hippynn is a python package for defining, training, and applying neural networks to atomistic systems. In particular, it focuses on Hierarchical Interacting Particle Neural Networks (HIP-NNs), a deep learning architecture for atomistic systems. HIP-NNs take input data describing the properties of atomistic systems (often generated using ab-initio quantum mechanics) to learn fast and accurate models. A trained HIP-NN can predict potential energy surfaces, atomic charges, and more. hippynn uses PyTorch for portable high-performance code, including both CPU and GPU support. hippynn allows for extensive customization, including user-defined models and loss functions, to facilitate future research into extensions of HIP-NN as well as other atomistic deep learning models.

Lubbers, Nicolas↗

CRDIAC: Coupled Reactor Depletion Instrument with Automated Control

When modeling the behavior of a nuclear reactor over time, it is important to understand how the isotopes in the reactor will change, or transmute, over that time. This is especially important in the reactor fuel itself. Many nuclear physics modeling codes model how particles interact in the system, but do not model this over time.

11 NUCLEAR FUEL CYCLE AND FUEL MATERIALS↗

Automation of Plot Generation for Strategic Petroleum Reserve Cavern Leaching Monitoring

Monitoring cavern leaching after each calendar year of oil sales is necessary to support cavern stability efforts and long-term availability for oil drawdowns in the U.S. Strategic Petroleum Reserve. Modeling results from the SANSMIC code and recent sonars are compared to show projected changes in the cavern’s geometry due to leaching from raw-water injections. This report aims to give background on the importance of monitoring cavern leaching and provide a detailed explanation of the process used to create the leaching plots used to monitor cavern leaching. In the past, generating leaching plots for each cavern in a given leaching year was done manually, and every cavern had to be processed individually. A Python script, compatible with Earth Volumetric Studio, was created to automate most of the process. The script makes a total of 26 plots per cavern to show leaching history, axisymmetric representation of leaching, and SANSMIC modeling of future leaching. The current run time for the script is one hour, replacing 40-50 hours of the monitoring cavern leaching process.

02 PETROLEUM↗

ARM data-oriented metrics and diagnostics package for climate model evaluation (ARM-DIAGS-V3) version 3

A Python-based metrics and diagnostics package is currently being developed by the ARM Infrastructure Team at Lawrence Livermore National Laboratory to facilitate the use of long-term high frequency measurements from the ARM program in evaluating the regional climate simulation of clouds, radiation, precipitation, and aerosols. This metrics and diagnostics package computes climatological means of targeted climate model simulation and generates tables and plots for comparing the model simulation with ARM observational data. The CMIP model data sets are also included in the package to enable model inter-comparison as demonstrated in Zhang et al. (2018) and Zhang et al. (2020). The mean of the CMIP model can be served as a reference for individual models. Basic performance metrics are computed to measure the accuracy of mean state and variability of climate models. The evaluated physical quantities include cloud fraction, temperature, relative humidity, cloud liquid water path, total column water vapor, precipitation, sensible and latent heat fluxes, aerosol optical depth, and radiative fluxes, with plan to extend to more fields, such as the evaluation of model simulated aerosol physicochemical properties and cloud microphysics properties. Process-oriented diagnostics focusing on aerosol, cloud, and precipitation-related phenomena are also being developed for the evaluation and development of specific model physical parameterizations. In addition to the Southern Great Plains (SGP), North Slope of Alaska (NSA) and Tropical Western Pacific (TWP) atmospheric observatories in the ARMDIAGS version 2.0, the version 3.0 package have extended to the data collected at the ARM Eastern North Atlantic (ENA) atmospheric observatory and the Observation and Modeling of the Green Ocean Amazon (GOAMAZON) field campaign. The metrics and diagnostics package are currently built upon standard Python libraries and additional Python packages developed by DOE (CDAT). The ARM metrics and diagnostic package is available publicly with the hope that it can serve as an easy entry point for climate modelers to compare their models with ARM data. In this report, we first provide an overview of major metrics in section 2. The input data, which constitutes the core content of the metrics and diagnostics package, is summarized in section 3. A user's guide documenting the workflow/structure of the version 3.0 codes and including step-by-step instruction for running the package is described in section 4.

54 ENVIRONMENTAL SCIENCES↗

Materials for learning use of GSAS-II

The General Structure Analysis System (GSAS-II) package provides materials and crystallographic analysis for all types of diffraction data. It was initially made available with very limited capabilities, but over much of the last decade the features have been expanded, so that GSAS-II is now a comprehensive tool for nearly all types of structural and materials characterization studies. The need to provide materials to teach use of GSAS-II, while the software has been undergoing constant revision and expansion, has required new approaches for documentation. This has included providing tutorials, as each major new capability has been added, and context-sensitive help for each section of the program. Comments in the code are also expanded into a software reference guide. Finally, most recently, video versions of more than half of the tutorials were created and others were provided with animated graphics. All GSAS-II documentation is web-based.

97 MATHEMATICS AND COMPUTING↗

Catalyst-Vision (PEM Catalyst Layer Image Analysis Tool) [SWR-25-100]

Catalyst-Vision (PEM Catalyst Layer Image Analysis Tool) provides an advanced Python-based tool, primarily designed for use in a Jupyter/Colab notebook, for the quantitative morphological analysis of pre-segmented shapes. While developed for analyzing PEM catalyst layers from microscopy, its methodology is suitable for characterizing any grayscale object provided on a uniform white background. The tool uses a robust computer vision pipeline based on the Euclidean Distance Transform and skeletonization to accurately measure local thickness and tortuosity, providing a comprehensive characterization of an object's geometry and internal texture. If you find this code useful, please cite our preprint as: Chan, Ai-Lin and Hayden, Steven and Harvey, Steven P. and Smeaton, Michelle and Okrucky, Caleb and Watt, John and Ulična, Soňa and Spurgeon, Steven and Jungjohann, Katherine and Alia, Shaun, Mechanism-informed breakdown: understanding degradation by controlling voltage hold patterns in PEM water electrolyzers. Preprint (2025).

Spurgeon, Steven [National Laboratory of the Rocki↗

PyRAT - python radiography analysis tool (u)

PyRAT is a radiography analysis tool used to reconstruction images of unknown 1-0 objects. The tool is written in Python and developed for use on LINUX and Windows platforms. The tool is capable of performing nonlinear inversions of the images with minimal manual interaction in the optimization process. The tool utilizes the NOMAD mixed variable optimization tool to perform the optimization.

97 MATHEMATICS AND COMPUTING↗

Python Based Plume Dynamics Estimation Tool (PyPDET) Rapid Plume Strike Analysis for RPOD Maneuvers in Deep Space Operations

I worked as a NASA Intern during the Summer 2023 term in the DS-00 division under the supervision of my mentor, Dr. Jonathan Pitt. Our goal was to build on our previous work from 2022 to develop a plume strike estimation tool using a prescribed physics methodology and model plume impingement effects while considering the dynamics of a rendezvous, operations, proximity, and docking (RPOD) maneuver. This tool supports previously configured CFD-DSMC calculations by allowing for rapid analysis of initial designs using a low-fidelity source flow model. Engineers can then use the high-fidelity CFD-DSMC tool to consolidate results as they work towards finalizing a design. This year’s project was focused on developing a software application that other engineers would be using in their analysis. Thus, the user’s experience was considered in the development of this application. Proper documentation, testability, and modularity of the codebase was our priority. For example, the project included auto documentation procedures to start building towards a User Manual, while also including dedicated demonstration cases for more explicit communication of functionality. Also, this project included a framework for testing the source code for future developments. Additionally, care was taken to develop the code using an Object-Oriented Programming approach. Thus, allowing for a modular extensibility of functionality in anticipation of future developments. The core work of this project was developing an algorithm that would transform the visiting vehicle and associated thruster data according to the kinematics described in the jet firing history. It would then calculate the estimated plume strikes on two of the target vehicles and write data accordingly into a VTK file. Summer work is to conclude by developing and presenting a PowerPoint slide deck at the intern exit briefing on August 11 th , 2023. Once the model for simple plume strike calculations is developed and tested there are several avenues to explore to continue development of this tool. These are also discussed in this report.

Plume Impingement↗