Search NASA⌕ Search

SEARCH · Search NASA

Results for “python wrapper”

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 37 records · Page 2

Application of Machine Learning Techniques to an Agent-Based Model of Pantoea

Agent-based modeling (ABM) is a powerful simulation technique which describes a complex dynamic system based on its interacting constituent entities. While the flexibility of ABM enables broad application, the complexity of real-world models demands intensive computing resources and computational time; however, a metamodel may be constructed to gain insight at less computational expense. Here, we developed a model in NetLogo to describe the growth of a microbial population consisting of Pantoea . We applied 13 parameters that defined the model and actively changed seven of the parameters to modulate the evolution of the population curve in response to these changes. We efficiently performed more than 3,000 simulations using a Python wrapper, NL4Py . Upon evaluation of the correlation between the active parameters and outputs by random forest regression, we found that the parameters which define the depth of medium and glucose concentration affect the population curves significantly. Subsequently, we constructed a metamodel, a dense neural network, to predict the simulation outputs from the active parameters and found that it achieves high prediction accuracy, reaching an R 2 coefficient of determination value up to 0.92. Our approach of using a combination of ABM with random forest regression and neural network reduces the number of required ABM simulations. The simplified and refined metamodels may provide insights into the complex dynamic system before their transition to more sophisticated models that run on high-performance computing systems. The ultimate goal is to build a bridge between simulation and experiment, allowing model validation by comparing the simulated data to experimental data in microbiology.

59 BASIC BIOLOGICAL SCIENCES↗

Simulation of wind and solar energy generation over California with E3SM SCREAM regionally refined models at 3.25 km and 800 m resolutions

This study presents wind and solar power generation estimates derived from the US Department of Energy’s Simple Cloud-Resolving E3SM Atmosphere Model (SCREAM) Regionally Refined Models (RRM) over California at 3.25 km and 800 m horizontal resolutions, using the Python wrapper for the System Advisor Model (PySAM). The resulting wind and solar generation estimates are compared to monthly capacity factors reported to the Energy Information Administration (EIA), High-Resolution Rapid Refresh (HRRR, 3 km resolution) forecast model, and E3SM North American regionally refined model (NARRM, 25 km resolution). We systematically assess the impacts of generation modeling assumptions, meteorological models, and horizontal resolution. Results show that resolution plays a dominant role for wind energy: increasing from 25 to 3.25 km brings qualitative and quantitative improvements, most notably by resolving the phase error in the seasonal cycle found in coarser simulations. However, further refinement to 800 m offers minimal gains. SCREAM performs better than HRRR for solar power generation in single- and dual-axis tracking systems, likely due to more accurate surface radiation. The sensitivity of PySAM to system configuration, particularly for axis-tracking modeling in photovoltaics, is also highlighted. Overall, SCREAM-RRM shows strong potential for high-resolution energy assessments, with future progress depending on more in situ observations and clearer quantification of uncertainties in generation modeling.

Geosciences↗

MOOSE-Python Binder

This code is a wrapper for Python code so that it can be accessed by MOOSE and the two can pass variables back and forth. Since this code was developed by ORNL, it must be independently approved before being added to the MOOSE repository.

Cheniour, Amani↗

LAVA 1.0: A general-purpose python toolkit for calculation of material properties with LAMMPS and VASP

Here, we introduce LAVA, a general-purpose python toolkit to provide user-friendly and high throughput calculations for material properties using both LAMMPS and VASP. It contains a set of classes as well as pre-processing and post-processing functions to prepare, execute and extract information from LAMMPS/VASP simulations. An overview of the program structure is provided. The current version contains modules to calculate elastic and mechanical properties such as lattice constant, cohesive energy, cold curve, elastic constants, bulk and shear modulus, volume conserving/non-conserving deformation path, vacancy/interstitial formation energy, surface energy, stacking fault energy, melting point, radial distribution function, and thermal expansion. These functionalities are demonstrated for different interatomic potentials and DFT calculations in Al.

36 MATERIALS SCIENCE↗

Multidisciplinary Conceptual Design for Reduced-Emission Rotorcraft

Python-based wrappers for OpenMDAO are used to integrate disparate software for practical conceptual design of rotorcraft. The suite of tools which are connected thus far include aircraft sizing, comprehensive analysis, and parametric geometry. The tools are exercised to design aircraft with aggressive goals for emission reductions relative to fielded state-of-the-art rotorcraft. Several advanced reduced-emission rotorcraft are designed and analyzed, demonstrating the flexibility of the tools to consider a wide variety of potentially transformative vertical flight vehicles. To explore scale effects, aircraft have been sized for 5, 24, or 76 passengers in their design missions. Aircraft types evaluated include tiltrotor, single-main-rotor, coaxial, and side-by-side helicopters. Energy and drive systems modeled include Lithium-ion battery, hydrogen fuel cell, turboelectric hybrid, and turboshaft drive systems. Observations include the complex nature of the trade space for this simple problem, with many potential aircraft design and operational solutions for achieving significant emission reductions. Also interesting is that achieving greatly reduced emissions may not require exotic component technologies, but may be achieved with a dedicated design objective of reducing emissions.

Rotorcraf↗

BatAnalysis - A Comprehensive Python Pipeline for Swift BAT Survey Analysis

The Swift Burst Alert Telescope (BAT) is a coded-aperture gamma-ray instrument with a large field of view that primarily operates in survey mode when it is not triggering on transient events. The survey data consist of 80- channel detector plane histograms that accumulate photon counts over periods of at least 5 minutes. These histograms are processed on the ground and are used to produce the survey data set between 14 and 195 keV. Survey data comprise >90% of all BAT data by volume and allow for the tracking of long-term light curves and spectral properties of cataloged and uncataloged hard X-ray sources. Until now, the survey data set has not been used to its full potential due to the complexity associated with its analysis and the lack of easily usable pipelines. Here, we introduce the BatAnalysis Python package, a wrapper for HEASoftpy, which provides a modern, opensource pipeline to process and analyze BAT survey data. BatAnalysis allows members of the community to use BAT survey data in more advanced analyses of astrophysical sources, including pulsars, pulsar wind nebula, active galactic nuclei, and other known/unknown transient events that may be detected in the hard X-ray band. We outline the steps taken by the Python code and exemplify its usefulness and accuracy by analyzing survey data of the Crab Nebula, NGC 2992, and a previously uncataloged MAXI transient. The BatAnalysis package allows for ~18 yr of BAT survey data to be used in a systematic way to study a large variety of astrophysical sources.

46 INSTRUMENTATION RELATED TO NUCLEAR SCIENCE AND ↗

BatAnalysis - A Comprehensive Python Pipeline for Swift BAT Survey Analysis

The Swift Burst Alert Telescope (BAT) is a coded-aperture gamma-ray instrument with a large field of view that primarily operates in survey mode when it is not triggering on transient events. The survey data consist of 80-channel detector plane histograms that accumulate photon counts over periods of at least 5 minutes. These histograms are processed on the ground and are used to produce the survey data set between 14 and 195 keV. Survey data comprise >90% of all BAT data by volume and allow for the tracking of long-term light curves and spectral properties of cataloged and uncataloged hard X-ray sources. Until now, the survey data set has not been used to its full potential due to the complexity associated with its analysis and the lack of easily usable pipelines. Here, we introduce the BatAnalysis Python package, a wrapper for HEASoftpy, which provides a modern, open-source pipeline to process and analyze BAT survey data. BatAnalysis allows members of the community to use BAT survey data in more advanced analyses of astrophysical sources, including pulsars, pulsar wind nebula, active galactic nuclei, and other known/unknown transient events that may be detected in the hard X-ray band. We outline the steps taken by the Python code and exemplify its usefulness and accuracy by analyzing survey data of the Crab Nebula, NGC 2992, and a previously uncataloged MAXI transient. The BatAnalysis package allows for ~18 yr of BAT survey data to be used in a systematic way to study a large variety of astrophysical sources.

79 ASTRONOMY AND ASTROPHYSICS↗

BatAnalysis - A Comprehensive Python Pipeline for Swift BAT Survey Analysis

The Swift Burst Alert Telescope (BAT) is a coded aperture gamma-ray instrument with a large field of view that primarily operates in survey mode when it is not triggering on transient events. The survey data consists of eighty-channel detector plane histograms that accumulate photon counts over time periods of at least 5 minutes. These histograms are processed on the ground and are used to produce the survey dataset between 14 and 195 keV. Survey data comprises >90% of all BAT data by volume and allows for the tracking of long term light curves and spectral properties of cataloged and uncataloged hard X-ray sources. Until now, the survey dataset has not been used to its full potential due to the complexity associated with its analysis and the lack of easily usable pipelines. Here, we introduce the BatAnalysis python package , a wrapper for HEASoftpy, which provides a modern, open-source pipeline to process and analyze BAT survey data. BatAnalysis allows members of the community to use BAT survey data in more advanced analyses of astrophysical sources including pulsars, pulsar wind nebula, active galactic nuclei, and other known/unknown transient events that may be detected in the hard X-ray band. We outline the steps taken by the python code and exemplify its usefulness and accuracy by analyzing survey data from the Crab Pulsar, NGC 2992, and a previously uncataloged MAXI Transient. The BatAnalysis package allows for ∼ 18 years of BAT survey to be used in a systematic way to study a large variety of astrophysical sources.

Tyler Parsotan↗

Automated Detection of Spurious Signals in VLBI Phase Calibration Data

In this memorandum, a set of processing strategies for automatic masking of phase calibration tones is outlined as implemented in the software package PIMA in the task Generate Phase Calibration Mask, or GEPM. The task relies on a robust procedure of cleaning phase calibration data before employing several mathematical strategies designed to selectively identify spurious signals from phase calibration tones. These strategies were derived as more rigorous implementations of heuristics traditionally used by analysts in manually identifying problematic phase calibration data. The task is intended to automate the process of generating a phase calibration mask and in so doing increase the speed and regularity of VLBI analysis. At the outset of the project, a series of goals were identified to evaluate the success of this mask generation. This included the development of an algorithm to identify and mask short-term (defined as less than 10 seconds in length) spurious signals affecting phase calibration data, the development of an algorithm to identify and mask phase calibration tones affected by constant radio-frequency interference, the implementation of a detection scheme for identifying large jumps in phase calibration phase caused by clock breaks, and finally a method of reporting phase calibration health metrics to the user. Processing of over 10 experiments has demonstrated that the final form of the task GEPM as detailed in this technical memorandum satisfies each of these conditions and satisfactorily performs the task of automatic phase calibration data masking, although the wide variety in quality and characteristics of phase calibration data makes a single solution to the problem quite difficult. A series of user inputs have therefore been defined to assist analysts in tailoring automatic masking to specific stations and phase calibration generators. The vast majority of applicable code was written in FORTRAN to increase execution speed and ease of interfacing with the existing code base in PIMA, but a wrapper function in Python was also written to allow for a simpler method of interacting with GEPM and inputting relevant parameters. In addition to this report, thorough documentation was added to the already existing repositories associated with PIMA as a whole.

Geodesy↗

Decomposition Algorithms for Scalable Quantum Annealing

The presented python code provides wrapper functions for two decomposition algorithms: One algorithm to decompose Maximum Clique problems and one to decompose Minimum Vertex Cover problems. The functions take as input a networkx graph object, and decompose either problem on the input graph recursively into subproblems such that the optimal solution can be constructed from the optimal solutions of both subproblems. The recursion ends as soon as the subproblems reach a pre-specified size limit by the user, and they can be solved using any method provided in advance by the user as external function. This includes exact solvers or an adiabatic quantum annealer.

Pelofske, Elijah↗

OCHRE™ Gymnasium (ochre_gym) [SWR-23-47]

OCHRE™ Gymnasium is a Python framework for conducting reinforcement learning research on residential building energy management problems. It is a lightweight wrapper around OCHRE, a Python-based thermal-electric residential building simulator developed in-house at NREL. OCHRE Gymnasium adheres to the standard OpenAI Gym API for a reinforcement learning environment. Detailed Sphinx documentation will be auto-generated and accompany this codebase. This documentation will detail the API, provide examples of how to use the code, etc.

Emami, Patrick↗

CiteSoft_Py

There is a need to provide a way for dev-users (Scientists, Engineers, and other Software Developers) to get credit (citations) when they contribute to an important software package - particularly a large package that is already established. Various solutions (including cross package) solutions do exist, but a simple standard format that can work between multiple packages and multiple languages in a modular way is not widely available. CiteSoft_py is a python implementation of CiteSoft. CiteSoft is a plain text standard consisting of a format and a protocol that exports the citations for the end-users for whichever softwares they have used. CiteSoft has been designed so that software dev-users can rely upon it regardless of coding language or platform, and even for cases where multiple codes are working in a coupled manner. The CiteSoft_py implementation includes python decorators to make wrappers for facile use. The purpose is that when dev-users (scientists, engineers and professional programmers) contribute to a collaborative software project, that the appropriate citations (e.g., journal article, conference proceeding) are provided to the end-user. The end-user does not need to know how to use a command line interface, API, etc.

Savara, Aditya↗

QUiNN

SAND2023-05484O Quantification of Uncertainties in Neural Networks (QUiNN) is a python library centered around various probabilistic wrappers over PyTorch modules in order to provide uncertainty estimation in neural network (NN) predictions. Sandia National Laboratories is a multimission laboratory managed and operated by National Technology & Engineering Solutions of Sandia, LLC, a wholly owned subsidiary of Honeywell International Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA0003525.

Sargsyan, Khachik↗

The MCNPTools Package: Installation and Use

MCNPTools is a C++ software library bound to Python (2 & 3) via the Simplified Wrapper and Interface Generator (SWIG version 3.0.7). The report lists the minimum build requirements and the compiler options that are currently tested and supported.

97 MATHEMATICS AND COMPUTING↗

rabpro: global watershed boundaries, river elevation profiles, and catchment statistics

River and Basin Profiler (rabpro) is a Python package to delineate watersheds, extract river flowlines and elevation profiles, and compute watershed statistics for any location on the Earth’s surface. As fundamental hydrologically-relevant units of surface area, watersheds are areas of land that drain via aboveground pathways to the same location, or outlet. Delineations of watershed boundaries are typically performed on digital elevation models (DEMs) that represent surface elevations as gridded rasters. Depending on the resolution of the DEM and the size of the watershed, delineation may be very computationally expensive. With this in mind, we designed rabpro to provide user-friendly workflows to manage the complexity and computational expense of watershed calculations given an arbitrary coordinate pair. In addition to basic watershed delineation, rabpro will extract the elevation profile for a watershed’s mainchannel flowline. This enables the computation of river slope, which is a critical parameter in many hydrologic and geomorphologic models. Finally, rabpro provides a user-friendly wrapper around Google Earth Engine’s (GEE) Python API to enable cloud-computing of zonal watershed statistics and/or time-varying forcing data from hundreds of available datasets. Altogether, rabpro provides the ability to automate or semi-automate complex watershed analysis workflows across broad spatial extents.

54 ENVIRONMENTAL SCIENCES↗

Wrapper for the optimization of cross-section generation in OpenMC

The "Wrapper for the optimization of cross-section generation in OpenMC" is Python-based software that runs the open-source Monte Carlo code OpenMC (https://docs.openmc.org/en/stable/ ) to generate cross-sections for any reactor geometry. The wrapper then optimizes those cross sections. The optimization aims to choose an energy group structure and a scattering representation that maximize accuracy with respect to continuous-energy results while avoiding significant computational expense. It then outputs these cross-sections in an ISOXML format readable by the Idaho National Lab code suite MOOSE (Olin William Calvin, Mark D DeHart, “Architecture for the Performance of Nuclear Fuel Depletion Calculations”, Idaho National Laboratory report, November 2019). The expected use-cases of this software include: -finding the best group structure and scattering representation for a specific reactor -testing the appropriateness of energy group structures for different reactor types -comparing energy group structures and scattering representations to each other -generating cross sections for use in deterministic codes, including ones found in the MOOSE suite The example reactor geometry included in this release is a generic reactor design, not based on any reactor in existence or in development. It was fabricated for the sole purpose of being a “testbed-geometry” upon which to develop this tool. Since the tool is designed to be generic, the nature of the test geometry is not very important, however, it is valuable to include as an example for users who are unfamiliar with developing reactor geometries for OpenMC.

Kreher, Miriam↗

PythonFOAM: In-situ data analyses with OpenFOAM and Python

Here, we outline the development of a general-purpose Python-based data analysis tool for OpenFOAM. Our implementation relies on the construction of OpenFOAM applications that have bindings to data analysis libraries in Python. Double precision data in OpenFOAM is cast to a NumPy array using the NumPy C-API and Python modules may then be used for arbitrary data analysis and manipulation on flow-field information. We highlight how the proposed wrapper may be used for an in-situ online singular value decomposition (SVD) implemented in Python and accessed from the OpenFOAM solver PimpleFOAM. Here, 'in-situ' refers to a programming paradigm that allows for a concurrent computation of the data analysis on the same computational resources utilized for the partial differential equation solver. In addition, to demonstrate parallel deployments, we deploy a distributed SVD, which collects snapshot data across the ranks of a distributed simulation to compute the global left singular vectors. Crucially, both OpenFOAM and Python share the same message passing interface (MPI) communicator for this deployment which allows Python objects and functions to exchange NumPy arrays across ranks. Subsequently, we provide scaling assessments of this distributed SVD on multiple nodes of Intel Broadwell and KNL architectures for canonical test cases such as the large eddy simulations of a backward facing step and a channel flow at friction Reynolds number of 395. Finally, we demonstrate the deployment of a deep neural network for compressing the flow-field information using an autoencoder to demonstrate an ability to use state-of-the-art machine learning tools in the Python ecosystem.

97 MATHEMATICS AND COMPUTING↗