tjturnage / cloud-radar-server

Radar server in the cloud for NOAA computing project
MIT License
2 stars 2 forks source link


Radar Simulator in the Cloud

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

COBRAS (ClOud Based RAdar Simulator) is an application developed by Travis Wilson (currently at NOAA Global Systems Laboratory in Boulder, CO). This application is hosted on a web server and incrementally serves out files from the NOAA Next Generation Radar (NEXRAD) Level 2 Base Data archive[2] (henceforth, L2 data). End users leverage third party software called GR2Analyst Version 3 (henceforth, GR2)[3] to poll these files and render them into a visual display of the radar data. COBRAS contains its own Graphical User Interface (GUI) that makes it easy for a user to initiate a polling session.

Another application called l2munger[4] was developed by Daryl Herzmann at Iowa State University and is able to modify L2 data file metadata so that the dataset assumes the identity of another radar location and/or different valid times. It’s often desirable to alias L2 data in this manner because it keeps the event anonymous and allows people to “experience” severe weather transposed to their own, more familiar location. Once the file conversion is complete, it’s then possible to leverage an independent script to incrementally serve out files in the same manner that COBRAS is able to achieve. Unlike COBRAS, l2munger does not feature its own GUI; however, it would be feasible to create one.

Both COBRAS and l2munger require a web server to function. Web servers have been provided ad hoc either by private website owners or through National Weather Service (NWS) local or regional efforts. It should be self-evident that any private and non-NOAA affiliated training resource can not be considered a viable option for NOAA-centric training. Alternatively, some NWS Weather and Forecast Offices (WFOs) run COBRAS or l2munger directly on their local intranet. At NWS Central Region (CR) Headquarters, a COBRAS server is available to all WFOs. In all of these cases, however, this prevents external access for trainees on telework or for NOAA partners outside of the NWS. Moreover, a lack of central management due to all of these options makes it difficult to coordinate training efforts that often run in parallel and sometimes unknowingly compete for resources. Hence, there is a strong need for a web server that is externally accessible to NOAA/NWS employees via their ICAM credentials. This would allow for multi-office distributed training events that would improve readiness for hazardous weather as well as for mutual aid scenarios associated with large severe weather outbreaks.

In 2023, an NWS contract was finalized with Gibson Ridge, the company that developed GR2. This contract provided individual GR2 licenses to all NWS meteorologists. This development emphasizes how GR2 has become an integral part of NWS warning operations. By extension, it is well recognized that GR2 serves as a valuable training tool as evidenced by the Warning Operations Course: Severe Track training curriculum offered by the Warning Decision Training Division[6] as well as the Radar Feature Catalogs created by the CR Convective Warning Improvement Project (CWIP)[5].

Either COBRAS or l2munger, when combined with GR2, offers a powerful training structure. Progressive disclosure of radar data that can be visually rendered in GR2 creates a Displaced Real-Time (DRT) simulation environment, similar to what’s experienced in aircraft flight simulators. In this case, however, meteorologists are given the opportunity to “train as they fight'' as they build proficiency ahead of actual severe weather events.

However, severe weather diagnosis includes more than just assessing radar data. The Near Storm Environment (NSE) is another key ingredient because it represents atmospheric conditions in the immediate vicinity of the thunderstorms and strongly influences the characteristics of thunderstorms that develop and evolve. These characteristics subsequently inform which weather hazards (such as damaging winds, large hail, and tornadoes) are most likely to occur and how severe those hazards may become. Assessing the NSE requires the introduction of additional datasets. This includes Numerical Weather Prediction (NWP) guidance, which provides a three dimensional view of atmospheric properties and how these properties evolve with time. Another useful dataset is surface observations, which are refreshed at a much faster rate than NWP output.

To integrate supplemental datasets as described above, GR2 is able to display these datasets along with the rendered radar imagery using placefiles[7]. Placefiles are text files that can be dynamically updated with features that are time-synchronized with radar data. This allows animations of radar displays to similarly feature animations of placefile features that depict the evolving NSE environment. Work has been completed for creating NSE placefiles[8] and surface observation placefiles[9]. The next step is providing an interface in which a user can initiate the creation of these files so they can be served out to GR2 in a manner similar to how radar data are disseminated. The goal of this proposed work is to take cloud-based GR2 simulations to the next level by expanding its usage, support, functionality, and applicability.

This project is a collaborative effort among:

Priorities Satisfied

Initial deliverables

References:

(back to top)

Built With

This list will continue to grow. Please check back later.

(back to top)

Getting Started

This requires a server instance that with apache http service. In this case we are using a RHEL 8 instance.

Prerequisites

Python environment

Run the following to create an Anaconda/Mamba environment called cloud-radar with the required libraries (you should be able to use either conda or mamba). We built our environment with miniforg3.

  mamba env create -f environment.yaml

WGRIB2

Wgrib2 version 3.0.2 or higher is necessary for time interpolations, grid upscaling, and decoding older versions of the RAP model. Installing this software can be tricky, and the steps needed to do so can be different on each machine. On a RHEL machine:

wget https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v3.0.2
tar -xvzf wgrib2.tgz.v3.0.2
cd grib2

Edit makefile and set USE_NETCDF3=0 as we don't need to export netCDF files and this simplifies the build. Then, if which gfortran doesn't return an executable, do:

dnf -y install make gcc gcc-gfortran.x86_64

Followed by:

export CC=gcc
export FC=gfortran
make -j4

If this is successful, a folder called wgrib2 should have been created with a wgrib2 binary/executable file within it. Either move this of softlink it into /usr/local/bin or somewhere similar in your $PATH.

WGET

A working version of WGET is needed to download model data.

Installation

Clone the repo

   git clone https://github.com/tjturnage/cloud-radar-server.git

Edit Config Files

Within the scripts/meso sub-directory, open configs.py. The first six variables must be changed to specify the locations of the Python, WGRIB2, and WGET executables on your system, as well as where you'd like output and log files to be stored. NUM_THREADS controls how many threads are utilized during the computationally-expensive parcel lifting steps during the NSE placefile creation and should be set to a number less than the total number of threads available.

(back to top)

Usage

Runs a dash application on a self-contained flask server. In the base directory run python radar-server
After the servers starts, visit http://127.0.0.1:8050/

(back to top)

Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributors

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

T.J. Turnage - NWS Grand Rapids
thomas.turnage@noaa.gov
Project Link: https://github.com/tjturnage/cloud-radar-server

(back to top)

Acknowledgments