用另外一種方式畫衛星雲圖。這方法式結合了matplotlib、pyresample和cartopy
使用viridis這個色階畫出來長這樣。
色調強化雲圖簡單的來說,就是將紅外線雲圖依照溫度填上不同的顏色。
首先,必須有一張對照表,定義個溫度區間所要使用的顏色,然後再查表,找出資料灰度值所代表的溫度,我使用的高知大學提供的向日葵8號衛星資料,附一個對照表,依照需求整理成下表。
依照表格,可以利用for迴圈把每一個格點的顏色填入。
from PIL import Image
import numpy as np
import pyresample as pr
from pycoast import ContourWriterAGG
import aggdraw
Source_def = pr.load_area('Table/Projection.proj','KoChi_1800') # 原始FDK資料的投影
Image_def = pr.load_area('Table/Projection.proj','LCC_1000') # 輸出圖檔的投影
PGMIR1='HMW822090416IR1.pgm'
cntS = np.fromfile(PGMIR1,dtype='uint8')
dsize=1800
arraysize=dsize*dsize
cntS = cntS[-arraysize:]
cntS = cntS.reshape((dsize,dsize))
RoI = 5000 # 取樣之影響半徑
Cnt = pr.kd_tree.resample_nearest(Source_def, cntS, Image_def, radius_of_influence=RoI)
xs = Cnt.shape[0]
ys = Cnt.shape[1]
cntRGB = np.zeros((xs,ys,3),dtype=np.uint8)
for x in range(xs) :
for y in range(ys) :
if Cnt[y,x] > 249 : # -90. :
cntRGB[y,x,:] = [255,255,255]
elif Cnt[y,x] >243 : #-80. :
cntRGB[y,x,:] = [255,70,255]
elif Cnt[y,x] >237 : # -70. :
cntRGB[y,x,:] = [255,0,255]
elif Cnt[y,x] > 230 : # -60. :
cntRGB[y,x,:] = [0,200,200]
elif Cnt[y,x] > 211 : #< -40. :
cntRGB[y,x,:] = [0,0,0]
elif Cnt[y,x] > 184 : # -20. :
cntRGB[y,x,:] = [200,155,0]
elif Cnt[y,x] > 149 : # 0. :
cntRGB[y,x,:] = [0,145,0]
elif Cnt[y,x] > 105: # 20. :
cntRGB[y,x,:] = [0,40,255]
else :
cntRGB[y,x,:] = [0,40,200]
Img_new = Image.fromarray(cntRGB,'RGB')
ShapePath = 'Table/gshhg-shp-2.3.7'
cw = ContourWriterAGG(ShapePath)
cw.add_coastlines(Img_new,Image_def,resolution='l',outline=(255,0,0),width=2)
ttfFile = 'Table/LiberationMono-Regular.ttf'
font = aggdraw.Font('white',ttfFile)
cw.add_grid(Img_new,Image_def,(20,20),(10,10),font,outline=(0,0,255),width=3)
Img_new.show()
Img_new.save('LCC_Enhance.png')
延續前一篇文章,使用pyresample轉換了衛星雲圖的投影。接下來要在圖上加上海岸線和經緯線。
from PIL import Image
import numpy as np
import pyresample as pr
from pycoast import ContourWriterAGG
import aggdraw
Source_def = pr.load_area('Table/Projection.proj','KoChi_1800') # 原始FDK資料的投影
Image_def = pr.load_area('Table/Projection.proj','LCC_1000') # 輸出圖檔的投影
PGMIR1='HMW822090416IR1.pgm'
cntS = np.fromfile(PGMIR1,dtype='uint8')
dsize=1800
arraysize=dsize*dsize
cntS = cntS[-arraysize:]
cntS = cntS.reshape((dsize,dsize))
RoI = 5000 # 取樣之影響半徑
Cnt = pr.kd_tree.resample_nearest(Source_def, cntS, Image_def, radius_of_influence=RoI)
Img = Image.fromarray(Cnt,'L')
Img_new=Img.convert('RGB') #把灰階的Img轉換成RGB的Img_new
前面這些程式碼先把要輸出的圖準備好,注意,要把圖轉換成RBG的格式,否則海岸線和經緯線也會是黑白的。
這個程式的目的是要做投影的轉換,原本高知大學提供的衛星雲圖是等經緯度的投影
等經緯度的投影轉換成其他投影,例如藍伯特投影(LCC),就需用到pyresample這套件。
使用2種衛星頻道,製作RGB合成雲圖。
從日本日本高知大學衛星資料庫下載2筆資料。 選取檔案格式為Geo-coordinate mapped data for GAME research area. N70 - S20, E70 - E160. 1/20 degree resolution. 1800 x 1800 pixels. PGM (Portable Gray Map) format with Gzip compression.的資料。
選紅外線頻道IR1及IR2的資料,就選軒蘭諾颱風。
將一筆衛星資料,畫出一筆灰階的衛星雲圖。
從日本日本高知大學衛星資料庫下載一筆資料。 選取檔案格式為Geo-coordinate mapped data for GAME research area. N70 - S20, E70 - E160. 1/20 degree resolution. 1800 x 1800 pixels. PGM (Portable Gray Map) format with Gzip compression.的資料。
選一個紅外線頻道IR1的資料,就選上週的軒蘭諾颱風。有兩種讀寫方式,第一種是直接用PIL讀取,讀進來的格式直接就是圖形的物件。
說明日本向日葵 8 號(Himawari-8)地球同步衛星之特色,以及其和先前的 MTSAT (Multi-functional Transport Satellite)地球同步衛星的異同之處。雖然我沒有考普考,不過我還是想試試把答案寫出來:
The GPM core observatory satellite flew above Nepartak on July 4 at 2151 UTC (5:51 p.m. EDT). GPM identified very tall thunderstorm towers near the center of the intensifying tropical storm. These tall thunderstorms called "hot towers" were found to reach heights of 17.0 km (about 10.5 miles). Those storms were dropping rain at a rate of over 193 mm (7.6 inches) per hour. Credit: NASA/JAXA/SSAI, Hal PierceGPM的全名是Global Precipitation Measurement Mission,中文直譯為全球降水觀測計畫,這計畫是一個國際合作的觀測計畫,由一個核心星( GPM Core Satellite)以及其他數顆衛星共同觀測。在GPM核心衛星上有2個主要儀器,一個是由美國NASA負責的GPM微波輻射計(GPM Microwave Imager, 簡稱GMI ),另一個是由日本JAXA所負責的雙頻降雨雷達(Dual-Frequency Precipitation Radar,簡稱DPR)。前面的動畫即是是來自GPM衛星的DPR的觀測所做成的立體影像。
![]() |
| NPP的VIIRS M7頻道(0.865μm)的觀測資料。分別是加州林林大火發生前後的影像(左圖August 13, 2013,右圖August 30, 2013)。 |
For example, following significant fire damage, water is more likely to run off, and less likely to be absorbed into the soil surface, hence decreasing the amount of rain needed to produce flooding, dangerous landslides and debris flows.若是照字面上直譯:
例如,顯著火災損壞之後,水更容易容易產生涇流,並且更不容易被吸收到土壤表面,因此減少了產生洪水、危險的山體滑坡和泥石流災害需要的雨量。以上的內容來自GOES-R的文件《GOES-R ABI Fact Sheet Band 3 (The “vegetation" near-infrared band) The “need to know” Advanced Baseline Imager reference guide for the NWS forecaster》
![]() |
| AHI 0.86μm在2015年01月25日的影像,不但可以看到雲,還有地形。圖中很明顯的可以分辦出日本的九州和四國兩個大島。 |