-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmat2txt.py
More file actions
47 lines (32 loc) · 757 Bytes
/
mat2txt.py
File metadata and controls
47 lines (32 loc) · 757 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- coding: utf-8 -*-
"""
Front Matter
=============
Created on
Author: Mitchell O'Flaherty-Sproul
Requirements
===================================
Absolutely Necessary:
* Numpy
* SciPy
* Matplotlib
Optional, but recommended:
Functions
=========
"""
#load modules
import numpy as np
import scipy.io as sio
import matplotlib.pyplot as plt
from math import pi
from datatools import *
from gridtools import *
from misctools import *
import scipy as sp
import matplotlib as mpl
np.set_printoptions(precision=8,suppress=True,threshold=sys.maxsize)
import sys
infile='data/oil_locations_sdl050'
tempdic={}
sio.loadmat(infile+'.mat',mdict=tempdic)
np.savetxt(infile+'.dat',np.hstack([tempdic['lonmap'],tempdic['latmap']]),fmt='%12.12f %12.12f')