Changeset 4388
- Timestamp:
- Apr 17, 2007, 5:10:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4387 r4388 2651 2651 basename_in + '_va.nc', 2652 2652 basename_in + '_e.nc') 2653 2654 #Create new file 2653 2655 write_sww_header(outfile, times, number_of_volumes, 2654 2656 number_of_points, description=description) 2655 # #Create new file2656 # outfile.institution = 'Geoscience Australia'2657 # outfile.description = 'Converted from Ferret files: %s, %s, %s, %s'\2658 # %(basename_in + '_ha.nc',2659 # basename_in + '_ua.nc',2660 # basename_in + '_va.nc',2661 # basename_in + '_e.nc')2662 2663 2664 # #For sww compatibility2665 # outfile.smoothing = 'Yes'2666 # outfile.order = 12667 2668 # #Start time in seconds since the epoch (midnight 1/1/1970)2669 # outfile.starttime = starttime = times[0]2670 # times = times - starttime #Store relative times2671 2672 # # dimension definitions2673 # outfile.createDimension('number_of_volumes', number_of_volumes)2674 2675 # outfile.createDimension('number_of_vertices', 3)2676 # outfile.createDimension('number_of_points', number_of_points)2677 2678 2679 # #outfile.createDimension('number_of_timesteps', len(times))2680 # outfile.createDimension('number_of_timesteps', len(times))2681 2682 # # variable definitions2683 # outfile.createVariable('x', precision, ('number_of_points',))2684 # outfile.createVariable('y', precision, ('number_of_points',))2685 # outfile.createVariable('elevation', precision, ('number_of_points',))2686 2687 # #FIXME: Backwards compatibility2688 # outfile.createVariable('z', precision, ('number_of_points',))2689 # #################################2690 2691 # outfile.createVariable('volumes', Int, ('number_of_volumes',2692 # 'number_of_vertices'))2693 2694 # outfile.createVariable('time', precision,2695 # ('number_of_timesteps',))2696 2697 # outfile.createVariable('stage', precision,2698 # ('number_of_timesteps',2699 # 'number_of_points'))2700 2701 # outfile.createVariable('xmomentum', precision,2702 # ('number_of_timesteps',2703 # 'number_of_points'))2704 2705 # outfile.createVariable('ymomentum', precision,2706 # ('number_of_timesteps',2707 # 'number_of_points'))2708 2709 # outfile.variables['time'][:] = times #Store time relative2710 2657 2711 2658 #Store … … 2734 2681 y[i] = northing 2735 2682 i += 1 2736 2737 2683 2738 2684 #Construct 2 triangles per 'rectangular' element … … 2754 2700 geo_ref = write_NetCDF_georeference(origin, outfile) 2755 2701 2756 # if origin == None:2757 # zone = refzone2758 # xllcorner = min(x)2759 # yllcorner = min(y)2760 # else:2761 # zone = origin[0]2762 # xllcorner = origin[1]2763 # yllcorner = origin[2]2764 2765 2766 # outfile.xllcorner = xllcorner2767 # outfile.yllcorner = yllcorner2768 # outfile.zone = zone2769 2770 2771 2702 if elevation is not None: 2772 2703 z = elevation
Note: See TracChangeset
for help on using the changeset viewer.