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 1,027 records · Page 57

Automatic Fortran to C++ conversion with FABLE

In scientific computing, Fortran was the dominant implementation language throughout most of the second part of the 20th century. The many tools accumulated during this time have been difficult to integrate with modern software, which is now dominated by object-oriented languages. Driven by the requirements of a large-scale scientific software project, we have developed a Fortran to C++ source-to-source conversion tool named FABLE. This enables the continued development of new methods even while switching languages. We report the application of FABLE in three major projects and present detailed comparisons of Fortran and C++ runtime performances. Our experience suggests that most Fortran 77 codes can be converted with an effort that is minor (measured in days) compared to the original development time (often measured in years). With FABLE it is possible to reuse and evolve legacy work in modern object-oriented environments, in a portable and maintainable way. FABLE is available under a nonrestrictive open source license. In FABLE the analysis of the Fortran sources is separated from the generation of the C++ sources. Therefore parts of FABLE could be reused for other target languages.

59 BASIC BIOLOGICAL SCIENCES↗

LANL12-RS-107J PYTHON Radiography Analysis Tool (PyRAT). Mid-Year Deliverable Report for FY15

This document is a mid-year report on a deliverable for the PYTHON Radiography Analysis Tool (PyRAT) for project LANL12-RS-107J in FY15. The deliverable is deliverable number 2 in the work package and is titled “Add the ability to read in more types of image file formats in PyRAT”. Right now PyRAT can only read in uncompressed TIF files (tiff files). It is planned to expand the file formats that can be read by PyRAT, making it easier to use in more situations. A summary of the file formats added include jpeg, jpg, png and formatted ASCII files.

97 MATHEMATICS AND COMPUTING↗

torch-einshard v1.0

torch-einshard is a Python library for describing local and distributed PyTorch tensor computations with compact, einsum-like notation. Its expressions name logical axes, specify how they are sharded across a PyTorch DeviceMesh, and represent partial reductions. The library automatically performs contractions, permutations, reshaping, splitting, gathering, reduction, reduce-scatter, and repartitioning while preserving autograd. Additional features include sharding-aware FFTs, tensor rolls, halo exchange, sliding windows, 1D–3D convolutions, uneven-shard handling, parameter initialization and gradient management, and cost-based execution planning. It is designed for scientific machine learning and large-model workloads, including tensor-, sequence-, and spatial-parallel MLPs, attention, convolutions, and spectral operations. Compared with manually combining torch.einsum and distributed collectives, torch-einshard expresses both the mathematical operation and data placement in one readable formula. This reduces boilerplate and synchronization errors, keeps forward and backward communication consistent, and allows the library to select optimized collective strategies without changing model code.

Morozov, Dmitriy [Lawrence Berkeley National Labor↗

ATDM ASD report for ECP October 2018

In October the team merged in updated ATDM/Trilinos configuration to include SPARC requirements. Assisted and worked on issues identified by the EMPIRE switchover to the ATDM/Trilinos configuration. Progress was made on automating dashboard triaging. Discovered and began addressing issues with mixed language calling with gcc-7.2 on Power8. Worked on new Python tool to filter CDASH reports to only show new issues. Completed ECP ST review. In October the team put an algorithm in place to prevent inverted elements in SPARC during refinement and worked on tests to morph mesher and should be ready for SGM integration soon. The team worked on solver rebalance and corrected issues. Complete SIMD work. Worked out next steps for solver improvements for EMPIRE. Adjusted some solver settings and to improve performance; strong scaling curves are flat instead of ascending etc. Worked on optimizing kernels for SPARC. Completed ECP ST reviews. The team worked on cleaning up branch for merge into SPARC master dev branch. Progress was made building scripts for catalyst builds on all HPC platforms of interest. Worked on adding TuckerMPl reader as plugin for catalyst. Completed ECP project review. Work has continued on NimbleSM, which now runs in a container and can be used modularly with an MPI code. The team also made progress on a qthreads version of NibleSM. Worked on build system issues within NimbleSM and Sierra for GPUs. Progressed on getting kookfied material models in NimbleSM. The team incorporated panel feedback form ECP project reviews into FY19 plans.

97 MATHEMATICS AND COMPUTING↗

CLMM : a LSST-DESC cluster weak lensing mass modeling library for cosmology

ABSTRACT We present the v1.0 release of CLMM, an open source python library for the estimation of the weak lensing masses of clusters of galaxies. CLMM is designed as a stand-alone toolkit of building blocks to enable end-to-end analysis pipeline validation for upcoming cluster cosmology analyses such as the ones that will be performed by the Vera C. Rubin Legacy Survey of Space and Time-Dark Energy Science Collaboration (LSST-DESC). Its purpose is to serve as a flexible, easy-to-install, and easy-to-use interface for both weak lensing simulators and observers and can be applied to real and mock data to study the systematics affecting weak lensing mass reconstruction. At the core of CLMM are routines to model the weak lensing shear signal given the underlying mass distribution of galaxy clusters and a set of data operations to prepare the corresponding data vectors. The theoretical predictions rely on existing software, used as backends in the code, that have been thoroughly tested and cross-checked. Combined theoretical predictions and data can be used to constrain the mass distribution of galaxy clusters as demonstrated in a suite of example Jupyter Notebooks shipped with the software and also available in the extensive online documentation.

79 ASTRONOMY AND ASTROPHYSICS↗

HydroEcoLSTM: A Python package with graphical user interface for hydro-ecological modeling with long short-term memory neural network

Machine learning (ML) is emerging as a promising tool for modeling hydro-ecological processes due to the increasing availability of large environmental data. However, the use of ML requires sufficient programming knowledge due to a lack of a graphical user interface (GUI). In this study, we introduced a GUI package, named HydroEcoLSTM, with the long short-term memory network (LSTM) as the core model, that allows non-ML experts to utilize their domain knowledge to construct complex ML models. We demonstrated the functionalities of HydroEcoLSTM with two practical examples, including (1) predictions of streamflow in both gauged and ungauged catchments and (2) predictions of multiple outputs (i.e., streamflow and isotope transport from two catchments). The simulation results obtained in both case experiments are satisfactory. In the first example, the average Nash–Sutcliffe Efficiency (NSE) for streamflow simulation during the testing period is 0.79 while the application of the trained model in two assumed ungauged catchments also achieves the average NSE of 0.68. In the second example, the average NSE for streamflow and instream isotope simulation during the testing period is 0.71. Ultimately, applications of HydroEcoLSTM with real-world examples demonstrate its potential use for practical applications and research without requiring extensive coding skills.

54 ENVIRONMENTAL SCIENCES↗

Two-Scale 13 C Metabolic Flux Analysis for Metabolic Engineering

Accelerating the Design-Build-Test-Learn (DBTL) cycle in synthetic biology is critical to achieving rapid and facile bioengineering of organisms for the production of, e.g., biofuels and other chemicals. The Learn phase involves using data obtained from the Test phase to inform the next Design phase. As part of the Learn phase, mathematical models of metabolic fluxes give a mechanistic level of comprehension to cellular metabolism, isolating the principle drivers of metabolic behavior from the peripheral ones, and directing future experimental designs and engineering methodologies. Furthermore, the measurement of intracellular metabolic fluxes is specifically noteworthy as providing a rapid and easy-to-understand picture of how carbon and energy flow throughout the cell. Here, we present a detailed guide to performing metabolic flux analysis in the Learn phase of the DBTL cycle, where we show how one can take the isotope labeling data from a 13 C labeling experiment and immediately turn it into a determination of cellular fluxes that points in the direction of genetic engineering strategies that will advance the metabolic engineering process.For our modeling purposes we use the Joint BioEnergy Institute (JBEI) Quantitative Metabolic Modeling (jQMM) library, which provides an open-source, python-based framework for modeling internal metabolic fluxes and making actionable predictions on how to modify cellular metabolism for specific bioengineering goals. It presents a complete toolbox for performing different types of flux analysis such as Flux Balance Analysis, 13 C Metabolic Flux Analysis, and it introduces the capability to use 13 C labeling experimental data to constrain comprehensive genome-scale models through a technique called two-scale 13 C Metabolic Flux Analysis (2S- 13 C MFA) [1]. In addition to several other capabilities, the jQMM is also able to predict the effects of knockouts using the MoMA and ROOM methodologies. The use of the jQMM library is illustrated through a step-by-step demonstration, which is also contained in a digital Jupyter Notebook format that enhances reproducibility and provides the capability to be adopted to the user's specific needs. As an open-source software project, users can modify and extend the code base and make improvements at will, providing a base for future modeling efforts.

13C Metabolic flux analysis↗

NEW TECHNIQUES FOR HIGH-CONTRAST IMAGING WITH ADI: THE ACORNS-ADI SEEDS DATA REDUCTION PIPELINE

We describe Algorithms for Calibration, Optimized Registration, and Nulling the Star in Angular Differential Imaging (ACORNS-ADI), a new, parallelized software package to reduce high-contrast imaging data, and its application to data from the SEEDS survey. We implement several new algorithms, including a method to register saturated images, a trimmed mean for combining an image sequence that reduces noise by up to {approx}20%, and a robust and computationally fast method to compute the sensitivity of a high-contrast observation everywhere on the field of view without introducing artificial sources. We also include a description of image processing steps to remove electronic artifacts specific to Hawaii2-RG detectors like the one used for SEEDS, and a detailed analysis of the Locally Optimized Combination of Images (LOCI) algorithm commonly used to reduce high-contrast imaging data. ACORNS-ADI is written in python. It is efficient and open-source, and includes several optional features which may improve performance on data from other instruments. ACORNS-ADI requires minimal modification to reduce data from instruments other than HiCIAO. It is freely available for download at www.github.com/t-brandt/acorns-adi under a Berkeley Software Distribution (BSD) license.

79 ASTRONOMY AND ASTROPHYSICS↗

DSPS: Differentiable stellar population synthesis

ABSTRACT Models of stellar population synthesis (SPS) are the fundamental tool that relates the physical properties of a galaxy to its spectral energy distribution (SED). In this paper, we present DSPS: a python package for SPS. All of the functionality in DSPS is implemented natively in the JAX library for automatic differentiation, and so our predictions for galaxy photometry are fully differentiable, and directly inherit the performance benefits of JAX, including portability onto GPUs. DSPS also implements several novel features, such as i) a flexible empirical model for stellar metallicity that incorporates correlations with stellar age, ii) support for the Diffstar model that provides a physically-motivated connection between the star formation history of a galaxy (SFH) and the mass assembly of its underlying dark matter halo. We detail a set of theoretical techniques for using autodiff to calculate gradients of predictions for galaxy SEDs with respect to SPS parameters that control a range of physical effects, including SFH, stellar metallicity, nebular emission, and dust attenuation. When forward modelling the colours of a synthetic galaxy population, we find that DSPS can provide a factor of 5 speed-up over standard SPS codes on a CPU, and a factor of 300-400 on a modern GPU. When coupled with gradient-based techniques for optimization and inference, DSPS makes it practical to conduct expansive likelihood analyses of simulation-based models of the galaxy–halo connection that fully forward model galaxy spectra and photometry.

79 ASTRONOMY AND ASTROPHYSICS↗

Machine learning framework for predicting uranium enrichments from M400 CZT gamma spectra

A machine learning framework was developed for predicting uranium enrichments from M400 CZT gamma spectra. This framework leverages the availability of a large amount of measured M400 gamma spectra and uses a recently updated version of Gamma Detector Response and Analysis Software (GADRAS) for gamma spectrum analysis and generation. It also leverages the existing machine learning modules in Python for gamma spectrum data processing, curation, model training, benchmarking, and optimization of the deep machine learning models. The framework is used to develop a deep learning model to analyze gamma spectra from a set of U 3 O 8 samples with enrichments ranging from 0.31 to 93.17% and UF 6 cylinders with enrichments ranging from 0.2 to 4.95%, and the model performance is tested using a set of measured spectra and the respective declared enrichment values. Results show that the model can correctly classify 99.35% of the U 3 O 8 sample enrichments, and can predict the samples’ enrichments within an average absolute error of 0.099% (in percentage points of enrichment). For the UF 6 cylinders, the average absolute error was approximately 0.03%, with an accuracy of 98% in classifying discrete enrichment values of UF 6 samples. Finally, the results also show that the model has performed significantly better in terms of predicting enrichments in UF 6 cylinders based on measured gamma spectra than the GEM code, with a standard deviation (of the relative errors) of 2.23% (compared with the 11.51% value for the GEM code) based on results from a set of test data.

46 INSTRUMENTATION RELATED TO NUCLEAR SCIENCE AND ↗

CROCUS Optical All Precipitation Gauge Data at Argonne National Laboratory Prairie Site

The APG (Optical Scientific Inc. All-Precipitation Gauge 815-DS) dataset contains one-minute measurements of precipitation rate, precipitation accumulation, air temperature, and present weather detection, both in 4680 format and decoded. Data were collected at the Argonne Testbed for Multiscale Observational Science (ATMOS), a 20-acre prairie site at Argonne National Laboratory in Lemont, Illinois. The data is presented as daily NetCDF (.nc) files, each containing approximately 24 hours of observations. Files follow the naming convention of: the project (CROCUS), location (atmos), instrument name (apg), data level (raw, a1), and date (year, month, day). The NetCDF format can be accessed using common scientific software such as Python using xarray, netCDF4 or act-doe.

54 ENVIRONMENTAL SCIENCES↗

statusMessageReporting

Unlike computer languages like C++ which has throw/catch, Python which has try/except and other newer computer languages, C has no built-in mechanism for handling exceptions (e.g., memory allocate failure or a divide by zero exceptions). While simple exception handling in the form of an integer parameter (e.g, errno) or an enum are often implemented in C programs, the richer types of exception reporting possible with newer computer languages are rarely implemented in C. The statusMessageReporting package was created to facilitate rich exception reporting by C functions to their calling functions. The statusMessageReporting (smr) package allows a function, called the generator, to communicate an exception to its calling function using a statusMessageReporting report. The main parts of a report are: 1)the level of the report called the status (valid levels are smr_status_Ok, smr_status_Info, smr_statusWarning and smr_status_Error) 2) a string called the report's message and 3) two integer values, one representing the generator's ID, called the libraryID, and the other is the library's specific integer, called the code, that represents the type of exception the generator is reporting. The code is similar to the errno for the C standard library. Since libraries are often developed independent of one another, they often use the same code values to represent different exceptions (e.g., one library may define the code 3 to be an error opening a file while another library may define the code 3 to be a divide-by-zero error) which is why the libraryID is needed. That is, the equivalent of errno is the combination libraryID:code. To insure that each library's libraryID is unique, libraryIDs must be obtained from the function smr_registerLibrary.

Beck, Bret↗

IK-Frag: Frag data generator for the PHITS simulation with the inverse kinematic reaction producing a focused neutron beam

IK-Frag has been developed for the creation of the nuclear cross-section data format, which is named frag data and can be used in PHITS, a Monte Carlo simulation code. IK-Frag focuses on the inverse kinematic reactions between a lithium or beryllium ion and a proton target. These reactions achieve naturally collimated neutrons and potentially reduce the necessity of radiation shielding. IK-Frag enables PHITS users to conduct simulations for the inverse kinematic reactions. The present software aims to contribute to future development of the neutron source system using the inverse kinematic reactions.

43 PARTICLE ACCELERATORS↗

Data and code from: Multivariate bayesian regression model for predicting disposed ash composition at U.S. coal fired power stations

This dataset contains the code and data files needed for implementation of a Multivariate Bayesian Regression model, described in Jin et al. (2025), for the historical prediction of the chemical composition of disposed coal ash at U.S. coal fired power plants as a function of annualized coal purchase data. The integrated coal supply data file (CoalSupplyDataset.csv) represents a compilation of monthly fuel purchase records for the period 1973-2022 at major U.S. power stations. These records were obtained from the U.S. Energy Information Administration. The CSV file also contains, for each coal purchase record, the coal region of the mine as defined by the U.S. Geological Survey. Data entry errors and data gaps in the EIA records were corrected as described in Jin et al. This CSV file represents the integrated coal supply data after corrections were made. The model structure and fitting parameters are encoded in pickle file format (Bayesian.pkl). The model was developed with the coal supply data and coal ash composition data, apportioned according to the Stratified Shuffle Split for training and testing subsets. The model was built using Python and the PyMC library. Reference Publication: Jin, Z.; Huang, J.; Hower, J.C.; Hsu-Kim, H.(2025). Predictive Assessment of the Chemical Composition of Coal Ash in Reserve at U.S. Disposal Sites. Environmental Science & Technology.

Coal ash composition↗

Easy, Scalable Subsetting of GEDI Point Clouds

The GEDI Subsetter, a Python tool developed for NASA’s Multi-mission Algorithm and Analysis Platform (MAAP), optimizes the accessibility and visualization of GEDI point clouds by enabling users to efficiently subset data in a convenient, scalable manner. Complex science data often requires users to learn new software skills and handle many large files. Handling and cleaning large data sets is tedious and error-prone. These challenges significantly impede analysis. One of the goals of NASA's MAAP is to provide a platform that lowers the barrier to conducting research and analysis at scale. When a group of MAAP users wanted to conduct above-ground biomass estimation using GEDI data, we found that their existing workflow for leveraging GEDI data suffered from the barriers mentioned above. Furthermore, their workflow did not scale easily beyond a small number of granules. We found that existing tools related to GEDI data retrieval and subsetting were too limiting, so the GEDI Subsetter was written to support MAAP users’ needs. Being able to run many subsetting jobs simultaneously in the MAAP, and parallelizing the code itself, has led to significant speed improvements in obtaining relevant data, reducing subsetting time from hours to minutes. MAAP users can now more quickly and easily obtain only the data relevant to their research, by choosing which GEDI collection they want to work with (L1A, L2A, L2B, or L4A), and how they want to subset it, by specifying an area of interest, a temporal range, and relevant attributes. This has significantly reduced the feedback loop for users, allowing them to much more quickly subset GEDI data and begin their analysis. Although the GEDI Subsetter originally targeted users of the MAAP, it is generalized such that it can also be used outside of the MAAP and includes a command-line interface for convenience. Furthermore, with minor modifications, it should be possible to use it with non-GEDI data as the general pattern should be applicable to other sparse/track-based sensors.

Charles Daniels↗

TH-D-BRB-04: Pinnacle Scripting: Improving Efficiency While Maintaining Safety

Scripting capabilities and application programming interfaces (APIs) are becoming commonly available in modern treatment planning systems. These links to the treatment planning system (TPS) allow users to read data from the TPS, and in some cases use TPS functionality and write data back to the TPS. Such tools are powerful extensions, allowing automation of routine clinical tasks and supporting research, particularly research involving repetitive tasks on large patient populations. The data and functionality exposed by scripting/API capabilities is vendor dependent, as are the languages used by script/API engines, such as the Microsoft .NET framework or Python. Scripts deployed in a clinical environment must be commissioned and validated like any other software tool. This session will provide an overview of scripting applications and a discussion of best practices, followed by a practical introduction to the scripting capabilities of three commercial treatment planning systems. Learning Objectives: Understand the scripting capabilities available in several treatment planning systems Learn how to get started using scripting capabilities Understand the best practices for safe script deployment in a clinical environment R. Popple, Varian Medical Systems has provided research support unrelated to the topic of this session.R. Cardan, Varian Medical Systems for grant research, product evaluation, and teaching honorarium.

60 APPLIED LIFE SCIENCES↗

DEFT: a program for operators in EFT

We describe a Python-based computer program, DEFT, for manipulating operators in effective field theories (EFTs). In its current incarnation, DEFT can be applied to 4-dimensional, Poincaré invariant theories with gauge group SU(3)×SU(2)×U(1), such as the Standard Model (SM), but a variety of extensions (e.g. to lower dimensions or to an arbitrary product of unitary gauge groups) are conceptually straightforward. Amongst other features, the program is able to: (i) check whether an input list of Lagrangian operators (of a given dimension in the EFT expansion) is a basis for the space of operators contributing to S-matrix elements, once redundancies (such as Fierz-Pauli identities, integration by parts, and equations of motion) are taken into account; (ii) generate such a basis (where possible) from an input algorithm; (iii) carry out a change of basis. We describe applications to the SM (where we carry out a number of non-trivial cross-checks) and extensions thereof, and outline how the program may be of use in precision tests of the SM and in the ongoing search for new physics at the LHC and elsewhere. The code and instructions can be downloaded from http://web.physics.ucsb.edu/~dwsuth/DEFT/.

72 PHYSICS OF ELEMENTARY PARTICLES AND FIELDS↗

microMS: A Python Platform for Image-Guided Mass Spectrometry Profiling

Image-guided mass spectrometry (MS) profiling provides a facile framework for analyzing samples ranging from single cells to tissue sections. The fundamental workflow utilizes a whole-slide microscopy image to select targets of interest, determine their spatial locations, and subsequently perform MS analysis at those locations. Improving upon prior reported methodology, a software package was developed for working with microscopy images. microMS, for microscopy-guided mass spectrometry, allows the user to select and profile diverse samples using a variety of target patterns and mass analyzers. Written in Python, the program provides an intuitive graphical user interface to simplify image-guided MS for novice users. The class hierarchy of instrument interactions permits integration of new MS systems while retaining the feature-rich image analysis framework. microMS is a versatile platform for performing targeted profiling experiments using a series of mass spectrometers. The flexibility in mass analyzers greatly simplifies serial analyses of the same targets by different instruments. The current capabilities of microMS are presented, and its application for off-line analysis of single cells on three distinct instruments is demonstrated. The software has been made freely available for research purposes. .

46 INSTRUMENTATION RELATED TO NUCLEAR SCIENCE AND ↗