Greetings, Orekit community,
I am new to Orekit and trying to reproduce 02-orbit-determination-example.ipynb to use it for a similar ODP using SLR data. But when I try to load station data, the code hereunder gives me an error, and I need your help. Your help/direction is much appreciated!
Code:
stationFile = ‘SLRF2014_POS+VEL_2030.0_180504.snx’
stationEccFile = ‘ecc_xyz.snx’
import slrDataUtils
stationData = slrDataUtils.parseStationData(stationFile, stationEccFile, startCollectionDate)
display(stationData)
error:
…indexing.py:925: PerformanceWarning: indexing past lexsort depth may impact performance.
return self._getitem_tuple(key)
KeyError Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
3360 try:
→ 3361 return self._engine.get_loc(casted_key)
3362 except KeyError as err:
~/anaconda3/lib/python3.7/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
~/anaconda3/lib/python3.7/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: 0
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
/tmp/ipykernel_6302/2687762062.py in
2 stationEccFile = ‘ecc_xyz.snx’
3 import slrDataUtils
----> 4 stationData = slrDataUtils.parseStationData(stationFile, stationEccFile, startCollectionDate)
5 display(stationData)
~/Documents/1Apro/OreKit/OK01/slrDataUtils.py in parseStationData(stationFile, stationEccFile, epoch)
140 for stationId, staData in stationData.iterrows():
141 indexTuple = (staData[‘CODE’], staData[‘PT’])
→ 142 refEpoch = stationxyz.loc[indexTuple, ‘REF_EPOCH’][0]
143 yearsSinceEpoch = (epoch - refEpoch).days / 365.25
144
~/anaconda3/lib/python3.7/site-packages/pandas/core/series.py in getitem(self, key)
940
941 elif key_is_scalar:
→ 942 return self._get_value(key)
943
944 if is_hashable(key):
~/anaconda3/lib/python3.7/site-packages/pandas/core/series.py in _get_value(self, label, takeable)
1049
1050 # Similar to Index.get_value, but we do not fall back to positional
→ 1051 loc = self.index.get_loc(label)
1052 return self.index._get_values_for_loc(self, loc, label)
1053
~/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/multi.py in get_loc(self, key, method)
2920
2921 if not isinstance(key, tuple):
→ 2922 loc = self._get_level_indexer(key, level=0)
2923 return _maybe_to_slice(loc)
2924
~/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/multi.py in _get_level_indexer(self, key, level, indexer)
3202 else:
3203
→ 3204 idx = self._get_loc_single_level_index(level_index, key)
3205
3206 if level > 0 or self._lexsort_depth == 0:
~/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/multi.py in _get_loc_single_level_index(self, level_index, key)
2853 return -1
2854 else:
→ 2855 return level_index.get_loc(key)
2856
2857 def get_loc(self, key, method=None):
~/anaconda3/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
3361 return self._engine.get_loc(casted_key)
3362 except KeyError as err:
→ 3363 raise KeyError(key) from err
3364
3365 if is_scalar(key) and isna(key) and not self.hasnans:
KeyError: 0