日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

【Python】嫦娥探月数据(PDS)处理与可视化

發(fā)布時間:2025/3/12 python 59 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Python】嫦娥探月数据(PDS)处理与可视化 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

大家好,本鯨來蹭嫦娥5號的熱度了。

2020年11月24日4時30分,我國在中國文昌航天發(fā)射場,用長征五號遙五運載火箭成功發(fā)射探月工程嫦娥五號探測器。正式開啟我國首次地外天體采樣返回之旅。(并在12月1日23時11分,成功著陸月球并傳回著陸影像圖)

隨后,美國國家航空航天局(NASA)在其官方推特賬號上對中國航天取得的新突破進(jìn)行了一番點評。

“隨著嫦娥五號的發(fā)射升空,中國開始努力加入美國和前蘇聯(lián)獲取月面樣本的行列。我們希望中國和全球科學(xué)界分享中國探月工程所獲得的數(shù)據(jù),以增進(jìn)我們對于月球的了解,就像美國的阿波羅計劃和阿爾忒彌斯計劃所做的那樣。”

這話。。。中國探月工程數(shù)據(jù)發(fā)布與信息服務(wù)系統(tǒng)(http://moon.bao.ac.cn/)表示有些莫名奇妙。。。

早在2018年4月04日,該網(wǎng)站就發(fā)布了“嫦娥二號全月50米分辨率DEM數(shù)據(jù)”,并且就在前不久的11月3日,該網(wǎng)站還發(fā)布了嫦娥四號第八批科學(xué)數(shù)據(jù)。

這不由地讓我想關(guān)心一句“NASA你是這個格式的數(shù)據(jù)讀不出”嗎?

這不,和鯨社區(qū)的 @lqy 大佬制作了在線項目,專題介紹了中國探月工程數(shù)據(jù)發(fā)布與信息服務(wù)系統(tǒng)(http://moon.bao.ac.cn/)如何使用,如何獲取數(shù)據(jù),如何讀取數(shù)據(jù)的問題,希望NASA的同學(xué)全文閱讀,盡量減少不必要的誤會,靴靴。

項目鏈接

嫦娥探月數(shù)據(jù)(PDS)處理與可視化

https://www.kesci.com/mw/project/5fc081b065710400309ef8e7

示例數(shù)據(jù)鏈接

嫦娥四號探月工程數(shù)據(jù)

https://www.kesci.com/mw/dataset/5fc4ec4b6571040030a1bd5f

項目概覽

(數(shù)據(jù)獲取略)

安裝模塊

!pip install --upgrade pip !pip install pds4-tools==1.2 !pip install colour-demosaicing==0.1.6

導(dǎo)入模塊

from pds4_tools import pds4_read import matplotlib.pyplot as plt import matplotlib %matplotlib inlineimport numpy as np from PIL import Imagefrom skimage import exposure from skimage import data, img_as_float import colourfrom colour_demosaicing import (demosaicing_CFA_Bayer_bilinear,demosaicing_CFA_Bayer_Malvar2004,demosaicing_CFA_Bayer_Menon2007,mosaicing_CFA_Bayer) cctf_encoding = colour.cctf_encoding _ = colour.utilities.filter_warnings()

灰度圖像

path = 'CE4_GRAS_TCAM-I-023_SCI_N_20190106035123_20190106035123_0004_A.2CL' d = pds4_read(path, quiet=True) fig, axes = plt.subplots(1,1,figsize=(10,10)) img = np.array(d[0].data) axes.imshow(img, cmap='gray')

灰度圖+直方圖

def read_pds(path):data = pds4_read(path, quiet=True)img = np.array(data[0].data)img = img_as_float(img)return imgdef plot_img_and_hist(image, hist=True, bins=128):"""Plot an image along with its histogram."""if hist:fig, axes = plt.subplots(2,1, figsize=(10,10), gridspec_kw={'height_ratios': [3, 1]})ax_img, ax_hist = axeselse:fig, ax_img = plt.subplots(figsize=(10,10))# Display imageax_img.imshow(image, cmap='gray')ax_img.set_axis_off()if hist:# Display histogramax_hist.hist(image[:,:,0].ravel(), bins=bins, histtype='step', color='red')ax_hist.hist(image[:,:,1].ravel(), bins=bins, histtype='step', color='green')ax_hist.hist(image[:,:,2].ravel(), bins=bins, histtype='step', color='blue')ax_hist.ticklabel_format(axis='y', style='scientific', scilimits=(0, 0))ax_hist.set_xlabel('Pixel intensity')ax_hist.set_xlim(0, 1)ax_hist.set_yticks([])def export_img(name, img):pil_img = Image.fromarray(np.uint8(img*255))pil_img.save(name)path = 'CE4_GRAS_TCAM-I-023_SCI_N_20190106035123_20190106035123_0004_A.2CL' img = read_pds(path) plot_img_and_hist(img, hist=True) plt.show() export_img(f"{path}.png", img)

彩色圖

def debayer_img(img, CFA='RGGB'):# Menon2007 yields better edges than bilineardebayered = cctf_encoding(demosaicing_CFA_Bayer_Menon2007(img, CFA))return debayered def stretch_img(img):p2, p98 = np.percentile(img, (2, 98))img = exposure.rescale_intensity(img, in_range=(p2, p98))return imgpath = '/home/kesci/input/CE44057/CE4_GRAS_PCAML-C-006_SCI_N_20190104084559_20190104084559_0001_B.2BL' img = read_pds(path) print(img.shape) debayered = debayer_img(img) final = stretch_img(debayered) plot_img_and_hist(final, hist=True) plt.show() export_img(f"{path}.png", final)

查看屬性

d.label.to_dict()['Product_Observational']

參考資料

[1]用Python打開嫦娥玉兔的科學(xué)數(shù)據(jù):

https://zhuanlan.zhihu.com/p/106395591

[2]ChangE_4_data_playground

https://github.com/siyu6974/ChangE_4_data_playground

[3]嫦娥探月數(shù)據(jù)(PDS)處理與可視化:

https://www.kesci.com/mw/project/5fc081b065710400309ef8e7

往期精彩回顧適合初學(xué)者入門人工智能的路線及資料下載機(jī)器學(xué)習(xí)及深度學(xué)習(xí)筆記等資料打印機(jī)器學(xué)習(xí)在線手冊深度學(xué)習(xí)筆記專輯《統(tǒng)計學(xué)習(xí)方法》的代碼復(fù)現(xiàn)專輯 AI基礎(chǔ)下載機(jī)器學(xué)習(xí)的數(shù)學(xué)基礎(chǔ)專輯 獲取本站知識星球優(yōu)惠券,復(fù)制鏈接直接打開: https://t.zsxq.com/qFiUFMV 本站qq群704220115。加入微信群請掃碼:

總結(jié)

以上是生活随笔為你收集整理的【Python】嫦娥探月数据(PDS)处理与可视化的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。