test_asciigrid.py 548 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from formats.asciigrid import AsciiGrid
import numpy as np
import os.path

f = None
try:
    # Test writing and reading of a grid with integer numbers
    fn = os.path.join('data', 'intasc.npy')
    data = np.load(fn)
    hfn = os.path.join('data', 'intasc.hdr')
    f = open(hfn, 'r')
    header = f.readlines()
    
finally:
    if f != None: f.close()
    
    

f = None
try:
    # Test reading and writing of a grid with float numbers
    fn = os.path.join('data', 'fltasc.npy')
    data = np.load(fn)
    
finally:
    if f != None: f.close()