Changeset 148


Ignore:
Timestamp:
09/08/2009 05:35:19 PM (14 years ago)
Author:
marcus
Message:
  • conversion tool for path/files
  • more tests
Location:
SHX/trunk/src/SeismicHandler
Files:
8 added
2 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/src/SeismicHandler/tests/data/asc2pkl.py

    r146 r148  
     1#! /usr/bin/env python 
    12# -*- coding: utf-8 -*- 
    23 
  • SHX/trunk/src/SeismicHandler/tests/test_commands.py

    r146 r148  
    44from SeismicHandler.core.modules.Trace import Traces 
    55from SeismicHandler.core.modules.Variables import Symbol, System 
     6from SeismicHandler.core.modules.Tools import convertFilename 
    67from SeismicHandler.core.commands import Run 
    78 
     
    333334         
    334335        self.checkTraceData(self.traces[1], cmpindex="int", digits=5) 
    335  
     336         
     337    def testLocate(self): 
     338        # XXX not tested since it depends on AL command  
     339        pass 
     340     
     341    def testMark(self): 
     342        # XXX Commands for visualisation are not tested yet. 
     343        pass 
     344     
     345    def testMaxAmpl(self): 
     346        Run("cresharp") 
     347        Run("trcfct 1 mul 100") 
     348        Run("maxampl 1 35") 
     349        self.checkTraceData(self.traces[0], cmpindex="maxampl", digits=5) 
     350         
     351    def testMaximum(self): 
     352        Run("cresharp") 
     353        Run("cresharp") 
     354        Run("mirror 2") 
     355        Run("maximum all number") 
     356        self.checkTraceData(self.traces[2], cmpindex="maximum1") 
     357        self.checkTraceData(self.traces[3], cmpindex="maximum2") 
     358         
     359    def test2Mdir(self): 
     360        for i in range(3): 
     361            Run("cresharp") 
     362 
     363        Run("mirror 2") 
     364         
     365        Symbol.azi = 0. 
     366        Symbol.inci = 0. 
     367         
     368        Run("mdir 1,2 10. 20. &azi") 
     369        self.assertAlmostEqual(Symbol.azi, 6.271768) 
     370         
     371        Run("mdir 1-3 10. 20. &azi &inci") 
     372        self.assertAlmostEqual(Symbol.azi, 263.763123, 4) 
     373        self.assertAlmostEqual(Symbol.inci, 45.170059, 5) 
     374         
     375        Symbol.azi = None 
     376        Symbol.inci = None         
     377         
     378    def testPick(self): 
     379        # read real world data (@ = don't convert case of this command) 
     380        Run("@READGSE %s ALL" % convertFilename("data/GRF_031102_0225.GSE")) 
     381        # create symbol 
     382        Symbol.x = "" 
     383         
     384        Run("pick 1 0 200 &x") 
     385        self.assertEqual(Symbol.x, " 2-NOV-2003_02:26:43.500") 
     386         
     387        # delete symbol 
     388        Symbol.x = None 
     389     
    336390    def testSum(self): 
    337391        # this test fails for some reason 
     
    359413 
    360414def suite(): 
    361     return unittest.makeSuite(commandsTestCase, 'test') 
    362 #    return unittest.makeSuite(commandsTestCase, 'test2') 
     415#    return unittest.makeSuite(commandsTestCase, 'test') 
     416    return unittest.makeSuite(commandsTestCase, 'test2') 
    363417 
    364418if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.