lizhengnss / POSGO

GNU General Public License v3.0
81 stars 26 forks source link

an error in the Python script Analyze.py #4

Closed liusheng2020 closed 4 months ago

liusheng2020 commented 5 months ago

Hello, there may be an error in the Python script Analyze.py. Could you please help me check it, thank you. `def CalDifference(_cal, _ref): """ @author : shengyixu Created on 2022.8.20 Purpose : 获取PosGO计算值与IE参考值的残差序列 input : PosGO计算文件:_cal IE参考文件:_ref """ result = {} for time, cal in _cal.items():

    if time in _ref.keys():
        result.update(
            {time: {'b': radians(cal["b"] - _ref[time]["b"]) * RE,
                    **'l': radians(cal["l"] - _ref[time]["l"]) * RE / sin(radians(cal["b"])),**    
                    'h': cal["h"] - _ref[time]["h"],
                    'stat': cal['stat'],
                    }})
return result`

"When cal['b']=0, which means it's on the equator, it's evidently incorrect."

'l': radians(cal["l"] - _ref[time]["l"]) * RE **/ sin(radians(cal["b"])**)should be 'l': radians(cal["l"] - _ref[time]["l"]) * RE ** *cos(radians(cal["b"])**).

After modification, the program will generate results consistent with the haversine_distance function.

`def haversine_distance(blh_1, blh_2): dlat = blh_2.lat - blh_1.lat dlng = blh_2.lng - blh_1.lng a = np.sin(dlat/2)2 + np.cos(blh_1.lat) np.cos(blh_2.lat) np.sin(dlng/2)2 dist = 2 HAVERSINE_RADIUS np.arcsin(np.sqrt(a)) return dist

def pandas_haversine_distance(df1, df2): blh1 = BLH( lat=np.deg2rad(df1['LatitudeDegrees'].to_numpy()), lng=np.deg2rad(df1['LongitudeDegrees'].to_numpy()), hgt=0, ) blh2 = BLH( lat=np.deg2rad(df2['LatitudeDegrees'].to_numpy()), lng=np.deg2rad(df2['LongitudeDegrees'].to_numpy()), hgt=0, ) return haversine_distance(blh1, blh2)`

After modification, some associated Figuer and data should be renew, such as POSGO Fig. 13 in User Manual.docx(Time series of positioning errors of P40 dataset in the north (N, blue), east (E, red), and up (U, green) components of the GO for RP): raw: image new: image As it indicates, we get lower position error in 'Longitude'.

lizhengnss commented 4 months ago

The previous script had some inaccuracies, so I made modifications and calculated the positioning errors in the N, E, and U directions. Please use the latest script. Due to changes in the script, there may be some differences between the results and those in the document(doc/POSGO User Manual.docx).