1、搭建flask框架。

2、整合JPSS,葵花8,GF3,哨兵1,哨兵2,哨兵3,资源2号,环境1号,SNPP等遥感数据解析算法。
3、flask中添加扫描各个卫星扫描任务,定时扫描,数据入库
This commit is contained in:
2021-12-01 14:27:49 +08:00
commit c5481ead05
52 changed files with 4163 additions and 0 deletions

0
common/__init__.py Normal file
View File

Binary file not shown.

View File

@ -0,0 +1,5 @@
"""
Author : XinYi Song
Time : 2021/11/23 9:47
Desc:
"""

Binary file not shown.

Binary file not shown.

85
common/config/factory.py Normal file
View File

@ -0,0 +1,85 @@
"""
Author : XinYi Song
Time : 2021/11/23 9:47
Desc:
"""
from flask import Flask
from flask_apscheduler import APScheduler
scheduler = APScheduler()
def create_app():
app = Flask(__name__)
# 配置任务,不然无法启动任务
app.config.update(
{
"SCHEDULER_API_ENABLED": True,
"SCHEDULER_TIMEZONE": "Asia/Shanghai",
"JOBS": [
{
"id": "my_job", # 任务ID
"func": "util:scan_file_util.scan_VJ102_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 2 * 60 # 时间间隔
},
{
"id": "job2", # 任务ID
"func": "util:scan_file_util.scan_VJ103_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job3", # 任务ID
"func": "util:scan_file_util.scan_GF3MDJ_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job4", # 任务ID
"func": "util:scan_file_util.scan_H08_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job5", # 任务ID
"func": "util:scan_file_util.scan_Sentinel1_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job6", # 任务ID
"func": "util:scan_file_util.scan_Sentinel2_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job7", # 任务ID
"func": "util:scan_file_util.scan_Sentinel3OL_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job8", # 任务ID
"func": "util:scan_file_util.scan_HJ1_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job9", # 任务ID
"func": "util:scan_file_util.scan_ZY3_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
},
{
"id": "job10", # 任务ID
"func": "util:scan_file_util.scan_SNPP_dir", # 任务位置
"trigger": "interval", # 触发器
"seconds": 3 * 60 # 时间间隔
}
]
}
)
scheduler.init_app(app)
scheduler.start()
return app

5
common/tools/__init__.py Normal file
View File

@ -0,0 +1,5 @@
"""
Author : XinYi Song
Time : 2021/11/22 14:11
Desc:
"""

Binary file not shown.

Binary file not shown.

40
common/tools/dms.py Normal file
View File

@ -0,0 +1,40 @@
"""
Author : XinYi Song
Time : 2021/11/5 14:12
Desc:
"""
from util.http_util import httpUtil
def dms_login():
"""
数管系统登录
:return:
"""
res = httpUtil(url='http://192.168.2.9:8820/api/login',
params={"userName": "client1", "password": "sxy1998"}).post_param()
return res.json()['data']
def dms_task_record(token_s: str, collectionCode: str):
"""
调用数管系统获取遥感数据归档任务的接口
:param collectionCode:
:param token_s:
:return:
"""
res = httpUtil(url='http://192.168.2.9:8820/api/data-storage-task-record/get/collection-code/revision',
params={"collectionCode": collectionCode, "revision": 1}, token=token_s).get_herder()
return res.json()['data']
def dms_sensing_data(token_s: str, collectionCode: str):
"""
调用数管系统获取所有遥感数据的接口
:param collectionCode:
:param token_s:
:return:
"""
res = httpUtil(url='http://192.168.2.9:8820/api/remote-sensing-data/get/collection-code',
params={"collectionCode": collectionCode}, token=token_s).get_herder()
return res.json()['data']