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 55 records · Page 3

Modelica Buildings Library Extension for AC and DC Building Comparison (Modelica DC Buildings) v1

This software simulates and compares the losses in AC and DC buildings. It uses formatted load profile data from EnergyPlus, PV generation data from PVWatts, realistic converter efficiency curves based on product data, a battery controller based on excess PV, and a realistic wire model. The software includes Modelica code, which is an extension of the Buildings Library Electrical models. It also includes Python code, which manages the Modelica parametric simulations and plots results.

Gerber, Daniel↗

Explainable Machine Learning for Functional Data

Black-box machine learning models are recognized as useful tools for prediction applications, but the algorithmic complexity of some models causes interpretation challenges. Explainability methods have been proposed to provide insight into these models, but there is little research focused on supervised modeling with functional data inputs. We argue that, especially in applications of high consequence, it is important to explicitly model the functional dependence in a black-box analysis to not obscure or misrepresent patterns in explanations. As such, we propose the V ariable importance E xplainable E lastic S hape A nalysis (VEESA) pipeline for training supervised machine learning models with functional inputs. The pipeline is an analysis process that includes the data preprocessing, modeling, and post-hoc explanations. The preprocessing is done using elastic functional principal components analysis, which accounts for vertical and horizontal variability in functional data and, ultimately, allows for explanations in the original data space that identify the important functional variability without bias due to correlated variables. Here, we demonstrate the pipeline on two high-consequence applications: explosives classification for national security and inkjet printer identification in forensic science. The applications exhibit the VEESA pipeline’s ability to provide an understanding of the characteristics of the functional data useful for prediction. Code for implementing the pipeline is available in the veesa R package (and supplemental python code).

Elastic Shape Analysis↗

tonalli : an asexual genetic code to characterize APOGEE-2 stellar spectra. I. Validation with synthetic and solar spectra

ABSTRACT We present tonalli, a spectroscopic analysis python code that efficiently predicts effective temperature, stellar surface gravity, metallicity, $\alpha$-element abundance, and rotational and radial velocities for stars with effective temperatures between 3200 and 6250 K, observed with the Apache Point Observatory Galactic Evolution Experiment 2 (APOGEE-2). tonalli implements an asexual genetic algorithm to optimize the finding of the best comparison between a target spectrum and the continuum-normalized synthetic spectra library from the Model Atmospheres with a Radiative and Convective Scheme (MARCS), which is interpolated in each generation. Using simulated observed spectra and the APOGEE-2 solar spectrum of Vesta, we study the performance, limitations, accuracy, and precision of our tool. Finally, a Monte Carlo realization was implemented to estimate the uncertainties of each derived stellar parameter.

Adame, Lucía (ORCID:0000000263286099)↗

Amazon windthrow disturbances are likely to increase with storm frequency under global warming: Data and Codes

This zipfile includes datasets and codes that were used to produce the results in the paper entitled Amazon windthrow disturbances are likely to increase with storm frequency under global warming. Datasets include: 1. Windthrow density across the entire Amazon - GIS shapefile format 2. Current ERA 5 mean afternoon convective available potential energy (CAPE) (1990-2019) - Remote Sensing TIFF format 3. Estimated future mean CAPE from 10 models in CMIP 6 (2070-2099) - Remote Sensing TIFF format 4. Python codes in jupyter notebook and processed datasets used to generate Fig.2a and Table 1 in the paper. You will need to use Jupyter Notebook and Python for accessing and reading the codes. Please contact Yanlei Feng (ylfeng@berkeley.edu) for any questions. Paper associated with this dataset: Feng, Y., Negrón-Juárez, R.I., Romps, D.M. and Chambers, J.Q., 2023. Amazon windthrow disturbances are likely to increase with storm frequency under global warming. Nature communications, 14(1), p.101.

54 ENVIRONMENTAL SCIENCES↗

Correcting for telluric absorption: Methods, case studies, and release of the TelFit code

Ground-based astronomical spectra are contaminated by the Earth's atmosphere to varying degrees in all spectral regions. We present a Python code that can accurately fit a model to the telluric absorption spectrum present in astronomical data, with residuals of ∼3%-5% of the continuum for moderately strong lines. We demonstrate the quality of the correction by fitting the telluric spectrum in a nearly featureless A0V star, HIP 20264, as well as to a series of dwarf M star spectra near the 819 nm sodium doublet. We directly compare the results to an empirical telluric correction of HIP 20264 and find that our model-fitting procedure is at least as good and sometimes more accurate. The telluric correction code, which we make freely available to the astronomical community, can be used as a replacement for telluric standard star observations for many purposes.

79 ASTRONOMY AND ASTROPHYSICS↗

Machine learning results and code

Results for all the Four MLP-NN, RF, XGBR, and RF algorithms for each of geophysical array`s and machine learning python code is provided.

58 GEOSCIENCES↗

Integration of scanning probe microscope with high-performance computing: Fixed-policy and reward-driven workflows implementation

The rapid development of computation power and machine learning algorithms has paved the way for automating scientific discovery with a scanning probe microscope (SPM). The key elements toward operationalization of the automated SPM are the interface to enable SPM control from Python codes, availability of high computing power, and development of workflows for scientific discovery. Here, we build a Python interface library that enables controlling an SPM from either a local computer or a remote high-performance computer, which satisfies the high computation power need of machine learning algorithms in autonomous workflows. We further introduce a general platform to abstract the operations of SPM in scientific discovery into fixed-policy or reward-driven workflows. Furthermore, our work provides a full infrastructure to build automated SPM workflows for both routine operations and autonomous scientific discovery with machine learning.

47 OTHER INSTRUMENTATION↗

Probabilistic Analysis of Uncertainty in ATRC Flux Profiles

ATRC is a replica of the larger ATR design and is used to conduct research and obtain data such as flux measurements, excess reactivity, and loading requirements before being loaded into ATR. One method for determining the impact an experiment will have at ATR is by looking at the axial flux profile along the fuel rod in the corresponding ATRC experiment; however, flux wand measurements includes large amounts of variation which makes drawing conclusions from the data difficult. This poster describes a definitive method to propagate the uncertainty from ATRC measurements using Python code.

21 SPECIFIC NUCLEAR REACTORS AND ASSOCIATED PLANTS↗

Data Files for Runoff Evaluation in an Earth System Land Model for Permafrost Regions

Modeling of hydrological runoff is essential for accurately capturing spatiotemporal feedbacks within the land–atmosphere system, particularly in sensitive regions such as permafrost landscapes. However, substantial uncertainties persist in the terrestrial runoff parameterization schemes used in Earth system and land surface models. This is particularly true in permafrost regions, where landscape heterogeneity is high and reliable observational data are scarce.This data set includes all files that were produced and applied in the paper Runoff Evaluation in an Earth System Land Model for Permafrost Regions [Xiang et al. in review]. The paper is in review as of July 1 2025 in Geoscientific Model Development (GMD). In this study, we evaluate the performance of runoff parameterization schemes in the Energy Exascale Earth System Model (E3SM) land model (ELM). Our proposed framework leverages simulation results from the Advanced Terrestrial Simulator (ATS), which is a physics-rich integrated surface/subsurface hydrologic model that has been successfully evaluated previously in Arctic tundra regions. We used ATS to simulate runoff from 22 representative hillslopes in the Sagavanirktok River basin, located on the North Slope of Alaska, then compared the output with ELM’s parameterized representation of total runoff. This dataset contains 2 figure image files (*.png, *jpg) that describe the study site and methods, as well as folders (Figure*.zip) that contain the associated data files (*.csv, *.dat) and python code notebooks (*.ipynb) for figures 3-7 in the paper. Jupyter notebook (*.ipynb) files that produce the figure files using the associated data files will run within a python environment configured with Jupyter Lab or Notebook packages.

54 ENVIRONMENTAL SCIENCES↗

Saloon

Saloon is a Vim plugin that simplifies Python code linter / fixer configuration and usage. Saloon's menu lets developers toggle which static analysis tools to use and delegates those changes to ALE's (Asynchronous Lint Engine) API. Since prospector (python linter aggregate) already handles multiple tools, and is integrated with ALE, most of the actual linting will initially be handled via prospector calls.

Bloss, DavidK.↗

HERO WEC 2024 - Electrical Configuration Deployment Data

The following submission includes raw and processed electrical configuration deployment data from the in water deployment of NREL's Hydraulic and Electric Reverse Osmosis Wave Energy Converter (HERO WEC), in the form of parquet files, TDMS files, CSV files, bag files, and MATLAB workspaces. This dataset was collected in April 2024 at the Jennette's pier test site in North Carolina. Raw data as TDMS, CSV, and bag files are provided here alongside processed data in the form of MATLAB workspaces and Parquet files. This dataset includes the Python code used to process the data and MATLAB scripts to visualize the processed data. All data types, calculations, and processing is described in the included "Data Descriptions" document. All files in this dataset are described in detail in the included README. This data set has been developed by the National Renewable Energy Laboratory, operated by Alliance for Sustainable Energy, LLC, for the U.S. Department of Energy (DOE) under Contract No. DE-AC36-08GO28308. Funding provided by the U.S. Department of Energy Office of Energy Efficiency and Renewable Energy Water Power Technologies Office.

16 TIDAL AND WAVE POWER↗

1D Heat Loss Models Validation Experiment

Contains data from the model validation in the 1D Heat Loss Models to Predict the Aquifer Temperature Profile during Hot/Cold Water Injection Project. The data include two COMSOL models (2D axisymmetric benchmark model and 2D Vinsome model), one python code (1D Vinsome based FEM numerical simulation), one matlab main code (1D Newton analytical solution and all results comparison visualization), and output files generated from the above models.

1D↗

edxia: Microstructure characterisation from quantified SEM-EDS hypermaps

The characterisation of cement paste microstructure is an important step towards understanding durability mechanisms in cementitious materials. Scanning electron microscopy (SEM) coupled with energy dispersive spectroscopy (EDS) is a widely used technique to analyse the microstructure at the micron-scale. However, it is challenging, notably because the characteristic size of many phases is found on a scale smaller than the EDS interaction volume. This work presents a new image analysis framework to identify phases and quantify the microstructure of cementitious materials from SEM-EDS hypermaps. By leveraging domain knowledge, representative points are attributed to phases and mixtures of phases based on ratio plots. Then, quantitative analysis of the microstructure can be carried out (chemical composition, particle size distributions, volume fractions, …). We demonstrate the abilities of the framework, and we present possible applications and extensions of the method. The framework is available as both a graphical interface and a Python code.

36 MATERIALS SCIENCE↗

Measuring the Stress Factors for Photovoltaic (PV) Backsheet Degradation

Back sheet failure has resulted in power loss and large-scale recall of photovoltaic modules, resulting in billions of dollars in lost revenue. The light exposure on the backside of a photovoltaic module comes primarily from reflected light which alters the distribution of natural sunlight. Because of this, modelling the backside exposure and duplicating the exposure is much more difficult than modeling the frontside exposure. This project aims to study how various back sheets and junction box materials degrade under different conditions and to develop Python code to help model and predict degradation. The stress factors for back-sheet degradation must be quantified to extrapolate accelerated stress tests to the field. Test samples were placed in the A3, A4, and A5 conditions, as defined in IEC 62788-7-2, to assess the temperature and humidity dependence of ultraviolet (UV) induced degradation. We are utilizing a custom chamber with exposure from 0.5 UV-suns to 5 UV-suns to understand the dependence of degradation on light intensity. A group of samples put in the A3 condition had glass filters with 50% UV cut-offs of 320 nm, 335 nm, and 360 nm to assess the wavelength dependence of UV degradation. All this data is necessary to assess the impact of non-standard UV light exposure. The material evaluation tests include gloss measurements, attenuated total internal reflectance Fourier transform infrared spectroscopy (ATR-FTIR), UV-visible reflectance/transmittance utilizing a Cary Ci7000 spectrophotometer, and a nano-indenter for surface hardness and modulus measurements. Alongside the experimental work, there is a computational effort using raytracing and Python open-source tools in PVDeg , PVLib, and Bifacial_Radiance. This code will create specific exposure scenarios and enable the evaluation of chamber degradation relative to field degradation. Equation 1 is a strawman equation used to model degradation on the backside of a PV module. We will create simplified code, based on the results of ray-tracing calculations, which uses a view factor approach to provide fast calculations for the most common exposure scenarios.

14 SOLAR ENERGY↗

Mountain Basin Controls on the Snow-to-Streamflow Signal: An AIC-Weighted Multiple Linear Regression Framework

A regression-based analysis quantifies how basin characteristics modulate the snow-to-streamflow signal. First, we use the ERA5-Land reanalysis gridded product (European Centre for Medium Range Weather Forecasts reanalysis 5 -Land component) for 4,655 hydrologic unit code - 10 (HUC10) mountain basins across the western United States (US) for water years 1987–2024. Linear regressions are performed for peak snow water equivalent (SWE) and annual streamflow for each mountain basin. Models use ordinary least squares in Python’s statsmodels package. After which, an Akaike Information Criterion (AIC)–weighted ensemble multiple linear regression (MLR) framework with 47 watershed traits is used to predict the linear regression coefficient of determination (r-squared) defining the ability of peak SWE to predict annual streamflow across all mountain basin. Predictor sets are constrained to avoid multicollinearity by excluding models with variance inflation factors (VIF) greater than 5. Mountain basin traits included in the MLR include seasonal climate, topography, vegetation type and structure, and bedrock geology. Accepted models are considered if their AIC is within 2.0 of the model with the minimum AIC, or best model. To compare predictor influence across acceptable models, we computed standardized regression coefficients. To evaluate structural redundancy among models, we constructed binary inclusion vectors for each acceptable model, denoting whether a predictor was present (1) or absent (0). Core predictor variables are defined as occurring in at least 67% of the acceptable models. For this regional analysis, only one model was found acceptable, with higher snow-to-streamflow translation (higher r-squared) occurring in colder mountain basins with higher relative winter precipitation, more snow accumulation and a lower fraction of annual precipitation that falls in the spring and summer. The second component of the data package uses previously published, high-resolution output from an integrated hydrological model of the East River watershed using the U.S. Geological Survey Groundwater and Surface water Flow model (GSFLOW, doi:10.15485/1998576). East River MLR expands upon the approach described above to explore the response of five streamflow metrics—annual streamflow, runoff efficiency, 7-day minimum flow, low-flow duration, and non-perennial stream fraction to snow system indicators including peak SWE, snow-covered area, snow disappearance date, and the fraction of basin area characterized by low-to-no snow, as well as seasonal precipitation and temperature, and annual hydrologic variables representing soil moisture, evapotranspiration (ET), the partitioning of incoming precipitation to evapotranspiration (ET/P), groundwater storage, and groundwater inflow to streams. MLR was done on all water years (P0: 1987-2024) and for each period as determined in the split analysis using pooled regression techniques (P1: 1987-2011 and P2: 2012-2024) to evaluate shifting predictor variable emphasis on streamflow generation. Results indicate that since 2012, peak SWE has lost statistical strength in its prediction of annual streamflow and runoff efficiency, and the indirect influence of spring temperature has emerged as critically important. Low-flow metrics remain largely influenced by soil moisture, vegetation water use and groundwater inflows with summer precipitation becoming a direct influence on minimum summer flow. Together, these data and Python-based analysis tools provide a framework for identifying the key watershed characteristics that control how streamflow responds to snow from year to year. The package also helps quantify uncertainty in statistical models and assess how snow–streamflow relationships vary across regions and over time. This dataset contains comma-separated values files (.csv), text files (.txt), python code files (.py), figure files (.png), and shapefiles (.cpg, .dbf, .prj, .sbn, .sbx, .shp, .xml). Further details on file contents and MLR execution can be found in the readme file and the FLMD files. Work was supported by the Watershed Function Science Focus Area at Lawrence Berkeley National Laboratory funded by the US Department of Energy, Office of Science, Biological and Environmental Research under Contract No. DE-AC02-05CH11231.

54 ENVIRONMENTAL SCIENCES↗

Hourly Electricity Demand Profiles for Each County in the Contiguous United States

This dataset provides estimated hourly electricity demand for each county in the contiguous United States from 2016-2023. The demand profiles represent the sum of two components: (1) Weighted averages of reported hourly demand profiles for North American Electric Reliability Corporation balancing authority (BA) regions and subregions, scaled to match annual estimates of county-level retail sales and direct use of electricity and weighted by the estimated percentage of county load served by each BA region or subregion. (2) Weighted averages of modeled hourly, county- and sector-level distributed photovoltaic (DPV) capacity factor profiles, scaled to match annual estimates of on-site consumption of DPV-generated electricity for each county and weighted by the percentage of consumption attributable to each sector Annual county-level retail sales are estimated by aggregating utility-reported sales to the state level and allocating the results to counties according to each county's share of state population. Annual county-level direct use is calculated by aggregating power plant-reported direct use values. Annual county-level on-site consumption of DPV-generated electricity is estimated by aggregating utility-reported net metering data to determine the amount of DPV-generated electricity sold back to the grid for each state, subtracting those values from modeled state-level DPV generation estimates, and allocating the results to counties according to each county's share of statewide modeled DPV generation. The open-source Python code used to develop this dataset is available at "Historical Load Data Repository" link below.

14 SOLAR ENERGY↗

Full-sky beam convolution for cosmic microwave background applications

We introduce a publicly available full-sky beam convolution code library intended to inform the design of future cosmic microwave background (CMB) instruments and help current experiments probe potential systematic effects. The code can be used to assess the impact of optical systematics on all stages of data reduction for a realistic experiment, including analyses beyond power spectrum estimation, by generating signal timelines that may serve as input to full analysis pipelines. The design and mathematical framework of the Python code is discussed along with a few simple benchmarking results. We present a simple two-lens refracting telescope design and use it together with the code to simulate a year-long dataset for 400 detectors scanning the sky on a satellite instrument. The simulation results identify a number of sub-leading optical non-idealities and demonstrate significant B-mode residuals caused by extended sidelobes that are sensitive to polarized radiation from the Galaxy. For the proposed design and satellite scanning strategy, we show that a full physical optics beam model generates B-mode systematics that differ significantly from the simpler elliptical Gaussian model. The code is available at https://github.com/adrijd/beamconv

46 INSTRUMENTATION RELATED TO NUCLEAR SCIENCE AND ↗

FEM Analysis of Hybrid LTS/HTS Cos-Theta Dipole Magnet

After the recent results on Bi-2212 superconductive magnets realized and tested in canted cosine-theta and solenoid designs, respectively, at Lawrence Berkeley National Laboratory (LBNL) and NHMFL, the first Bi-2212 stress-managed cosine-theta insert magnet is in the assembly phase at Fermilab. This insert will be part of the first hybrid cosine-theta magnet made of Nb3Sn outer layers within the US-MDP effort to reach 20 T bore field. This paper reports the analytical analysis of the cosine-theta Nb3Sn/Bi-2212 hybrid magnet. As an introduction, it shows the validation of the finalized HTS coils' design optimized using the ROXIE code. Subsequently, it reports the parameters, logic, and implementation method of the 2D electromagnetic and mechanical FEM analysis of the LTS/HTS hybrid magnet. Results from the ANSYS detailed model made with sub-modeling geometry are compared with the homogeneous model implemented in the past. Moreover, a Python code was implemented to simulate the current degradation due to stresses in the detail-modeled conductor areas. The current degradation is introduced in the simulation dynamics for both conductors as an iteration process during the energization load step only after applying pre-stress and thermal loads. The numerical and graphic results of the 2D cosine-theta LTS/HTS magnet cross-section will be described and analyzed.

D'Agliano, A.↗