Changeset 7621
- Timestamp:
- Feb 11, 2010, 4:44:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DVD_images/update_DVD_images.py
r7515 r7621 282 282 # paths to various source directories 283 283 'data_src_path': 'data/western_australia/geraldton_tsunami_scenario/anuga', 284 'arcgis_src_path': 'data/western_australia/geraldton_tsunami_scenario/ArcGIS',285 'viz_src_path': 'data/western_australia/geraldton_tsunami_scenario/visualisations',286 284 'proj_src_path': 'sandpits/jgriffin/ANUGA/anuga_work/production/wa/geraldton_2009', 287 'report_src_path': 'data/four_east_coast_communities_reporting/Professional_opinions_final', 285 'report_src_path': 'data/western_australia/documents', #need to update this 286 'arcgis_src_path': 'data/western_australia/geraldton_tsunami_scenario/anuga', 287 'observation_src_path': '/nas/gemd/georisk/tsunami/WA_tsunami_validation/observations', 288 'viz_src_path': 'data/western_australia/geraldton_tsunami_scenario/anuga', 288 289 289 290 # paths to destination directories (under 'jurisdiction' root) 290 291 'data_dst_path': 'data/western_australia/geraldton_tsunami_scenario/anuga', 291 292 'proj_dst_path': 'project', 292 'viz_dst_path': 'documents',293 'arcgis_dst_path': 'data/western_australia/geraldton_tsunami_scenario/ArcGIS',294 293 'report_dst_path': 'documents', 295 294 'viz_dst_path': 'figures', 295 'arcgis_dst_path': 'gis', 296 'observation_dst_path': 'field_observations', 296 297 # copy or create whole directories 297 'make_dst_dirs': [ 'boundaries', 'meshes', 'outputs', 'topographies'],298 'copy_data_dirs': [ 'polygons', 'gauges'],298 'make_dst_dirs': [ 'boundaries','meshes', 'outputs', 'topographies','polygons', 'gauges'], 299 'copy_data_dirs': [], 299 300 300 301 # copy 'data' files or directories … … 302 303 #'topographies/Data_lineage.doc', 303 304 'outputs/2004_tsunami_validation', 305 'gauges/geraldton_validation_gauges.csv', 304 306 'boundaries/wa04_val', 305 307 'boundaries/landward_boundary.csv', 306 'boundaries/urs_order.csv' 308 'boundaries/urs_order.csv', 309 'boundaries/URSGA_gauges_All_WA.csv', 310 #'boundaries/URSGA_gauges_WA', 311 'polygons/buffer_20m.csv', 312 'polygons/ocean_initial_condition.csv', 313 'polygons/land_initial_condition.csv', 314 'polygons/poly_all.csv', 315 'polygons/harbour.csv', 316 'polygons/CBD_500m.csv', 317 'polygons/CBD_1km.csv', 318 'polygons/island_wallabi_poly2.csv', 319 'polygons/island_dingiville_poly.csv', 320 'polygons/island_pelsaert_poly.csv', 321 'polygons/land_initial_condition.csv', 322 'polygons/ocean_initial_condition.csv', 323 'meshes/CBD.csv', 324 'meshes/wall.csv' 307 325 ], 308 326 … … 320 338 'copy_arc_files': [], 321 339 340 # copy 'observation' files or directories 341 'copy_observation_files': ['PostTsunamiSurveyData_RunUp.xls'], 342 322 343 # copy 'report' file 323 'copy_report_files': ['GA_record_WA_tsunami_validation.pdf']344 'copy_report_files': ['Horspool_et_al_GA_record_2009_XX.pdf'] 324 345 } 325 346 … … 350 371 '''Copy a file or complete directory.''' 351 372 373 ## os.system('cp -R %s %s' % (src, dst)) 374 375 #print('copy_file_or_dir: %s -> %s' % (src, dst)) 376 352 377 # could be a file or directory being copied 353 378 try: 354 379 shutil.copyfile(src, dst) 355 380 except IOError, e: 381 print 'str(e)=%s' % str(e) 356 382 if 'Is a directory' in str(e): 357 383 shutil.copytree(src, dst) … … 378 404 arcgis_src_path = os.path.join(main_path, j_dict['arcgis_src_path']) 379 405 arcgis_dst_path = os.path.join(os.getcwd(), j_name, j_dict['arcgis_dst_path']) 406 observation_src_path = j_dict['observation_src_path'] 407 observation_dst_path = os.path.join(os.getcwd(), j_name, j_dict['observation_dst_path']) 380 408 report_src_path = os.path.join(main_path, j_dict['report_src_path']) 381 409 report_dst_path = os.path.join(os.getcwd(), j_name, j_dict['report_dst_path']) … … 385 413 log('Getting project from: %s' % proj_src_path) 386 414 log('Getting ArcGIS from: %s' % arcgis_src_path) 415 log('Getting Observations from: %s' % observation_src_path) 387 416 log('Getting report from: %s' % report_src_path) 388 417 log('') … … 442 471 copy_file_or_dir(src_file, new_file) 443 472 473 # copy required observational files 474 log('Creating directory: %s' % observation_dst_path) 475 os.makedirs(observation_dst_path) 476 for copy_file in j_dict['copy_observation_files']: 477 src_file = os.path.join(observation_src_path, copy_file) 478 new_file = os.path.join(observation_dst_path, copy_file) 479 log('Copying: %s' % copy_file) 480 copy_file_or_dir(src_file, new_file) 481 444 482 # copy report 445 483 log('Creating directory: %s' % report_dst_path) … … 447 485 src_file = os.path.join(report_src_path, copy_file) 448 486 new_file = os.path.join(report_dst_path, copy_file) 487 print 'src', src_file 488 print 'new', new_file 449 489 log('Copying: %s' % copy_file) 450 490 copy_file_or_dir(src_file, new_file)
Note: See TracChangeset
for help on using the changeset viewer.