Added a calc_masks function for readability

The calc_masks function has an option for tri=True, if that's turned on
then the upper triangle will be excluded, but if not then it will be
included.
Included a setup_colorbar function

Again for readability