es_sfgtools.pride_tools.kin_file_operations module
- class es_sfgtools.pride_tools.kin_file_operations.PridePPP(*, modified_julian_date: Annotated[float, Ge(ge=0)], second_of_day: Annotated[float, Ge(ge=0), Le(le=86400)], east: Annotated[float, Ge(ge=-6378100), Le(le=6378100)], north: Annotated[float, Ge(ge=-6378100), Le(le=6378100)], up: Annotated[float, Ge(ge=-6378100), Le(le=6378100)], latitude: Annotated[float, Ge(ge=-90), Le(le=90)], longitude: Annotated[float, Ge(ge=0), Le(le=360)], height: Annotated[float, Ge(ge=-101), Le(le=100)], number_of_satellites: Annotated[int, Ge(ge=0), Le(le=125)] = 1, pdop: Annotated[float, Ge(ge=0), Le(le=1000)] = 0, time: datetime | None = None)
Bases:
BaseModelData class for PPP GNSS kinematic position output Docs: https://github.com/PrideLab/PRIDE-PPPAR
- east: float
- classmethod from_kin_file(data: List[str]) PridePPP | ValidationError
Read kinematic position file and return a DataFrame.
- Parameters:
data (List[str]) – A list of strings representing a line from the kin file.
- Returns:
A PridePPP object or a validation error.
- Return type:
Union[“PridePPP”, ValidationError]
- height: float
- latitude: float
- longitude: float
- model_computed_fields = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config = {'coerce': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields = {'east': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=-6378100), Le(le=6378100)]), 'height': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=-101), Le(le=100)]), 'latitude': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=-90), Le(le=90)]), 'longitude': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=0), Le(le=360)]), 'modified_julian_date': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=0)]), 'north': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=-6378100), Le(le=6378100)]), 'number_of_satellites': FieldInfo(annotation=int, required=False, default=1, metadata=[Ge(ge=0), Le(le=125)]), 'pdop': FieldInfo(annotation=float, required=False, default=0, metadata=[Ge(ge=0), Le(le=1000)]), 'second_of_day': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=0), Le(le=86400)]), 'time': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None), 'up': FieldInfo(annotation=float, required=True, metadata=[Ge(ge=-6378100), Le(le=6378100)])}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- modified_julian_date: float
- north: float
- number_of_satellites: int
- pdop: float
- classmethod populate_time(values)
Convert from modified julian date and seconds of day to standard datetime format
- second_of_day: float
- time: datetime | None
- up: float
- classmethod validate_time(values)
- es_sfgtools.pride_tools.kin_file_operations.get_wrms_from_res(res_path)
Get WRMS from a RES file.
- Parameters:
res_path (str) – The path to the RES file.
- Returns:
A DataFrame with the WRMS data.
- Return type:
pd.DataFrame
- es_sfgtools.pride_tools.kin_file_operations.kin_to_kin_position_df(source: str | Path) DataFrame | None
Create a KinPositionDataFrame from a kin file from PRIDE-PPP.
This includes WRMS residuals.
- Parameters:
source (str | Path) – The path to the kin file.
- Returns:
DataFrame with kinematic data and residuals, or None if the file cannot be parsed.
- Return type:
pd.DataFrame | None
- es_sfgtools.pride_tools.kin_file_operations.plot_kin_results_wrms(kin_df, title=None, save_as=None)
Plot kinematic results with WRMS.
- Parameters:
kin_df (pd.DataFrame) – The kinematic data.
title (str, optional) – The title of the plot, by default None.
save_as (str, optional) – The path to save the plot to, by default None.
- es_sfgtools.pride_tools.kin_file_operations.read_kin_data(kin_path)
Read a kin file and return a DataFrame.
- Parameters:
kin_path (str) – The path to the kin file.
- Returns:
A DataFrame with the kin data.
- Return type:
pd.DataFrame
- es_sfgtools.pride_tools.kin_file_operations.validate_kin_file(source: str | Path) bool
Validate a kin file.
This is done by checking if it can be parsed into a DataFrame and contains data.
- Parameters:
source (str | Path) – The path to the kin file.
- Returns:
True if the kin file is valid, False otherwise.
- Return type:
bool