Beispiel #1
0
    def test_readability(self):
        io1 = hsio()
        io1.read_spec(self.fname_hdr_spec)
        self.assertIsInstance(io1.spyfile_spec, SpyFile.SpyFile,
                              'Not a SpyFile object')

        io2 = hsio()
        io2.read_spec(os.path.splitext(self.fname_hdr_spec)[0])
        self.assertIsInstance(io2.spyfile_spec, SpyFile.SpyFile,
                              'Not a SpyFile object')
Beispiel #2
0
 def setUp(self):
     '''
     This setUp function will be called for every single test that is run
     '''
     self.fname_hdr_spec = FILENAME_HDR_SPEC
     self.io = hsio()
     self.io.read_spec(FILENAME_HDR_SPEC)
Beispiel #3
0
 def test_write_spec(self):
     fname_hdr_spec = os.path.join(self.test_dir,
                                   self.io.name_short + '-mean.spec.hdr')
     self.io.write_spec(fname_hdr_spec, self.spec_mean, self.spec_std)
     io2 = hsio()
     io2.read_spec(fname_hdr_spec)
     self.assertIsInstance(io2.spyfile_spec, SpyFile.SpyFile,
                           'Not a SpyFile object')
Beispiel #4
0
 def setUp(self):
     '''
     This setUp function will be called for every single test that is run
     '''
     self.fname_hdr = FILENAME_HDR
     self.test_dir = tempfile.mkdtemp()
     self.io = hsio(FILENAME_HDR)
     self.spec_mean, self.spec_std, _ = self.io.tools.mean_datacube(
         self.io.spyfile.open_memmap())
Beispiel #5
0
 def test_write_cube(self):
     fname_hdr_out = os.path.join(self.test_dir,
                                  self.io.name_short + '.bip.hdr')
     self.io.write_cube(fname_hdr_out,
                        self.io.spyfile.open_memmap(),
                        metadata=self.io.spyfile.metadata)
     io2 = hsio(fname_hdr_out)
     self.assertIsInstance(io2.spyfile, SpyFile.SpyFile,
                           'Not a SpyFile object')
Beispiel #6
0
    def test_readability(self):
        io1 = hsio()
        io1.read_cube(self.fname_hdr)
        self.assertIsInstance(io1.spyfile, SpyFile.SpyFile,
                              'Not a SpyFile object')

        io2 = hsio()
        io2.read_cube(os.path.splitext(self.fname_hdr)[0])
        self.assertIsInstance(io2.spyfile, SpyFile.SpyFile,
                              'Not a SpyFile object')

        io3 = hsio(self.fname_hdr)
        self.assertIsInstance(io3.spyfile, SpyFile.SpyFile,
                              'Not a SpyFile object')

        io4 = hsio(os.path.splitext(self.fname_hdr)[0])
        self.assertIsInstance(io4.spyfile, SpyFile.SpyFile,
                              'Not a SpyFile object')
Beispiel #7
0
 def setUp(self):
     '''
     This setUp function will be called for every single test that is run
     '''
     self.test_dir = tempfile.mkdtemp()
     self.fname_hdr = FILENAME_HDR
     self.io = hsio(FILENAME_HDR)
     self.my_spatial_mod = spatial_mod(self.io.spyfile,
                                       base_dir=self.io.base_dir,
                                       name_short=self.io.name_short,
                                       name_long=self.io.name_long)
Beispiel #8
0
 def test_instance_independence(self):
     self.io.set_io_defaults(dtype=int,
                             force=True,
                             ext='spec',
                             interleave='bsq',
                             byteorder=1)
     io2 = hsio()
     self.assertNotEqual(self.io.defaults.envi_write.ext,
                         io2.defaults.envi_write.ext,
                         ('New instance of hsio did not result in a new'
                          'instance of defaults'))
Beispiel #9
0
 def setUp(self):
     '''
     This setUp function will be called for every single test that is run
     '''
     self.fname_hdr = FILENAME_HDR
     self.io = hsio(FILENAME_HDR)
Beispiel #10
0
 def setUp(self):
     '''
     This setUp function will be called for every single test that is run
     '''
     self.io = hsio()