Changeset 6595


Ignore:
Timestamp:
Mar 24, 2009, 2:06:16 PM (15 years ago)
Author:
ole
Message:

Added the nonstandard central meridian option, tested and implemented it in the Adeladie Phase II scripts.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/coordinate_transforms/test_redfearn.py

    r6520 r6595  
    147147
    148148        # Then project to zone 49
    149         zone, easting, northing = redfearn(-29.233299999,114.05,zone=49)
     149        zone, easting, northing = redfearn(-29.233299999,114.05, zone=49)
    150150
    151151        assert zone == 49
     
    163163
    164164        # Then project to zone 50
    165         zone, easting, northing = redfearn(-29.1333,113.9667,zone=50)
     165        zone, easting, northing = redfearn(-29.1333,113.9667, zone=50)
    166166
    167167        assert zone == 50
     
    178178
    179179        # Then project to zone 49
    180         zone, easting, northing = redfearn(-29.1667,114,zone=49)
     180        zone, easting, northing = redfearn(-29.1667,114, zone=49)
    181181
    182182        assert zone == 49
  • anuga_core/source/anuga/shallow_water/data_manager.py

    r6584 r6595  
    55035503            origin=None,
    55045504            zone=None,
     5505            central_meridian=None,           
    55055506            mean_stage=0.0,
    55065507            zscale=1.0,
     
    57195720    # Check zone boundaries
    57205721    if zone is None:
    5721         refzone, _, _ = redfearn(latitudes[0], longitudes[0])
     5722        refzone, _, _ = redfearn(latitudes[0], longitudes[0],
     5723                                 central_meridian=central_meridian)
    57225724    else:
    57235725        refzone = zone
    57245726
     5727       
     5728
    57255729    old_zone = refzone
    57265730
    57275731    for i in range(number_of_points):
    5728         zone, easting, northing = redfearn(latitudes[i], longitudes[i],
    5729                                            zone=zone)
     5732        computed_zone, easting, northing = redfearn(latitudes[i], longitudes[i],
     5733                                                    zone=zone,
     5734                                                    central_meridian=central_meridian)
    57305735        x[i] = easting
    57315736        y[i] = northing
    5732         if zone != refzone:
     5737        if computed_zone != refzone:
    57335738            msg = 'All sts gauges need to be in the same zone. \n'
    57345739            msg += 'offending gauge:Zone %d,%.4f, %4f\n' \
    5735                    % (zone, easting, northing)
     5740                   % (computed_zone, easting, northing)
    57365741            msg += 'previous gauge:Zone %d,%.4f, %4f' \
    57375742                   % (old_zone, old_easting, old_northing)
    57385743            raise Exception, msg
    5739         old_zone = zone
     5744        old_zone = computed_zone
    57405745        old_easting = easting
    57415746        old_northing = northing
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r6584 r6595  
    67936793        os.remove(sts_file)
    67946794
    6795     def test_urs2sts_nonstandard_projection(self):
     6795    def test_urs2sts_nonstandard_meridian(self):
    67966796        """
    6797         Test single source
     6797        Test single source using the meridian from zone 50 as a nonstandard meridian
    67986798        """
    67996799        tide=0
     
    68186818
    68196819        base_name, files = self.write_mux2(lat_long_points,
    6820                                       time_step_count, time_step,
    6821                                       first_tstep, last_tstep,
    6822                                       depth=gauge_depth,
    6823                                       ha=ha,
    6824                                       ua=ua,
    6825                                       va=va)
     6820                                           time_step_count, time_step,
     6821                                           first_tstep, last_tstep,
     6822                                           depth=gauge_depth,
     6823                                           ha=ha,
     6824                                           ua=ua,
     6825                                           va=va)
    68266826
    68276827        urs2sts(base_name,
    68286828                basename_out=base_name,
    6829                 zone=50,
    6830                 mean_stage=tide,verbose=False)
     6829                central_meridian=123,
     6830                mean_stage=tide,
     6831                verbose=False)
    68316832
    68326833        # now I want to check the sts file ...
     
    68486849        y = points[:,1]
    68496850
    6850         #Check that all coordinate are correctly represented       
    6851         #Using the non standard projection (50)
     6851        # Check that all coordinate are correctly represented       
     6852        # Using the non standard projection (50)
    68526853        for i in range(4):
    6853             zone, e, n = redfearn(lat_long_points[i][0], lat_long_points[i][1], zone=50)
     6854            zone, e, n = redfearn(lat_long_points[i][0],
     6855                                  lat_long_points[i][1],
     6856                                  central_meridian=123)
    68546857            assert num.allclose([x[i],y[i]], [e,n])
    6855             assert zone==geo_reference.zone
    6856 
     6858            assert zone==-1
     6859
     6860           
    68576861    def test_urs2sts_nonstandard_projection_reverse(self):
    68586862        """
     
    69106914        y = points[:,1]
    69116915
    6912         #Check that all coordinate are correctly represented       
    6913         #Using the non standard projection (50)
     6916        # Check that all coordinate are correctly represented       
     6917        # Using the non standard projection (50)
    69146918        for i in range(4):
    6915             zone, e, n = redfearn(lat_long_points[i][0], lat_long_points[i][1], zone=50)
     6919            zone, e, n = redfearn(lat_long_points[i][0], lat_long_points[i][1],
     6920                                  zone=50)
    69166921            assert num.allclose([x[i],y[i]], [e,n])
    69176922            assert zone==geo_reference.zone
  • anuga_work/production/australia_ph2/adelaide/build_urs_boundary.py

    r6387 r6595  
    142142                basename_out=output_dir,
    143143                ordering_filename=project.urs_order,
     144                central_meridian=project.central_meridian,
    144145                weights=mux_weights,
    145                 mean_stage=project.tide,
    146146                verbose=True)
    147147    else:                           # a single mux stem file, assume 1.0 weight
     
    160160                basename_out=output_dir,
    161161                ordering_filename=order_filename,
     162                central_meridian=project.central_meridian,               
    162163                weights=mux_weights,
    163                 mean_stage=project.tide,
    164164                verbose=True)
    165165
  • anuga_work/production/australia_ph2/adelaide/project.py

    r6581 r6595  
    2525# Model specific parameters.
    2626# One or all can be changed each time the run_model script is executed
     27
     28central_meridian = 137.5 # This is the nonstandard projection needed
    2729tide = 0                # difference between MSL and HAT
    2830event_number = 64322    # the event number
Note: See TracChangeset for help on using the changeset viewer.