GRAS嫦娥工程数据(PDS)2级数据处理

一、数据获取

  1. 注册并登录:月球与行星探测工程数据服务与信息发布系统
    月球与行星探测工程数据服务与信息发布系统

由于中国航天启动天问系列航天任务,网站首页名称由探月工程数据发布系统更名为月球与行星数据发布系统,探月工程被包含为页面一个子集,目前网站首页和数据检索页的账号系统是分开的,需要在数据检索页注册和登录账号,隶属于GRAS月球与行星探测工程地面应用系统

  1. 进入数据检索页面:月球与行星探测工程数据服务与信息发布系统-检索页面
    月球与行星探测工程数据服务与信息发布系统-检索页面
    或者你可以下载PDS数据集:月球与行星探测工程数据服务与信息发布系统-PDS数据集
    月球与行星探测工程数据服务与信息发布系统-PDS数据集
    相应的介绍页面:月球与行星探测工程数据服务与信息发布系统-PDS数据集说明地图
    月球与行星探测工程数据服务与信息发布系统-PDS数据集说明地图
  2. 下载数据文件,数据文件后缀为.2A.2AL.2B.2BL.2C.2CL格式,其中2A、2B、2C是数据文件,2AL、2BL、2CL是数据标签XML文件,必须下载同名的.2A/B/C和.2AL/BL/CL文件才能正确处理。(如果缺失,有临时生成的方法)你也可以保存下载链接进行批量下载。

二、数据说明

  文件名包含了任务标识、数据来源、探测仪器(科学载荷)缩写、数据产品类型、数据时间特性等信息

  嫦娥探月工程的数据的组织形式就叫做PDS,是NASA开发的一种专门用于存储行星探索任务的数据系统。数据的后缀有.2A/.2AL、.2B/.2BL、.2C/.2CL,2AL/2BL/2CL文件是数据标签文件 ,拿记事本可以打开。里面记录了拍摄器材、拍摄时间和曝光参数等信息,最重要的是它存储了一个文件路径,也就是同名的2A/2B/2C文件。2A/2B/2C文件里面才是实际的图片数据。

  首先嫦娥着陆器,玉兔月球车拍了照片,通过鹊桥中继卫星把数据发回来。观测站的天线大锅收到流数据,经过同步、解扰、解码、多站融合纠错后得到0级数据。分类整理并加入拍摄时间、参数等元信息后我们就有了1级数据。1级数据近似于我们用的相机拍的raw格式数据。2级数据的获取过程其实和深空拍摄的后期差不太多,2A大致是经过暗场、偏置场校正的,2B再做一步平场和镜头正畸,而2C是debayer之后的。

  以嫦娥6号命名规则为例,给出详细的命名规则,其余大同小异。
  其余数据产品文件命名规则参考:月球与行星探测工程数据服务与信息发布系统-PDS数据集说明地图

点击查看CE-6 数据产品文件命名规则

CE-6 数据产品文件命名规则

嫦娥六号数据产品文件名称使用如下格式(所有文件名称均采用大写字母):

1
CEx_st_pl_ty_dc_yyyymmddhhmiss_YYYYMMDDHHMISS_ob_ver.lv

文件名字段含义说明

字段位置含义取值说明
CEx1任务标识嫦娥六号着陆器取值为 CE6-L
st2数据来源(接收站)编号取值为 GRAS
pl3探测仪器缩写详见下方载荷名称缩写表
ty4数据产品类型详见下方数据产品类型表
dc5数据时间特性详见下方数据时间特性表
yyyymmddhhmiss6开始时间世界时格式
YYYYMMDDHHMISS7结束时间世界时格式
ob8探测周期序号占4个字符
ver9产品版本取值 A~Z,第一版为 ‘A’,最后一版为 ‘Z’
lv10产品级别详见下方产品级别表

详细字段说明

探测仪器缩写 (pl)

载荷名称文件名中的字段值含义
全景相机 PCAMPCAML-I全景相机左静态拍照
全景相机 PCAMPCAMR-I全景相机右静态拍照
降落相机 LCAMLCAM-1降落相机模式1
降落相机 LCAMLCAM-2降落相机模式2
月壤结构探测仪 LRPRLRPR-A月壤结构探测仪自动扫描
月球矿物光谱分析仪 LMSLMS-S-D月球矿物光谱分析仪 短波光谱探测
月球矿物光谱分析仪 LMSLMS-S-C月球矿物光谱分析仪 短波光谱定标
月球矿物光谱分析仪 LMSLMS-C-D月球矿物光谱分析仪 可见波段探测
月球矿物光谱分析仪 LMSLMS-C-C月球矿物光谱分析仪 可见波段定标
月球矿物光谱分析仪 LMSLMS-N-D月球矿物光谱分析仪 近红外光谱探测
月球矿物光谱分析仪 LMSLMS-N-C月球矿物光谱分析仪 近红外光谱定标
月球矿物光谱分析仪 LMSLMS-M-D月球矿物光谱分析仪 中波光谱探测
月球矿物光谱分析仪 LMSLMS-M-C月球矿物光谱分析仪 中波光谱定标

数据产品类型 (ty)

数据产品类型缩写含义
SCI科学数据产品
AUX辅助数据产品

数据时间特性 (dc)

数据时间特性含义
R实时数据
P回放数据
N不可分辨数据(混合数据)

文件名时间码含义

  • 1级数据:文件名起止时间为探测周期的起止时间(世界时)
  • 2级数据:文件名起止时间为实际数据起止时间,图像数据起止时间相同,皆为本帧图像的时间(世界时)

产品级别 (lv)

产品级别含义
011级科学数据产品
01L1级数据产品标签
2A2A级数据产品
2AL2A级数据产品标签
2B2B级数据产品
2BL2B级数据产品标签

数据产品级别定义

三、数据处理

方法一、使用Python中pds4-tools库对2级数据进行处理

环境依赖

Python 3.16.13
如果你使用anacoda可以参考下列对虚拟环境的配置

1
2
conda create -n changE python=3.6
conda activate changE
依赖列表
NameVersionBuildChannel
backcall0.2.0pyh9f0ad1d_0conda-forge
backports1.0pyhd8ed1ab_4conda-forge
backports.functools_lru_cache2.0.0pyhd8ed1ab_0conda-forge
blas1.0mklhttps://mirrors.ustc.edu.cn/anaconda/pkgs/main
ca-certificates2025.9.9haa95532_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
certifi2021.5.30py36haa95532_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
cloudpickle2.0.0pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
colorama0.4.5pyhd8ed1ab_0conda-forge
colour-demosaicing0.1.6pypi_0pypi
colour-science0.3.16pypi_0pypi
cycler0.11.0pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
cytoolz0.11.0py36he774522_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
dask-core2021.3.0pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
decorator5.1.1pyhd8ed1ab_0conda-forge
entrypoints0.4pyhd8ed1ab_0conda-forge
freetype2.13.3h0620614_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
giflib5.2.2h7edc060_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
icc_rt2022.1.0h6049295_2https://mirrors.ustc.edu.cn/anaconda/pkgs/main
icu58.2ha925a31_3https://mirrors.ustc.edu.cn/anaconda/pkgs/main
imageio2.15.0pypi_0pypi
intel-openmp2025.0.0haa95532_1164https://mirrors.ustc.edu.cn/anaconda/pkgs/main
ipykernel5.5.5py36hfacbf0b_0conda-forge
ipython7.16.1py36h7b2dad6_2conda-forge
ipython_genutils0.2.0pyhd8ed1ab_1conda-forge
jedi0.17.2py36ha15d459_1conda-forge
jpeg9fha349fce_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
jupyter_client7.1.2pyhd8ed1ab_0conda-forge
jupyter_core4.8.1py36ha15d459_0conda-forge
kiwisolver1.3.1py36hd77b12b_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
lerc3.0hd77b12b_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
libdeflate1.17h2bbff1b_1https://mirrors.ustc.edu.cn/anaconda/pkgs/main
libpng1.6.39h8cc25b3_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
libsodium1.0.18h8d14728_1conda-forge
libtiff4.5.1hd77b12b_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
libwebp1.3.2hbc33d0d_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
libwebp-base1.3.2h3d04722_1https://mirrors.ustc.edu.cn/anaconda/pkgs/main
libzlib1.3.1h02ab6af_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
lz4-c1.9.4h2bbff1b_1https://mirrors.ustc.edu.cn/anaconda/pkgs/main
matplotlib3.3.4py36haa95532_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
matplotlib-base3.3.4py36h49ac443_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
mkl2020.2256https://mirrors.ustc.edu.cn/anaconda/pkgs/main
mkl-service2.3.0py36h196d8e1_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
mkl_fft1.3.0py36h46781fe_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
mkl_random1.1.1py36h47e9c7a_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
nest-asyncio1.6.0pyhd8ed1ab_0conda-forge
networkx2.5py_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
numpy1.19.5pypi_0pypi
numpy-base1.19.2py36ha3acd2a_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
olefile0.46pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
openssl1.1.1wh2bbff1b_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
parso0.7.1pyh9f0ad1d_0conda-forge
pds4-tools1.2pypi_0pypi
pickleshare0.7.5py_1003conda-forge
pillow8.4.0pypi_0pypi
pip21.2.2py36haa95532_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
prompt-toolkit3.0.36pyha770c72_0conda-forge
pygments2.14.0pyhd8ed1ab_0conda-forge
pyparsing3.0.4pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
pyqt5.9.2py36h6538335_2https://mirrors.ustc.edu.cn/anaconda/pkgs/main
python3.6.13h3758d61_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
python-dateutil2.8.2pyhd8ed1ab_0conda-forge
python_abi3.62_cp36mconda-forge
pywavelets1.1.1py36he774522_2https://mirrors.ustc.edu.cn/anaconda/pkgs/main
pywin32301py36h68aa20f_0conda-forge
pyyaml5.4.1py36h2bbff1b_1https://mirrors.ustc.edu.cn/anaconda/pkgs/main
pyzmq22.3.0py36h1d5d788_0conda-forge
qt5.9.7vc14h73c81de_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
scikit-image0.17.2py36h1e1f486_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
scipy1.5.4pypi_0pypi
setuptools58.0.4py36haa95532_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
sip4.19.8py36h6538335_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
six1.17.0pypi_0pypi
sqlite3.50.2hda9a48d_1https://mirrors.ustc.edu.cn/anaconda/pkgs/main
tifffile2020.10.1py36h8c2d366_2https://mirrors.ustc.edu.cn/anaconda/pkgs/main
tk8.6.15hf199647_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
toolz0.11.2pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
tornado6.1py36h68aa20f_1conda-forge
traitlets4.3.3pyhd8ed1ab_2conda-forge
ucrt10.0.22621.0haa95532_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
vc14.3h2df5915_10https://mirrors.ustc.edu.cn/anaconda/pkgs/main
vc14_runtime14.44.35208h4927774_10https://mirrors.ustc.edu.cn/anaconda/pkgs/main
vs2015_runtime14.44.35208ha6b5a95_10https://mirrors.ustc.edu.cn/anaconda/pkgs/main
wcwidth0.2.10pyhd8ed1ab_0conda-forge
wheel0.37.1pyhd3eb1b0_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
wincertstore0.2py36h7fe50ca_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
xz5.6.4h4754444_1https://mirrors.ustc.edu.cn/anaconda/pkgs/main
yaml0.2.5he774522_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
zeromq4.3.4h0e60522_1conda-forge
zlib1.3.1h02ab6af_0https://mirrors.ustc.edu.cn/anaconda/pkgs/main
zstd1.5.7h56299aa_0https://mirrors

安装第三方库

使用pip命令和conda命令安装第三方库

1
2
3
4
5
pip install --upgrade pip
pip install pds4-tools==1.2
pip install colour-demosaicing==0.1.6
conda install matplotlib
conda install scikit-image

导入库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pds4_tools import pds4_read
import matplotlib.pyplot as plt
import matplotlib
%matplotlib inline

import numpy as np
from PIL import Image

from skimage import exposure
from skimage import data, img_as_float
import colour

from 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()

灰度图像

1
2
3
4
5
path = './input/文件名.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')
  • 输出示例
    输出示例

灰度图+直方图

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
def read_pds(path):
data = pds4_read(path, quiet=True)
img = np.array(data[0].data)
img = img_as_float(img)
return img

def 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 = axes
else:
fig, ax_img = plt.subplots(figsize=(10,10))

# Display image
ax_img.imshow(image, cmap='gray')
ax_img.set_axis_off()

if hist:
# Display histogram
ax_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 = './input/文件名.2CL'
img = read_pds(path)
plot_img_and_hist(img, hist=True)
plt.show()
export_img(f"{path}.png", img)

彩色图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def debayer_img(img, CFA='RGGB'):
# Menon2007 yields better edges than bilinear
debayered = 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 img

path = './input/文件名.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)
  • 输出示例
    输出示例
    输出示例

查看属性

1
d.label.to_dict()['Product_Observational']
  • 如果一切顺利,它会像这样工作
    输出示例

We salute China's Space Program.