备注:这里介绍的各种预处理都分单独版和批量版,批量实现的函数名后面多了一个 s。以下举例都是按照批量转换,既传入 measure 列表的形式。演示数据如下:
meas = [
('station', 'TN1', 100),
('ts', 'TN1', 'TN2', 30.15319, 15.37591, 1000)
]
针对 ts,angle,dir 类型的观测,将小数表示的度分秒转成弧度,以供后续计算
meas = mfit.dms2rs(meas)
print(meas)
[('station', 'TN1', 100), ('ts', 'TN1', 'TN2', 0.5281167542925584, 0.2728487764053169, 1000)]
根据温度,湿度,气压,计算边长改正比,单位ppm
ppm = mfit.count_ppm(35, 0.5, 1000)
print(ppm)
计算气象ppm: -24.625733318414735
用上述计算的ppm,以及加乘常熟,对边长测量进行改正
meas = mfit.ts_adjusts(meas, b=1, k=1, ppm=ppm)
print(meas)
加乘常数,ppm改正: [('station', 'TN1', 100), ('ts', 'TN1', 'TN2', 0.5281167542925584, 0.2728487764053169, 999.9763742666815)]
将竖直角,斜距拆分成高差,平距,并进行地球曲率改正,大气折光改正
meas = mfit.ts2ahds(meas, db=1, dk=1, da=1, K=0.1)
print(meas)
水平角,竖直角,斜距转水平角,高差,平距,并进行曲率改正,折光改正 [('station', 'TN1', 100), ('axhd', 'TN1', 'TN2', 0.5281167542925584, 269.535070255318, 962.9660421210108, 1, 4.684207947929276, 1.8871853600136306)]
将平距投影到统一高程面上
meas = mfit.distprojs(meas, 500)
print(meas)
平距投影到500m海拔 [('station', 'TN1', 100), ('axhd', 'TN1', 'TN2', 0.5281167542925584, 269.535070255318, 963.0061441553868, 1, 4.684207947929276, 1.8871853600136306)]
meas = mfit.splitmeas(meas)
print(meas)
拆分成基础观测 [('station', 'TN1', 100), ('dir', 'TN1', 'TN2', 0.5281167542925584, 1), ('dist', 'TN1', 'TN2', 963.0061441553868, 1.8871853600136306), ('lev', 'TN1', 'TN2', 269.535070255318, 4.684207947929276)]
# 后方交汇
points = [
('TN2', 1000, 1000, 101, True),
('TN8', 1367.77286, 1117.43005, 102, True),
('TN9', 1294.76794, 1789.72043, 103, True),
('TN1', 893, 1603, 100, False)]
measures = [
('station', 'TN1', 100),
('ts', 'TN1', 'TN2', 0, 0.00163, 612.41862),
('ts', 'TN1', 'TN8', 0.598815, 0.00294, 678.73168),
('ts', 'TN1', 'TN9', 1.8317007, 0.00678, 442.39598)
]
# 预处理
ppm = mfit.count_ppm(35, 0.5, 1000)
meas = mfit.ts_adjusts(measures, b=1, k=1, ppm=ppm)
meas = mfit.ts2ahds(meas, db=1, dk=1, da=1, K=0.1)
meas = mfit.distprojs(meas, 500)
# n高效算法到这里即可
rst, sta = mfit.backward_x(points, meas)
print(mfit.report([rst]))
name | x | y | h | type | dxx | dxy | dyy | dhh |
---|---|---|---|---|---|---|---|---|
TN1 | 893.6412 | 1603.1319 | 99.9805 | False | 0.8691 | 0.1680 | 0.8190 | 2.3629 |
# 经典算法要继续拆分成基础观测
meas = mfit.splitmeas(meas)
pts, info, sta = mfit.solve(points, meas, db=1, dk=1, da=1)
print(mfit.report(pts, info, sta))
name | x | y | h | type | dxx | dxy | dyy | dhh |
---|---|---|---|---|---|---|---|---|
TN2 | 1000.0000 | 1000.0000 | 101.0000 | True | nan | nan | nan | nan |
TN8 | 1367.7729 | 1117.4300 | 102.0000 | True | nan | nan | nan | nan |
TN9 | 1294.7679 | 1789.7204 | 103.0000 | True | nan | nan | nan | nan |
TN1 | 893.6412 | 1603.1319 | 99.9805 | False | 0.8692 | 0.1681 | 0.8190 | 2.3629 |
measure | from | to | mea(°) | value(°) | dl(″) |
---|---|---|---|---|---|
direction | TN1 | TN2 | 0.0000 | 280.0010 | 0.3852 |
direction | TN1 | TN8 | 34.3096 | 314.3094 | 0.3417 |
direction | TN1 | TN9 | 104.9487 | 24.9460 | 0.4289 |
measure | from | to | mea(m) | value(m) | dl(mm) |
---|---|---|---|---|---|
distance | TN1 | TN2 | 612.4421 | 612.4380 | 0.7630 |
distance | TN1 | TN8 | 678.7555 | 678.7541 | 0.6755 |
distance | TN1 | TN9 | 442.4035 | 442.4002 | 0.9888 |
measure | from | to | mea(m) | value(m) | dl(mm) |
---|---|---|---|---|---|
level | TN1 | TN2 | 1.0247 | 1.0195 | 2.3629 |
level | TN1 | TN8 | 2.0280 | 2.0195 | 2.3629 |
level | TN1 | TN9 | 3.0132 | 3.0195 | 2.3629 |
后验单位中误差: 5.1347