Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## This script identifies LLWW modifiers that do not comply with associated wetland LLWW codes ##
- def codeChecker(LLWW_CODE, LLWW_MODIFIERS):
- if LLWW_MODIFIERS is not None:
- LLWW_MODIFIERS = LLWW_MODIFIERS.split(',')
- incorrect_LLWW_MODIFIERS = []
- LLWW_CODE = LLWW_CODE[0:4]
- match_dict = {'LOBA': ['bg', 'id', 'kt', 'ml', 'pd', 'pl', 'pp', 'sv', 'ts', 'go', 'hf', 'sw', 'ww', 'ds'],
- 'LOFP': ['bg', 'fm', 'id', 'kt', 'ml', 'ox', 'pd', 'pl', 'pp', 'sv', 'ts', 'aq', 'go', 'sw', 'ww', 'ds'],
- 'LOFR': ['ay', 'bg', 'id', 'kt', 'ml', 'pl', 'pp', 'sv', 'ts', 'go', 'hf', 'dr', 'sw', 'ww', 'ds', 'it'],
- 'LEBA': ['ay', 'ml', 'ox', 'pd', 'pl', 'sv', 'ts', 'ch', 'go', 'hf', 'sw', 'ww', 'ds', 'fs', 'it'],
- 'LEFP': ['ay', 'fm', 'kt', 'ml', 'ox', 'pd', 'pl', 'sv', 'ts', 'aq', 'ch', 'go', 'hf', 'sw', 'ww', 'ds', 'fs', 'it'],
- 'LEFR': ['ay', 'kt', 'ml', 'ox', 'pl', 'sv', 'ts', 'ch', 'go', 'hf', 'dr', 'sw', 'ww', 'ds', 'fs', 'it'],
- 'TEBA': ['ay', 'ml', 'pd', 'sv', 'ts', 'ch', 'au', 'it', 'rf'],
- 'TEFL': ['ay', 'fm', 'hs', 'id', 'il', 'kt', 'ox', 'pd', 'pl', 'pp', 'sv', 'ts', 'aq', 'ch', 'im', 'ar', 'au', 'ds', 'fs', 'gw', 'ir', 'it', 'rf'],
- 'TEFR': ['ay', 'kt', 'ml', 'sv', 'ts', 'ch', 'au', 'it', 'rf'],
- 'TESL': ['ay', 'fm', 'kt', 'ml', 'ox', 'pd', 'pl', 'pp', 'aq', 'ch', 'hf', 'au', 'it', 'rf']}
- if LLWW_CODE in match_dict.keys():
- for modifier in LLWW_MODIFIERS:
- if modifier in match_dict[LLWW_CODE]:
- incorrect_LLWW_MODIFIERS.append(modifier)
- return(','.join(incorrect_LLWW_MODIFIERS))
- else:
- return(None)
- else:
- return(None)
- ## This script identifies LLWW modifiers that do not comply with associated waterbody LLWW codes ##
- def codeChecker(Waterbody, LLWW_MODIFIERS):
- if LLWW_MODIFIERS is not None:
- LLWW_MODIFIERS = LLWW_MODIFIERS.split(',')
- incorrect_LLWW_MODIFIERS = []
- match_dict = {'LK': ['ay', 'il', 'pl', 'ch', 'rr', 'sw', 'ww', 'fs', 'ir', 'it'],
- 'PD': ['ay', 'sl', 'ch', 'ld', 'rr']}
- if Waterbody in match_dict.keys():
- for modifier in LLWW_MODIFIERS:
- if modifier in match_dict[Waterbody]:
- incorrect_LLWW_MODIFIERS.append(modifier)
- return(','.join(incorrect_LLWW_MODIFIERS))
- else:
- return(None)
- else:
- return(None)
- ## This script identifies LLWW modifiers that do not comply with associated flowpath LLWW codes ##
- def codeChecker(FlowPath, LLWW_MODIFIERS):
- if LLWW_MODIFIERS is not None:
- LLWW_MODIFIERS = LLWW_MODIFIERS.split(',')
- incorrect_LLWW_MODIFIERS = []
- match_dict = {'BI': ['ar', 'au', 'ds', 'fs', 'ir', 'it', 'rf'],
- 'TB': ['ds', 'fs', 'gw', 'ir', 'it',],
- 'IN': ['au', 'ds', 'fs', 'gw', 'it', 'rf'],
- 'OU': ['au', 'fs', 'ir', 'it', 'rf'],
- 'VR': ['ar', 'au', 'ds', 'fs', 'ir', 'it', 'rf']}
- if FlowPath in match_dict.keys():
- for modifier in LLWW_MODIFIERS:
- if modifier in match_dict[FlowPath]:
- incorrect_LLWW_MODIFIERS.append(modifier)
- return(','.join(incorrect_LLWW_MODIFIERS))
- else:
- return(None)
- else:
- return(None)
- ## This script identifies LLWW modifiers that do not comply with associated stream LLWW codes ##
- def codeChecker(Flow, LLWW_MODIFIERS):
- if LLWW_MODIFIERS is not None:
- LLWW_MODIFIERS = LLWW_MODIFIERS.split(',')
- incorrect_LLWW_MODIFIERS = []
- match_dict = {'1': ['ay', 'bg', 'fm', 'fn', 'id', 'il', 'kt', 'mr', 'ox', 'pl', 'pp', 'sa', 'sl', 'aq', 'go', 'gr', 'im', 'dr', 'sw', 'ww', 'wm', 'ar', 'ds', 'fs', 'gw', 'ir', 'it'],
- '2': ['ay', 'bg', 'fm', 'fn', 'id', 'il', 'kt', 'mr', 'ox', 'pl', 'pp', 'sa', 'sl', 'aq', 'go', 'gr', 'im', 'ld', 'dr', 'sw', 'ww', 'wm', 'ar', 'ds', 'ir', 'it'],
- '3': ['bg', 'fm', 'fn', 'id', 'il', 'kt', 'mr', 'ox', 'pl', 'pp', 'sa', 'sl', 'aq', 'go', 'gr', 'hy', 'im', 'ld', 'dr', 'rr', 'sw', 'ww', 'wm', 'ar', 'ds', 'ir'],
- '4': ['bg', 'fm', 'fn', 'id', 'il', 'kt', 'mr', 'ox', 'pl', 'pp', 'sa', 'sl', 'aq', 'go', 'gr', 'hy', 'im', 'ld', 'dr', 'rr', 'sw', 'ww', 'wm', 'ar', 'au', 'ds', 'gw', 'ir', 'rf'],
- '5': ['ay', 'bg', 'fm', 'fn', 'id', 'il', 'kt', 'mr', 'ox', 'pl', 'pp', 'sa', 'sl', 'go', 'gr', 'im', 'ld', 'dr', 'rr', 'ww', 'wm', 'au', 'fs', 'gw', 'ir', 'it', 'rf']}
- if Flow in match_dict.keys():
- for modifier in LLWW_MODIFIERS:
- if modifier in match_dict[Flow]:
- incorrect_LLWW_MODIFIERS.append(modifier)
- return(','.join(incorrect_LLWW_MODIFIERS))
- else:
- return(None)
- else:
- return(None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement