Search NASA⌕ Search

SEARCH · Search NASA

Results for “Python implementation”

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 235 records · Page 13

Metis: A Pure Metropolis Markov Chain Monte Carlo Bayesian Inference Library

The use of Bayesian inference in data analysis has become the standard for large scienti c experiments [1, 2]. The Monte Carlo Codes Group(XCP-3) at Los Alamos has developed a simple set of algorithms currently implemented in C++ and Python to easily perform at-prior Markov Chain Monte Carlo Bayesian inference with pure Metropolis sampling. These implementations are designed to be user friendly and extensible for customization based on speci c application requirements. This document describes the algorithmic choices made and presents two use cases.

97 MATHEMATICS AND COMPUTING↗

SU-F-T-340: Direct Editing of Dose Volume Histograms: Algorithms and a Unified Convex Formulation for Treatment Planning with Dose Constraints

Purpose: To develop a procedure for including dose constraints in convex programming-based approaches to treatment planning, and to support dynamic modification of such constraints during planning. Methods: We present a mathematical approach that allows mean dose, maximum dose, minimum dose and dose volume (i.e., percentile) constraints to be appended to any convex formulation of an inverse planning problem. The first three constraint types are convex and readily incorporated. Dose volume constraints are not convex, however, so we introduce a convex restriction that is related to CVaR-based approaches previously proposed in the literature. To compensate for the conservatism of this restriction, we propose a new two-pass algorithm that solves the restricted problem on a first pass and uses this solution to form exact constraints on a second pass. In another variant, we introduce slack variables for each dose constraint to prevent the problem from becoming infeasible when the user specifies an incompatible set of constraints. We implement the proposed methods in Python using the convex programming package cvxpy in conjunction with the open source convex solvers SCS and ECOS. Results: We show, for several cases taken from the clinic, that our proposed method meets specified constraints (often with margin) when they are feasible. Constraints are met exactly when we use the two-pass method, and infeasible constraints are replaced with the nearest feasible constraint when slacks are used. Finally, we introduce ConRad, a Python-embedded free software package for convex radiation therapy planning. ConRad implements the methods described above and offers a simple interface for specifying prescriptions and dose constraints. Conclusion: This work demonstrates the feasibility of using modifiable dose constraints in a convex formulation, making it practical to guide the treatment planning process with interactively specified dose constraints. This work was supported by the Stanford BioX Graduate Fellowship and NIH Grant 5R01CA176553.

60 APPLIED LIFE SCIENCES↗

Developing a GUI for the Robotic Test Stand

The introduction of this poster explains the technology behind DUNE’s far and near detectors and how passing neutrinos generate electrons that drift into a wire grid. I then explain how 3 ASICs manage signals received from electron interception. Next, the poster states how COLDATA chips are undergoing quality control by a Robotic Test Stand using a state machine. I further explained how earlier tests were done via a command line script and the necessity to implement a user-friendly Graphical User Interface with new features a command line can’t implement. For the implementation section, tools and methods for implementation are listed such as Python, tkinter, and GitHub as well as how multithreading and queue implementation was necessary for GUI functionality. Then, I elaborated on the GUIs new features. Finally, I explain how the GUI will be distributed across multiple institutions and future changes planned for the GUI. Photos of the RTS, far detector cave, diagram of anode assembly plane, COLDATA chips, set up tab, result tab, and legacy command line interface are shown.

Gutierrez Villanueva, Jaziel [DuPage Coll.]↗

Real-Time Optimization Workflow Status Update

Economically optimal and safe operation of integrated energy systems (IES) requires optimization at many different time scales. A real-time optimization (RTO) workflow will attempt to maximize revenue and minimize operational costs on a time scale of minutes to hours. Such a workflow requires the use of a digital twin (DT), which is a virtual representation of a physical system. The DT is updated using real-time data from the physical system, and serves as a model in an optimization framework. The optimization results are then sent back to the physical system to complete the loop. This report details the progress made in developing building blocks for a DT/RTO framework. The Risk Analysis Virtual Environment (RAVEN) platform within the Framework for Optimization of Resources and Economics (FORCE) tool suite can perform many of the tasks required for building a DT and performing RTO. The first item of this report details RAVEN enhancements that enable RAVEN workflows to be run in various environments. Data communication between the physical system and its DT is essential for successful RTO. This includes preprocessing real-time data, loading data into a data warehouse, and querying the stored data. The second section of this report describes the progress made in implementing an adapter in Python in order for Deep Lynx to handle the data communication. Typical dispatch optimization frameworks are built on linear programming (LP). The prototype RTO workflow developed in this report uses an LP problem as a part of a receding-horizon- or economic model predictive control (EMPC) based optimization. The third section of this report details the framework of an RTO workflow in which the system consists of a simple electrical storage device. A DT can be built from a reduced-order model (ROM). Integrating a ROM into a typical LP optimization framework has been challenging because most optimization packages require the user to write algebraic expressions for the system model. The final section of this report shows how an externally built RAVEN ROM can be integrated in an RTO framework by using the Python package Pyomo. This demonstrates the RTO workflow capability from a software-only perspective and is an important step in demonstrating the capability to implement an RTO workflow for a physical system.

97 MATHEMATICS AND COMPUTING↗

TPSAS-NF1676L-32060-DND

All previous PSP testing done in the Unitary Plan Wind Tunnel (UPWT) have required a significant amount of manual operation of the system. This has resulted in decreased testing efficiency and precluded the ability to provide near real-time data analysis to the customer. The overall goal of this project is to integrate the PSP data acquisition system into the supersonic UPWT data acquisition system (DAS) and create an adaptive software platform from which PSP data acquisition can be triggered by the tunnel and critical testing conditions can be recorded in real time for rapid analysis of the PSP data. This analysis includes the mapping of up to eight camera views onto a surface grid for analysis and converting to pressure using parameters supplied by the DAS. To fully implement this solution, communication must first be established between the Unitary DAS and the PSP DAS. This will be done by employing multiple scripts written in Python and C++ and implemented on a Linux cluster. These will be demonstrated and refined on an upcoming test (December 2018), and the successful completion will result in the ability to have automatic collection of PSP images and near real-time analysis capabilities.

Juliette Eddins↗

Graph Neural Networks and Applied Linear Algebra v.1.0

SAND2024-01365O The Graph Neural Networks and Applied Linear Algebra is companion software for the educational article with the same title. The software provides illustrative examples of graph neural networks in Matlab and Python. These stand-alone algorithms are for educational purposes. The software also includes graph neural network-based algorithms for a trainable Jacobi iteration as well as diffusion coefficient estimation. The software provides human-interpretable implementations of Graph Neural Networks in Matlab and Python. These implementations are not optimized for performance and instead emphasize readability. 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.

SciDAC↗

PvaPy: Python API for EPICS PV Access

As the number of sites deploying and adopting EPICS Version 4 grows, so does the need to support PV Access from multiple languages. Especially important are the widely used scripting languages that tend to reduce both software development time and the learning curve for new users. In this paper we describe PvaPy, a Python API for the EPICS PV Access protocol and its accompanying structured data API. Rather than implementing the protocol itself in Python, PvaPy wraps the existing EPICS Version 4 C++ libraries using the Boost.Python framework. This approach allows us to benefit from the existing code base and functionality, and to significantly reduce the Python API development effort. PvaPy objects are based on Python dictionaries and provide users with the ability to access even the most complex of PV Data structures in a relatively straightforward way. Its interfaces are easy to use, and include support for advanced EPICS Version 4 features such as implementation of client and server Remote Procedure Calls (RPC).

Veseli, S.↗

Implementation of real‐time TDDFT for periodic systems in the open‐source PySCF software package

Abstract We present a new implementation of real‐time time‐dependent density functional theory (RT‐TDDFT) for calculating excited‐state dynamics of periodic systems in the open‐source Python‐based PySCF software package. Our implementation uses Gaussian basis functions in a velocity gauge formalism and can be applied to periodic surfaces, condensed‐phase, and molecular systems. As representative benchmark applications, we present optical absorption calculations of various molecular and bulk systems and a real‐time simulation of field‐induced dynamics of a (ZnO) 4 molecular cluster on a periodic graphene sheet. We present representative calculations on optical response of solids to infinitesimal external fields as well as real‐time charge‐transfer dynamics induced by strong pulsed laser fields. Due to the widespread use of the Python language, our RT‐TDDFT implementation can be easily modified and provides a new capability in the PySCF code for real‐time excited‐state calculations of chemical and material systems.

37 INORGANIC, ORGANIC, PHYSICAL, AND ANALYTICAL CH↗

PySolate : A Python‐Based Thresholding Tool to Denoise or Designal Seismic Waveforms Based on the Continuous Wavelet Transform

PySolate is a Python‐based toolset that implements the continuous wavelet transform and nonlinear thresholding operations to denoise or designal seismic data, following Langston and Mousavi (2019). This filtering approach can remove microseismic noise to isolate intermediate‐period seismic signals that are key to enabling full‐waveform modeling and analysis of smaller‐magnitude regional events. This approach is best for the application to signals with frequency or time separation of signal and noise, in contrast to Fourier analysis, which is effective when signal and noise are separated in frequency. We demonstrate the Python toolset using the six announced Democratic People’s Republic of Korea declared nuclear tests, showing the effectiveness of isolating the seismic signal compared to standard bandpass filtering. In conclusion, we also demonstrate the ease of using the toolset with any Python processing tools.

Asia↗

Multi-shock design tools in double shell models

The essence of the project was to implement a program in python that demonstrated certain models put forth by fusion physicists. Across the time spent at Los Alamos National Laboratory, much was spent programming. Though fundamentally programmatical in nature, the task contained considerable difficulty hid within mathematically deriving and manipulating the models while maintaining data discretization. The result of solving these complications gave invaluable experience in applied mathematics. The final product, a piece of lengthy code, ended up having the full range of desired capabilities, with plans for more. Given the laser power history from a pulse shot on NIF, Omega, or any other Inertial Confinement Fusion facility, the code maps the terrain of radiation temperature inside the hohlraum throughout the period of the shot. Additionally, shock wave convergence prediction was implemented as additional capability. As the name of the project suggests, this tool acts as a compass of direction for researchers designing laser power profiles. Further development of this tool will undoubtedly assist in the research conducted on single and double-shell indirect ICF, consequently expanding the capabilities of operating stewardship over the national nuclear stockpile.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

MadGraph 5 : Going Beyond

MadGraph 5 is the new version of the MadGraph matrix element generator, written in the Python programming language. It implements a number of new, efficient algorithms that provide improved performance and functionality in all aspects of the program. It features a new user interface, several new output formats including C++ process libraries for Pythia 8, and full compatibility with FeynRules for new physics models implementation, allowing for event generation for any model that can be written in the form of a Lagrangian. MadGraph 5 builds on the same philosophy as the previous versions, and its design allows it to be used as a collaborative platform where theoretical, phenomenological and simulation projects can be developed and then distributed to the high-energy community. We describe the ideas and the most important developments of the code and illustrate its capabilities through a few simple phenomenological examples.

72 PHYSICS OF ELEMENTARY PARTICLES AND FIELDS↗

Effect of Tempering and Rolling on Fatigue Crack Growth Behavior of Modified 9Cr-1Mo Steel

In the present work, fatigue crack growth (FCG) behavior of modified 9Cr-1Mo steel has been investigated near fatigue threshold and Paris regime at room temperature (RT) and 650 °C. The modified 9Cr-1Mo steel was subjected to normalizing at 1050 °C followed by tempering (650-750 °C) and warm rolling at 550 °C followed by tempering in order to improve its precipitation state and refine microstructure. The microstructural parameters such as grain size, block size, lath width and precipitate size were examined and correlated with FCG and tensile properties of investigated samples. The results showed that decreasing tempering temperature significantly reduces the fatigue threshold at RT while increases the yield strength at elevated temperature (i.e., 650 °C). Increase in fatigue threshold is found to increase with the increase in block size, whereas high density of fine precipitates contributed the high temperature strength. The FCG rate in Paris regime was less affected by heat treatment and rolling process at RT. However, rolled sample tested at 650 °C shows a decrease in FCG rate as compared to heat-treated samples. In terms of higher FCG resistance and yield strength, warm rolling followed by tempering at low temperature (i.e., 700 °C) can be considered optimum. For the numerical simulation of FCG behavior, extended finite element method (XFEM) along with Paris law has been implemented in ABAQUS using python script. The simulated FCG behavior is found in good agreement with the experimental results.

36 MATERIALS SCIENCE↗

A systematic comparison of machine learning methods for modeling of dynamic processes applied to combustion emission rate modeling

Ten established, data-driven dynamic algorithms are surveyed and a practical guide for understanding these methods generated. Existing Python programming packages for implementing each algorithm are acknowledged, and the model equations necessary for prediction are presented. A case study on a coal-fired power plant’s NO x emission rates is performed, directly comparing each modeling method’s performance on a mutual system. Each model is evaluated by its root mean squared error (RMSE) on out-of-sample future horizon predictions. Optimal hyperparameters are identified using either an exhaustive search or genetic algorithm. The top five model structures of each method are used to recursively predict future NO x emission rates over a 60-step time horizon. The RMSE at each future timestep is determined, and the recursive output prediction trends compared against measurements in time. The GRU neural network is identified as the best candidate for representing the system, demonstrating accurate and stable predictions across the future horizon by all considered models, while satisfactory performance was observed in several of the ARX/NARX formulations. Finally, these efforts have contributed 1) a concise resource of multiple proven dynamic machine learning methods, 2) a practical guide explaining the use of these methods, effectively lowering the “barrier-to-entry” of deploying such models in control systems, 3) a comparison study evaluating each method’s performance on a mutual system, 4) demonstration of accurate multi-timestep emissions modeling suitable for systems-level control, and 5) generalizable results demonstrating the suitability of each method for prediction over a multi-step future horizon to other complex dynamic systems.

42 ENGINEERING↗

Parametrizations of coupled betatron motion for strongly coupled lattices

The coupling of transverse motion is a natural occurrence in particle accelerators, either in the form of a residual coupling arising from imperfections or originating by design from strong systematic coupling fields. While the first can be treated perturbatively, the latter requires a robust approach adapted to strongly coupled optics, and a parametrization of the linear optics must be performed to explore beam dynamics in such peculiar lattices. This work highlights the key physical interpretations of the main parametrization formalisms to describe linear coupled optics, along with explicit links and comparisons of these parametrizations. Concepts rarely illustrated in other works, such as forced mode flips and local coupling, are explored in detail, clarifying some anomalies that can arise in lattice functions. The analytical methods have been implemented in a reference Python package and connected with ray-tracing and integration codes to explore examples of strongly coupled lattices, which are discussed in detail to highlight the key physical interpretations of the parametrizations and characteristics of the lattices.

47 OTHER INSTRUMENTATION↗

CoverM: read alignment statistics for metagenomics

SUMMARY: Genome-centric analysis of metagenomic samples is a powerful method for understanding the function of microbial communities. Calculating read coverage is a central part of analysis, enabling differential coverage binning for recovery of genomes and estimation of microbial community composition. Coverage is determined by processing read alignments to reference sequences of either contigs or genomes. Per-reference coverage is typically calculated in an ad-hoc manner, with each software package providing its own implementation and specific definition of coverage. Here we present a unified software package CoverM which calculates several coverage statistics for contigs and genomes in an ergonomic and flexible manner. It uses "Mosdepth arrays" for computational efficiency and avoids unnecessary I/O overhead by calculating coverage statistics from streamed read alignment results. AVAILABILITY AND IMPLEMENTATION: CoverM is free software available at https://github.com/wwood/coverm. CoverM is implemented in Rust, with Python (https://github.com/apcamargo/pycoverm) and Julia (https://github.com/JuliaBinaryWrappers/CoverM_jll.jl) interfaces.

Aroney, Samuel T N↗

A selection function toolbox for subsets of astronomical catalogues

ABSTRACT Large catalogues are ubiquitous throughout astronomy, but most scientific analyses are carried out on smaller samples selected from these catalogues by chosen cuts on catalogued quantities. The selection function of that scientific sample – the probability that a star in the catalogue will satisfy these cuts and so make it into the sample – is thus unique to each scientific analysis. We have created a general framework that can flexibly estimate the selection function of a sample drawn from a catalogue in terms of position, magnitude and colour. Our method is unique in using the binomial likelihood and accounting for correlations in the selection function across position, magnitude, and colour using Gaussian processes and spherical harmonics. We have created a new open-source python package selectionfunctiontoolbox that implements this framework and used it to make three different estimates of the APOGEE DR16 red giant sample selection function, as a subset of 2MASS, with each estimate using an increasing amount of technical knowledge of the APOGEE targeting. In a companion paper, we applied our methodology to derive estimates of the astrometric and spectroscopic selection functions of Gaia EDR3. Our framework will make it trivial for astrophysicists to estimate the selection function that they should be using with the custom sample of stars that they have chosen to answer their scientific question.

79 ASTRONOMY AND ASTROPHYSICS↗

Emission line predictions for mock galaxy catalogues: a new differentiable and empirical mapping from DESI

ABSTRACT We present a simple, differentiable method for predicting emission line strengths from rest-frame optical continua using an empirically determined mapping. Extensive work has been done to develop mock galaxy catalogues that include robust predictions for galaxy photometry, but reliably predicting the strengths of emission lines has remained challenging. Our new mapping is a simple neural network implemented using the JAX Python automatic differentiation library. It is trained on Dark Energy Spectroscopic Instrument Early Release data to predict the equivalent widths (EWs) of the eight brightest optical emission lines (including H α, H β, [O ii], and [O iii]) from a galaxy’s rest-frame optical continuum. The predicted EW distributions are consistent with the observed ones when noise is accounted for, and we find Spearman’s rank correlation coefficient ρs > 0.87 between predictions and observations for most lines. Using a non-linear dimensionality reduction technique, we show that this is true for galaxies across the full range of observed spectral energy distributions. In addition, we find that adding measurement uncertainties to the predicted line strengths is essential for reproducing the distribution of observed line-ratios in the BPT diagram. Our trained network can easily be incorporated into a differentiable stellar population synthesis pipeline without hindering differentiability or scalability with GPUs. A synthetic catalogue generated with such a pipeline can be used to characterize and account for biases in the spectroscopic training sets used for training and calibration of photo-z’s, improving the modelling of systematic incompleteness for the Rubin Observatory LSST and other surveys.

79 ASTRONOMY AND ASTROPHYSICS↗

Structural complexity of snapshots of two-dimensional Fermi-Hubbard systems

The development of quantum gas microscopy for two-dimensional optical lattices has provided an unparalleled tool to study the Fermi-Hubbard model (FHM) with ultracold atoms. Spin-resolved projective measurements, or snapshots, have played a significant role in quantifying correlation functions, theory verification, and thus the uncovering of underlying physical phenomena such as antiferromagnetism at commensurate filling on bipartite lattices and other charge and spin correlations, as well as dynamical properties at various densities. Here we employ a recent concept, the multiscale structural complexity, and show that when computed for the snapshots (of single spin species, local moments, or total density) it can provide a theory-free property, immediately accessible to experiments. Specifically, after benchmarking results for Ising and $XY$ models, we study the structural complexity of snapshots of the repulsive FHM in the two-dimensional square lattice as a function of doping and temperature. We generate projective measurements using determinant quantum Monte Carlo and compare their complexities against those from the experiment. We demonstrate that these complexities are linked to relevant physical observables such as the entropy and double occupancy. Their behaviors capture the development of correlations and relevant length scales in the system. Furthermore, we provide an open-source code in python which can be implemented into data analysis routines in experimental settings for the square lattice.

75 CONDENSED MATTER PHYSICS, SUPERCONDUCTIVITY AND↗