Search NASA⌕ Search

SEARCH · Search NASA

Results for “Python script”

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.

312 records · Page 18

INGRID: An interactive grid generator for 2D edge plasma modeling

A fusion boundary-plasma domain is defined by axisymmetric magnetic surfaces where the geometry is often complicated by the presence of one or more X-points; and modeling boundary plasmas usually relies on computational grids that account for the magnetic field geometry. The new grid generator INGRID (Interactive Grid Generator) presented in this work is a Python-based code for calculating grids for fusion boundary plasma modeling, for a variety of configurations with one or two X-points in the domain. INGRID first performs partitioning over the domain consisting of a small number of patches conforming to the magnetic field and wall geometry; then it generates a subgrid on each of the patches and joins them into a global grid. This domain partitioning strategy makes possible a uniform treatment of various configurations with one or two X-points in the domain. This includes single-null, double-null, and other configurations with two X-points in the domain. The INGRID design allows generating grids either interactively, via a parameter-file driven GUI, or using a non-interactive script-controlled workflow. Results of testing demonstrate that INGRID is a flexible, robust, and user-friendly grid-generation tool for fusion boundary-plasma modeling.

70 PLASMA PHYSICS AND FUSION TECHNOLOGY↗

Bifacial_Radiance v0.4.2 [SWR-18-03]

The bifacial_radiance software contains a series of Python wrapper functions to make working with RADIANCE easier, particularly for the PV researcher interested in bifacial PV performance. For more information, check out our documentation, Tutorials in the form of Jupyter Notebooks, or refer to our Wiki and Issues page. Installation https://youtu.be/4A9GocfHKyM This video shows how to install the bifacial_radiance software and all associated software needed. More info on the Wiki. Instructions are also shown below. For detailed instructions of how to install bifacial_radiance, you can also refer to the installation guide. A GUI has been added in version 3.0. The GUI reads/writes all input parameters necessary to run a simulation, and runs the specified simulation by calling the correct functions with the specified parameters. So no need to use a journal or a script! But you still need to install following the procedure below.

Deline, Chris↗

Advanced Terrestrial Simulator (ATS) evaluation dataset at 7 catchments across the continental United States

This dataset comprises of the input files and other files required for Advanced Terrestrial Simulator (ATS) simulations at 7 catchments across the continental United States. ATS is an integrated surface-subsurface hydrology model. We include Jupyter notebooks (within scripts folder) for individual catchments showing information (including data sources, river network, soil, geology, landuse types etc.) on preparing the machine readable input files. ATS observation output files are provided in the output folder. Figures and analyses (.xlsx sheets) are also provided. The catchments include, Taylor River Upstream (Colorado); (b) Cossatot River (Arkansas); (c) Panther Creek (Alabama); (d) Little Tennessee River (North Carolina and Georgia); (e) Mayo River (Virginia); (f) Flat Brook (New Jersey); (g) Neversink River headwaters (New York). Readme files are provided inside the directories providing more details. Files types include: .xml, .h5, .xlsx, .png, .ipynb, .py, .nc, .txt. All of the files types can be accessed by open source software, details on software requirements are following: .xml (any text editors including notepad and textedit), .h5 (in python using hdf libraries), .xlsx (WPS Office Spreadsheets, OpenOffice Calc, LibreOffice Calc, Microsoft Office etc.), .png (any image viewer), .ipynb (Jupyter notebook), .py (any text editors including notepad and textedit), .nc (using python or other open source software).

54 ENVIRONMENTAL SCIENCES↗

Improving the Estimation of the Atmospheric Water Vapor Pressure Using Interpretable Long Short-Term Memory Networks: Dataset, Python code, and trained models

Atmospheric water vapor pressure is an essential meteorological control on land surface and hydrologic processes. It is not as frequently observed as other meteorologic conditions, but often inferred through the August–Roche–Magnus formula by simply assuming dew point and daily minimum temperatures are equivalent or by empirically correlating the two temperatures using an aridity correction. The performance of both methods varies considerably across different regions and during different time periods; obtaining consistently accurate estimates across space and time remains a great challenge. We applied an interpretable Long Short-Term Memory (iLSTM) network conditioned on static, location specific attributes to estimate daily vapor pressure for 83 FLUXNET sites in the United States and Canada. This data package includes all raw data of the 83 FLUXNET sites, input data for model training/validation/test, trained models and results, and python codes for the manuscript "Improving the Estimation of the Atmospheric Water Vapor Pressure Using an Interpretable Long Short-term Memory Network". Specifically, it consists of five parts. - First, "1_Daymet_data_83sites.zip" includes raw data downloaded from Daymet for the 83 sites used in the paper according to their longitude and latitude, in which vapor pressure is used. It also includes a pre-processed CSV data file combining all data from the 83 sites which is specifically used for the paper. - Second, "2_Fluxnet2015_data_83sites.zip" includes raw half hourly data of the 83 sites downloaded from FLUXNET2015 data portal, pre-processed daily data of the 83 sites, a CSV file including combined pre-processed daily data of the 83 sites, and a CSV file including the information (site ID, site name, latitude, longitude, data available period) of the 83 sites. - Third, "3_MODIS_LAI_data_83sites_raw.zip" includes raw leaf area index (LAI) data downloaded from the AppEEARs data portal. - Fourth, "4_Scripts.zip" includes all scripts related to model training and post-processing of a trained model, and a jupyter notebook showing an example for model post-processing. Two typo errors in files titled "run2get_args.py" and "postprocess.py" were corrected on March 27, 2024 to avoid confusions. - Finally, "Trained_models_and_results.zip" includes three folders and three files with suffix ".npy", and each folder corresponds to one file with suffix ".npy" with the same title. Each of the three folders include all trained models associated with one iLSTM model configuration (35 models for each configuration, details are described in the paper). Each file with suffix ".npy" includes the post-processed results of the corresponding 35 models under one iLSTM model configuration.

54 ENVIRONMENTAL SCIENCES↗

Coupling Subsurface and Above-Surface Models for Optimizing the Design of Borefields and District Heating and Cooling Systems

Accurate dynamic energy simulation is important for the design and sizing of district heating and cooling systems with geothermal heat exchange for seasonal energy storage. Current modeling approaches in building and district energy simulation tools typically consider heat conduction through the ground between boreholes without flowing groundwater. While detailed simulation tools for subsurface heat and mass transfer exist, these fall short in simulating above-surface energy systems. To support the design and operation of such systems, the study developed a coupled model including a software package for building and district energy simulation, and software for detailed heat and mass transfer in the subsurface. For the first, it uses the open-source Modelica Buildings Library, which includes dynamic simulation models for building and district energy and control systems. For the heat and mass transfer in the soil, it uses the TOUGH simulator. The TOUGH family of codes can model heat and multi-phase, multi-component mass transport for a variety of fluid systems, as well as chemical reactions, in fractured porous media. The study validated the coupled modeling approach by comparing the simulation results with one from the g-function based ground response model. It then looked into effects when the water table and the regional groundwater flow are considered in the ground, from the perspective of heat exchange between borehole and ground, and the electrical consumption of the district heating and cooling systems. To access the simulation models, please find the links in the submission: -- For coupled approach validation: see model Buildings.Fluid.Geothermal.Borefields.Examples.BorefieldsWithTough and Buildings.Examples.DistrictReservoirNetworks.Examples.Reservoir3Variable_TOUGH from the "Modelica Building Library" resource, branch issue1495_tough_interface, commit a2667c0. -- For the study of the effect of water table: see model Buildings.Examples.DistrictReservoirNetworks.Examples.Reservoir3Variable_TOUGH from he "Modelica Building Library" resource, branch issue1495_tough_interface_moreIO, commit 760de49. -- For the study of the effect of regional groundwater flow: see Buildings.Examples.DistrictReservoirNetworks.Examples.Reservoir3Variable_TOUGH from he "Modelica Building Library" resource, branch issue1495_tough_interface_moreIO_3D, commit c2a2d2a. The coupling interface script "GrounResponse.py" can be found from the above links in the folder Buildings/Resources/Python-Sources. Also, the needed files for TOUGH simulation are in the folder Buildings/Resources/Python-Sources/ToughFiles that can be accessed through the above links. A brief description of these files is given below; detailed specifications for the first three files may be found in the TOUGH3 Users Guide (Jung et al., 2018) https://tough.lbl.gov/documentation/tough-manuals/. (1) INCON - initial conditions for each grid block (2) INFILE - main input file with material properties and control parameters (3) MESH - description of the computational grid (4) readsave - Modelica/TOUGH interface program: read the final output of TOUGH simulation after TOUGH time step and prepare for transfer to Modelica for next Modelica time step (5) readsave.inp - input parameters for program readsave (6) writeincon - Modelica/TOUGH interface program: write the output of Modelica after Modelica time step and prepare for transfer to TOUGH as initial conditions for the next TOUGH step (7) writeincon.inp - input parameters for program writeincon

15 GEOTHERMAL ENERGY↗

Sensitivity Analysis of Drivers Water Shortage in the Los Angeles Region During Drought

The code and detailed step-by-step instructions for generating the model output data, processing results, and analysis and plotting are provided at https://github.com/IMMM-SFA/Ferencz_et_al_2026_ER_Water. The PyArtes model is a python adaptation of the Artes model. PyArtes uses many of the same input data and optimization model architecture as Artes. Documentation for the PyArtes model is provided in the Supplement to the paper. The primary data product are simulated monthly water shortages for indoor and outdoor demand under a large ensemble of drought scenarios (>13,000). The droughts are hypothetical and are not based on historical time series data of supply sources - though historical data did help inform ranges explored for supply parameters. Demands are informed by recent 2017-2021 water supply data. Demands used for the model can be accessed at https://github.com/IMMM-SFA/Ferencz_et_al_2026_ER_Water. Simulations resolve demand for over 90 water providers in the study region. The results report 36 months of water shortage data for each indoor and outdoor demand node. The study also developed a multilayer perceptron (MLP) neural network trained on a subset of the simulated shortage ensemble to emulate worst annual water shortage for a given set of parameter multipliers -- provided the parameter values fall within the ranges sampled in the ensemble. Emulated water shortages for synthetic ensembles are in the MLP-generated shortages folder. The MLP model was used to generate larger ensembles to support Sobol analysis that would have been extremely computationally expensive to simulate. Datasets provided in this repository*: Simulated shortages. These results are used for the analysis for Figures 5, 8, and 9 in the paper, and also to train the MLP emulator. .zip file containing outputs for the 13,312 scenario ensemble. Separate .csv files for indoor and outdoor shortage for each scenario. Rows = demand ids (~100), Columns = months (36) Units = acre-feet/month of shortage (shortage = monthly demand - supply). 1 acft = 1233.48 m^3 .csv files of aggregated shortages derived from the 13,312 ensemble Rows = scenarios (13,312), Columns = demand ids (~100) Units = acre-feet/year (either worst annual shortage or total shortage over the 3-year drought) .csv file of the parameter multipliers scenarios for the ensemble .csv file of the parameter ranges and baseline values the multipliers were applied to MLP-generated shortages. These results are used for Figures 4, 6, and 7 in the paper. mwd higher folder: scenario ensembles, emulated worst year total shortages (acft), and Sobol results Emulated shortages. Rows = scenarios, columns = demand ids, units acft Sobol results. Rows = demand ids, columns Sobol (S1, ST, or 95% confidence interval) value for each parameter mwd lower folder: scenario ensembles, emulated worst year total shortages (acft), and Sobol results same organization as mwd higher MLP performance: performance metrics (R^2, RMSE, BIAS, MAPE) for the testing subset (20% or 2,662 scenarios) and simulated vs emulated worst year shortage (acre-feet/year) for every demand node, MWD wholesale regions, and the entire study region (LAC). Supporting data for figures. Figure plotting scripts in the associated GitHub repo. These files support analysis and visualization. Geospatial Data used for plotting simulated water shortages and Sobol results. Dictionary of full names for demand nodes in the model and estimates of water supply by source type informed by Artes input files and California Urban Water Management Planning data: https://water.ca.gov/Programs/Water-Use-And-Efficiency/Urban-Water-Use-Efficiency/Urban-Water-Management-Plans *Readme files provided for each folder.

drought↗