Compare commits
2 Commits
4db713b2da
...
922b0fe516
| Author | SHA1 | Date | |
|---|---|---|---|
| 922b0fe516 | |||
| 669db5373f |
2
.idea/Masterprojekt-Campusnetz.iml
generated
2
.idea/Masterprojekt-Campusnetz.iml
generated
@@ -4,7 +4,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.14" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.14 (Masterprojekt)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.14" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14 (Masterprojekt)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
57
Berechnungen.py
Normal file
57
Berechnungen.py
Normal file
@@ -0,0 +1,57 @@
|
||||
import sympy as sp
|
||||
|
||||
class Berechnungen:
|
||||
def __init__(self, a, b):
|
||||
self.a_wert = a
|
||||
self.b_wert = b
|
||||
self.e_quadrat_wert = self.e_quadrat()
|
||||
self.e_strich_quadrat_wert = self.e_strich_quadrat()
|
||||
|
||||
def e_quadrat(self):
|
||||
return (self.a_wert**2 - self.b_wert**2) / self.a_wert **2
|
||||
|
||||
def e_strich_quadrat(self):
|
||||
return (self.a_wert**2 - self.b_wert**2) / self.b_wert **2
|
||||
|
||||
def P(self, x, y):
|
||||
return sp.sqrt(x**2 + y**2)
|
||||
|
||||
def hilfswinkel(self, z, x, y):
|
||||
hw = sp.atan2(z * self.a_wert, self.P(x, y) * self.b_wert)
|
||||
return hw
|
||||
|
||||
def B(self, z, x, y):
|
||||
hilfswinkel = self.hilfswinkel(z, x, y)
|
||||
B = sp.atan2((z + self.e_strich_quadrat_wert * self.b_wert * sp.sin(hilfswinkel) ** 3), (self.P(x, y) - self.e_strich_quadrat_wert * self.a_wert * sp.cos(hilfswinkel) ** 3))
|
||||
return B
|
||||
|
||||
def L(self, x, y):
|
||||
return sp.atan2(y, x)
|
||||
|
||||
def H(self, x, y, z):
|
||||
B = self.B(z, x, y)
|
||||
H = (self.P(x, y) / sp.cos(B)) - self.a_wert / (sp.sqrt(1 - self.e_quadrat_wert * sp.sin(B) ** 2))
|
||||
return H
|
||||
|
||||
def geometrische_breite_laenge(self, dict_koordinaten):
|
||||
for punktnummer, matrix in dict_koordinaten.items():
|
||||
|
||||
dict_koordinaten[punktnummer] = [matrix, self.B(matrix[2], matrix[0], matrix[1]), self.L(matrix[0], matrix[1])]
|
||||
return dict_koordinaten
|
||||
|
||||
class Einheitenumrechnung:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def mas_to_rad(mas):
|
||||
umrechnungsfaktor = 1 / 1000 * 1 / 3600 * sp.pi / 180
|
||||
grad = mas * umrechnungsfaktor
|
||||
return grad
|
||||
|
||||
def mm_to_m(mm):
|
||||
m = mm / 1000
|
||||
return m
|
||||
|
||||
def ppb(ppb):
|
||||
ppb *= 10 ** (-9)
|
||||
return ppb
|
||||
@@ -13,7 +13,8 @@
|
||||
"import importlib\n",
|
||||
"import Koordinatentransformationen\n",
|
||||
"import sqlite3\n",
|
||||
"import Funktionales_Modell"
|
||||
"import Funktionales_Modell\n",
|
||||
"import Berechnungen"
|
||||
],
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
@@ -292,15 +293,41 @@
|
||||
"importlib.reload(Datenbank)\n",
|
||||
"db_zugriff = Datenbank.Datenbankzugriff(pfad_datenbank)\n",
|
||||
"\n",
|
||||
"# Parameter des GRS80-ellipsoids (Bezugsellipsoid des ETRS89 / DREF 91 (2025)\n",
|
||||
"# ToDo: Quelle mit möglichst genauen Parametern heraussuchen!\n",
|
||||
"a = 6378137.0 #m\n",
|
||||
"b = 63567552.314 #m\n",
|
||||
"\n",
|
||||
"importlib.reload(Funktionales_Modell)\n",
|
||||
"fm = Funktionales_Modell.FunktionalesModell(pfad_datenbank)\n",
|
||||
"fm = Funktionales_Modell.FunktionalesModell(pfad_datenbank, a, b)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"#db_zugriff.get_beobachtungen_id_standpunkt_zielpunkt(\"tachymeter_distanz\")\n",
|
||||
"fm.jacobi_matrix_symbolisch()"
|
||||
"Jacobimatrix_symbolisch = fm.jacobi_matrix_symbolisch()[0]\n",
|
||||
"Jacobimatrix_symbolisch_liste_unbekannte = fm.jacobi_matrix_symbolisch()[1]\n",
|
||||
"Jacobimatrix_symbolisch_liste_zeilenbeschriftungen = fm.jacobi_matrix_symbolisch()[2]"
|
||||
],
|
||||
"id": "d38939f7108e1788",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
},
|
||||
{
|
||||
"metadata": {},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"importlib.reload(Datenbank)\n",
|
||||
"db_zugriff = Datenbank.Datenbankzugriff(pfad_datenbank)\n",
|
||||
"importlib.reload(Funktionales_Modell)\n",
|
||||
"fm = Funktionales_Modell.FunktionalesModell(pfad_datenbank, a, b)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"fm.jacobi_matrix_zahlen_iteration_0(Jacobimatrix_symbolisch, \"naeherung_us\", Jacobimatrix_symbolisch_liste_unbekannte, Jacobimatrix_symbolisch_liste_zeilenbeschriftungen)"
|
||||
],
|
||||
"id": "dba5ecd0354bbc48",
|
||||
"outputs": [],
|
||||
"execution_count": null
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import sympy as sp
|
||||
|
||||
class Einheitenumrechnung:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def mas_to_rad(mas):
|
||||
umrechnungsfaktor = 1 / 1000 * 1 / 3600 * sp.pi / 180
|
||||
grad = mas * umrechnungsfaktor
|
||||
return grad
|
||||
|
||||
def mm_to_m(mm):
|
||||
m = mm / 1000
|
||||
return m
|
||||
|
||||
def ppb(ppb):
|
||||
ppb *= 10 ** (-9)
|
||||
return ppb
|
||||
19
Export.py
Normal file
19
Export.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import csv
|
||||
|
||||
class Export:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def matrix_to_csv(dateiname, liste_spaltenbeschriftung, liste_zeilenbeschriftung, Matrix, beschriftung_kopfzeile = ""):
|
||||
with open(dateiname, "w", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.writer(csvfile, delimiter=";")
|
||||
|
||||
kopfzeile = [beschriftung_kopfzeile]
|
||||
for spaltenbeschriftung in liste_spaltenbeschriftung:
|
||||
kopfzeile.append(str(spaltenbeschriftung))
|
||||
writer.writerow(kopfzeile)
|
||||
|
||||
for zeilenbeschriftung, zeile in zip(liste_zeilenbeschriftung, Matrix.tolist()):
|
||||
zeile_als_text = [zeilenbeschriftung] + [str(eintrag) for eintrag in zeile]
|
||||
writer.writerow(zeile_als_text)
|
||||
@@ -1,11 +1,13 @@
|
||||
from Datenbank import *
|
||||
import sympy as sp
|
||||
import csv
|
||||
from Export import Export
|
||||
from Berechnungen import Berechnungen
|
||||
|
||||
|
||||
class FunktionalesModell:
|
||||
def __init__(self, pfad_datenbank):
|
||||
def __init__(self, pfad_datenbank, a, b):
|
||||
self.pfad_datenbank = pfad_datenbank
|
||||
self.berechnungen = Berechnungen(a, b)
|
||||
|
||||
def jacobi_matrix_symbolisch(self):
|
||||
liste_beobachtungsarten = ["tachymeter_distanz", "tachymeter_richtung", "tachymeter_zenitwinkel"]
|
||||
@@ -14,17 +16,8 @@ class FunktionalesModell:
|
||||
liste_beobachtungen_rohdaten = []
|
||||
liste_punktnummern =[]
|
||||
|
||||
liste_beobachtungen_jacobian = []
|
||||
liste_orientierungsunbekannte = []
|
||||
|
||||
liste_beobachtungsgleichungen_jacobian = []
|
||||
liste_beobachtungsgleichungen_abgeleitet = []
|
||||
|
||||
liste_beobachtungen_abgeleitet = []
|
||||
liste_zeilenbeschriftungen_jacobian = []
|
||||
|
||||
liste_zeilenbeschriftungen_abgeleitet = []
|
||||
|
||||
for beobachtungsart in liste_beobachtungsarten:
|
||||
liste_id_standpunkt_zielpunkt = db_zugriff.get_beobachtungen_id_beobachtungsgruppe_standpunkt_zielpunkt(beobachtungsart)
|
||||
|
||||
@@ -164,22 +157,32 @@ class FunktionalesModell:
|
||||
else:
|
||||
return None
|
||||
|
||||
# --- Export der A_jacobian-Matrix in eine CSV-Datei ---
|
||||
dateiname_export = "Jacobi_Matrix.csv"
|
||||
Export.matrix_to_csv(r"Zwischenergebnisse\Jacobi_Matrix_Symbolisch.csv", liste_unbekannte,
|
||||
liste_zeilenbeschriftungen_gesamt, A_gesamt, "Beobachtung")
|
||||
return A_gesamt, liste_unbekannte, liste_zeilenbeschriftungen_gesamt
|
||||
|
||||
with open(dateiname_export, "w", newline="", encoding="utf-8") as csvfile:
|
||||
writer = csv.writer(csvfile, delimiter=";")
|
||||
def jacobi_matrix_zahlen_iteration_0(self, A_symbolisch, koordinatenart, liste_unbekannte = None, liste_zeilenbeschriftungen_gesamt = None):
|
||||
|
||||
# Kopfzeile: leere Ecke + Namen der Unbekannten
|
||||
kopfzeile = ["Beobachtung"]
|
||||
for unbekannte in liste_unbekannte:
|
||||
kopfzeile.append(str(unbekannte))
|
||||
writer.writerow(kopfzeile)
|
||||
if koordinatenart == "naeherung_us":
|
||||
db_zugriff = Datenbankzugriff(self.pfad_datenbank)
|
||||
dict_koordinaten_B_L = self.berechnungen.geometrische_breite_laenge(db_zugriff.get_koordinaten(koordinatenart))
|
||||
|
||||
# Zeilen: Standpunkt-Zielpunkt + Jacobimatrix-Zeile
|
||||
for zeilenbeschriftung, zeile in zip(liste_zeilenbeschriftungen_gesamt, A_gesamt.tolist()):
|
||||
zeile_als_text = [zeilenbeschriftung] + [str(eintrag) for eintrag in zeile]
|
||||
writer.writerow(zeile_als_text)
|
||||
substitutionen = {}
|
||||
|
||||
for punktnummer, vektor in dict_koordinaten_B_L.items():
|
||||
X_sym, Y_sym, Z_sym, B_sym, L_Sym = sp.symbols(f"X{punktnummer} Y{punktnummer} Z{punktnummer} B{punktnummer} L{punktnummer}")
|
||||
|
||||
return A_gesamt
|
||||
substitutionen[X_sym] = vektor[0][0]
|
||||
substitutionen[Y_sym] = vektor[0][1]
|
||||
substitutionen[Z_sym] = vektor[0][2]
|
||||
substitutionen[B_sym] = vektor[1]
|
||||
substitutionen[L_Sym] = vektor[2]
|
||||
|
||||
A_numerisch = A_symbolisch.xreplace(substitutionen)
|
||||
|
||||
Export.matrix_to_csv(r"Zwischenergebnisse\Jacobi_Matrix_Numerisch_Iteration0.csv", liste_unbekannte,
|
||||
liste_zeilenbeschriftungen_gesamt, A_numerisch, "Beobachtung")
|
||||
|
||||
return A_numerisch
|
||||
else:
|
||||
print("Koordinaten noch nicht implementiert!")
|
||||
@@ -1,7 +1,7 @@
|
||||
# Transformation ITRF2020 --> ETRF89/DREF91 Realisierung 2025
|
||||
|
||||
import sympy as sp
|
||||
from Einheitenumrechnung import Einheitenumrechnung
|
||||
from Berechnungen import Einheitenumrechnung
|
||||
|
||||
# Helmetert Paramteter zur Referenzepoche t0
|
||||
t0 = 2015.0
|
||||
|
||||
2629
Zwischenergebnisse/Jacobi_Matrix_Numerisch_Iteration0.csv
Normal file
2629
Zwischenergebnisse/Jacobi_Matrix_Numerisch_Iteration0.csv
Normal file
File diff suppressed because it is too large
Load Diff
|
Can't render this file because it is too large.
|
Reference in New Issue
Block a user