diff --git a/arc/__init__.py b/arc/__init__.py index 4244672..33c76bf 100644 --- a/arc/__init__.py +++ b/arc/__init__.py @@ -1,15 +1,15 @@ # This software was developed by United States Army Corps of Engineers (USACE) # employees in the course of their official duties. USACE used copyrighted, -# open source code to develop this software, as such this software +# open source code to develop this software, as such this software # (per 17 USC § 101) is considered "joint work." Pursuant to 17 USC § 105, # portions of the software developed by USACE employees in the course of their # official duties are not subject to copyright protection and are in the public # domain. -# +# # USACE assumes no responsibility whatsoever for the use of this software by # other parties, and makes no guarantees, expressed or implied, about its -# quality, reliability, or any other characteristic. -# +# quality, reliability, or any other characteristic. +# # The software is provided "as is," without warranty of any kind, express or # implied, including but not limited to the warranties of merchantability, # fitness for a particular purpose, and noninfringement. In no event shall the @@ -17,12 +17,12 @@ # liability, whether in an action of contract, tort or otherwise, arising from, # out of or in connection with the software or the use or other dealings in the # software. -# +# # Public domain portions of this software can be redistributed and/or modified # freely, provided that any derivative works bear some notice that they are # derived from it, and any modified versions bear some notice that they have -# been modified. -# +# been modified. +# # Copyrighted portions of the software are annotated within the source code. # Open Source Licenses, included in the source code, apply to the applicable # copyrighted portions. Copyrighted portions of the software are not in the @@ -40,7 +40,7 @@ -#import arc.ula_window as ula_window +import arc.ula_window as ula_window import arc.get_all as get_all import arc.ant_GUI as ant_GUI import arc.shortcut as shortcut diff --git a/arc/ant_GUI.py b/arc/ant_GUI.py index 9be3a04..91ab5cb 100644 --- a/arc/ant_GUI.py +++ b/arc/ant_GUI.py @@ -731,8 +731,15 @@ def calculate_and_graph(self): elif current_style == 'Switch to Unique Dates': #Means it is currently on CSV self.get_inputs_csv() except Exception: - self.L.Wrap(traceback.format_exc()) + print('The APT cannot complete this analysis.\n') + print('The following error occurred. Please close the APT and reboot.\n') + # self.L.Wrap(traceback.format_exc()) raise + + # python = sys.executable + # os.execl(python, python, * sys.argv) + # self.master.mainloop() + # End of calculate_and_graph method @@ -1184,9 +1191,9 @@ def calculate_or_add_batch(self, batch, params): forecast_enabled = True # Import anteProcess try: - from . import anteProcess - except Exception: import anteProcess + except Exception: + from . import anteProcess # Set data_variable specific variables if radio == 'Rain': if self.rain_instance is None: diff --git a/arc/anteProcess.py b/arc/anteProcess.py index 78d059f..78e82a3 100644 --- a/arc/anteProcess.py +++ b/arc/anteProcess.py @@ -72,6 +72,7 @@ import matplotlib.ticker as ticker from matplotlib import rcParams import pylab + # Stop annoying urllib3 errors for EPQS tests # import logging # logging.getLogger("urllib3").setLevel(logging.ERROR) @@ -866,8 +867,7 @@ def getStations(self): self.wimp_scraper.get_season(lat=float(self.site_lat), lon=float(self.site_long), month=int(self.dates.observation_month), - output_folder=None, - # output_folder=self.folderPath, + output_folder=self.folderPath, watershed_analysis=self.watershed_analysis) del palmer_value, palmer_class, palmer_color # Query all Elevations @@ -881,8 +881,11 @@ def getStations(self): # find the primary station after multiprocessing finishes need_primary = True - primary_station = self.getBest(need_primary=need_primary) - print(primary_station.location) + try: + primary_station = self.getBest(need_primary=need_primary) + print(primary_station.location) + except: + self.log.Wrap("No suitable primary station locations were found by the APT...") secondary_stations_sorted_list = [] if primary_station is not None: # Note that the primary station has been found @@ -1067,37 +1070,23 @@ def createFinalDF(self): num_rows_antecedent = missing_before_antecedent-missing_after_antecedent num_rows = num_rows_normal + num_rows_antecedent if num_rows > 0: - if n == 1: # n=1 should be the primary station in the station list - num_stations_used += 1 - # BUILD STATIONS TABLE - vals = [] - vals.append(station.name) - vals.append(station.location) - vals.append(station.elevation) - vals.append("{0}*".format(station.distance)) - vals.append("{0}*".format(station.elevDiff)) - vals.append("{0}*".format(station.weightedDiff)) - vals.append(num_rows_normal) - vals.append(num_rows_antecedent) - station_table_values.append(vals) - else: - num_stations_used += 1 - # BUILD STATIONS TABLE - vals = [] - vals.append(station.name) - vals.append(station.location) - vals.append(station.elevation) - vals.append(station.distance) - vals.append(station.elevDiff) - vals.append(station.weightedDiff) - vals.append(num_rows_normal) - vals.append(num_rows_antecedent) - station_table_values.append(vals) + num_stations_used += 1 + # BUILD STATIONS TABLE + vals = [] + vals.append(station.name) + vals.append(station.location) + vals.append(station.elevation) + vals.append(station.distance) + vals.append(station.elevDiff) + vals.append(station.weightedDiff) + vals.append(num_rows_normal) + vals.append(num_rows_antecedent) + station_table_values.append(vals) # SAVE RESULTS TO CSV IN OUTPUT DIRECTORY if self.save_folder is not None: # Generate output try: - station_csv_name = '{}_{}.csv'.format(best_station.name,self.dates.observation_date).replace('/','_') # Slashes keep getting added to file names somehow, causing failures here + station_csv_name = '{}_{}.csv'.format(station.name,self.dates.observation_date).replace('/','_') # Slashes keep getting added to file names somehow, causing failures here station_csv_path = os.path.join(self.stationFolderPath, station_csv_name) if os.path.isfile(station_csv_path) is False: self.log.Wrap('Saving station data to CSV in output folder...') @@ -1502,6 +1491,7 @@ def createFinalDF(self): # Get WebWIMP Wet/Dry Season Determination if self.data_type == 'PRCP': + # Querying WebWIMP to collect Wet / Dry season info...' try: # Querying WebWIMP to collect Wet / Dry season info...' wet_dry_season_result = self.wimp_scraper.get_season(lat=float(self.site_lat), @@ -1552,15 +1542,12 @@ def createFinalDF(self): # Make graph tic marks face outward rcParams['xtick.direction'] = 'out' rcParams['ytick.direction'] = 'out' - # Construct Figure plt.ion() # MAKES PLOT.SHOW() NON-BLOCKING fig = plt.figure(figsize=(17, 11)) fig.set_facecolor('0.77') fig.set_dpi(140) - # add a footer to the station table to describe the asterisk. - footer_text = '*This station is considered the primary station and these values are generated in relation to the location of interest.' - fig.text(0.51,0.31, footer_text, fontsize=10, color="black") + # fig.text(0.51,0.31, fontsize=10, color="black") if self.data_type == 'PRCP': # if num_stations_used < 14: ax1 = plt.subplot2grid((9, 10), (0, 0), colspan=10, rowspan=6) @@ -1906,38 +1893,16 @@ def createFinalDF(self): # None, # SAVE_FOLDER, # False] - INPUT_LIST = ['PRCP', - '38.5', - '-121.5', - 2018, + INPUT_LIST = [['PRCP', + '36.98', + '-110.084', + 2021, + 4, 10, - 15, None, None, SAVE_FOLDER, - False] - INPUT_LIST = [ - ['PRCP', '38.5', '-121.5', 1935, 5, 15, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1940, 2, 29, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1941, 2, 28, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1942, 12, 7, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1943, 6, 12, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1944, 7, 19, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1945, 8, 21, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1950, 3, 15, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1951, 6, 16, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1952, 7, 4, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1965, 1, 1, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1971, 5, 28, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1973, 7, 4, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1978, 11, 21, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1981, 12, 2, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1984, 4, 24, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1985, 9, 13, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1989, 5, 18, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 1998, 12, 1, None, None, SAVE_FOLDER, False], - ['PRCP', '38.5', '-121.5', 2020, 6, 20, None, None, SAVE_FOLDER, False], - ] + False]] for i in INPUT_LIST: INSTANCE.setInputs(i, watershed_analysis=False, all_sampling_coordinates=None) input('Stall for debugging. Press enter or click X to close') diff --git a/arc/custom_watershed_query.py b/arc/custom_watershed_query.py index d7d6ead..0603d29 100644 --- a/arc/custom_watershed_query.py +++ b/arc/custom_watershed_query.py @@ -1,15 +1,15 @@ # This software was developed by United States Army Corps of Engineers (USACE) # employees in the course of their official duties. USACE used copyrighted, -# open source code to develop this software, as such this software +# open source code to develop this software, as such this software # (per 17 USC § 101) is considered "joint work." Pursuant to 17 USC § 105, # portions of the software developed by USACE employees in the course of their # official duties are not subject to copyright protection and are in the public # domain. -# +# # USACE assumes no responsibility whatsoever for the use of this software by # other parties, and makes no guarantees, expressed or implied, about its -# quality, reliability, or any other characteristic. -# +# quality, reliability, or any other characteristic. +# # The software is provided "as is," without warranty of any kind, express or # implied, including but not limited to the warranties of merchantability, # fitness for a particular purpose, and noninfringement. In no event shall the @@ -17,12 +17,12 @@ # liability, whether in an action of contract, tort or otherwise, arising from, # out of or in connection with the software or the use or other dealings in the # software. -# +# # Public domain portions of this software can be redistributed and/or modified # freely, provided that any derivative works bear some notice that they are # derived from it, and any modified versions bear some notice that they have -# been modified. -# +# been modified. +# # Copyrighted portions of the software are annotated within the source code. # Open Source Licenses, included in the source code, apply to the applicable # copyrighted portions. Copyrighted portions of the software are not in the @@ -93,7 +93,7 @@ def findHorizontalUnits(csString): def shapefile_sample(lat, lon, shapefile): """ Identify the HUC of a given huc_digits in which the supplied coordinates lie. - If selected, generate random sampling points (# and minimum spacing determined by HUC Digits) + If selected, generate random sampling points (# and minimum spacing determined by HUC Digits) """ # Shapefile Query Adapted from # https://stackoverflow.com/questions/7861196/check-if-a-geopoint-with-latitude-and-longitude-is-within-a-shapefile/13433127#13433127 @@ -145,7 +145,7 @@ def shapefile_sample(lat, lon, shapefile): # Set up a spatial filter such that the only features we see when we # loop through "lyr_in" are those which overlap the point defined above - log.Wrap(' -Filtering HUC8 features by spatial overlap with selected coordinates...') + log.Wrap(' -Filtering HUC8 features by spatial overlap with selected coordinates...') lyr_in.SetSpatialFilter(pt) # Loop through the overlapped features and display the field of interest for feat_in in lyr_in: @@ -158,14 +158,12 @@ def shapefile_sample(lat, lon, shapefile): if not horizontal_units.lower() in supported_units: # Transform geometry to Albers selected_feature_geometry.Transform(transform_source_to_albers) - transform_back = transform_albers_to_wgs # Update horizontal units geo_ref = selected_feature_geometry.GetSpatialReference() horizontal_units = findHorizontalUnits(str(geo_ref)) if horizontal_units.lower() in supported_units: # Calculate Area selected_huc_area = selected_feature_geometry.GetArea() - transform_back = rtran # Convert Area to Square Miles if horizontal_units.lower() in ['meter', 'meters']: huc_square_miles = selected_huc_area / 2590000 @@ -206,7 +204,7 @@ def shapefile_sample(lat, lon, shapefile): # Announce protocol commencement log.Wrap('') log.Wrap('Generating potential sampling points and testing the above conditions...') - + # Add initially selected coordinates as the first sampling point previously_selected_points.append(pt) coordinates_within_polygon.append([lat, lon]) @@ -228,7 +226,7 @@ def shapefile_sample(lat, lon, shapefile): test_x_round = round(test_x, 6) test_y_round = round(test_y, 6) if points_tested_since_last_success > 3000: - if num_points < 997: + if num_points < 997: log.Wrap('Sampling complete (3000 consecutive points tested since the last suitable one was found).') break else: @@ -261,7 +259,10 @@ def shapefile_sample(lat, lon, shapefile): num_points -= 1 points_selected += 1 previously_selected_points.append(test_pt) - [wgs_lon, wgs_lat, z] = transform_back.TransformPoint(test_x, test_y) + if not horizontal_units.lower() in supported_units: + [wgs_lon, wgs_lat, z] = transform_albers_to_wgs.TransformPoint(test_x, test_y) + else: + [wgs_lon, wgs_lat, z] = rtran.TransformPoint(test_x, test_y) wgs_lat = round(wgs_lat, 6) wgs_lon = round(wgs_lon, 6) coordinates_within_polygon.append([wgs_lat, wgs_lon]) @@ -289,6 +290,3 @@ def shapefile_sample(lat, lon, shapefile): # print(point) duration = time.clock() - start_time print('DevOnly: Processing took {} seconds'.format(duration)) - - - diff --git a/arc/ula_window.py b/arc/ula_window.py index b9ab417..b2bb05f 100644 --- a/arc/ula_window.py +++ b/arc/ula_window.py @@ -165,45 +165,45 @@ def checkboxChecked(self): def click_accept_button(self): self.master.destroy() # Close ULA window self.write_ula_accepted_file() - print('Checking for a newer version of the APT...') - get_all.main() - print('Checking for all required images...') - get_all.ensure_images() - print('Checking for Watershed Boundary Dataset - HUC2.shp...') - get_all.ensure_wbd_folder() - print('Checking for U.S. Boundary dataset...') - get_all.ensure_us_shp_folder() - print('Checking for NOAA Climate Divisions dataset...') - get_all.ensure_climdiv_folder() - print('Checking for latest nationwide cache of the Web-based Watershed Interactive Modeling Program (WebWIMP) results...') - get_all.ensure_WIMP() - print('Checking for all additional binaries required for exectuion...') - get_all.ensure_binaries() - print("All checks completed successfully.") - print("") - print('Launching APT...') - module_folder = os.path.dirname(os.path.realpath(__file__)) - root_folder = os.path.split(module_folder)[0] - main_exe_path = '"{}\\main_ex.exe"'.format(root_folder) - test = subprocess.Popen(main_exe_path, shell=True) - time.sleep(2) - x = test.poll() - if x == 4294967295: - print('The APT is malfunctioning, likely due to a failed update.') - print(' Attempting to repair the directory...') - get_all.attempt_repair() - print('Repair package installed successfully. Attempting to run main EXE again...') - test = subprocess.Popen(main_exe_path, shell=True) - time.sleep(2) - x = test.poll() - if x == 4294967295: - print('Repair was unsuccessful. Please email APT-Report-Issue@usace.army.mil') - print(' to apprise them of the current situation. If you try the tool again') - print(' later, updates will likely have been made to correct the issue.') - time.sleep(1) - print('Closign in 5 seconds...') - time.sleep(5) - sys.exit() + # print('Checking for a newer version of the APT...') + # get_all.main() + # print('Checking for all required images...') + # get_all.ensure_images() + # print('Checking for Watershed Boundary Dataset - HUC2.shp...') + # get_all.ensure_wbd_folder() + # print('Checking for U.S. Boundary dataset...') + # get_all.ensure_us_shp_folder() + # print('Checking for NOAA Climate Divisions dataset...') + # get_all.ensure_climdiv_folder() + # print('Checking for latest nationwide cache of the Web-based Watershed Interactive Modeling Program (WebWIMP) results...') + # get_all.ensure_WIMP() + # print('Checking for all additional binaries required for exectuion...') + # get_all.ensure_binaries() + # print("All checks completed successfully.") + # print("") + # print('Launching APT...') + # module_folder = os.path.dirname(os.path.realpath(__file__)) + # root_folder = os.path.split(module_folder)[0] + # main_exe_path = '"{}\\main_ex.exe"'.format(root_folder) + # test = subprocess.Popen(main_exe_path, shell=True) + # time.sleep(2) + # x = test.poll() + # if x == 4294967295: + # print('The APT is malfunctioning, likely due to a failed update.') + # print(' Attempting to repair the directory...') + # get_all.attempt_repair() + # print('Repair package installed successfully. Attempting to run main EXE again...') + # test = subprocess.Popen(main_exe_path, shell=True) + # time.sleep(2) + # x = test.poll() + # if x == 4294967295: + # print('Repair was unsuccessful. Please email APT-Report-Issue@usace.army.mil') + # print(' to apprise them of the current situation. If you try the tool again') + # print(' later, updates will likely have been made to correct the issue.') + # time.sleep(1) + # print('Closign in 5 seconds...') + # time.sleep(5) + # sys.exit() def click_cancel_button(self): self.master.destroy() # Close ULA window @@ -233,6 +233,7 @@ def write_ula_accepted_file(self): def run(self): # Find "ula_accepted.txt" + count = 0 module_path = os.path.dirname(os.path.realpath(__file__)) root_folder = os.path.split(module_path)[0] ula_accepted_file = os.path.join(root_folder, 'ula_accepted') @@ -242,6 +243,7 @@ def run(self): else: self.master.mainloop() + if __name__ == '__main__': APP = Main() APP.run() diff --git a/arc/watershed_summary.py b/arc/watershed_summary.py index fe11330..911a3fc 100644 --- a/arc/watershed_summary.py +++ b/arc/watershed_summary.py @@ -1,15 +1,15 @@ # This software was developed by United States Army Corps of Engineers (USACE) # employees in the course of their official duties. USACE used copyrighted, -# open source code to develop this software, as such this software +# open source code to develop this software, as such this software # (per 17 USC § 101) is considered "joint work." Pursuant to 17 USC § 105, # portions of the software developed by USACE employees in the course of their # official duties are not subject to copyright protection and are in the public # domain. -# +# # USACE assumes no responsibility whatsoever for the use of this software by # other parties, and makes no guarantees, expressed or implied, about its -# quality, reliability, or any other characteristic. -# +# quality, reliability, or any other characteristic. +# # The software is provided "as is," without warranty of any kind, express or # implied, including but not limited to the warranties of merchantability, # fitness for a particular purpose, and noninfringement. In no event shall the @@ -17,12 +17,12 @@ # liability, whether in an action of contract, tort or otherwise, arising from, # out of or in connection with the software or the use or other dealings in the # software. -# +# # Public domain portions of this software can be redistributed and/or modified # freely, provided that any derivative works bear some notice that they are # derived from it, and any modified versions bear some notice that they have -# been modified. -# +# been modified. +# # Copyrighted portions of the software are annotated within the source code. # Open Source Licenses, included in the source code, apply to the applicable # copyrighted portions. Copyrighted portions of the software are not in the @@ -171,7 +171,7 @@ def parse_results(results_list): parse_result.append(sampling_points_table_colors) return parse_result - + def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, huc_size, results_list, watershed_summary_path): """Creates Summary of results and prints to pdf""" @@ -181,7 +181,7 @@ def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, # Parse results list using function parsed_results = parse_results(results_list) - + # Unpack function results avg_ap_score = parsed_results[0] preliminary_determination = parsed_results[1] @@ -191,16 +191,33 @@ def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, pie_colors = parsed_results[5] sampling_points_table_values = parsed_results[6] sampling_points_table_colors = parsed_results[7] - + # Construct Figure #plt.ion() # MAKES PLOT.SHOW() NON-BLOCKING fig = plt.figure(figsize=(13.5, 8.5)) fig.set_facecolor('0.90') + + # Add Logo + fig.set_dpi(135) + import os + MODULE_PATH = os.path.dirname(os.path.realpath(__file__)) + ROOT = os.path.split(MODULE_PATH)[0] + images_folder = os.path.join(ROOT, 'images') + logoFile = os.path.join(images_folder, 'Traverse_80%_1920.png') + logo = plt.imread(logoFile) + img = fig.figimage(X=logo, xo=0, yo=0) + img.set_zorder(0) + ax1 = plt.subplot2grid((20, 9), (3, 1), colspan=4, rowspan=2) ax2 = plt.subplot2grid((20, 9), (6, 1), colspan=4, rowspan=2) ax3 = plt.subplot2grid((20, 9), (9, 1), colspan=4, rowspan=2) ax4 = plt.subplot2grid((20, 9), (12, 0), colspan=9, rowspan=9) ax5 = plt.subplot2grid((20, 18), (3, 11), colspan=4, rowspan=7) + ax1.set_zorder(1) + ax2.set_zorder(1) + ax3.set_zorder(1) + ax4.set_zorder(1) + ax5.set_zorder(1) #pie_colors = [light_red, light_green, light_blue] patchyes, texts, autotexts = ax5.pie(pie_sizes, @@ -212,20 +229,12 @@ def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, for autotext in autotexts: autotext.set_color('white') autotext.set_path_effects([path_effects.Stroke(linewidth=3, foreground='black'), path_effects.Normal()]) - + for text in texts: text.set_color('white') text.set_path_effects([path_effects.Stroke(linewidth=3, foreground='black'), path_effects.Normal()]) - # Add Logo - fig.set_dpi(135) - import os - MODULE_PATH = os.path.dirname(os.path.realpath(__file__)) - ROOT = os.path.split(MODULE_PATH)[0] - images_folder = os.path.join(ROOT, 'images') - logoFile = os.path.join(images_folder, 'Traverse_80%_1920.png') - logo = plt.imread(logoFile) - img = fig.figimage(X=logo, xo=0, yo=0) + # for text in texts: @@ -362,7 +371,7 @@ def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, today_str = today_datetime.strftime('%Y-%m-%d') # Add Generated on today's date text #date_generated_text = ax1.text(0.027, 0.153, "Generated on {}".format(today_str), size=10, color='white') - date_generated_text = ax1.text(0.025, 0.153, "Generated on {}".format(today_str), size=10, color='white') + date_generated_text = fig.text(0.45, 0.93, "Generated on {}".format(today_str), size=10, color='white') date_generated_text.set_path_effects([path_effects.Stroke(linewidth=3, foreground='black'), path_effects.Normal()]) # Remove space between subplots @@ -381,7 +390,7 @@ def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, # Save PDF print('Saving Watershed Summary figure...') fig.savefig(watershed_summary_path, facecolor='0.90') - + # Closing figure in memory safe way print('Closing figure...') pylab.close(fig) @@ -529,9 +538,9 @@ def create_summary(site_lat, site_long, observation_date, geographic_scope, huc, # huc_size=1266.29, # results_list=RESULTS_LIST, # watershed_summary_path=WATERSHED_SUMMARY_PATH) - + if WATERSHED_SUMMARY_PATH: import subprocess subprocess.Popen(WATERSHED_SUMMARY_PATH, shell=True) -len('Cosumnes River (ESRI)') \ No newline at end of file +len('Cosumnes River (ESRI)') diff --git a/main_ex.py b/main_ex.py new file mode 100644 index 0000000..4060d38 --- /dev/null +++ b/main_ex.py @@ -0,0 +1,91 @@ +# This software was developed by United States Army Corps of Engineers (USACE) +# employees in the course of their official duties. USACE used copyrighted, +# open source code to develop this software, as such this software +# (per 17 USC § 101) is considered "joint work." Pursuant to 17 USC § 105, +# portions of the software developed by USACE employees in the course of their +# official duties are not subject to copyright protection and are in the public +# domain. +# +# USACE assumes no responsibility whatsoever for the use of this software by +# other parties, and makes no guarantees, expressed or implied, about its +# quality, reliability, or any other characteristic. +# +# The software is provided "as is," without warranty of any kind, express or +# implied, including but not limited to the warranties of merchantability, +# fitness for a particular purpose, and noninfringement. In no event shall the +# authors or U.S. Government be liable for any claim, damages or other +# liability, whether in an action of contract, tort or otherwise, arising from, +# out of or in connection with the software or the use or other dealings in the +# software. +# +# Public domain portions of this software can be redistributed and/or modified +# freely, provided that any derivative works bear some notice that they are +# derived from it, and any modified versions bear some notice that they have +# been modified. +# +# Copyrighted portions of the software are annotated within the source code. +# Open Source Licenses, included in the source code, apply to the applicable +# copyrighted portions. Copyrighted portions of the software are not in the +# public domain. + +###################################### +## ------------------------------- ## +## Antecedent Precipitation Tool ## +## ------------------------------- ## +## Written by: Jason Deters ## +## ------------------------------- ## +## Last Edited on: 2020-06-22 ## +## ------------------------------- ## +###################################### + +# Import Standard Libraries +import multiprocessing + +# Import Custom Libraries +import arc + +TITLE = """ + + ++++ +++ ++++ +++ ++++ +++ _ _ _ + hNNN +NNNy hNNm yNNN+ mNNd oNNN+ /\ | | | | | | + hMMMhhMMMmymMMN hMMMhyNMMmyhMMM+ / \ _ __ | |_ ___ ___ ___ __| | ___ _ __ | |_ + sNMMMMMMMMMMMMd syyo syyy yyys sNMMMMMMMMMMMMm / /\ \ | '_ \| __/ _ \/ __/ _ \/ _` |/ _ \ '_ \| __| + +mMMMMMMMMMMs NMMh mMMMo+MMMN +dMMMMMMMMMMh / ____ \| | | | || __/ (_| __/ (_| | __/ | | | |_ + dMMMm++MMMM+ NMMNNMMMMNNMMMN yMMMMo+dMMMs _/_/_ \_\_| |_|\__\___|\___\___|\__,_|\___|_| |_|\__| + dMMMm MMMM+ yNMMMMMMMMMMMmy yMMMM+ dMMMs | __ \ (_) (_) | | | (_) + dMMMm MMMM+ sMMMMMMMMMMm+ yMMMM+ dMMMs | |__) | __ ___ ___ _ _ __ _| |_ __ _| |_ _ ___ _ __ + dMMMmooMMMMyyyyyyhMMMMMMMMMMmyyyyyydMMMMsodMMMs | ___/ '__/ _ \/ __| | '_ \| | __/ _` | __| |/ _ \| '_ \ + dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMs | | | | | __/ (__| | |_) | | || (_| | |_| | (_) | | | | + dMMMMMMMMMMMMMMMMMMMNhysshmMMMMMMMMMMMMMMMMMMMs |_|___|_|_ \___|\___|_| .__/|_|\__\__,_|\__|_|\___/|_| |_| + dMMMNyyMMMMMMyymMMMh+ hMMMNyyMMMMMMhymMMMs |__ __| | | | | + dMMMm MMMMMM dMMN NMMN NMMMMM+ dMMMs | | ___ ___ | | |_| + dMMMm MMMMMM+ dMMm mMMN NMMMMM+ dMMMs | |/ _ \ / _ \| | -Written by: + +dMMMMm++MMMMMMddNMMm mMMMddMMMMMMo+dMMMNh | | (_) | (_) | | Jason C. Deters, + hMMMMMMNNMMMMMMMMMMMm mMMMMMMMMMMMNNNMMMMMo |_|\___/ \___/|_| U.S. Army Corps of Engineers + hMMMMMMMMMMMMMMMMMMMNhhhhhhhhhNMMMMMMMMMMMMMMMMMMMo + ymmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm+ + +""" +def ula_window(): + # Launch ULA + APP = arc.ula_window.Main() + APP.run() + +def main(): + print(TITLE) + # Launch GUI + APP = arc.ant_GUI.Main() + APP.run() + +if __name__ == '__main__': + multiprocessing.freeze_support() + arc.get_all.ensure_antecdent_precipitation_tool_exe() + arc.get_all.ensure_images() + arc.get_all.ensure_wbd_folder() + arc.get_all.ensure_us_shp_folder() + arc.get_all.ensure_climdiv_folder() + arc.get_all.ensure_WIMP() + arc.get_all.ensure_binaries() + arc.shortcut.create_shortcut_frozen() + ula_window() + main() diff --git a/v/main_ex b/v/main_ex index f8f3c08..140333f 100644 --- a/v/main_ex +++ b/v/main_ex @@ -1 +1 @@ -1.0.18 +1.0.19 diff --git a/version b/version index 21e8796..140333f 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.3 +1.0.19