forked from NingAnMe/GFSSI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
69 lines (59 loc) · 2.38 KB
/
install.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
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2019/8/15
@Author : AnNing
"""
import tarfile
from lib.aid_lonlat_projlut import make_disk_projlut_4km, make_disk_projlut_1km
from lib.aid_basemap import make_basemap_fy4a
from lib.aid_lonlat_lut import make_lonlat_lut_1km, make_lonlat_lut_fy3d_1km
from lib.lib_constant import *
from lib.lib_read_ssi import FY4ASSI, FY3DSSIENVI
from lib.lib_get_index_by_lonlat import make_point_index_lut
if not os.path.isfile(PROJ_LUT_FY4_4KM):
print('生成FY4 4KM投影经纬度文件')
make_disk_projlut_4km(out_file=PROJ_LUT_FY4_4KM)
print(PROJ_LUT_FY4_1KM)
if not os.path.isfile(BASEMAP_FY4_4KM):
print('生成FY4 4KM背景图')
make_basemap_fy4a(res='4km', out_file=BASEMAP_FY4_4KM)
print(BASEMAP_FY4_4KM)
if not os.path.isfile(KDTREE_LUT_FY4_4KM):
print('生成FY4 4KM查找表')
lats = FY4ASSI.get_latitude_4km()
lons = FY4ASSI.get_longitude_4km()
make_point_index_lut(lons, lats, out_file=KDTREE_LUT_FY4_4KM)
print(KDTREE_LUT_FY4_4KM)
if not os.path.isfile(LON_LAT_LUT_FY4_1KM):
print('生成FY4 1KM经纬度文件')
make_lonlat_lut_1km(D_DEM_1KM, out_file=LON_LAT_LUT_FY4_1KM)
print(LON_LAT_LUT_FY4_1KM)
if not os.path.isfile(PROJ_LUT_FY4_1KM):
print('生成FY4 1KM投影经纬度文件')
make_disk_projlut_1km(out_file=PROJ_LUT_FY4_1KM)
print(PROJ_LUT_FY4_1KM)
if not os.path.isfile(KDTREE_LUT_FY4_1KM):
print('生成FY4 1KM查找表')
lons = FY4ASSI.get_longitude_1km()
lats = FY4ASSI.get_latitude_1km()
make_point_index_lut(lons, lats, out_file=KDTREE_LUT_FY4_1KM)
print(KDTREE_LUT_FY4_1KM)
if not os.path.isfile(D_DEM_1KM):
print('解压D_DEM.txt')
dir_path = get_aid_path()
with tarfile.open('Aid/ddem.tar', 'r') as tar:
tar.extract('D_DEM.txt', dir_path)
print(D_DEM_1KM)
if not os.path.isfile(LON_LAT_LUT_FY3_1KM):
print('生成FY3 1KM经纬度文件')
fy3d_envi = os.path.join(get_aid_path(), 'Sz_20190531.dat')
make_lonlat_lut_fy3d_1km(fy3d_envi, out_file=LON_LAT_LUT_FY3_1KM)
print(LON_LAT_LUT_FY3_1KM)
if not os.path.isfile(KDTREE_LUT_FY3_1KM):
print('生成FY3 1KM查找表')
fy3d_envi = os.path.join(get_aid_path(), 'Sz_20190531.dat')
data_loader = FY3DSSIENVI(fy3d_envi)
lons, lats = data_loader.get_lon_lat()
make_point_index_lut(lons, lats, out_file=KDTREE_LUT_FY3_1KM)
print(KDTREE_LUT_FY3_1KM)