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 307 records · Page 17

JSPEC: A Program for IBS and Electron Cooling Simulation

JSPEC (JLab Simulation Package on Electron Cooling) is an open-source C++ program developed at Jefferson Lab to simulate the evolution of the ion beam under the intrabeam scattering effect and/or the electron cooling effect. JSPEC includes various models of the ion beam, the electron beam, and the friction force, aiming to reflect the latest advances in the field and to provide a useful tool to the community. JSPEC has been benchmarked against other cooling simulation codes and experimental data. It has been used to support the cooler design for JLEIC, an earlier JLab design for the Electron-Ion Collider. A Python wrapper of the C++ code, pyJSPEC, for Python 3.x environment has also been developed and released. It allows users to run JSPEC simulations in a Python environment and makes it possible for JSPEC to collaborate with other accelerator and beam modeling programs, as well as plentiful Python tools in data visualization, optimization, machine learning, etc. In this report, we introduce the features of JSPEC, with a focus on the latest development, and demonstrate how to use JSPEC and pyJSPEC with sample codes and numerical examples.

Accelerator Physics↗

NPTFit: A Code Package for Non-Poissonian Template Fitting

We present NPTFit, an open-source code package, written in Python and Cython, for performing non-Poissonian template fits (NPTFs). The NPTF is a recently developed statistical procedure for characterizing the contribution of unresolved point sources (PSs) to astrophysical data sets. The NPTF was first applied to Fermi gamma-ray data to provide evidence that the excess of ∼GeV gamma-rays observed in the inner regions of the Milky Way likely arises from a population of sub-threshold point sources, and the NPTF has since found additional applications studying sub-threshold extragalactic sources at high Galactic latitudes. The NPTF generalizes traditional astrophysical template fits to allow for the ability to search for populations of unresolved PSs that may follow a given spatial distribution. NPTFit builds upon the framework of the fluctuation analyses developed in X-ray astronomy, thus it likely has applications beyond those demonstrated with gamma-ray data. The NPTFit package utilizes novel computational methods to perform the NPTF efficiently. The code is available at http://github.com/bsafdi/NPTFit and up-to-date and extensive documentation may be found at http://nptfit.readthedocs.io.

79 ASTRONOMY AND ASTROPHYSICS↗

ACTINN: automated identification of cell types in single cell RNA sequencing

Abstract Motivation Cell type identification is one of the major goals in single cell RNA sequencing (scRNA-seq). Current methods for assigning cell types typically involve the use of unsupervised clustering, the identification of signature genes in each cluster, followed by a manual lookup of these genes in the literature and databases to assign cell types. However, there are several limitations associated with these approaches, such as unwanted sources of variation that influence clustering and a lack of canonical markers for certain cell types. Here, we present ACTINN (Automated Cell Type Identification using Neural Networks), which employs a neural network with three hidden layers, trains on datasets with predefined cell types and predicts cell types for other datasets based on the trained parameters. Results We trained the neural network on a mouse cell type atlas (Tabula Muris Atlas) and a human immune cell dataset, and used it to predict cell types for mouse leukocytes, human PBMCs and human T cell sub types. The results showed that our neural network is fast and accurate, and should therefore be a useful tool to complement existing scRNA-seq pipelines. Availability and implementation The codes and datasets are available at https://figshare.com/articles/ACTINN/8967116. Tutorial is available at https://github.com/mafeiyang/ACTINN. All codes are implemented in python. Supplementary information Supplementary data are available at Bioinformatics online.

Ma, Feiyang (ORCID:0000000262600787)↗

ThunderBoltz API

The ThunderBoltz application programming interface (API) code is written in Python and is comprised of a set of tools to facilitate compilation of the ThunderBoltz code, as well as fast assembly and formatting of input files for the ThunderBoltz code, post-processing tools of ThunderBoltz results, plotting tools, and runs/schedules the ThunderBoltz code executable for calculations. The ThunderBoltz API code is utilized for importing and manipulating input cross section sets, input conditions, and any other simulation settings made available within the ThunderBoltz input deck via user-defined settings or via automatic generation. The API comes with a set of plotting capabilities of input cross sections, results from ThunderBoltz, and post-processed results carried out with the API.

Park, Ryan↗

An X-ray Intensity Operations Monitor (AXIOM) (Final LDRD Project Report)

The Saturn accelerator has historically lacked the capability to measure time-resolved spectra for its 3-ring bremsstrahlung x-ray source. This project aimed to create a spectrometer called AXIOM to provide this capability. The project had three major development pillars: hardware, simulation, and unfold code. The hardware consists of a ring of 24 detectors around an existing x-ray pinhole camera. The diagnostic was fielded on two shots at Saturn and over 100 shots at the TriMeV accelerator at Idaho Accelerator Center. A new Saturn x-ray environment simulation was created using measured data to validate. This simulation allows for timeresolved spectra computation to compare the experimental results. The AXIOM-Unfold code is a new parametric unfold code using modern global optimizers and uncertainty quantification. The code was written in Python, uses Gitlab version control and issue tracking, and has been developed with long term code support and maintenance in mind.

43 PARTICLE ACCELERATORS↗

Improved Verification and Validation Testing and Tools including Nuclear Criticality Safety Applications with the MCNP6.3® Code [Abstract]

A new Python-based framework has been developed to enable a more consistent layout with automatable setup, execution, and documentation of all verification and validation (V&V) test suites previously established for use with the MCNP code. In this paper, the new general framework for the V&V test suites is discussed, including information on all of the current capabilities and plans for future capabilities. For nuclear criticality safety applications, the existing V&V benchmark problems within the criticality, extended criticality, and analytic k-effective test suites have been ported into this new framework. In addition, the status and updates to the Rossi-alpha and subcritical multiplicationtest suites will be discussed. Some V&V results exercising new MCNP6.3 capabilities will be demonstrated.

97 MATHEMATICS AND COMPUTING↗

Final Report - PyVERAIn: An Open Source, Python-based CASL Preprocessing Platform for Reactor Geometry, Code Discretizations, and Parallel Domain Decompositions

The introduction of advanced modeling and simulation practices over the last several decades has proven to produce better products, more quickly, and at the reduced cost. This computational experimentation has enabled the design and development of a variety of innovative products by reducing the need to build expensive prototypes, and by allowing rapid, comprehensive design studies across a wide range of products. Despite these successes, there are significant barriers to widespread adoption of these tools. This project aims to address several of these barriers.

22 GENERAL STUDIES OF NUCLEAR REACTORS↗

Stata Hybrids: Updates and Ideas

At last year's Stata conference I presented two projects for using Python with Stata: a plugin that embeds the Python programming language within Stata and code for using Stata data sets in Python. In this talk I will describe some small improvements being made to these projects, and I will present other ideas for combining tools with Stata. Some of these ideas use Python, some use JavaScript and a web browser.

Fieldler, James↗

Conducted Susceptibility Data Adaptation Tool

The purpose of this research project is to help NASA scientists increase effectivity in testing by reducing the amount of time required for data conversion from initial measurements to the analysis stage. This project resulted in a data conversion tool developed in python using the openpyxl library. When lab personnel perform the Conducted Susceptibility 101 (CS101) and Conducted Susceptibility 02 (CS02) tests in the Semi-anechoic Electromagnetic Compatibility Test Facility at NASA Langley Research Center, the driving code produces a text file under the .DAT extension.The data must be manually converted the .DAT file into an Excel file line by line for data analysis.The Conducted Susceptibility Data Adaptation Tool (CSDAT) uses python code to convert the .DAT files to spreadsheets automatically which saves lab personnel time which they could use for faster analysis as well as prevents possible human error such as leaving out a line of data in the manual conversion process.

Gabriel Johnson↗

User’s Manual for Seal_Flux: A Seal Barrier Reduced-Order Model (Update)

This report provides a brief description on the use of the Seal_Flux computer program developed as part of the effort to quantify the risk of geologic storage of carbon dioxide (CO 2 ) under the U.S. Department of Energy’s (DOE) National Risk Assessment Partnership (NRAP). The Seal_Flux code simulates the flow of CO 2 through a low permeability rock horizon or seal formation overlying the storage reservoir into which CO 2 is injected. A two-phase, relative permeability approach with Darcy’s law is used for one-dimensional (1D) flow computations of CO 2 through the horizon in the vertical direction. The code also allows the simulation of time-dependent processes that can influence such flow. However, as part of its design, Seal_Flux is what can be termed a “reduced-order model” (ROM) and is not intended as a full-functioning flow code. The theory and simulation in the code is streamlined and directed towards the implementation of Monte Carlo risk analyses of CO 2 transport or as termed in this context as “leakage.” While presented in this report as a stand-alone tool, the Seal_Flux code is intended to function in the future as one of several models as part of an integrated, systems-level model of CO 2 storage performance. Finally, the code is written in Python 3.10 to provide an open framework for further development by others and to assist in linking the code with other modules in an integrated assessment model.

58 GEOSCIENCES↗

Fourier-Bessel Particle-In-Cell (FBPIC) v0.1.0

The Fourier-Bessel Particle-In-Cell code is a scientific simulation software for relativistic plasma physics. It is a Particle-In-Cell code whose distinctive feature is to use a spectral decomposition in cylindrical geometry. This decomposition allows to combine the advantages of spectral 3D Cartesian PIC codes (high accuracy and stability) and those of finite-difference cylindrical PIC codes with azimuthal decomposition (orders-of-magnitude speedup when compared to 3D simulations). The code is built on Python and can run both on CPU and GPU (the GPU runs being typically 1 or 2 orders of magnitude faster than the corresponding CPU runs.) The code has the exact same output format as the open-source PIC codes Warp and PIConGPU (openPMD format: openpmd.org) and has a very similar input format as Warp (Python script with many similarities). There is therefore tight interoperability between Warp and FBPIC, and this interoperability will increase even more in the future.

Lehe, Remi↗

VESIcal Part I: An open-source thermodynamic model engine for mixed volatile (H2O-CO2) solubility in silicate melts

Thermodynamics has been fundamental to the interpretation of geologic data and modeling of geologic systems for decades. However, more recent advancements in computational capabilities and a marked increase in researchers’ accessibility to computing tools has outpaced the functionality and extensibility of currently available modeling tools. Here we present VESIcal (Volatile Equilibria and Saturation Identification calculator): the first comprehensive modeling tool for H 2 O, CO 2 , and mixed (H 2 O-CO 2 ) solubility in silicate melts that: a) allows users access to seven commonly used models, plus easy inter-comparison between models; b) provides universal functionality for all models (e.g., functions for calculating saturation pressures, degassing paths, etc.); c) can process large datasets (1,000’s of samples) automatically; d) can output computed data into an excel spreadsheet for simple post-modeling analysis; e) integrates advanced plotting capabilities directly within the tool; and f) provides all of these within the framework of a python library, making the tool extensible by the user and allowing any of the model functions to be incorporated into any other code capable of calling python. The tool is presented within this manuscript, which is a Jupyter notebook containing worked examples accessible to python users with a range of skill levels. The basic functions of VESIcal can also be access via a web app (https://vesical.anvil.app). The VESIcal python library is open-source and available for download at https://github.com/kaylai/VESIcal.

K. Iacovino↗

Large language model evaluation for high–performance computing software development

We apply AI-assisted large language model (LLM) capabilities of GPT-3 targeting high-performance computing (HPC) kernels for (i) code generation, and (ii) auto-parallelization of serial code in C ++, Fortran, Python and Julia. Our scope includes the following fundamental numerical kernels: AXPY, GEMV, GEMM, SpMV, Jacobi Stencil, and CG, and language/programming models: (1) C++ (e.g., OpenMP [including offload], OpenACC, Kokkos, SyCL, CUDA, and HIP), (2) Fortran (e.g., OpenMP [including offload] and OpenACC), (3) Python (e.g., numpy, Numba, cuPy, and pyCUDA), and (4) Julia (e.g., Threads, CUDA.jl, AMDGPU.jl, and KernelAbstractions.jl). Kernel implementations are generated using GitHub Copilot capabilities powered by the GPT-based OpenAI Codex available in Visual Studio Code given simple + + prompt variants. To quantify and compare the generated results, we propose a proficiency metric around the initial 10 suggestions given for each prompt. For auto-parallelization, we use ChatGPT interactively giving simple prompts as in a dialogue with another human including simple “prompt engineering” follow ups. Results suggest that correct outputs for C++ correlate with the adoption and maturity of programming models. For example, OpenMP and CUDA score really high, whereas HIP is still lacking. We found that prompts from either a targeted language such as Fortran or the more general-purpose Python can benefit from adding language keywords, while Julia prompts perform acceptably well for its Threads and CUDA.jl programming models. Finally, we expect to provide an initial quantifiable point of reference for code generation in each programming model using a state-of-the-art LLM. Overall, understanding the convergence of LLMs, AI, and HPC is crucial due to its rapidly evolving nature and how it is redefining human-computer interactions.

97 MATHEMATICS AND COMPUTING↗

ENDFtk: A robust tool for reading and writing ENDF-formatted nuclear data

ENDFtk is a recently developed C++ and Python interface to interact with ENDF-6 formatted nuclear data files. It provides a robust and complete interface, allowing the reading and writing of all formats currently part of the ENDF-6 formats manual, as well as some non-ENDF formats used by the NJOY processing code. It provides an interface that mimics the names in the ENDF-6 formats manual as well as an equivalent interface using human-readable attribute names. It is robust and powerful enogh for nuclear data experts to develop complex applications, while also simple enough to be used non-experts to retrieve and manipulate evaluated nuclear data. ENDFtk offers the ability to easily interrogate and manipulate data either in large-scale code projects or in simple Python scripts. Here, in this paper, a brief overview of the interface is given, as well as more substantial examples demonstrating plotting simple data, interacting with more complex data, and writing new data to files. ENDFtk is open source and available for download via GitHub (https://github.com/njoy/ENDFtk).

97 MATHEMATICS AND COMPUTING↗

Rigorous Two-Step Activation for Fusion Systems with PyNE - Paper 127

In fusion systems, high energy neutrons activate system components. After shutdown, the biological dose rate from photons emitted from these components must be estimated as a function of position and time for maintenance planning. High resolution results can be obtained using the mesh-based Rigorous Two-Step (R2S) method. A neutron transport simulation provides mesh-based neutron fluxes. Using these fluxes and an appropriate irradiation scenario, a nuclear inventory analysis code is used to determine the photon source density within each mesh volume element at any decay time after shutdown. The photon source density mesh is used as a source for photon transport. Photon fluxes are tallied at positions of interest and flux-to-dose rate conversion factors are used to estimate the biological dose rate. Previous work by the authors involved the creation of R2S-ACT, an open source R2S workflow, using the Direct Accelerated Geometry Monte Carlo (DAGMC) version of MCNP5 (DAG-MCNP5) for both transport steps and the ALARA nuclear inventory analysis code. Various use cases may require different combinations of transport and activation codes, and nearly all of the capabilities of R2S-ACT have broader utility. For these reasons, the individual components of R2S-ACT were reimplemented within PyNE. PyNE is a collaborative, trans-institutional, open source project consisting of Python, Cython, and C++ code pertinent to nuclear simulations and analysis. This work involved additions to the PyNE mcnp, mesh, material, alara, dagmc, and sampling modules. A lightweight r2s module was then added to connect the code from these modules. The r2s and sampling modules, together with DAG-MCNP5 and ALARA form a complete R2S workflow for obtaining shutdown dose rate results. Mesh operations, geometry discretization, physics code input/output parsing, and mesh-based source sampling capabilities have been added to PyNE generically, eliminating the need to duplicate this effort across multiple applications. The PyNE r2s module uses these capabilities to couple MCNP and ALARA to form an R2S workflow, which has been validated with the FNG shutdown dose rate benchmark. Future work will involve benchmarking the workflow using tetrahedral mesh and also non-analog sampling options. added so that they can be used interchangeably. This will allow for comparisons between results obtained by different physics codes with minimal human effort. Work will also be done to create and implement an importance sampling method for biasing neutron transport towards regions of phase space of high importance to photon dose rate tallies. This will improve the efficiency of obtaining shutdown dose rate results in large, highly-attenuating geometries. (authors)

61 RADIATION PROTECTION AND DOSIMETRY↗

Parallel Fenics Implementation of Block Solvers (pFibs)

This software is a Python package designed to act as an interface between FEniCS and PETSc to facilitate the construction and application of parallel block solvers/preconditioners. The original intent of this software was to help enable Battery and Wind Farm simulations for use on high performance computing systems. The code is written in Python and uses the petsc4py module to access the more advance features of the PETSc Krylov Solver. In essence, pFibs is an interface to make accessing these features more streamlined. Additionally, pFibs also provides a template for building custom Python based preconditioning algorithms.

Allen, Jeffery↗

ExactPack Documentation

For code verification, one compares the code output against known exact solutions. There are many standard test problems used in this capacity, such as the Noh and Sedov problems. ExactPack is a utility that integrates many of these exact solution codes into a common API (application program interface), and can be used as a stand-alone code or as a python package. ExactPack consists of python driver scripts that access a library of exact solutions written in Fortran or Python. The spatial profiles of the relevant physical quantities, such as the density, fluid velocity, sound speed, or internal energy, are returned at a time specified by the user. The solution profiles can be viewed and examined by a command line interface or a graphical user interface, and a number of analysis tools and unit tests are also provided. We have documented the physics of each problem in the solution library, and provided complete documentation on how to extend the library to include additional exact solutions. ExactPack’s code architecture makes it easy to extend the solution-code library to include additional exact solutions in a robust, reliable, and maintainable manner.

97 MATHEMATICS AND COMPUTING↗

Python/Lua Benchmarks

This is an adaptation of the pre-existing Scimark benchmark code to a variety of Python and Lua implementations. It also measures performance of the Fparser expression parser and C and C++ code on a variety of simple scientific expressions.

Busby, L.↗