Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “Python codes”

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 199 records · Page 11

SPISEA: A Python-based Simple Stellar Population Synthesis Code for Star Clusters

We present Stellar Population Interface for Stellar Evolution and Atmospheres (SPISEA), an open-source Python package that simulates simple stellar populations. The strength of SPISEA is its modular interface which offers the user control of 13 input properties including (but not limited to) the initial mass function, stellar multiplicity, extinction law, and the metallicity-dependent stellar evolution and atmosphere model grids used. The user also has control over the initial–final mass relation in order to produce compact stellar remnants (black holes, neutron stars, and white dwarfs). We demonstrate several outputs produced by the code, including color–magnitude diagrams, HR-diagrams, luminosity functions, and mass functions. SPISEA is object-oriented and extensible, and we welcome contributions from the community. The code and documentation are available on GitHub (https://github.com/astropy/SPISEA) and ReadtheDocs (https://spisea.readthedocs.io/en/latest/), respectively.

79 ASTRONOMY AND ASTROPHYSICS↗

Dataset for 'Stream Temperature Predictions for River Basin Management in the Pacific Northwest and Mid-Atlantic Regions Using Machine Learning', Water 2022

This data package presents forcing data, model code, and model output for classical machine learning models that predict monthly stream water temperature as presented in the manuscript ‘Stream Temperature Predictions for River Basin Management in the Pacific Northwest and Mid-Atlantic Regions Using Machine Learning’, Water (Weierbach et al., 2022). Specifically, for input forcing datasets we include two files each generated using the BASIN-3D data integration tool (Varadharajan et al., 2022) for stations in the Pacific Northwest and Mid Atlantic Hydrologic regions. Model code (written in python with the use of jupyter notebooks) includes codes for data preprocessing, training Multiple Linear Regression, Support Vector Regression, and Extreme Gradient Boosted Tree models, and additional notebooks for analysis of model output. We include specific model output files which represent modeling configurations presented in the manuscript also presented in an hdf5 format. Together, these data make up the workflow for predictions across three scenarios (single station, regional, and predictions in unmonitored basins) presented in the manuscript and allow for reproducibility of modeling procedures.

54 ENVIRONMENTAL SCIENCES↗

A2E2G (Atmosphere to Electrons to the Grid platform) [SWR-23-22]

A2E2G is a platform that integrates 1) forecasting tools to account for weather uncertainty, with 2) aerodynamic wind plant models to account for wake dynamics and wind plant operation, and 3) economic models to advise on operation for a wind power plant that offers grid services in addition to energy. The A2E2G platform can be used as a high-level controller for a wind plant for market participation and real-time wind plant control. The A2E2g platform is a holistic Python tool with modules that can be run to 1) advise on market participation and 2) control and operate a wind power plant in real time. The A2E2g framework assumes two stages: the first stage is in day-ahead and the second stage is in real-time. Managing uncertainty is key in the first stage and managing variability is key in the second stage. The different components have models written and developed in the Python programming language. The code is assembled into a Python package and can be easily downloaded and installed from the A2E2g repository (https://github.com/NREL/a2e2g).

Sinner, Michael↗

Strategic Petroleum Reserve Cavern Leaching Monitoring CY24

This report provides an analysis of the effects of raw water leaching at the U.S. SPR using the Sandia Solution Mining Code (SANSMIC). A new version of the code has been established in the past year (implemented in Python and C++ code) and was used for this annual report. Additionally, the setup, running, and post-processing of leaching modeling has now been streamlined into a single Python notebook environment for each cavern run.

58 GEOSCIENCES↗

Divertor heat load estimates on NSTX and DIII-D using new and open-source 2D inversion analysis code

A thermography inversion algorithm has been developed in the open-source Python-based computer code, HYPERION, to calculate the heat flux incident on plasma-facing components (PFCs) in axisymmetric tokamaks. The chosen mesh size at the surface significantly affects the calculated transient heat flux results. The calculated transient heat flux will exceed the real value when the mesh size tends to zero but will underestimate the real value when the mesh size is large. A criterion for determining the appropriate mesh size for the transient heat flux calculation will be discussed. The numerical scheme for HYPERION uses a 2D fully implicit finite-difference approach, allowing temperature-dependent thermal properties of PFC materials. The inversion algorithm is benchmarked against established heat flux calculation codes, TACO and THEODOR, based on thermography data from NSTX and DIII-D respectively. The primary benefits of HYPERION compared to TACO and THEODOR are that it is open-source and it allows for the optimization of mesh thickness along the substrate. The algorithm also accounts for the thermal properties of thin surface layers that characteristically form on PFCs due to plasma-material interactions. The agreement between HYPERION and THEODOR is excellent, as the percent difference between the codes is ~5% on average in the case of the DIII-D data for moderate to high heat flux. Verification tests with TACO show slightly higher average percent differences of 8% and 12%. In using HYPERION to study filaments in heat flux, the initial results indicate that small ELMs filaments significantly broaden the divertor heat flux, and decrease divertor peak flux. Compared to the inter-ELM, the small ELM filaments decrease the divertor peak surface temperature. With intermittent divertor filaments, the divertor heat flux width is comparable with that found in L-mode.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

ExactPack

A new version of the verification tool ExactPack, 1.7.0, includes three new solvers: A Radshocks solver, Riemann solver and an Elastic-Plastic Piston problem solver. The code has been refactored to work with Python 3. All Fortran code has been removed and solvers implemented in Fortran have been re-implemented in Python where necessary. All unit tests have been converted to use the Pytest format and all the GUI, CLI and verification analysis code has been removed.

Thrussell, Jasper↗

Code Artifact for: Clustering Analysis of Commercial Vehicles Using Automatically Extracted Features from Time Series Data [SWR-21-96]

This repository contains data ingestion, feature extraction, and analysis code used in NREL Technical report "Clustering Analysis of Commercial Vehicles Using Automatically Extracted Features from Time Series Data." The code is written in Python. The ETL and feature extraction code must be run in a Spark context. The analysis code can be run without Spark, provided you have pre-computed features in a CSV file. Analysis code related to the NREL Technical Report NREL/TP-2C00-74212. Includes PySpark functions to perform trip segmentation and feature extraction over big time series data in Apache Spark. Includes "domain specific" features such as Aerodynamic Speed (ft/s), Characteristic Acceleration (ft/s2), Percent Below 55 (%), Percent Zero (%), Stops Per Mile, Average Speed (mph), Maximum Speed (mph), and Speed Standard Deviation (mph). Includes Pyspark UDF to compute "domain agnostic" features using the TSFresh library. This software record also includes the analysis notebooks and code to generate the results in the previously mentioned technical report.

Perr-Sauer, Jordan↗

Feature Interpretability

The feature interpretability code is a python module that interprets and analyzes neural networks trained on hydrodynamic simulation output in the form of numpy arrays. The code takes trained neural networks and extracts internal model states in the form of images. Additionally, tools for covariance analysis of network weights and predictions are provided. This code is built on the TensorFlow and PyTorch python libraries, and includes trained networks and example input data for demonstration purposes.

Callis, Skylar↗

EDAT

SAND2022-13281 O EDAT is a suite of tools for analyzing time-dependent electron densities produced by time-dependent density functional theory (TDDFT) simulations of ion-irradiated materials and surfaces. The code’s key capabilities include various routines to extract the number of electrons emitted from a surface, the energy spectrum of these emitted electrons, and the number of electrons captured by the ion. The code is written in Python and can interface with multiple TDDFT codes. 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.

Kononov, Alina↗

Towards A Better Measurement of eta-Earth and Beyond Via Modernizing the Kepler Pipeline: An Update

The measurement of the occurrence of rocky habitable-zone planets orbiting Sun-like stars (eta-Earth), is a fundamental quantity for guiding our search for habitable exoplanets. Despite being launched 15 years ago, NASA’s Kepler mission remains responsible for finding the majority of all known exoplanet candidates relevant to eta-Earth, ushering in a new era of exoplanet demographics studies and continuing to drive planet occurrence rate calculations. However, the paucity of detections of likely rocky planets in the habitable zones of their host stars remains a limiting factor for estimating eta-Earth. We describe our five-year project for modernizing the Kepler planet detection and vetting pipeline in order to produce a more complete and reliable exoplanet catalog, which will lead to more accurate and precise measurements of eta-Earth. First, we are currently porting the original Kepler pipeline code from MATLAB to Python. We will then describe new stellar catalogs based on Gaia and ground-based imaging data, and ways to improve the pipeline detection and vetting algorithms. We will provide an update on the current state of this work. When completed, we will use this new pipeline and catalog to calculate updated estimates of eta-Earth. The full, updated pipeline code in Python, as well as all our inputs and results, will be made available to the public for detailed exoplanet occurrence-rate and demographics studies.

kepler↗

Comparing the Performance of Julia on CPUs versus GPUs and Julia-MPI versus Fortran-MPI: a case study with MPAS-Ocean (Version 7.1)

Abstract. Some programming languages are easy to develop at the cost of slow execution, while others are fast at runtime but much more difficult to write. Julia is a programming language that aims to be the best of both worlds – a development and production language at the same time. To test Julia's utility in scientific high-performance computing (HPC), we built an unstructured-mesh shallow water model in Julia and compared it against an established Fortran-MPI ocean model, the Model for Prediction Across Scales–Ocean (MPAS-Ocean), as well as a Python shallow water code. Three versions of the Julia shallow water code were created: for single-core CPU, graphics processing unit (GPU), and Message Passing Interface (MPI) CPU clusters. Comparing identical simulations revealed that our first version of the Julia model was 13 times faster than Python using NumPy, where both used an unthreaded single-core CPU. Further Julia optimizations, including static typing and removing implicit memory allocations, provided an additional 10–20× speed-up of the single-core CPU Julia model. The GPU-accelerated Julia code was almost identical in terms of performance to the MPI parallelized code on 64 processes, an unexpected result for such different architectures. Parallelized Julia-MPI performance was identical to Fortran-MPI MPAS-Ocean for low processor counts and ranges from 2× faster to 2× slower for higher processor counts. Our experience is that Julia development is fast and convenient for prototyping but that Julia requires further investment and expertise to be competitive with compiled codes. We provide advice on Julia code optimization for HPC systems.

54 ENVIRONMENTAL SCIENCES↗

Python-Cubit ® Enhancement Scripts: 16.14

The Python-Cubit ® enhancement code base is intended to be used as an extension to already existing Cubit ® functionality. It provides the user with a number of functionalities that are either currently outside the realm of the python functions which Cubit ® supplies internally (such as vector math), or that are comprised of commonly used combinations of already existing python functionalities (such as removing a full round from a slot cut). The foreseen style of use for many of these scripts is to utilize volume names and geometric data such as surface area, surface type, etc. as a way to filter out geometries, and provide a powerful id-less method. These filters combined with a number of already existing python functionalities such as the set() operator and zip() function can be used to operate on many geometries at a single time without a need for the user to manually select them or use their ids. Please refer to the example given in the documents examples section for a demonstration of the work flow.

97 MATHEMATICS AND COMPUTING↗

Python-Cubit® Enhancement Scripts: 16.18

The Python-Cubit® enhancement code base is intended to be used as an extension to already existing Cubit® functionality. It provides the user with a number of functionalities that are either currently outside the realm of the python functions which Cubit® supplies internally (such as vector math), or that are comprised of commonly used combinations of already existing python functionalities (such as removing a full round from a slot cut).

97 MATHEMATICS AND COMPUTING↗

photoemission

The code is a python package that implements a one-step model to estimate quantum efficiency of photoemission from solid state surfaces. The analytical formulation is based on the approach proposed in Phys Rev B 95, 075439 (2017). This code extends that formalism from a model Hamiltonian to the calculation of quantum efficiency from the electronic states derived from solid-state quantum mechanical calculations obtained using the VASP code.

Batista, Enrique↗

The LLNL nuclear data infrastructure for the GNDS data format

The next generation of nuclear data infrastructure tools at the Livermore National Laboratory (LLNL) consists of pipeline of codes that read and process nuclear data from evaluated files saved in the new GNDS (Generalised Nuclear Data Structure) nuclear data format. The processing code FUDGE (For Updating Data and Generating Evaluations) is at the front-end of this pipeline as it reads and process the evaluated data for use in downstream transport codes. FUDGE is Python based with C and C++ extensions for computationally intensive tasks. As is the case for the evaluated data, the processed output is also saved in the GNDS format and the GIDI+ API is provided as the interface between the processed data and the transport codes. GIDI+ is a C++ based suite of codes and it includes GIDI (General Interaction Data Interface), a library for reading and writing GNDS data, and MCGIDI which is the cross section lookup, and reaction and product distribution sampling interface between Monte Carlo transport codes and the GNDS data. GIDI provides methods for easy access to the multi-group processed GNDS data and this is demonstrated through its implementation in ARDRA, the LLNL deterministic transport code. The evaluation and sampling methods in MCGIDI are available as both CPU and GPU methods which facilitates the use of MCGIDI in both traditional CPU-based as well as the next generation mixed model computational architectures. This is demonstrated through the GIDI+ implementation in MERCURY, the LLNL Monte Carlo transport code. (authors)

22 GENERAL STUDIES OF NUCLEAR REACTORS↗

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↗

FlowPM: Distributed TensorFlow implementation of the FastPM cosmological N-body solver

Here, we present FlowPM, a Particle-Mesh (PM) cosmological N-body code implemented in Mesh-TensorFlow for GPU-accelerated, distributed, and differentiable simulations. We implement and validate the accuracy of a novel multi-grid scheme based on multiresolution pyramids to compute large-scale forces efficiently on distributed platforms. We explore the scaling of the simulation on large-scale supercomputers and compare it with corresponding Python based PM code, finding on an average 10x speed-up in terms of wallclock time. We also demonstrate how this novel tool can be used for efficiently solving large scale cosmological inference problems, in particular reconstruction of cosmological fields in a forward model Bayesian framework with hybrid PM and neural network forward model. We provide skeleton code for these examples and the entire code is publicly available at https://github.com/modichirag/flowpm[Formula presented].

79 ASTRONOMY AND ASTROPHYSICS↗

HERMES

HERMES - High-speed Event Retrieval and Management for Enhanced Spectral imaging code. This code is meant to unpack and process neutron imaging data from the TPX3Cam made by Amsterdam Scientific Instruments. The TPX3Cam utilizes the Timepix3 chip in a single photon counting mode of image acquisition. The photon counting data streaming off the TPX3Cam needs to be process and analyzed in order to create final images. Therefore we are developing both python and cpp codes to allow for users of the TPX3Cam to efficiently analyze data and create images.

Long, Alexander↗