Changeset 2035
- Timestamp:
- Nov 17, 2005, 2:00:56 PM (19 years ago)
- Location:
- inundation/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pyvolution/data_manager.py
r2032 r2035 3588 3588 else: 3589 3589 lat_max_index = searchsorted(latitudes, maxlat)+1 3590 3591 3590 if minlon == None: 3592 3591 lon_min_index = 0 … … 3597 3596 3598 3597 if maxlon == None: 3599 l at_max_index = len(longitudes)3598 lon_max_index = len(longitudes) 3600 3599 else: 3601 l at_max_index = searchsorted(longitudes, maxlon)+13602 3603 return lat_min_index, lat_max_index, lon_min_index, l at_max_index3600 lon_max_index = searchsorted(longitudes, maxlon)+1 3601 3602 return lat_min_index, lat_max_index, lon_min_index, lon_max_index 3604 3603 3605 3604 -
inundation/pyvolution/test_data_manager.py
r2032 r2035 3333 3333 minlat = -37.6, maxlat = -37.6, 3334 3334 minlon = 148.3, maxlon = 148.3 3335 ,verbose = True3335 #,verbose = True 3336 3336 ) 3337 3337 … … 3468 3468 3469 3469 ## 6th test 3470 3470 3471 kmin, kmax, lmin, lmax = get_min_max_indexes (latitudes,longitudes, 3471 3472 1.5,4,18,32) … … 3480 3481 longitudes_news == [10, 20, 30], 3481 3482 'failed') 3483 3482 3484 3483 3485 ## 7th test … … 3500 3502 self.failUnless(m2d == [[5,6],[9,10]], 3501 3503 'failed') 3502 3504 3505 def test_get_min_max_indexes2(self): 3506 latitudes = [-45,-40,-35,-30] 3507 longitudes = [148,149,150,151] 3508 3509 # k - lat 3510 # l - lon 3511 kmin, kmax, lmin, lmax = get_min_max_indexes (latitudes,longitudes, 3512 -37,-27,147,149.5) 3513 3514 #print "kmin",kmin;print "kmax",kmax 3515 #print "lmin",lmin;print "lmax",lmax 3516 latitudes_new = latitudes[kmin:kmax] 3517 longitudes_news = longitudes[lmin:lmax] 3518 #print "latitudes_new", latitudes_new 3519 #print "longitudes_news",longitudes_news 3520 3521 self.failUnless(latitudes_new == [-40, -35, -30] and \ 3522 longitudes_news == [148, 149,150], 3523 'failed') 3524 3525 def test_get_min_max_indexes3(self): 3526 latitudes = [-60,-55,-50,-45,-40,-35,-30] 3527 longitudes = [148,149,150,151] 3528 3529 # k - lat 3530 # l - lon 3531 kmin, kmax, lmin, lmax = get_min_max_indexes (latitudes,longitudes, 3532 -37,-27,147,149.5) 3533 3534 3535 #print "kmin",kmin;print "kmax",kmax 3536 #print "lmin",lmin;print "lmax",lmax 3537 latitudes_new = latitudes[kmin:kmax] 3538 longitudes_news = longitudes[lmin:lmax] 3539 #print "latitudes_new", latitudes_new 3540 #print "longitudes_news",longitudes_news 3541 3542 self.failUnless(latitudes_new == [-40, -35, -30] and \ 3543 longitudes_news == [148, 149,150], 3544 'failed') 3545 3503 3546 #------------------------------------------------------------- 3504 3547 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.