基于數學模型量化植被的干沉降過程,突破傳統站點尺度研究的局限性,結合多源衛星遙感產品形成2000-2020年中國城市綠地對PM2.5和PM10的干沉降量估計柵格數據集,對城市大氣污染防治、綠地區域規劃和城市可持續發展有重要意義.
應用結果
代碼
#導入安裝包
import os
import json
import datetime
import streamlit as st
import streamlit.components.v1 as components
import traceback
from PIL import Imageimport aie#這里我們進行分析
#獲取指定鏈接的文件信息
current_work_dir = os.path.dirname(__file__)
#加載地圖
collection_id = 'TJNU_3JECO_CHINA_DDEP_V01'# 隱藏頁面右上角的action bar按鈕
hide_streamlit_action_button = """<style>#MainMenu {visibility: hidden;}</style>
"""
#設定界面的指定布局
st.set_page_config(layout="wide", page_title="AIE AppHub")
st.markdown(hide_streamlit_action_button, unsafe_allow_html=True)# 調整頁面頂部邊距
st.markdown(" <style> div[class^='css-1544g2n'] { padding-top: 1px; } </style> ", unsafe_allow_html=True)
st.markdown(" <style> div[class^='block-container'] { padding-top: 1px; } </style> ", unsafe_allow_html=True)#初始化aie函數
def aie_init():'''AIE開發者SDK初始化請登錄后訪問https://engine-aiearth.aliyun.com/#/utility/auth-token 獲取認證token,并將token設置為系統環境變量(變量名為SDK_TOKEN),以便下述代碼獲取并初始化SDK。'''token = os.environ.get("SDK_TOKEN") # 請至應用空間設置-環境變量中添加SDK_TOKENaie.Authenticate(token=token)aie.Initialize()# 設定默認的函數,但是每次運行只一次
@st.cache_resource
def load_logo():logo = Image.open(current_work_dir + '/logo.png')return logo# 設定默認的函數,但是每次運行只一次
@st.cache_resource
def get_default_aie_map():aie_map = aie.Map(center=[111.98,33.50],height=800,zoom=4)return aie_map.to_html()# 設定默認參數,也就是初始狀態下的結果
def page_reset_callback():st.session_state['parameter'] = 'PM25'st.session_state['time_picker'] = [datetime.date(2020, 1, 1), datetime.date(2020, 1, 31)]st.session_state['render_map_html'] = get_default_aie_map()# 這里設定默認的地圖參數
def aie_map_layer_assemble(start_date, end_date,band):# 拼接AIE 數據查詢SDK語句aie_init()feature_collection = aie.FeatureCollection('China_Province')image_collection = aie.ImageCollection(collection_id) \.filterDate(start_date.strftime('%Y-%m-%d'), end_date.strftime('%Y-%m-%d')) \aie_map = aie.Map