-
Notifications
You must be signed in to change notification settings - Fork 0
/
box2Linux_migrate.py
57 lines (33 loc) · 1.18 KB
/
box2Linux_migrate.py
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
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python
# coding: utf-8
# In[2]:
from boxMigrate import boxMigrate
from pyproj import Proj
from pandas import DataFrame
import numpy as np
id = '4stt8wd7hn5c19obxhh2kpnf7419pni6'
secret = 'UfS1HnLjbgGeQuh4dtIXBJRT2kVdQC4M'
token = '5syKM4iqoCr3kSjC2qIVqUTCYo9UgVU6'
target_dir = 'Rocky_Pflug'
# subdirs = ['N40_0W106_0_agg_16','WY2020']
out_path = '/scratch/summit/jupf7869/500m/'
keys = ['B_Prior','CV_Prior','CVis_Prior','Weights']
xMin = 410000; xMax = 463500
yMin = 4414000; yMax = 4495000
# In[3]:
x = [xMin, xMax, xMax, xMin]
y = [yMin, yMin, yMax, yMax]
df = DataFrame(np.c_[x,y],columns = ['Meters East','Meters South'])
project = Proj("+proj=utm +zone=13N")
lon, lat = project(df['Meters East'].values, df['Meters South'].values,
inverse=True)
# In[4]:
client, root_directory = boxMigrate.target_directory(id,secret,token,target_dir)
print(root_directory)
# In[9]:
yrRange = range(1985,2021)
for year in yrRange:
subdirs = ['N40_0W106_0_agg_16','CV_weights','WY'+str(year)]
# print(subdirs)
boxMigrate.download_data(root_directory,subdirs,client,out_path,
filter='latlon',lon = lon,lat = lat,keys = keys)