ProbSevere LightningCast
ProbSevere LightningCast is a part of the ProbSevere portfolio of machine-learning algorithms for convective hazards. The main LightningCast model predicts the probability of any lightning (as observed by GLM) in the next 60 minutes. It uses GOES-R ABI channels as predictors and utilizes a U-Net convolutional neural network architecture. The model was trained with TensorFlow and uses Python. It can be run in near-real time or on archived cases.
Installation
Lightningcast Requires Python version 3.9 or 3.10 and supports level 1 files from either goes satellites or himawari satellites (FLDK and JP sectors only). Lightningcast can be used as either a docker container or can be installed with pip as a Python package.
Docker
Running with docker is simple and can be as easy as mounting in a directory and passing in user lightningcast parameters.
docker pull gitlab.ssec.wisc.edu:5555/jcintineo/lightningcast/lightningcast-c7r:latest
If you have a specific verison number (For LightingCast versions 1.3.3 and Later) You can specify that version like so:
LC_VERSION=1.3.3
docker pull gitlab.ssec.wisc.edu:5555/jcintineo/lightningcast/lightningcast-c7r:${LC_VERSION}
Install with PIP
Below is an example install using conda (native installs or different virtual environments work as well). For conda setup instructions see here. Set up a conda environment, activate it, and install lightningcast:
conda create --name lightningcast python=3.10 -y
conda activate lightningcast
pip install https://gitlab.ssec.wisc.edu/api/v4/projects/1015/packages/generic/lightningcast/latest/lightningcast-latest.tar.gz
If you know the version number you want (For LightingCast versions 1.3.3 and Later) You can install that package directly like so:
LC_VERSION="1.3.3"
pip install https://gitlab.ssec.wisc.edu/api/v4/projects/1015/packages/generic/lightningcast/${LC_VERSION}/lightningcast-${LC_VERSION}.tar.gz
Setup Dev Environment
Initialize editable pip environment
There is a bit of setup that needs to be done so we will use the build/dev_setup.sh
script. This script will do the setup and then install lightnincast in pip's editable mode (pip install -e
) so that you can edit source files and then imediatly see the results by running python -m lightningcast
. Clone the lightningcast repo and then navigate to it.
conda create --name lightningcast-devenv python=3.10 -y
conda activate lightningcast-devenv
build/dev_setup.sh
Initialize conda without installing
Clone the lightingcast repo and navigate into it.
cd build
conda create --name lightningcast-reqs python=3.10 -y
conda activate lightningcast-reqs
pip install -r requirements.txt
LightningCast Options/Configuration
Required Channels / Bands
Basic Channel Prediction Reqs:
ABI: 02, 05, 13, 15
AHI: 03, 05, 13, 15
Extra Channels for images:
ABI:
DayLandCloud: 03
IR-only Cloud Phase: 11, 14
AHI:
DayLandCloud: 04
IR-only Cloud Phase: 11, 14
Required argument(s)
Lightningcast requires only one argument: input_file
. This should be a path to a single level 1 file in the same directory as all other required files. Otherwise, it should be a path to a text file where each new line is a path to a single level 1 file.
For Goes channels 02, 05, 13, 15 are required. For Himawari data all files for Bands 03, 05, 13, 15 are required.
Note: If a level 1 file path doesn't resolve, then lightningcast will check if datadir_patt
is set in the config (See next section). If it is, then lightningcast will concatenate datadir_patt
to the beginning of the path and try again. If running through docker ensure that the path being passed through datadir_patt
is mounted into the container.
Optional argument(s):
- --yaml_config: List of yaml config files separated by spaces
- --yaml_overrides: List of key-value pairs separated by spaces that set/override specific options
Config
Lightningcast uses a yaml cascade for configuration settings. For a yaml introduction see here. The cascading configuration design pattern takes and merges multiple data structures (mostly yaml files, though specific values can also be passed. See Section --yaml_overrides). Data structures are merged following specific rules with values in higher priority data structures overriding values in lower priority data structures (see section: Override priority). This allows users to have a set of values for most/all cases by default while still allowing customization for individual cases, such as different sectors.
Yaml arguments
Any number of yaml files may be passed in and used as config files:
--yaml_config $file1 $file2
Set and override specific options:
--yaml_overrides numeric_option=1 string_option=one numeric_array_option1="[1, 5, 3.5]" string_array_option="[one, two, \"3\", \"true\"]" boolean_option=false boolean_array="[false, false, true]" special_dir=\"{lc_base}/special_dir\"
Arrays must be wrapped in double quotes. Wrap values in escaped double quotes to force them to be a string. Values that reference another key/value pair (see section: Referencing other options and custom options) must be wrapped in escaped double quotes.
Override priority
When multiple values are passed in for the same key, they are assigned based by the following rules:
- Values passed in through --yaml_overrides. Overrides to the right take priority
- Values in yaml files passed in through --yaml_config. Files to the right take priority.
- Values in files in the the packages_install_location/config/default. Filenames later in alphabetical order take priority.
Note: Within the same file, values farther down take priority.
Referencing other options and custom options
Users may create their own options that don't conflict with predefined available options (see "Available Options" section). Within string options, users may also reference any other set string option by wrapping its key in brackets. Referencing undefined options or recursive referencing will result in errors. See an example yaml config (from ci-paths-override-sample.yaml
) below:
inroot: '/data/PLTG/LightningCast_testdata/' # custom option
outdir: '{inroot}/test-output' # Predefined option referencing custom option
logfile: '{outdir}/logs/lightning.log' # Predefined option referencing other predefined option
make_json: true
awips_nc: 3
datadir_patt: '{inroot}' # Predefined option referencing custom option
Default values
At the package install location lightningcast has a config/default
directory that contains yamls that are used by default. Editing these directly is discouraged.
It is better to override their values instead. The provided sample configs contain a copy of the default yamls for user perusal.
Available Options
Some options are set at runtime and cannot be overridden. User options that reference these will also be set accordingly at runtime.
Option | Type | Description |
---|---|---|
pwd | string | Set to present working directory at program runtime |
lc_base | string | Path to install directory of package. Probably under python site-packages (python -m site) |
For some user options, users may use format codes in the option's value based on the input file's start_time
. User options include:
Option | Default Value | Type | Description | May use Format Codes |
---|---|---|---|---|
outdir | '{pwd}/OUTPUT' | string | Location for lightningcast output | True |
datadir_patt | null | string | Value to be appended to the beginning of file paths if they don't point to a valid file. If running through docker ensure that the path being passed through datadir_patt is mounted into the container. |
True |
logfile | null | string | File path to log output too. If not set no logging will happen. | |
make_img | 0 | int | Make images. 1=DayLandCloud, 2=VIS, 3=DCC, 4=DCP, 5=sandwich, 0=none. Makes grayscale CH13 at night. | |
num_threads | null | int | Limit the number of CPU threads that tensorflow (prediction engine component) can use. | |
sector_suffix | null | string | What to append to the sector name for writing files. E.g., 'AL' will generate output files like so: {outdir}/RadC_AL/{filename} (assuming sector is 'RadC') |
|
sector | null | string | Hard override sector instead of retrieving dynamically. Use should generally be avoided. | |
ll_bbox | null | array[float] | Lat/lon bounding box of image. SWlon, NElon, SWlat, NElat. Default (null) is the entire image. | |
ind_bbox | null | array[int] | data ind bounding box of image. xmin, xmax, ymin, ymax. Note that ymin is towards top of the image. Also, these are data indices with respect to 2-km channels (e.g., C13)...not projection coords. This is generally only used for RadF, where there might be space-looks. If space-looks are unwanted or unexpected, just use ll_bbox | |
make_json | false | boolean | Save a json to outdir. | |
geotiff | false | boolean | Save as a geotiff | |
re_upload | null | string | Full path to re_upload executable. Will execute after json is written. | True |
prob_values | [0.1, 0.25, 0.5, 0.75] | array[float] | probability values to contour (0 to 1). | |
glmpatt | null | string | GLM file pattern. For segments of FD scenes, outside of CONUS or PACUS, use (e.g.), "https://lightningdev.umd.edu/feng_data_sharing/113_g16_glmgrid_arch/%Y/%Y%j/OR_GLM-L3-GLMF-M3_G16_e%Y%m%d%H%M00.nc" |
True |
glmvar | 'flash_extent_density' | string | GLM variable name. Could use "Flash_extent_density_window" for UMD archive files. | |
eni_path | null | string | Path to global ENI point data. Generally used for Himawari. | True |
mrms_patt | null | string | Pattern for MRMS grib2 files. May use {{ch}} in string to represent channel, such as 'Reflectivity_-10C'. Only used if model has MRMS predictors or if ref10 is True (i.e., plotting radar data). Example: "/ships19/grain/probsevere/radar/%%Y/%%Y%%m%%d/grib2/{{ch}}/MRMS_{{ch}}00.50%%Y%%m%%d-%%H%%M*.grib2" |
True |
contour_cmap | null | string | Matplotlib colormap string for the probability contours. | |
colors | ['#0000FF', '#00FFFF', '#00FF00', '#CC00FF'] |
array[string] | List of colors for prob. contours. Up to 8. Can be hex or standard. Default = blue cyan green magenta. Ignored if contour_cmap is set. |
|
lightning_meteograms | false | boolean | Create meteograms of LightningCast probs and GLM and ENI flashes for static locations. Upload the updated meteogram data to a web database. |
|
county_map | false | boolean | Use county map in image creation. | |
netcdf | 0 | int | Write a netcdf of the LC probs in native geostationary format. 1 = w/o parallax correction; 2 = w/ parallax correction using constant cloud height of plax_hgt meters; 3 = save both parallax-corrected and uncorrected grids. Default = 0 (i.e., don't write netcdf) |
|
awips_nc | 0 | int | Write a netcdf of the LC probs in AWIPS-compatible format. 1 = w/o parallax correction; 2 = w/ parallax correction using constant cloud height of plax_hgt meters; 3 = save both plax-corrected and uncorrected grids. Default = 0 (i.e., don't write netcdf) |
|
fire_event_ts | false | boolean | Post-processing that grabs probs and GLM flashes and associates them with current active fire events | |
pickle_preds_labs | false | boolean | Save the predictions and labels in a pickle file for later evaluation. | |
timeseries | [] | array[float] | A lat/lon pair to create a time series with. E.g., [43.82, -76.40]. The optional 3rd arg is a flag to make an image at every time. E.g., [43.82, -76.40, 1] |
|
grplacefile | false | boolean | Make GR placefile. | |
plax_hgt | 0 | int | Height above the earth's surface for parallax correction, in meters. We will use this constant height to do a parallax correction in both netCDF (if --awips_nc ≥ 2 or --netcdf ≥ 2) and geojson outputs. Default = 0, which means no correction. If > 0, a parallax-corrected file will be written. |
|
plax_pkl | null | string | (DEPRECATED). Pickle file with parallax-corrected indices for saving gridded LightningCast files. The default is to use PLAX files found in {lc_base}/static for GOES-East and GOES-West. These files were created a priori with an assumed constant cloud height (height found within the pickles). Set to true to enable and |
|
extra_script | null | string | Full path to script to execute after netcdf creation (usu. for LDM send). | |
ftp | null | string | Post json files to this FTP path | |
ref10 | false | boolean | Make images with MRMS Ref -10C overlaid. Assumes sat is desired. RGB background and no contours. | |
plot_engln | false | boolean | Plot ENGLN flashes. Automatically True if the imager is non-GOES. | |
plot_points | null | array[int] | Plot red dots for these points. E.g., [-100.1, 36.45, -98.22, 44.87] | |
ltg_stats | false | boolean | Save/create ltg statistics for points in the input domain. Typically used for lead-time. | |
pixel_buff_and_stride | [5, 40] | array[int] | Used in conjunction with ltg_stats. Provide two ints, corresponding to the number of 2-km pixels to buffer a point and the number of 2-km pixels to stride the image. To output stats for every pixel without any buffer (generally not recommended), set pixel_buff_and_stride 0 1 |
|
model | '{lc_base}/static/fit_conv_model.h5' | string | CNN model used for predictions. | |
model_config_file | '{lc_base}/static/model_config.pkl' | string | This file contains mean and SD of channels (a pickle file). | |
sat_info | See table Below | array | An array containing satellite data and output file metadata. |
sat_info options:
Option | Default | Type | Description |
---|---|---|---|
stride | 4 | int | The number of pixels we want to subsample the computed probs, in effect smoothing the end product |
max_focal_plane_temp_threshold | 101 | int | Generally used only for GOES-17 loop-heat-pipe issue |
bad_data_fraction_threshold | 0.05 | float | fraction of bad data allowed before entire blocks get flagged |
qc_hs | 25 | int | half-size (at 2km res) for QCing purposes |
production_site | 'CIMSS' | string | |
time_patt | '%Y%m%d-%H%M%S UTC' | string | |
institution | 'University of Wisconsin -- Madison' | string | |
production_environment | 'dev' | string |
Usage Example
Lightningcast can be run using a docker container or by a local install. Inputs are almost identical. Sample yaml configs were extracted during installation if using the direct install method or are present in the docker container. When running with docker only custom yaml files, input files, and the output location need to be mounted.
Aquire test data
Run:
curl https://bin.ssec.wisc.edu/pub/probsevere/lightningcast/nccf/LightningCast_testdata_20240627.tgz -O
tar xzf LightningCast_testdata_20240627.tgz
cd LightningCast_testdata/
output:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2550M 100 2550M 0 0 233M 0 0:00:10 0:00:10 --:--:-- 249M
Direct Install
Below the environmental variable CONFIG_LOC
stores the path to the config directory:
conda activate lightningcast # Substitute as needed depending on if / which virtual environment is being used.
CONFIG_LOC="$(realpath ../config/)" # Replace with path to extracted configs if needed
python -m lightningcast himawari09/2023/2023_10_11_284/HS_H09_20231011_2100_B03_FLDK_R05_S0110.DAT --yaml_config $CONFIG_LOC/options/sectors/himawari-fldk.yaml $CONFIG_LOC/options/nccf.yaml
output:
2024-02-19 11:54:46.667682: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-19 11:54:46.697579: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 11:54:46.839571: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-19 11:54:46.839613: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-19 11:54:46.866136: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-19 11:54:46.922225: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 11:54:46.922919: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-19 11:54:47.547768: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-02-19 11:54:48 UTC | INFO | predict_ltg.py | predict_ltg | Process started.
2024-02-19 11:54:50.205838: E external/local_xla/xla/stream_executor/cuda/cuda_driver.cc:274] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2024-02-19 11:54:50.205865: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:129] retrieving CUDA diagnostic information for host: lpfantz-pop-os
2024-02-19 11:54:50.205868: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:136] hostname: lpfantz-pop-os
2024-02-19 11:54:50.205971: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:159] libcuda reported version is: 535.86.5
2024-02-19 11:54:50.205983: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:163] kernel reported version is: 535.86.5
2024-02-19 11:54:50.205985: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:241] kernel version seems to match DSO: 535.86.5
2024-02-19 11:54:50 UTC | INFO | predict_ltg.py | predict_ltg | Overhead: 2.067 seconds
2024-02-19 11:54:50 UTC | INFO | predict_ltg.py | predict_ltg | processing 20231011-210000 UTC...
2024-02-19 11:54:51 UTC | INFO | predict_ltg.py | sector_shift | Computed satellite-zenith angle
2024-02-19 11:54:51 UTC | INFO | predict_ltg.py | predict_ltg | got crop...
2024-02-19 11:54:52 UTC | INFO | predict_ltg.py | predict_ltg | got B03..., (1460, 2084)
2024-02-19 11:54:52 UTC | INFO | predict_ltg.py | predict_ltg | got B05..., (365, 521)
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/dask/core.py:127: RuntimeWarning: invalid value encountered in log
return func(*(_execute_task(a, cache) for a in args))
2024-02-19 11:54:52 UTC | INFO | predict_ltg.py | predict_ltg | got B13..., (365, 521)
2024-02-19 11:54:52 UTC | INFO | predict_ltg.py | predict_ltg | got B15..., (365, 521)
2024-02-19 11:54:52 UTC | INFO | predict_ltg.py | predict_ltg | making predictions...
2024-02-19 11:54:52 UTC | INFO | predict_ltg.py | predict_ltg | input dims: (1, 1456, 2080, 1) (1, 728, 1040, 1) (1, 364, 520, 2)
1/1 [==============================] - 1s 727ms/step
2024-02-19 11:54:53 UTC | INFO | predict_ltg.py | predict_ltg | predict time: 0.779 seconds
2024-02-19 11:54:53 UTC | INFO | predict_ltg.py | predict_ltg | Using satzen thresh. of 80 deg. to screen out large viewing-angle predictions.
2024-02-19 11:54:53 UTC | INFO | predict_ltg.py | predict_ltg | max new_preds: 0.999
2024-02-19 11:54:53 UTC | INFO | predict_ltg.py | save_off_grid | Remapped probability data.
2024-02-19 11:54:53 UTC | INFO | utils.py | write_netcdf | Process started
2024-02-19 11:54:53 UTC | INFO | utils.py | write_netcdf | Wrote out /home/lpfantz/lc-demo/LightningCast_testdata/OUTPUT/20231011/ahi_japan/FLDK_GUAM/netcdf/LtgCast-FLDK-GUAM_v1-0-3_h9_s202310112100000_e202310112100000_c202402191754533.nc
2024-02-19 11:54:53 UTC | INFO | utils.py | write_netcdf | Process ended
2024-02-19 11:54:53 UTC | INFO | predict_ltg.py | predict_ltg | total time: 2.903 seconds
2024-02-19 11:54:53 UTC | INFO | predict_ltg.py | predict_ltg | Process ended.
run:
python -m lightningcast filelists/ge-radc.txt --yaml_config $CONFIG_LOC/options/sectors/ge-radc.yaml $CONFIG_LOC/options/nccf.yaml
output:
2024-02-19 11:56:35.548392: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-19 11:56:35.549690: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 11:56:35.572375: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-19 11:56:35.572399: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-19 11:56:35.573045: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-19 11:56:35.576701: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 11:56:35.576823: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-19 11:56:35.963856: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-02-19 11:56:36 UTC | INFO | predict_ltg.py | predict_ltg | Process started.
2024-02-19 11:56:38.053038: E external/local_xla/xla/stream_executor/cuda/cuda_driver.cc:274] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2024-02-19 11:56:38.053061: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:129] retrieving CUDA diagnostic information for host: lpfantz-pop-os
2024-02-19 11:56:38.053065: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:136] hostname: lpfantz-pop-os
2024-02-19 11:56:38.053166: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:159] libcuda reported version is: 535.86.5
2024-02-19 11:56:38.053178: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:163] kernel reported version is: 535.86.5
2024-02-19 11:56:38.053180: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:241] kernel version seems to match DSO: 535.86.5
2024-02-19 11:56:38 UTC | INFO | predict_ltg.py | predict_ltg | Overhead: 1.964 seconds
2024-02-19 11:56:38 UTC | INFO | predict_ltg.py | predict_ltg | processing 20230704-200118 UTC...
2024-02-19 11:56:39 UTC | INFO | utils.py | plax | Performing parallax correction with satlon = -75 deg. and elevation = 9000.0 m.
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:196: RuntimeWarning: invalid value encountered in sin
(np.sin(latdiff / 2.0)) ** 2
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:197: RuntimeWarning: invalid value encountered in cos
+ np.cos(satlat_rad) * np.cos(datalat_rad) * (np.sin(londiff / 2.0)) ** 2
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:197: RuntimeWarning: invalid value encountered in sin
+ np.cos(satlat_rad) * np.cos(datalat_rad) * (np.sin(londiff / 2.0)) ** 2
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:232: RuntimeWarning: invalid value encountered in cos
- 2.0 * altitude * earth_radius * np.cos(datalat_rad)
2024-02-19 11:56:40 UTC | INFO | utils.py | plax | Getting new xinds (for lons) and yinds (for lats)
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:331: RuntimeWarning: invalid value encountered in subtract
dy = (lats[:-2, 1:-1] - lats[2:, 1:-1]) / 2.0
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:332: RuntimeWarning: invalid value encountered in subtract
dx = (lons[1:-1, :-2] - lons[1:-1, 2:]) / 2.0
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:342: RuntimeWarning: invalid value encountered in cast
xind[1:-1, 1:-1] = new_elem
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/utils.py:343: RuntimeWarning: invalid value encountered in cast
yind[1:-1, 1:-1] = new_line
2024-02-19 11:56:40 UTC | INFO | utils.py | plax | Accounting for pixels off the grid
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/sat_zen_angle.py:16: RuntimeWarning: invalid value encountered in cos
beta = np.arccos(np.cos(lat) * np.cos(lon))
/home/lpfantz/anaconda3/envs/lightningcast/lib/python3.10/site-packages/lightningcast/sat_zen_angle.py:19: RuntimeWarning: invalid value encountered in arcsin
zenith = np.arcsin(
2024-02-19 11:56:40 UTC | INFO | predict_ltg.py | sector_shift | Computed satellite-zenith angle
2024-02-19 11:56:41 UTC | INFO | predict_ltg.py | predict_ltg | got C02..., (6000, 10000)
2024-02-19 11:56:41 UTC | INFO | predict_ltg.py | predict_ltg | got C05..., (3000, 5000)
2024-02-19 11:56:41 UTC | INFO | predict_ltg.py | predict_ltg | got C13..., (1500, 2500)
2024-02-19 11:56:41 UTC | INFO | predict_ltg.py | predict_ltg | got C15..., (1500, 2500)
2024-02-19 11:56:41 UTC | INFO | predict_ltg.py | predict_ltg | making predictions...
2024-02-19 11:56:41 UTC | INFO | predict_ltg.py | predict_ltg | input dims: (1, 6000, 10000, 1) (1, 3000, 5000, 1) (1, 1500, 2500, 2)
1/1 [==============================] - 9s 9s/step
2024-02-19 11:56:51 UTC | INFO | predict_ltg.py | predict_ltg | predict time: 9.548 seconds
2024-02-19 11:56:51 UTC | INFO | predict_ltg.py | predict_ltg | Using satzen thresh. of 80 deg. to screen out large viewing-angle predictions.
2024-02-19 11:56:51 UTC | INFO | predict_ltg.py | predict_ltg | max new_preds: 1.000
2024-02-19 11:56:51 UTC | INFO | predict_ltg.py | predict_ltg | making contours and json...
2024-02-19 11:56:53 UTC | INFO | predict_ltg.py | write_json | wrote out /home/lpfantz/lc-demo/LightningCast_testdata/OUTPUT/20230704/goes_east/RadC/json//LtgCast-RadC_v1-0-3_g16_s202307042001183_e202307042003569_c202402191756533.json
2024-02-19 11:56:55 UTC | INFO | predict_ltg.py | write_json | wrote out /home/lpfantz/lc-demo/LightningCast_testdata/OUTPUT/20230704/goes_east/RadC/json_plax//LtgCast-pc-RadC_v1-0-3_g16_s202307042001183_e202307042003569_c202402191756555.json
2024-02-19 11:56:55 UTC | INFO | predict_ltg.py | predict_ltg | Creating GRPlacefile for GOES_East RadC
Wrote out /home/lpfantz/lc-demo/LightningCast_testdata/OUTPUT/20230704/goes_east/RadC/placefile//LtgCast-pc-RadC_v1-0-3_g16_s202307041901180_e202307042001180_c202402191756558.placefile
2024-02-19 11:56:56 UTC | INFO | predict_ltg.py | save_off_grid | Remapped probability data.
2024-02-19 11:56:56 UTC | INFO | utils.py | write_netcdf | Process started
2024-02-19 11:56:56 UTC | INFO | utils.py | write_netcdf | Wrote out /home/lpfantz/lc-demo/LightningCast_testdata/OUTPUT/20230704/goes_east/RadC/netcdf/LtgCast-RadC_v1-0-3_g16_s202307042001183_e202307042003569_c202402191756559.nc
2024-02-19 11:56:56 UTC | INFO | utils.py | write_netcdf | Process ended
2024-02-19 11:56:56 UTC | INFO | predict_ltg.py | predict_ltg | total time: 18.162 seconds
2024-02-19 11:56:56 UTC | INFO | predict_ltg.py | predict_ltg | Process ended.
An output
and OUTPUT
folder should now exist. Lowercase output
is testdata sample output and uppercase OUTPUT
is what was just generated ("OUTPUT" is the default output directory). The second invoke can be easily repeated with the other sectors' test data. Replace the filelist's and sector yaml config's basename according to the pattern of files in the filelist
directory,
For a datadir_patt
and outdir
option example. Run:
cd ..
python -m lightningcast goes16/2023/2023_07_04_185/abi/L1b/RadM1/OR_ABI-L1b-RadM1-M6C02_G16_s20231852001262_e20231852001319_c20231852001343.nc --yaml_config $CONFIG_LOC/options/sectors/ge-radc.yaml --yaml_overrides datadir_patt=LightningCast_testdata/ outdir=./lc-demo-output
output:
2024-02-19 12:26:49.316770: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-19 12:26:49.318088: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 12:26:49.341556: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-19 12:26:49.341580: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-19 12:26:49.342177: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-19 12:26:49.345789: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 12:26:49.345903: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-19 12:26:49.756201: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-02-19 12:26:50 UTC | INFO | predict_ltg.py | predict_ltg | Process started.
2024-02-19 12:26:52.571712: E external/local_xla/xla/stream_executor/cuda/cuda_driver.cc:274] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2024-02-19 12:26:52.571756: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:129] retrieving CUDA diagnostic information for host: lpfantz-pop-os
2024-02-19 12:26:52.571763: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:136] hostname: lpfantz-pop-os
2024-02-19 12:26:52.571913: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:159] libcuda reported version is: 535.86.5
2024-02-19 12:26:52.571938: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:163] kernel reported version is: 535.86.5
2024-02-19 12:26:52.571944: I external/local_xla/xla/stream_executor/cuda/cuda_diagnostics.cc:241] kernel version seems to match DSO: 535.86.5
2024-02-19 12:26:52 UTC | INFO | predict_ltg.py | predict_ltg | Overhead: 2.613 seconds
2024-02-19 12:26:52 UTC | INFO | predict_ltg.py | predict_ltg | processing 20230704-200126 UTC...
2024-02-19 12:26:53 UTC | INFO | utils.py | plax | Performing parallax correction with satlon = -75 deg. and elevation = 9000.0 m.
2024-02-19 12:26:53 UTC | INFO | utils.py | plax | Getting new xinds (for lons) and yinds (for lats)
2024-02-19 12:26:53 UTC | INFO | utils.py | plax | Accounting for pixels off the grid
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | sector_shift | Computed satellite-zenith angle
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | predict_ltg | got C02..., (2000, 2000)
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | predict_ltg | got C05..., (1000, 1000)
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | predict_ltg | got C13..., (500, 500)
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | predict_ltg | got C15..., (500, 500)
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | predict_ltg | making predictions...
2024-02-19 12:26:53 UTC | INFO | predict_ltg.py | predict_ltg | input dims: (1, 2000, 2000, 1) (1, 1000, 1000, 1) (1, 500, 500, 2)
1/1 [==============================] - 1s 817ms/step
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | predict time: 0.855 seconds
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | Using satzen thresh. of 80 deg. to screen out large viewing-angle predictions.
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | max new_preds: 1.000
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | making contours and json...
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | write_json | wrote out ./lc-demo-output/20230704/goes_east/RadM1/json//LtgCast-RadM1_v1-0-3_g16_s202307042001262_e202307042001331_c202402191826541.json
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | write_json | wrote out ./lc-demo-output/20230704/goes_east/RadM1/json_plax//LtgCast-pc-RadM1_v1-0-3_g16_s202307042001262_e202307042001331_c202402191826543.json
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | Creating GRPlacefile for GOES_East RadM1
Wrote out ./lc-demo-output/20230704/goes_east/RadM1/placefile//LtgCast-pc-RadM1_v1-0-3_g16_s202307041901260_e202307042001260_c202402191826543.placefile
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | save_off_grid | Remapped probability data.
2024-02-19 12:26:54 UTC | INFO | utils.py | write_netcdf | Process started
2024-02-19 12:26:54 UTC | INFO | utils.py | write_netcdf | Wrote out ./lc-demo-output/20230704/goes_east/RadM1/netcdf/LightningCast_GOES-16_RadM1_20230704-200126.nc
2024-02-19 12:26:54 UTC | INFO | utils.py | write_netcdf | Process ended
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | total time: 1.789 seconds
2024-02-19 12:26:54 UTC | INFO | predict_ltg.py | predict_ltg | Process ended.
If ran without the datadir_patt
option it will fail because input_file
does not point to a valid path from the current location. This problem can also be avoided by using an absolute path.
Alternatively, scripts called in lightningcast ci testing can be used. Copy the test script test/ci-cd_tests.sh
from this repo. Open it and set $DATA_LOC
to the location of the downloaded test data. Set $CONFIG_LOC
to the location of the config directory.
Finally, uncomment $EXTRA_ARGS
and run the script. Output is ommited here but should be similiar to earlier runs.
Docker
The docker image contains the environmental variable CONFIG_LOC
which stores the path to the config directory inside the container. Note the single qutoes around the paths using this variable. This also assumes you still have LC_VERSION
set from downloading the docker image.
Run:
docker run --rm --pull=always -v./:/work gitlab.ssec.wisc.edu:5555/jcintineo/lightningcast/lightningcast-c7r:latest himawari09/2023/2023_10_11_284/HS_H09_20231011_2100_B03_FLDK_R05_S0110.DAT --yaml_config '$CONFIG_LOC/options/sectors/himawari-fldk.yaml' '$CONFIG_LOC/options/nccf.yaml'
output:
2024-02-19 18:59:14.644910: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-19 18:59:14.646131: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 18:59:14.665928: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-19 18:59:14.665978: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-19 18:59:14.666929: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-19 18:59:14.670624: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 18:59:14.670742: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-19 18:59:15.106119: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-02-19 18:59:15 UTC | INFO | predict_ltg.py | predict_ltg | Process started.
2024-02-19 18:59:15 UTC | INFO | predict_ltg.py | predict_ltg | Overhead: 0.3 seconds
2024-02-19 18:59:15 UTC | INFO | predict_ltg.py | predict_ltg | processing 20231011-210000 UTC...
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | sector_shift | Computed satellite-zenith angle
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | got crop...
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | got B03..., (1460, 2084)
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | got B05..., (365, 521)
/usr/local/lib/python3.10/site-packages/dask/core.py:127: RuntimeWarning: invalid value encountered in log
return func(*(_execute_task(a, cache) for a in args))
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | got B13..., (365, 521)
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | got B15..., (365, 521)
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | making predictions...
2024-02-19 18:59:17 UTC | INFO | predict_ltg.py | predict_ltg | input dims: (1, 1456, 2080, 1) (1, 728, 1040, 1) (1, 364, 520, 2)
1/1 [==============================] - 1s 634ms/step
2024-02-19 18:59:18 UTC | INFO | predict_ltg.py | predict_ltg | predict time: 0.681 seconds
2024-02-19 18:59:18 UTC | INFO | predict_ltg.py | predict_ltg | Using satzen thresh. of 80 deg. to screen out large viewing-angle predictions.
2024-02-19 18:59:18 UTC | INFO | predict_ltg.py | predict_ltg | max new_preds: 0.999
2024-02-19 18:59:18 UTC | INFO | predict_ltg.py | save_off_grid | Remapped probability data.
2024-02-19 18:59:18 UTC | INFO | utils.py | write_netcdf | Process started
2024-02-19 18:59:18 UTC | INFO | utils.py | write_netcdf | Wrote out /work/OUTPUT/20231011/ahi_japan/FLDK_GUAM/netcdf/LtgCast-FLDK-GUAM_v1-0-5_h9_s202310112100000_e202310112100000_c202402191859186.nc
2024-02-19 18:59:18 UTC | INFO | utils.py | write_netcdf | Process ended
2024-02-19 18:59:18 UTC | INFO | predict_ltg.py | predict_ltg | total time: 2.832 seconds
2024-02-19 18:59:18 UTC | INFO | predict_ltg.py | predict_ltg | Process ended.
run:
docker run --rm --pull=always -v./:/work gitlab.ssec.wisc.edu:5555/jcintineo/lightningcast/lightningcast-c7r:latest filelists/ge-radc.txt --yaml_config '$CONFIG_LOC/options/sectors/ge-radc.yaml' '$CONFIG_LOC/options/nccf.yaml'
output:
2024-02-19 19:01:05.930101: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-19 19:01:05.931363: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 19:01:05.950801: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-19 19:01:05.950830: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-19 19:01:05.951447: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-19 19:01:05.955020: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 19:01:05.955140: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-19 19:01:06.383617: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-02-19 19:01:06 UTC | INFO | predict_ltg.py | predict_ltg | Process started.
2024-02-19 19:01:07 UTC | INFO | predict_ltg.py | predict_ltg | Overhead: 0.271 seconds
2024-02-19 19:01:07 UTC | INFO | predict_ltg.py | predict_ltg | processing 20230704-200118 UTC...
2024-02-19 19:01:08 UTC | INFO | utils.py | plax | Performing parallax correction with satlon = -75 deg. and elevation = 9000.0 m.
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:192: RuntimeWarning: invalid value encountered in sin
(np.sin(latdiff / 2.0)) ** 2
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:193: RuntimeWarning: invalid value encountered in cos
+ np.cos(satlat_rad) * np.cos(datalat_rad) * (np.sin(londiff / 2.0)) ** 2
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:193: RuntimeWarning: invalid value encountered in sin
+ np.cos(satlat_rad) * np.cos(datalat_rad) * (np.sin(londiff / 2.0)) ** 2
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:228: RuntimeWarning: invalid value encountered in cos
- 2.0 * altitude * earth_radius * np.cos(datalat_rad)
2024-02-19 19:01:09 UTC | INFO | utils.py | plax | Getting new xinds (for lons) and yinds (for lats)
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:327: RuntimeWarning: invalid value encountered in subtract
dy = (lats[:-2, 1:-1] - lats[2:, 1:-1]) / 2.0
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:328: RuntimeWarning: invalid value encountered in subtract
dx = (lons[1:-1, :-2] - lons[1:-1, 2:]) / 2.0
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:338: RuntimeWarning: invalid value encountered in cast
xind[1:-1, 1:-1] = new_elem
/usr/local/lib/python3.10/site-packages/lightningcast/utils.py:339: RuntimeWarning: invalid value encountered in cast
yind[1:-1, 1:-1] = new_line
2024-02-19 19:01:09 UTC | INFO | utils.py | plax | Accounting for pixels off the grid
/usr/local/lib/python3.10/site-packages/lightningcast/sat_zen_angle.py:16: RuntimeWarning: invalid value encountered in cos
beta = np.arccos(np.cos(lat) * np.cos(lon))
/usr/local/lib/python3.10/site-packages/lightningcast/sat_zen_angle.py:19: RuntimeWarning: invalid value encountered in arcsin
zenith = np.arcsin(
2024-02-19 19:01:09 UTC | INFO | predict_ltg.py | sector_shift | Computed satellite-zenith angle
2024-02-19 19:01:09 UTC | INFO | predict_ltg.py | predict_ltg | got C02..., (6000, 10000)
2024-02-19 19:01:10 UTC | INFO | predict_ltg.py | predict_ltg | got C05..., (3000, 5000)
2024-02-19 19:01:10 UTC | INFO | predict_ltg.py | predict_ltg | got C13..., (1500, 2500)
2024-02-19 19:01:10 UTC | INFO | predict_ltg.py | predict_ltg | got C15..., (1500, 2500)
2024-02-19 19:01:10 UTC | INFO | predict_ltg.py | predict_ltg | making predictions...
2024-02-19 19:01:10 UTC | INFO | predict_ltg.py | predict_ltg | input dims: (1, 6000, 10000, 1) (1, 3000, 5000, 1) (1, 1500, 2500, 2)
1/1 [==============================] - 11s 11s/step
2024-02-19 19:01:21 UTC | INFO | predict_ltg.py | predict_ltg | predict time: 10.985 seconds
2024-02-19 19:01:21 UTC | INFO | predict_ltg.py | predict_ltg | Using satzen thresh. of 80 deg. to screen out large viewing-angle predictions.
2024-02-19 19:01:21 UTC | INFO | predict_ltg.py | predict_ltg | max new_preds: 1.000
2024-02-19 19:01:21 UTC | INFO | predict_ltg.py | predict_ltg | making contours and json...
2024-02-19 19:01:23 UTC | INFO | predict_ltg.py | write_json | wrote out /work/OUTPUT/20230704/goes_east/RadC/json//LtgCast-RadC_v1-0-5_g16_s202307042001183_e202307042003569_c202402191901235.json
2024-02-19 19:01:26 UTC | INFO | predict_ltg.py | write_json | wrote out /work/OUTPUT/20230704/goes_east/RadC/json_plax//LtgCast-pc-RadC_v1-0-5_g16_s202307042001183_e202307042003569_c202402191901259.json
2024-02-19 19:01:26 UTC | INFO | predict_ltg.py | predict_ltg | Creating GRPlacefile for GOES_East RadC
2024-02-19 19:01:27 UTC | INFO | predict_ltg.py | save_off_grid | Remapped probability data.
2024-02-19 19:01:27 UTC | INFO | utils.py | write_netcdf | Process started
2024-02-19 19:01:27 UTC | INFO | utils.py | write_netcdf | Wrote out /work/OUTPUT/20230704/goes_east/RadC/netcdf/LtgCast-RadC_v1-0-5_g16_s202307042001183_e202307042003569_c202402191901265.nc
2024-02-19 19:01:27 UTC | INFO | utils.py | write_netcdf | Process ended
2024-02-19 19:01:27 UTC | INFO | predict_ltg.py | predict_ltg | total time: 19.990 seconds
2024-02-19 19:01:27 UTC | INFO | predict_ltg.py | predict_ltg | Process ended.
Wrote out /work/OUTPUT/20230704/goes_east/RadC/placefile//LtgCast-pc-RadC_v1-0-5_g16_s202307041901180_e202307042001180_c202402191901262.placefile
An output
and OUTPUT
folder should now exist. Lowercase output
is testdata sample output and uppercase OUTPUT
is what was just generated ("OUTPUT" is the default output directory). The second invoke can be easily repeated with the other sectors' test data. Replace the filelist's and sector yaml config's basename according to the pattern of files in the filelist
directory,
For a datadir_patt
and outdir
option example. Run:
cd ..
docker run --rm -v./:/work --pull=always gitlab.ssec.wisc.edu:5555/jcintineo/lightningcast/lightningcast-c7r:latest goes16/2023/2023_07_04_185/abi/L1b/RadM1/OR_ABI-L1b-RadM1-M6C02_G16_s20231852001262_e20231852001319_c20231852001343.nc --yaml_config '$CONFIG_LOC/options/sectors/ge-radc.yaml' --yaml_overrides datadir_patt=LightningCast_testdata/ outdir=./lc-demo-output
output:
2024-02-19 19:05:44.187848: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-19 19:05:44.189034: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 19:05:44.208723: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-19 19:05:44.208749: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-19 19:05:44.209381: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-19 19:05:44.212880: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-19 19:05:44.213019: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-19 19:05:44.644398: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-02-19 19:05:45 UTC | INFO | predict_ltg.py | predict_ltg | Process started.
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | Overhead: 0.901 seconds
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | processing 20230704-200126 UTC...
2024-02-19 19:05:46 UTC | INFO | utils.py | plax | Performing parallax correction with satlon = -75 deg. and elevation = 9000.0 m.
2024-02-19 19:05:46 UTC | INFO | utils.py | plax | Getting new xinds (for lons) and yinds (for lats)
2024-02-19 19:05:46 UTC | INFO | utils.py | plax | Accounting for pixels off the grid
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | sector_shift | Computed satellite-zenith angle
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | got C02..., (2000, 2000)
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | got C05..., (1000, 1000)
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | got C13..., (500, 500)
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | got C15..., (500, 500)
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | making predictions...
2024-02-19 19:05:46 UTC | INFO | predict_ltg.py | predict_ltg | input dims: (1, 2000, 2000, 1) (1, 1000, 1000, 1) (1, 500, 500, 2)
1/1 [==============================] - 1s 855ms/step
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | predict time: 0.898 seconds
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | Using satzen thresh. of 80 deg. to screen out large viewing-angle predictions.
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | max new_preds: 1.000
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | making contours and json...
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | write_json | wrote out ./lc-demo-output/20230704/goes_east/RadM1/json//LtgCast-RadM1_v1-0-5_g16_s202307042001262_e202307042001331_c202402191905475.json
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | write_json | wrote out ./lc-demo-output/20230704/goes_east/RadM1/json_plax//LtgCast-pc-RadM1_v1-0-5_g16_s202307042001262_e202307042001331_c202402191905476.json
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | Creating GRPlacefile for GOES_East RadM1
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | save_off_grid | Remapped probability data.
2024-02-19 19:05:47 UTC | INFO | utils.py | write_netcdf | Process started
2024-02-19 19:05:47 UTC | INFO | utils.py | write_netcdf | Wrote out ./lc-demo-output/20230704/goes_east/RadM1/netcdf/LightningCast_GOES-16_RadM1_20230704-200126.nc
2024-02-19 19:05:47 UTC | INFO | utils.py | write_netcdf | Process ended
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | total time: 1.847 seconds
2024-02-19 19:05:47 UTC | INFO | predict_ltg.py | predict_ltg | Process ended.
Wrote out ./lc-demo-output/20230704/goes_east/RadM1/placefile//LtgCast-pc-RadM1_v1-0-5_g16_s202307041901260_e202307042001260_c202402191905477.placefile
In this example datadir_patt
is a relative path pointing to a subdirectory of the present working directory which is being mounted into the container with -v./:/work
. If a datadir_patt
is being used that either isn't a subdirectory of the present working directory or is using an absolute path it is important to also mount that path in. If run without the datadir_patt
option it will fail because input_file
does not point to a valid path from the current location. This problem can also be avoided by using an absolute path properly mounted into the container.
Alternatively, scripts called in lightningcast ci testing can be used. Output is omitted here but should be similar to earlier runs. Assuming LightningCast_testdata/
is the current working directory, run the test script as present in the docker container:
mkdir test-script-output
docker run --rm --pull=always -v./:/data/PLTG/LightningCast_testdata -v./test-script-output:/test-output --entrypoint /bin/bash gitlab.ssec.wisc.edu:5555/jcintineo/lightningcast/lightningcast-c7r:latest /test/ci-cd_tests.sh