Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
dcc5bd8
Create config and input directory files.
anthony-ds May 25, 2021
ee1a7c9
Used iPOL version of csu_fhc instead of looking for csu_radartools ve…
anthony-ds May 25, 2021
aa55376
Changed style from 'presentation' to 'default'.
anthony-ds May 25, 2021
2cf29a0
Imported UserDict.UserDict instead of collections.UserDict
anthony-ds May 25, 2021
d4f0807
Commented out line 127.
anthony-ds May 25, 2021
f7ff077
Add drop_vars line, set to False
anthony-ds May 25, 2021
f74b13d
Commented out xr.open_mfdataset line to remove 'combine' flag
anthony-ds May 25, 2021
6c0a146
Added 'convname == None ==' to config file
anthony-ds May 25, 2021
9133980
Added 'vr_name == VR ==' to config file
anthony-ds May 25, 2021
a8cf9f8
Matched config file with version that Brenda emailed
anthony-ds May 26, 2021
20c490a
Commented out ax.set_extent() for now.
anthony-ds May 26, 2021
7f114cb
Changed suffix to remove tabs (antho)
anthony-ds May 26, 2021
72cef55
Changed exception for IndexError - trying something out
anthony-ds May 26, 2021
ee9fdc8
z variable has increments of 1 starting from 0.5
anthony-ds May 26, 2021
957928c
One file only for testing
anthony-ds May 26, 2021
8540049
No issues re: exception for IndexError. Needed to change z variable i…
anthony-ds May 26, 2021
b1af059
New plotsgit add iPOLARRIS_images_test/
anthony-ds May 26, 2021
a00a0c9
Commented out xticklabels line at 1050 for now
anthony-ds May 26, 2021
489fc33
plot_vertprof - make copy of array with .copy()
anthony-ds May 26, 2021
edcb56c
Turned off cs_over for composite map
anthony-ds May 27, 2021
79ab015
Cannot change values in original array. Made second holddat var (hold…
anthony-ds May 27, 2021
840b577
Turned some flags off for debugging.
anthony-ds May 27, 2021
b1e9584
yml file
anthony-ds May 27, 2021
b56eed7
Update env.yml file
anthony-ds May 28, 2021
b9e6ccc
Added Cython as dependency for Mac
anthony-ds May 28, 2021
29f2fca
Renamed env to pol2.7
anthony-ds May 28, 2021
290bc30
Ignore .so files
anthony-ds May 29, 2021
4f49b97
No need for Cython as dependency
anthony-ds May 29, 2021
a60678b
Ignore obs.txt file - subjective
anthony-ds May 29, 2021
5ffcfd5
Temporary place for instructions to run on MAC OS.
anthony-ds May 29, 2021
bb3c922
Undid changes to ignore .so and obs.txt files
anthony-ds May 29, 2021
3d08082
Necessary to have .so file
anthony-ds May 29, 2021
85abf37
Needed
anthony-ds May 29, 2021
a915f41
Make Python most updated version
anthony-ds May 29, 2021
65511ef
UserDict is part of the collections package.
anthony-ds May 29, 2021
e402196
Dimension d of size 1 not seen anymore with updated xarray. No need t…
anthony-ds May 29, 2021
d5f36ce
Current iPOLARRIS with dependencies does not concatenate radar files …
anthony-ds May 29, 2021
f6261ad
For xarray concatenation, in open_mfdataset, flag 'combine=nested' wo…
anthony-ds May 29, 2021
9092466
Implement if/else for comparing tdum to None or float
anthony-ds May 30, 2021
b40b883
Organized output flags
anthony-ds Jun 2, 2021
8208708
Organized output flags
anthony-ds Jun 2, 2021
fe40001
Removed repeated imports; added intro comments at beginning
anthony-ds Jun 6, 2021
8eb1fb5
Comments
anthony-ds Jun 6, 2021
c0a26eb
Output file changes
anthony-ds Jun 6, 2021
9f1d4eb
Comments
anthony-ds Jun 6, 2021
8909a6d
Comments
anthony-ds Jun 6, 2021
5304606
Cleaned up import packages
anthony-ds Jun 6, 2021
ba6e194
New: able to read config file and skip empty lines
anthony-ds Jun 6, 2021
4f688f9
Manual tracking of major package upgrades and changes
anthony-ds Jun 6, 2021
b8ed391
Can skip lines now! :D
anthony-ds Jun 6, 2021
8168721
Added tabs to increase clarity
anthony-ds Jun 6, 2021
bf2b493
Added comment that config file is being read.
anthony-ds Jun 6, 2021
f88e127
Radar input directory given instead of text file with files to read
anthony-ds Jun 7, 2021
c8df7bc
Radar input directory given instead of text file with files to read
anthony-ds Jun 7, 2021
90d7a7f
Log change to input directory search
anthony-ds Jun 7, 2021
a54dabf
Rearrange input file search commands and add script pausing
anthony-ds Jun 7, 2021
0ee4f38
More comments and re-arranging
anthony-ds Jun 7, 2021
e898438
More comments
anthony-ds Jun 7, 2021
aac266b
Modified some config entries for new radar file names
anthony-ds Jun 16, 2021
c4619a5
Added newline
anthony-ds Jun 16, 2021
38c624b
Don't need these files - just need to clear git status
anthony-ds Jun 16, 2021
0a6d495
Added Doppler and sounding flag info
anthony-ds Jun 16, 2021
025a2cd
Changed from looking for text file with files to glob
anthony-ds Jun 16, 2021
fa93cfe
Removed initialized rdum
anthony-ds Jun 16, 2021
2398e03
Added timestamp variables to search for datetime in sounding filename
anthony-ds Jun 16, 2021
ad1e333
Changed names of variables for parsing datetime strings of files; cha…
anthony-ds Jun 17, 2021
312db83
Adjusted start/end time input formatting
anthony-ds Jun 17, 2021
9ed29bb
Made adjustments to sounding loops for date formatting and searching
anthony-ds Jun 17, 2021
0f156a4
Changed search for sounding station and datetime in sounding file
anthony-ds Jun 17, 2021
9bb2c3d
Attempt at requirements file for pip install
anthony-ds Jun 18, 2021
ed7e849
Removed invalid pip: line
anthony-ds Jun 18, 2021
33d58fe
Returning to text file to list input ipol files for analysis, no more…
anthony-ds Jun 21, 2021
3ac3659
Removed comments
anthony-ds Jun 21, 2021
197a778
Fixed string length of datetime for Doppler reading
anthony-ds Jun 21, 2021
150613b
Instead of using .sel() to read in a dimension for u, v, w - use matr…
anthony-ds Jun 21, 2021
8c4837b
Created new text files to house destinations of dual-pol radar, dual-…
anthony-ds Jun 21, 2021
0eaa8b1
Read in sounding files from text file
anthony-ds Jun 21, 2021
47e356a
Sample sounding files here
anthony-ds Jun 21, 2021
82966d9
Text file points to location of sounding
anthony-ds Jun 21, 2021
5c5a185
Testing
anthony-ds Jun 21, 2021
8698c75
Redirect location in sounding file of variables to first line
anthony-ds Jun 21, 2021
de40556
Start reading the sounding file line 1
anthony-ds Jun 21, 2021
f5f7c32
Include .txt files and .nc files for samples
anthony-ds Jun 22, 2021
89fde01
Compressed .nc files for git push
anthony-ds Jun 22, 2021
6af491b
Need also the regridded dopp ncs
anthony-ds Jun 22, 2021
15b9c09
New .so file
Jun 22, 2021
32d4560
radar_files ==> rfiles
anthony-ds Jun 23, 2021
1d2245f
dopp_files ==> dfiles
anthony-ds Jun 23, 2021
243b6d1
Made xlim/ylim accurate
anthony-ds Jun 23, 2021
7b95736
Testing
anthony-ds Jun 23, 2021
1294f5a
New routine to put sounding data into dictionary; renaming of soundin…
anthony-ds Jun 24, 2021
25510bf
Changed what happens if tdum.any() = None
anthony-ds Jun 24, 2021
5ed1aea
Sounding loops can be turned on.
anthony-ds Jun 24, 2021
32d7eec
Don't update files in output folder.
anthony-ds Jun 24, 2021
bea378d
Files cleared
anthony-ds Jun 24, 2021
e45b84e
Placed Anthony as contributor
anthony-ds Jun 24, 2021
3f55401
Add gfortran compiler to conda env
anthony-ds Jun 24, 2021
40869ec
Removed gfortran package install with conda
anthony-ds Jun 24, 2021
c67856e
New file explaining how to create .so files that are readable
anthony-ds Jun 29, 2021
bcf975a
Added new color-blind colormap for REF
anthony-ds Jun 29, 2021
9c3ff5f
Added new flags: (a) to turn composite reflectivity spatial plot on/o…
anthony-ds Jun 29, 2021
96039ca
Removed a few newlines
anthony-ds Jun 29, 2021
9147049
NEW: updated the plot_composite function - new layout for output figu…
anthony-ds Jun 29, 2021
035f765
Changed directory source of sounding files
anthony-ds Jun 29, 2021
3c15d1d
Added an output sub-directory for plot_composite
anthony-ds Jun 29, 2021
d183f49
Added seconds to timestamps on composite plotting figure and filename
anthony-ds Jun 29, 2021
2c4431c
Cleaned up and user-friendified the comments further
anthony-ds Jun 29, 2021
32d312b
Added output headers for user-friendliness
anthony-ds Jun 29, 2021
b9a1fc2
Adjusting comments and add some new
anthony-ds Jun 29, 2021
d2bbcdd
New flags for PPIs and CAPPIs; xlim/ylim given in km
anthony-ds Jun 30, 2021
1e35dea
Created new function in plot_driver called plot_cappi. Moves some wor…
anthony-ds Jun 30, 2021
c111987
Moved xlim, ylim up to new section
anthony-ds Jul 6, 2021
84f4ced
NEW! CAPPI plotting changes to clean up
anthony-ds Jul 6, 2021
50aee59
Updated .so file from compilation with f2py
anthony-ds Jul 6, 2021
b3249e4
NEW! Additional flags for figures plotted by run_ipolarris_new.py, an…
anthony-ds Jul 7, 2021
e35b6b6
Added more new flags
anthony-ds Jul 13, 2021
a83b7d7
Changed file names to be lowercase
anthony-ds Jul 13, 2021
a11f877
Switched cfad_mpanel_flag on
anthony-ds Jul 13, 2021
6adab1d
Added exit comments at bottom
anthony-ds Jul 13, 2021
555f505
Bbox instead of tight_layout
anthony-ds Jul 13, 2021
0924dff
Working on first advanced plots: multi-panel and HID - made pretty
anthony-ds Jul 13, 2021
d400ec9
Removed newline
anthony-ds Jul 17, 2021
0686b71
Removed white color from HID colors
anthony-ds Jul 17, 2021
06f2311
Automated normalization of HID colorbar
anthony-ds Jul 17, 2021
f9300f8
NEW! Updated HID barh plot and colorbar
anthony-ds Jul 17, 2021
86eec74
Switched over to presentation.mplstyle for graphics settings - to be …
anthony-ds Jul 19, 2021
db4367c
Brackets around velocity units
anthony-ds Jul 19, 2021
589551a
4-panel for joint_flag cleaned up with larger text font and labelling
anthony-ds Jul 20, 2021
ea21b48
Use 'W' instead of 'upward_velocity' as labels
anthony-ds Jul 20, 2021
6c44ec8
Modified colorbar
anthony-ds Jul 20, 2021
f5198b3
Made indiv_flag and hid_prof figures pretty
anthony-ds Jul 20, 2021
936b638
Made changes in temperature/VV routine - was not working
anthony-ds Jul 22, 2021
e5a2ec1
Improved temperature/VV plots and changed flags passed from config
anthony-ds Jul 22, 2021
fa7275f
When indexing self.T array, removed '...' and instead included : for …
anthony-ds Jul 22, 2021
cb3e241
NEW! Added in new config variable to elect color-blind friendly REF c…
anthony-ds Aug 4, 2021
929f450
Changed to UserDict import
anthony-ds Oct 20, 2022
0948a0b
Changed to UserDict import
anthony-ds Oct 20, 2022
b101568
Changed to open dataset without combine
anthony-ds Oct 20, 2022
db0bee6
Toggled some options
anthony-ds Oct 20, 2022
3a15de6
Added second leading index to subset dvar
anthony-ds Oct 20, 2022
38a1151
Ignore files and folders from v1.0.5
anthony-ds Oct 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
*.ipynb
*.nc
*.cdf
*.png
*.tar.gz
*.tar
*.pyc
*.p
*.npy
*.log
output/*
other_samples/*
outputfig/*
configtxt/*
nexrad*
3 changes: 2 additions & 1 deletion GeneralFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

#import analysis_tools as AT
#import lightning_tools as LT
from CSU_RadarTools.csu_radartools import csu_fhc
#from CSU_RadarTools.csu_radartools import csu_fhc
import csu_fhc
import general_tools as gentools
import RadarConfig
from matplotlib.colors import from_levels_and_colors
Expand Down
6 changes: 6 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ Colorado State University, Dept. Atmos. Sci.
bdolan@atmos.colostate.edu
May 2017

Contributions by Anthony Di Stefano
The University of British Columbia, Dept. EOAS
adistefa@eoas.ubc.ca
June 2021

based on code from Brody Fuchs

Last updated on June 23, 2021
32 changes: 21 additions & 11 deletions RadarConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class RadarConfig(object):

def __init__(self, dz='DZ', zdr='DR', kdp='KD', ldr='LH', rho='RH', hid = 'HID',conv='Con',
temp='T', x='x', y='y', z='z', u='U', v='V',rr='RR', w='Wvar',vr='VR',mphys='None',exper = 'Case',
band = 'C',lat_0 = 0,lon_0=90.0,lat_r=None,lon_r=None,lat=None,lon=None,tm = None,radar_name = None):
band = 'C',lat_0 = 0,lon_0=90.0,lat_r=None,lon_r=None,lat=None,lon=None,tm = None,radar_name = None,
color_blind = False):
# ******** first the polarimetric stuff *************
self.dz_name = dz
self.zdr_name = zdr
Expand Down Expand Up @@ -56,21 +57,23 @@ def __init__(self, dz='DZ', zdr='DR', kdp='KD', ldr='LH', rho='RH', hid = 'HID',


self.species = np.array(['DZ','RN','CR','AG','WS','VI','LDG','HDG','HA','BD'])
self.hid_colors = ['White','LightBlue','MediumBlue','Darkorange','LightPink','Cyan','DarkGray',\
'Lime','Yellow','Red','Fuchsia']
#self.hid_colors = ['White','LightBlue','MediumBlue','Darkorange','LightPink','Cyan','DarkGray',\
# 'Lime','Yellow','Red','Fuchsia']
self.hid_colors = ['LightBlue','MediumBlue','Darkorange','LightPink','Cyan','DarkGray',\
'Lime','Yellow','Red','Fuchsia']
self.pol_vars = np.array([self.dz_name, self.zdr_name, self.kdp_name, self.ldr_name, self.rho_name, self.hid_name])

self.cs_colors = ['#FFFFFF', 'DodgerBlue', 'Red', 'Khaki']
self.cs_labels = ['', 'Strat', 'Conv', 'Mixed']

self.set_dbz_colorbar()
self.set_dbz_colorbar(color_blind=color_blind)
self.set_hid_colorbar()
self.set_cs_colorbar()

# Now just set some defaults
self.lims = {dz: [0,80], zdr: [-1, 3], kdp: [-0.5, 3], ldr: [-35, -20], rho: [0.95, 1.00], hid: [0, len(self.species)+1],w:[-25,25],vr:[-25,25],self.cs_name:[0,4],self.rr_name:[0.01,150]}
self.delta = {dz: 10, zdr: 1, kdp: 1, ldr: 5, rho: 0.005, hid: 1,w:5,vr:5,self.cs_name:1,self.rr_name:10}
self.units = {dz: '(dBZ)', zdr: '(dB)', kdp: '($^{\circ}$/km)', ldr: '(dB)', rho: '', hid: '',w:'m s$^{-1}$',vr:'m s$^{-1}$',self.cs_name:'',self.rr_name:'mm hr$^{-1}$'}
self.units = {dz: '(dBZ)', zdr: '(dB)', kdp: '($^{\circ}$/km)', ldr: '(dB)', rho: '', hid: '',w:'(m s$^{-1}$)',vr:'(m s$^{-1}$)',self.cs_name:'',self.rr_name:'(mm hr$^{-1}$)'}
self.names = {dz: 'Z', zdr: 'Z$_{DR}$', kdp: 'K$_{dp}$', ldr: 'LDR', rho: r'$\rho_{hv}$', hid: '',w:'',vr:'V$_r$',self.cs_name:'',self.rr_name:'RR'}
self.longnames = {dz: 'Reflectivity', zdr: 'Differntial reflectivity', kdp: 'Specific differential phase',\
ldr: 'Linear depolarization ratio', rho: 'Correlation coefficient', hid: 'Hydrometeor identification',w:'Vertical Velocity',vr:'Radial Velocity',\
Expand Down Expand Up @@ -126,13 +129,19 @@ def sav_title(self,tm = None):
return extra
#############################################################################################################

def set_dbz_colorbar(self, color_list=None):
def set_dbz_colorbar(self, color_list=None, color_blind=False):
if color_list is None:
# just use the default here
radarcbar = ['PeachPuff','Aqua','DodgerBlue','MediumBlue','Lime', \
'LimeGreen','Green','Yellow','Orange','OrangeRed', \
'Red', 'Crimson','Fuchsia','Indigo','DarkCyan','White']
else:
if color_blind is not True:
radarcbar = ['PeachPuff','Aqua','DodgerBlue','Blue','Lime', \
'LimeGreen','Green','Yellow','Orange','DarkOrange','Red', \
'Crimson','Fuchsia','Purple','Indigo','MidnightBlue']
#radarcbar = ['PeachPuff','Aqua','DodgerBlue','MediumBlue','Lime', \
# 'LimeGreen','Green','Yellow','Orange','OrangeRed','Red', \
# 'Crimson','Fuchsia','Indigo','DarkCyan','White']
else:
radarcbar = ['Lavender', 'Thistle', 'Plum', 'MediumPurple', 'CornFlowerBlue', 'SkyBlue', 'PaleTurquoise', 'LightCyan', 'Yellow', 'Gold', 'Orange', 'DarkOrange', 'Chocolate', 'IndianRed', 'FireBrick', 'Maroon']
else:
radarcbar = deepcopy(color_list)

temp_cmap = colors.ListedColormap(radarcbar)
Expand All @@ -151,7 +160,8 @@ def set_hid_colorbar(self, color_list=None):
hidcbar = deepcopy(color_list)
self.hid_cmap = colors.ListedColormap(hidcbar)

self.boundshid = np.arange(0,12)
#self.boundshid = np.arange(0,12)
self.boundshid = np.arange(self.hid_cmap.N+1)
self.normhid = colors.BoundaryNorm(self.boundshid, self.hid_cmap.N)
#############################################################################################################
def set_cs_colorbar(self, color_list=None):
Expand Down
Loading