forked from xhx509/drifter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
40 lines (31 loc) · 1.22 KB
/
test.py
File metadata and controls
40 lines (31 loc) · 1.22 KB
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
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 27 10:14:02 2014
@author: hxu
this progress extracts drifter data(coordinates) based on time range, geographic range or drifter id, then plot them.
The ouput file will be in same folder as this program.
input values: time period,gbox(maxlon, minlon,maxlat,minlat),or time period and id
function uses: getobs_drift_byrange,getobs_drift_byidrange,colors,getobs_drift_byid
output : a plot file to show drifter track.
"""
from basemap import basemap_region
import datetime as dt
import sys
import os
import pytz, pylab
import numpy as np
import matplotlib.pyplot as plt
from drifter_functions import getobs_drift_byrange,getobs_drift_byidrange,colors,getobs_drift_byid
ops=os.defpath
pydir='../'
sys.path.append(pydir)
#################Input values#############################################
fig = plt.figure()
ax = fig.add_subplot(111)
plt.plot(-67.8914,41.698,'.',markersize=30,color='black')
basemap_region('ne')
ax.patch.set_facecolor('lightblue') #set background color
plt.legend( numpoints=1,loc=2)
#plt.savefig('./'+dt.datetime.now().strftime('%Y-%m-%d %H:%M') + '.png')
#datetime_wanted=date2num(num2date(datetime_wanted)+datetime.timedelta( 0,step_size*60*60 ))
plt.show()