pro find_bright_band,reflectivity,location ; ******************************************* ; Written by Ben Foreback July 13, 2009 ; ******************************************* ; ; This program takes in a reflectivity column and determines ; if there is a bright band in that column based on a preset ; reflectivity difference. ; ; ******************************************* ; ; Inputs: ; reflectivity - This MUST be a vector representing the ; reflectivity at height intervals above the surface ; based radar at one single time. ; ; Outputs: ; location - This is the reflectivity index of the BOTTOM ; of the bright band. If no bright band is found, then ; the default value for location is -1. ; ; Preset variables: ; difference - The difference in reflectivity that two ; adjacent reflectivity measurements must have in order ; to trigger detection of a bright band. difference = 3.; dbz ; max_difference - Since bright bands never have really ; large differences, if the difference is greater ; than max_difference, then it should not flag a ; bright band because it is really just picking up ; noise. max_difference = 10.;dbz ; min_dbz - Since bright bands only really show up in ; thick, typically cumulonimbus clouds, we will only ; look for a bright band if the reflectivity is greater ; than this value. min_dbz = -5. ; max_layers - Maximum number of layers that can be a bright band. max_layers = 2 ; ************************************************************ location = -1; default numheights = n_elements(reflectivity) refl_flag = make_array(numheights,value=0) dummy_flag = 0 result = where(reflectivity ge min_dbz, count) if count le 0 then return refl_flag[result] = 1 for i=0,numheights-2 do begin if refl_flag[i] eq 1 and refl_flag[i+1] eq 1 then begin if reflectivity[i+1]-reflectivity[i] ge difference and $ reflectivity[i+1]-reflectivity[i] le max_difference then begin dummy_location = i+1 dummy_flag = 1 endif if dummy_flag eq 1 then begin if reflectivity[i]-reflectivity[i+1] ge difference and $ reflectivity[i]-reflectivity[i+1] le max_difference then begin if i-dummy_location le max_layers-1 then begin location=dummy_location return endif endif endif endif endfor return end