Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
361 commits
Select commit Hold shift + click to select a range
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
a640ce9
Fixed mistake with transAxes
anthony-ds Aug 11, 2021
d9ae62b
NEW! Temperature profile reading correctly. Height CFADs for HID are …
anthony-ds Aug 11, 2021
dc1818b
Put text files into input folder, changed name of output folder
anthony-ds Aug 16, 2021
4e5f3a0
Flashier message about .so file creation
anthony-ds Aug 16, 2021
699f2d5
Renamed accessing_so_files.txt name
anthony-ds Aug 16, 2021
98e9574
More clean-up of my_config.txt for clarity
anthony-ds Aug 16, 2021
a429755
Added a few words for clarity
anthony-ds Aug 16, 2021
de1fb73
Removed input()
anthony-ds Aug 16, 2021
7635462
Capitalized config file
anthony-ds Aug 16, 2021
bb035c1
Updated README
anthony-ds Aug 16, 2021
89b5c75
Removed quotes for variables type and station
anthony-ds Aug 16, 2021
21c5e39
Tried fixing weird single quote issue, no progress
anthony-ds Aug 16, 2021
5da0a82
Removed extrax and extra from software
anthony-ds Aug 16, 2021
3a24dcf
NEW! Output directory tree a.f. station and event
anthony-ds Aug 16, 2021
37ab19c
NEW! Simplified file naming for time-dependent output
anthony-ds Aug 16, 2021
1f4df16
NEW! Clean-up of output file naming, and more directory trees for eas…
anthony-ds Aug 16, 2021
246238c
NEW! RRP --> RR
anthony-ds Aug 16, 2021
d7a6087
Fixed RR issue with units - didn't detect name RR to find units if No…
anthony-ds Aug 18, 2021
5e39db1
NEW! Tab-friendly read of config file possible
anthony-ds Aug 18, 2021
d42026c
NEW! Simplified flag calls from config file, and modified comments
anthony-ds Aug 19, 2021
69d3459
cappi_multi working
anthony-ds Aug 24, 2021
7602d64
multi_xsec works - rhi figures created
anthony-ds Aug 25, 2021
0ec3008
Moved qr flags away from group, as these only function with model dat…
anthony-ds Aug 25, 2021
30346aa
Added uppercase naming for variables
anthony-ds Aug 27, 2021
6f5de26
NEW! CAPPI multi-panel optimized - proper HID colorbar, clean axes, f…
anthony-ds Aug 27, 2021
91dca3f
Adjusted ylim limit reading from config file for y-axis of multi-pane…
anthony-ds Aug 27, 2021
8c9e557
NEW! Cleaned up rhi multi-panel - similar changes as for cappi multi-…
anthony-ds Aug 27, 2021
2f9e787
Output panel figs for cappi and rhi
anthony-ds Aug 27, 2021
2af1462
Ignore .DS_Store files
anthony-ds Aug 27, 2021
81dca64
For cappi and rhi panel plots, set xlim, ylim
anthony-ds Aug 28, 2021
d638a5d
More documentation for turning plot flags on
anthony-ds Aug 28, 2021
2cb366c
NEW! Individual CAPPI and RHI figures available
anthony-ds Aug 30, 2021
5d7887a
NEW! xarray==0.18.0
anthony-ds Sep 2, 2021
0939705
Turned xlim,ylim on
anthony-ds Sep 2, 2021
4e08b1a
Adjustments for accommodate dd_on = False; remove unnecessary plot ax…
anthony-ds Sep 2, 2021
824c47e
ylab adjustment for CFAD 4-panel in case subplots not 2 x 2
anthony-ds Sep 2, 2021
d3ec1dc
The main changes are related to:
bdolan44 Sep 2, 2021
e69f964
These changes are to check which kind of sounding is being read in, o…
bdolan44 Sep 2, 2021
d70dcf4
More plotting enhancements for CFADs if there are fewer than 4 panels
anthony-ds Sep 2, 2021
25b1d8e
working on drizzle fixes.
bdolan44 Sep 2, 2021
bcbbcc6
Merge branch 'iPOLARRIS_v1.0.2' of https://github.com/anthony-ds/iPOL…
bdolan44 Sep 2, 2021
9bbe967
Removed input() for testing
anthony-ds Sep 2, 2021
14e45dd
Commented out a bunch of print statements to make a cleaner screen ou…
bdolan44 Sep 2, 2021
48ea155
Merging more changes from ADS and BD.
bdolan44 Sep 2, 2021
6053b60
Fixed spacing between CFAD panels when fewer than 4
anthony-ds Sep 2, 2021
bcfcc49
Modifications to read some data (MC3E) correctly and plot. Extra dime…
bdolan44 Sep 2, 2021
1a5d9b0
Changing HID color range back to 0 to nspecies+1.
bdolan44 Sep 2, 2021
92eb5ec
Added xlim for CFADs
anthony-ds Sep 2, 2021
55471d6
Merge branch 'iPOLARRIS_v1.0.2' of https://github.com/anthony-ds/iPOL…
anthony-ds Sep 2, 2021
f5c210a
The input file for MC3E observations.
bdolan44 Sep 2, 2021
b446053
Merge branch 'iPOLARRIS_v1.0.2' of https://github.com/anthony-ds/iPOL…
anthony-ds Sep 2, 2021
69295de
Changed output dir and set dd_on back to True
anthony-ds Sep 7, 2021
ee659ac
NEW! Masks for HID because values of -1 appear above the melting laye…
anthony-ds Sep 7, 2021
00231bb
ATTEMPT: New Doppler files that will correct the velocity plot issues...
anthony-ds Sep 8, 2021
260195d
NEW! iPOLARRIS fully functionalgit add .! All figures working, sample…
anthony-ds Sep 8, 2021
782c66f
Checked compo_ref to test different pre-processing projection
anthony-ds Sep 16, 2021
8918d0b
Renamed flags to be more obvious to user
anthony-ds Sep 16, 2021
9f9834f
Spaces
anthony-ds Sep 20, 2021
fe3d8a8
NEW! User output comments complete for entire run
anthony-ds Sep 28, 2021
e7651a7
Changed AG color to purple to distiguish better from CR
anthony-ds Sep 28, 2021
f075648
Fixed lettering on RHI multi-panel for when W is excluded
anthony-ds Oct 6, 2021
59a81d3
Changed orientation of multi-panel rhi figure
anthony-ds Oct 6, 2021
ad7f398
NEW! Radar site marker on CAPPI figures
anthony-ds Oct 6, 2021
090f904
Commented out the cappi ref function - redundant and masks some refle…
anthony-ds Oct 18, 2021
bd4abaf
Not ready to use mplstyle
anthony-ds Oct 18, 2021
6365c9a
Fixed output directory for individ cappi and rhi
anthony-ds Oct 18, 2021
16140a4
NEW! User welcome with instructions for Conda setup.
anthony-ds Oct 19, 2021
d278023
Changed rain rate limit to [1,30]
anthony-ds Oct 19, 2021
0e781cc
Spacing
anthony-ds Oct 19, 2021
f4df894
Keep settings
anthony-ds Oct 19, 2021
f54e02e
Extra input files
anthony-ds Oct 19, 2021
a817662
NEW! Only select radar files within the user-defined start and end.
anthony-ds Dec 4, 2021
1be4aa2
NEW! Added ffmpeg as dependency
anthony-ds Dec 6, 2021
f7ee81b
NEW! mp4 added as an option
anthony-ds Dec 6, 2021
765f5c8
Renamed MY_CONFIG.txt to show its for obs
anthony-ds Dec 7, 2021
a5dcae9
NEW! New config file for simulated data
anthony-ds Dec 7, 2021
19c507d
NEW! Sample simulation files for testing
anthony-ds Dec 7, 2021
45b200b
NEW! Corresponding obs samples for simulation samples
anthony-ds Dec 7, 2021
b940b6b
Changed name of obs config file
anthony-ds Dec 7, 2021
9b3d348
New obs config file
anthony-ds Dec 7, 2021
59bd647
Changed sim config file name
anthony-ds Dec 7, 2021
530283f
New test samples
anthony-ds Dec 7, 2021
b73a3fe
NEW! Accounted for multi-dim zname in wrf files, and removed T.values…
anthony-ds Dec 7, 2021
558e35b
NEW! Isolate datetime from obs or sim file
anthony-ds Dec 7, 2021
045c84e
Switched from ValueError to KeyError for removal of time dimensions
anthony-ds Dec 7, 2021
c71ea63
Removed input() to output min and max sounding T
anthony-ds Dec 7, 2021
6027485
Changed name of lat/lon variable
anthony-ds Dec 8, 2021
9a198b4
Adjusted indents in if/ele statement
anthony-ds Dec 8, 2021
8927109
Removed output print() statement
anthony-ds Dec 8, 2021
c5dfed6
Put lat/lon variable names with others
anthony-ds Dec 8, 2021
c8098e1
Changed output type to png
anthony-ds Dec 8, 2021
249ca32
Changed array size to match: sz//multiple ==> len(looped)
anthony-ds Dec 8, 2021
ccf2e57
NEW! Reading of sim config fully functional
anthony-ds Dec 8, 2021
af1ee07
Lowercase model physics name
anthony-ds Dec 9, 2021
32869f8
Corrected colormesh bin issue - make sure X length same as cfad(X,Y)
anthony-ds Dec 9, 2021
7335f13
NEW! Range of plotting improvements: inclusion of new xlim, ylim for …
anthony-ds Dec 9, 2021
79ce543
NEW! Functional first cfad comparison output figure for REF
anthony-ds Dec 9, 2021
bfb4181
NEW! Allow passing of xlabel based on variable naming
anthony-ds Dec 9, 2021
bbee02f
Fixed naming of variable longnames - capitalized letters
anthony-ds Dec 9, 2021
e16c424
NEW! Allow passing on xlabel based on variable longname
anthony-ds Dec 9, 2021
33eaf62
NEW! Enhanced CFAD plotting to compare model and obs
anthony-ds Dec 9, 2021
1436ba9
NEW! Fixed len of vol and hts; added new conditions for HID compariso…
anthony-ds Dec 11, 2021
98e3c70
NEW! HID comparison cfads work and look nice
anthony-ds Dec 11, 2021
9daeefa
NEW! Folder for past configs - need to bring them to maindir to run i…
anthony-ds Dec 11, 2021
4494aa3
Removed old dirs and config files that were moved to folder
anthony-ds Dec 11, 2021
5a9b23f
Removed old dirs and config files that were moved to folder
anthony-ds Dec 11, 2021
47c61b7
No longer needed
anthony-ds Dec 11, 2021
12dc63d
NEW! Moved contents of the BEFORE file into start of run_ipolarris
anthony-ds Dec 11, 2021
ea17ad5
Rename core scripts to remove 'new'
anthony-ds Dec 11, 2021
7084c25
No need to track pycache
anthony-ds Dec 11, 2021
82a0b4e
Tracking is done by Git
anthony-ds Dec 11, 2021
e29679c
Comment out cfad shape comment
anthony-ds Dec 11, 2021
7f2888e
NEW! Redirect output for HID_cdf to function in RadarData.py and incl…
anthony-ds Dec 11, 2021
7dd25bf
Uppercase mphys in polarris_driver output
anthony-ds Dec 11, 2021
4e56eeb
Enhanced command line outputs
anthony-ds Dec 11, 2021
9d8c772
Removed output mentioning location of csvdir
anthony-ds Dec 11, 2021
5e9ffcf
Add in args for ylab and cbar
anthony-ds Dec 11, 2021
b06a173
Add radar type to obs fig title
anthony-ds Dec 11, 2021
4c5056a
Reset all flags for OBS_CONFIG to testing
anthony-ds Dec 11, 2021
6dd2fef
Ignore .nc file > 100 MB
anthony-ds Dec 11, 2021
fc074aa
Ignore .nc file > 100 MB
anthony-ds Dec 11, 2021
6101b11
Added olym text files to be ignored
anthony-ds Dec 13, 2021
b6911f0
NEW! Restructuring of test input files for other users
anthony-ds Dec 13, 2021
72f7639
Ignore my files but keep test files
anthony-ds Dec 13, 2021
beb5209
NEW! HID comparison CFADs fixed; renaming of output directory
anthony-ds Dec 13, 2021
3089d60
Convert function broken - commented out
anthony-ds Dec 13, 2021
700aeba
Fixed radar_area function and made changes to convert_t function, tho…
anthony-ds Dec 13, 2021
d50f209
Restructuring of directories and files for user input and mine
anthony-ds Dec 13, 2021
0e18254
Ignore my logs folder
anthony-ds Dec 14, 2021
bc77883
Add int() when slicing - timeseries function
anthony-ds Dec 14, 2021
8da8983
Added underscore to merge date and time
anthony-ds Dec 14, 2021
9348b90
Added try except to ignore quotes on datetime of 12Z UWYO sounding
anthony-ds Dec 14, 2021
4fd95a2
Print all keys from config file so that in event of failure, user can…
anthony-ds Dec 14, 2021
5832979
Added a few \n
anthony-ds Dec 14, 2021
a8e932a
NEW! Separate dir for users testing with config files
anthony-ds Dec 14, 2021
6e4408b
Ignore anything outside the new testing dir
anthony-ds Dec 14, 2021
e187f76
Re-orienting of files and dirs
anthony-ds Dec 14, 2021
73633dd
NEW! Long-form hydrometeor names on HID colorbar
anthony-ds Dec 20, 2021
4058196
Changed ylim of HID subplot figs
anthony-ds Dec 20, 2021
e77c077
For testing, turn all output figs off
anthony-ds Jan 30, 2022
6919da9
Turned pause and exit option on
anthony-ds Jan 30, 2022
5ead81b
Removed '== True' for if statements, changed sounding intake if loop
anthony-ds Jan 30, 2022
c063062
NEW! Replaced wrfout sample files to test t_air
anthony-ds Jan 30, 2022
75c7275
Don't ignore POLARRIS WRF files (< 100 MB)
anthony-ds Jan 30, 2022
01e453a
Additional wrfout polarris file for testing t_air
anthony-ds Jan 30, 2022
bddd815
Toggled error exception KeyError to ValueError Line 146
anthony-ds Jan 30, 2022
ca69fe8
NEW! Able to read in wrfpol files to get temperature profile
anthony-ds Jan 31, 2022
c197f0d
NEW! polarris_driver attempting to read in WRF-POL temp data
anthony-ds Jan 31, 2022
5911456
NEW! iPOLARRIS can now take in temperature data from POLARRIS-f
anthony-ds Jan 31, 2022
29ceaf2
Skipping extra lines for long variable names
anthony-ds Mar 14, 2022
a2cd893
Improved text sizing for cappis and rhis, colorbars and radar centre …
anthony-ds Mar 14, 2022
f834402
Print out radar file names
anthony-ds Mar 14, 2022
fd7f7f1
Larger font size and colorbar option
anthony-ds Mar 14, 2022
aa1b1b0
NEW! Template config files that will be modified by ipol.sh
anthony-ds Aug 24, 2022
1a5257c
Ignore anything in configtxt dir
anthony-ds Aug 25, 2022
6491195
Set png as default output; blank out on/off flags
anthony-ds Aug 25, 2022
a7652b1
No change
anthony-ds Aug 25, 2022
ac4b3e3
New changes to xsec function for improved output - changes to lat lon…
anthony-ds Aug 25, 2022
13d3cc7
NEW! Wrapper script to generate companion text files for iPOLARRIS
anthony-ds Aug 25, 2022
7b13f7b
NEW! Quick-check script
anthony-ds Aug 25, 2022
8909074
Removed print comments
anthony-ds Aug 25, 2022
1ccab30
Removed old output files
anthony-ds Aug 25, 2022
66ff7fe
Flexibility for more WRF temp files to compare against radar timing
anthony-ds Aug 25, 2022
8b50b77
Greater sophistication with radar images
anthony-ds Aug 25, 2022
9530aba
Ignore output folder
anthony-ds Aug 26, 2022
6d215cb
NEW! Allow RR CAPPIs at all or specified altitudes
anthony-ds Aug 26, 2022
b895718
Removed key replace for ptype
anthony-ds Aug 26, 2022
2404b18
NEW! Add Pyart libraries for colorblind-friendly mapping
anthony-ds Aug 29, 2022
20f23fa
np.str ==> str
anthony-ds Aug 29, 2022
fa605cd
NEW! Removed plot_composite and plot_cappi - moved operations to Rada…
anthony-ds Aug 30, 2022
aec66bf
Added sensitivity when searching for lat/lon
anthony-ds Aug 30, 2022
d8310f4
NEW! Use RadarData to plot composite REF and cappi RR; remove redunda…
anthony-ds Aug 30, 2022
35de1fa
NEW! Rename spatial variables for use in xarray sel
anthony-ds Aug 30, 2022
39cd74e
NEW! Composite REF plotting and function for polishing lat/lon plots;…
anthony-ds Aug 30, 2022
664a86c
Change target space variables to be read by xarray sel
anthony-ds Aug 30, 2022
849cc3e
NEW! Latlon CAPPIs, reduced comments, new output directory for rain r…
anthony-ds Aug 31, 2022
77f2274
Added tqdm to count down completion of RR netcdf completion
anthony-ds Aug 31, 2022
0580116
NEW! Cartopy basemap for CAPPIs, polished CAPPI figures
anthony-ds Sep 1, 2022
fd7767e
Fixed mp4 creation for RR cappis
anthony-ds Sep 1, 2022
7db2293
Clean-up excess comments, remove REF cfad - done in plot_driver
anthony-ds Sep 2, 2022
5e6fc57
NEW! Fixed individ CAPPIs for radar vars
anthony-ds Sep 2, 2022
498ba07
NEW! Cappi-multi, RHI-multi and RHI-individ ALL functional
anthony-ds Sep 2, 2022
da82fd0
NEW! Config file for WRF input
anthony-ds Sep 13, 2022
f1e4602
Fixed reading of config file for z
anthony-ds Sep 13, 2022
38459c8
NEW! Masking of variables based on REF; check for temperature data if…
anthony-ds Sep 13, 2022
4997d95
NEW! Moved CFAD bins to RadarConfig as these are defaults
anthony-ds Sep 13, 2022
d470c8c
NEW! Pass latlon and dattype as arguments; improved x/y or lat/lon su…
anthony-ds Sep 13, 2022
727c216
NEW! Pass dattype and latlon as arguments into RadarData; loop over C…
anthony-ds Sep 13, 2022
ed46d31
NEW! New arguments to pass in
anthony-ds Sep 13, 2022
08227e4
Converted np.min/max to min/max
anthony-ds Sep 22, 2022
af21ee7
Removed redundant end line
anthony-ds Sep 22, 2022
abfcea9
NEW! Updated defaults, added CFAD defaults
anthony-ds Sep 22, 2022
583ed20
Fixed folder name and config header
anthony-ds Sep 23, 2022
cd18988
NEW! Cfad-multi
anthony-ds Sep 23, 2022
8b40a3f
NEW! Cfad-multi, and added/fixed latlon basemap
anthony-ds Sep 23, 2022
54cada2
Changed zlim to zmax, added cfad_multi, added pol_compare
anthony-ds Sep 23, 2022
bb3c0d1
NEW! Wrapper script allows model-obs comparison
anthony-ds Sep 23, 2022
04cea41
NEW! CFADs have date range at top
anthony-ds Sep 23, 2022
e18229a
Changed mp names to lowercase
anthony-ds Sep 26, 2022
3eca7ee
Experimenting with pol var masks
anthony-ds Sep 26, 2022
02bea16
NEW! Timestamp above CFADs
anthony-ds Sep 26, 2022
22758b9
Removed read
anthony-ds Sep 26, 2022
2324789
Removed tspan
anthony-ds Sep 26, 2022
ff82e8e
NEW! Comparison plots working
anthony-ds Sep 26, 2022
81630e4
NEW! Difference plots implemented with horizontal colorbars
anthony-ds Sep 27, 2022
8c4eefc
Remove a colorbar arg
anthony-ds Sep 27, 2022
efd4cb9
Add cfad output var
anthony-ds Sep 27, 2022
53edca3
Ignore my config files
anthony-ds Sep 27, 2022
45cdb45
Moved templates to configtxt/testing
anthony-ds Sep 27, 2022
f008603
New config file
anthony-ds Sep 28, 2022
fd9761d
Fixed error with xlim, ylim inputs
anthony-ds Sep 28, 2022
a39aff4
NEW! Fixed Cartopy basemaps for CAPPIs, ensured that all plots output…
anthony-ds Sep 28, 2022
1d0008b
NEW! Ensured that CAPPIs work for xlim/ylim non-latlon
anthony-ds Sep 28, 2022
c43c30f
NEW! WRF radar-relative x,y coordinates - CAPPIs now work with non-la…
anthony-ds Sep 29, 2022
002b12e
Update README
anthony-ds Oct 3, 2022
fe2b6a1
ipol.sh only works for iMAC OS
anthony-ds Oct 3, 2022
b43b518
NEW! New xshift/yshift for WRF x/y cell coordinates relative to radar…
anthony-ds Oct 3, 2022
a7b80ed
Renamed folder and file names using consistent variable names, whethe…
anthony-ds Oct 3, 2022
563c94f
Changed names_uc for vrad
anthony-ds Oct 3, 2022
b6d3849
Added grid for RHI and new upper limit for CFAD multi
anthony-ds Oct 3, 2022
7b93c9a
Normalize variable naming in command line output
anthony-ds Oct 3, 2022
282bbcb
Added if statement to creating RR files
anthony-ds Oct 4, 2022
82fc271
Adjust zmax for cfad multi to match the other panels
anthony-ds Oct 4, 2022
df6cc68
Removed excess comments
anthony-ds Oct 4, 2022
5ea8ffb
Fixed x/ylims on rhis
anthony-ds Oct 4, 2022
bfdc838
NEW! iPOLARRIS updated config files; cwr = Canadian Weather Radar; ne…
anthony-ds Oct 8, 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
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
*.ipynb
*.nc
*.cdf
*.png
*.tar.gz
*.tar
*.pyc
*.p
*.npy
*.DS_Store
*pycache*
olym*
inputtxt/*.txt
configtxt/2*
logs/*
samples/*
outputfig/*
nexrad_obs_config.txt
nexrad_wrf_config.txt
37 changes: 27 additions & 10 deletions 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 Expand Up @@ -118,7 +119,7 @@ def cfad(data = None,cfad =None,hts=None,value_bins=None, above=2.0, below=15.0,
#############################################################################################################

def cfad_plot(var,data = None,cfad=None, hts=None, nbins=20, ax=None, maxval=10.0, above=2.0, below=15.0, bins=None,
log=False, pick=None, z_resolution=1.0,levels=None,tspan =None,cont = False, rconf = None,mask = None,**kwargs):
log=False, pick=None, ylim=None, xlim=None, xlab=None, cbyes=0, z_resolution=1.0,levels=None,tspan =None,cont = False, rconf = None,mask = None,**kwargs):

if hts is None:
print ('please provide nominal heights to cfad_plot')
Expand Down Expand Up @@ -156,10 +157,10 @@ def cfad_plot(var,data = None,cfad=None, hts=None, nbins=20, ax=None, maxval=10.

# plot the CFAD
cfad_ma = np.ma.masked_where(cfad==0, cfad)
print(np.shape(cfad_ma),'cfad shape')
#print(np.shape(cfad_ma),'cfad shape')
levs = [0.02,0.05,0.1,0.2,0.5,1.0,2.0,5.0,10.0,15.0,20.,25.]
cols = ['lightgrey','silver','darkgray','slategrey','dimgray','blue','mediumaquamarine','yellow','orange','red','fuchsia','violet','thistle']
if cont is True:
levs = [0.02,0.05,0.1,0.2,0.5,1.0,2.0,5.0,10.0,15.0,20.,25.]
cols = ['silver','darkgray','slategrey','dimgray','blue','mediumaquamarine','yellow','orange','red','fuchsia','violet']
try:
pc = ax.contourf(bins[:-1],reshts,cfad_ma,levs,colors=cols,extend = 'both')
except TypeError as e:
Expand All @@ -168,17 +169,33 @@ def cfad_plot(var,data = None,cfad=None, hts=None, nbins=20, ax=None, maxval=10.
else:

if levels is not None:
cmap, norm = from_levels_and_colors([0.02,0.05,0.1,0.2,0.5,1.0,2.0,5.0,10.0,15.0,20.,25.], ['silver','darkgray','slategrey','dimgray','blue','mediumaquamarine','yellow','orange','red','fuchsia','violet']) # mention levels and colors here
cmap, norm = from_levels_and_colors(levs,cols) # mention levels and colors here
#print cmap
pc = ax.pcolormesh(bins, reshts, cfad_ma, norm=norm, cmap=cmap)
else:

pc = ax.pcolormesh(bins, reshts, cfad_ma, vmin=0, vmax=maxval, norm=norm, **kwargs)

cb = fig.colorbar(pc, ax=ax)
cb.set_label('Frequency (%)')
ax.set_ylabel('Height (km MSL)')
# try:
ax.set_xlabel(xlab,fontsize=16)
ax.tick_params(axis='both', which='major', labelsize=16)
ax.set_xlim(xlim)
ax.set_ylim(ylim)
if cbyes == 1:
lur,bur,wur,hur = ax.get_position().bounds
cbar_ax_dims = [lur+wur+0.02,bur,0.02,hur]
cbar_ax = fig.add_axes(cbar_ax_dims)
cbt = plt.colorbar(pc,cax=cbar_ax)
cbt.set_ticks(levs)
cbt.ax.tick_params(labelsize=16)
cbt.set_label('Frequency (%)', fontsize=16, rotation=270, labelpad=15)

# cb = fig.colorbar(pc, ax=ax)
# cb.set_label('Frequency (%)',fontsize=16,rotation=270,labelpad=20)
# cb.ax.tick_params(labelsize=16)
ax.set_yticks([])
ax.set_yticklabels([])
ax.tick_params(axis='y', which='major', labelsize=0)

if rconf is not None:
if var == 'DRC' or var == 'DRS':
varn = rconf.zdr_name
Expand Down
8 changes: 8 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ iPOLARRIS

This is a complimentary program to POLARRIS-f, a forward model for producing polarimetric radar observations from model simulations. This suite of tools reads in gridded data (from radar or simulation), runs radar retrievals, and makes standardized plots.

***NOTE: ipol.sh only works for iMAC environment.***

Written by Brenda Dolan
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
October 2020 - Present

based on code from Brody Fuchs

Last updated on August 16, 2021
64 changes: 40 additions & 24 deletions RadarConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@
import matplotlib.pyplot as plt
from copy import deepcopy
import datetime as dt

import pyart

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
self.kdp_name = kdp
self.ldr_name = ldr
self.rho_name = rho
self.rr_name = rr
if self.rr_name == None:
self.rr_name = 'RR'
self.temp_name = temp
self.hid_name = hid
self.vr_name = vr
Expand Down Expand Up @@ -53,33 +56,39 @@ def __init__(self, dz='DZ', zdr='DR', kdp='KD', ldr='LH', rho='RH', hid = 'HID',
self.date = tm
self.radar_name = radar_name



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.species_long = np.array(['Drizzle','Rain','Ice\nCrystals','Snow\nAggre-\ngates','Wet\nSnow','Vertical\nIce','Low-\nDensity\nGraupel','High-\nDensity\nGraupel','Hail','Big\nDrops'])
#self.hid_colors = ['White','LightBlue','MediumBlue','Darkorange','LightPink','Cyan','DarkGray',\
# 'Lime','Yellow','Red','Fuchsia']
self.hid_colors = ['LightBlue','MediumBlue','Darkorange','Purple','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.cfad_levs = [0.02,0.05,0.1,0.2,0.5,1.0,2.0,5.0,10.0,15.0,20.,25.]
self.cfad_cols = ['silver','darkgray','slategrey','dimgray','blue','mediumaquamarine','yellow','orange','red','fuchsia','violet']

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.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',\
self.cs_name: 'Convective/Stratiform',self.rr_name:'Rain Rate'}
self.cmaps = {dz: self.temp_cmap, zdr: plt.cm.Spectral_r, kdp: plt.cm.gist_heat_r, \
ldr: plt.cm.gist_rainbow_r, rho: plt.cm.jet, hid: self.hid_cmap,w:plt.cm.seismic,vr:plt.cm.bwr,self.cs_name: self.cs_cmap,self.rr_name:plt.cm.Spectral_r}
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,30],self.temp_name:[-30,30]}
self.cfbins = {dz: np.arange(-10,60.1,1), zdr: np.arange(-2,6.01,0.05), kdp: np.arange(-2,2.01,0.05), rho: np.arange(0.5,1.01,0.02), hid: '' , w: np.arange(-25,25.1,0.5), self.temp_name: np.arange(20,-60.1,-5)}
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.temp_name:5}
self.units = {dz: '(dBZ)', zdr: '(dB)', kdp: '($^{\circ}$ km$^{-1}$)', ldr: '(dB)', rho: '', hid: '',w:'(m s$^{-1}$)',vr:'(m s$^{-1}$)',self.cs_name:'',self.rr_name:'(mm hr$^{-1}$)',self.temp_name:'C'}
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.temp_name:'T'}
self.names_uc = {dz: 'REF', zdr: 'ZDR', kdp: 'KDP', ldr: 'LDR', rho: 'RHO', hid: 'HID',w:'W',vr:'VRAD',self.cs_name:'',self.rr_name:'RR',self.temp_name:'T'}
self.longnames = {dz: 'Reflectivity', zdr: 'Differential Reflectivity', kdp: 'Specific Differential Phase',\
ldr: 'Linear Depolarization Ratio', rho: 'Correlation Coefficient', hid: 'Hydrometeor Identification',w:'Vertical Velocity',vr:'Radial Velocity',\
self.cs_name: 'Convective/Stratiform',self.rr_name:'Rain Rate',self.temp_name:'Temperature'}
#self.cmaps = {dz: self.temp_cmap, zdr: plt.cm.Spectral_r, kdp: plt.cm.gist_heat_r, ldr: plt.cm.gist_rainbow_r, rho: plt.cm.jet, hid: self.hid_cmap,w:plt.cm.seismic,vr:plt.cm.bwr,self.cs_name: self.cs_cmap,self.rr_name:plt.cm.Spectral_r,self.temp_name:'RdYlBu_r'}
self.cmaps = {dz: self.temp_cmap, zdr: plt.cm.Spectral_r, kdp: plt.cm.gist_heat_r, ldr: plt.cm.gist_rainbow_r, rho: plt.cm.jet, hid: self.hid_cmap,w:plt.cm.seismic,vr:plt.cm.bwr,self.cs_name: self.cs_cmap,self.rr_name:plt.get_cmap('pyart_HomeyerRainbow'),self.temp_name:'RdYlBu_r'}
self.ticklabels = {dz: np.arange(0, 90, 10), zdr: np.arange(-1, 4, 1), kdp: np.arange(-0.5, 4.5, 1),
ldr: np.arange(-35, -15, 5), rho: np.arange(0.95, 1.01, 0.005), hid: np.append('', self.species),w:np.arange(-25,30.0,5.0),vr:np.arange(-25,30.0,5.0),
self.cs_name: self.cs_labels,self.rr_name:[0.1,1,10,30,50,70,100,130,150]}
self.cs_name: self.cs_labels,self.rr_name:[0.1,1,10,30,50,70,100,130,150],self.temp_name:np.arange(-30,35,5)}
#############################################################################################################

def print_date(self,tm=None, fmt='%Y-%m-%d %H:%M:%S %Z'):
Expand Down Expand Up @@ -126,13 +135,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 +166,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