def check_vcs(self, z1, z2, exception=1): """ Check the vertical coordinate systems If identical, return the system If not, raise an exception. """ vc = utils.level_type(z1) vc = utils.level_type(z2) if vc1 != vc2: print("Vertical coordinate systems not identical.") return False if exception: raise Exception else: return vc1
def check_vcs(self,z1,z2,exception=1): """ Check the vertical coordinate systems If identical, return the system If not, raise an exception. """ vc = utils.level_type(z1) vc = utils.level_type(z2) if vc1 != vc2: print("Vertical coordinate systems not identical.") return False if exception: raise Exception else: return vc1
def find_nearest_level(self,lv): lv_type = utils.level_type(lv) if lv_type == 'isentropic': pass # 'K' needs stripping # This will be tricky, varies a lot... elif lv_type == 'isobaric': pass # Plot logarithmically closest elif lv_type == 'surface': raise Exception # Shouldn't get here, surface should be covered. elif lv_type == 'PV-surface': pass elif lv_type == 'geometric': pass else: raise Exception return near_lv