required=False) vargs = parser.parse_args() if vargs.output_path is None: vargs.output_path = tempfile.mkdtemp() if not os.path.exists(vargs.output_path): raise ValueError('{path} not a valid path'.format(path=vargs.output_path)) sys.exit(1) return vargs if __name__ == "__main__": """ Processing of the full BOM WAVE DM dataset ./bom_wave_dm_process -i $ARCHIVE_DIR/AODN/BOM_WAVE_DM """ vargs = args() station_ls = filter(lambda f: os.path.isdir(f), glob.glob('{dir}/*'.format(dir=vargs.dataset_path))) global logger logger = IMOSLogging().logging_start(os.path.join(vargs.output_path, 'process.log')) for station_path in station_ls: logger.info('Processing WAVES for {station_path}'.format(station_path=os.path.basename(station_path))) process_station(station_path, vargs.output_path) logger.info('End of processing')
if vargs.output_path is None: vargs.output_path = tempfile.mkdtemp() if not os.path.exists(vargs.output_path): try: os.makedirs(vargs.output_path) except Exception as e: raise ValueError('{path} not a valid path'.format(path=vargs.output_path)) sys.exit(1) return vargs if __name__ == "__main__": """ Processing of the full BOM WAVE DM dataset ./bom_wave_dm_process -i $ARCHIVE_DIR/AODN/BOM_WAVE_DM """ vargs = args() station_ls = filter(lambda f: os.path.isdir(f), glob.glob('{dir}/*'.format(dir=vargs.dataset_path))) global logger logger = IMOSLogging().logging_start(os.path.join(vargs.output_path, 'process.log')) for station_path in station_ls: logger.info('Processing WAVES for {station_path}'.format(station_path=os.path.basename(station_path))) process_station(station_path, vargs.output_path) logger.info('End of processing')
if __name__ == "__main__": """ Processing of the full WAVERIDER dataset from DOT-WA ./wa_waverider_process """ vargs = args() global logger logger = IMOSLogging().logging_start(os.path.join(vargs.output_path, 'process.log')) if not os.path.exists(WIP_DIR): os.makedirs(WIP_DIR) sites_info = retrieve_sites_info_waverider_kml() for _, id in enumerate(sites_info): site_info = sites_info[id] logger.info('Processing WAVES for id: {id} {site_path}'.format(id=id, site_path=site_info['site_name'])) temporary_data_path, site_info = download_site_data(site_info) # returned site_info has extra md5 info from zip try: if site_info['already_uptodate']: logger.info('{site_path} already up to date'.format(site_path=site_info['site_name'])) shutil.rmtree(temporary_data_path) continue process_site(temporary_data_path, vargs.output_path, site_info) except Exception as e: logger.error(str(e)) logger.error(traceback.print_exc()) if os.path.exists(temporary_data_path): shutil.rmtree(temporary_data_path)
./wa_awac_process """ vargs = args() global logger logger = IMOSLogging().logging_start(os.path.join(vargs.output_path, 'process.log')) if not os.path.exists(WIP_DIR): os.makedirs(WIP_DIR) sites_info = retrieve_sites_info_awac_kml() for _, site_code in enumerate(sites_info): site_info = sites_info[site_code] temporary_data_path, site_info = download_site_data(site_info) # returned site_info has extra md5 info site_name = site_info['site_code'] try: if site_info['already_uptodate']: logger.info('{site_path} already up to date'.format(site_path=site_name)) shutil.rmtree(temporary_data_path) continue process_site(temporary_data_path, vargs.output_path, site_info) except Exception, e: logger.error(str(e)) logger.error(traceback.print_exc()) if os.path.exists(temporary_data_path): shutil.rmtree(temporary_data_path)
if __name__ == "__main__": """ Processing of the full WAVERIDER dataset from DOT-WA ./wa_waverider_process """ vargs = args() global logger logger = IMOSLogging().logging_start(os.path.join(vargs.output_path, 'process.log')) if not os.path.exists(WIP_DIR): os.makedirs(WIP_DIR) sites_info = retrieve_sites_info_waverider_kml() for _, id in enumerate(sites_info): site_info = sites_info[id] logger.info('Processing WAVES for id: {id} {site_path}'.format(id=id, site_path=site_info['site_name'])) temporary_data_path, site_info = download_site_data(site_info) # returned site_info has extra md5 info from zip try: if site_info['already_uptodate']: logger.info('{site_path} already up to date'.format(site_path=site_info['site_name'])) shutil.rmtree(temporary_data_path) continue process_site(temporary_data_path, vargs.output_path, site_info) except Exception, e: logger.error(str(e)) logger.error(traceback.print_exc()) if os.path.exists(temporary_data_path): shutil.rmtree(temporary_data_path)
./wa_awac_process """ vargs = args() global logger logger = IMOSLogging().logging_start(os.path.join(vargs.output_path, 'process.log')) if not os.path.exists(WIP_DIR): os.makedirs(WIP_DIR) sites_info = retrieve_sites_info_awac_kml() for _, site_code in enumerate(sites_info): site_info = sites_info[site_code] temporary_data_path, site_info = download_site_data(site_info) # returned site_info has extra md5 info site_name = site_info['site_code'] try: if site_info['already_uptodate']: logger.info('{site_path} already up to date'.format(site_path=site_name)) shutil.rmtree(temporary_data_path) continue process_site(temporary_data_path, vargs.output_path, site_info) except Exception as e: logger.error(str(e)) logger.error(traceback.print_exc()) if os.path.exists(temporary_data_path): shutil.rmtree(temporary_data_path)