# coding: utf-8

"""
    OurSky SDA

    The basic flow for a new organization is as follows: 1. View the available satellite targets with the [satellite targets](#tag/satellite-targets/GET/v1/satellite-targets) endpoint. Copy the id of the target you want to observe. 2. Create an organization target with the [organization target](#tag/organization-targets/GET/v1/organization-targets) endpoint. Use the id copied from above. 3. Create a webhook with the [webhook](#tag/webhooks/POST/v1/communications/webhook) endpoint to receive OSRs automatically (preferred) or use the [OSRs](#tag/observation-sequence-results/GET/v1/observation-sequence-results) endpoint to poll for OSRs.  Check out our [examples](https://github.com/ourskyai/oursky-examples) repository to see usage in each language.

    The version of the OpenAPI document: 1.3.9821
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from datetime import datetime
from typing import Optional, Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
from ourskyai_sda_api.models.v1_satellite_calibration_family import V1SatelliteCalibrationFamily

class V1NodeCalibrationResult(BaseModel):
    """
    V1NodeCalibrationResult
    """
    id: StrictStr = Field(...)
    node_id: StrictStr = Field(..., alias="nodeId")
    target_id: StrictStr = Field(..., alias="targetId")
    image_id: StrictStr = Field(..., alias="imageId")
    calculated_ra_radians: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="calculatedRaRadians", description="The right ascension of the center of the extracted streak, in radians")
    calculated_dec_radians: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="calculatedDecRadians", description="The declination of the center of the extracted streak, in radians")
    ground_truth_ra_radians: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="groundTruthRaRadians", description="Ground truth right ascension in radians, from SP3 file")
    ground_truth_dec_radians: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="groundTruthDecRadians", description="Ground truth declination in radians, from SP3 file")
    ra_error_arc_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="raErrorArcSeconds", description="Calculated error in RA, in arc-seconds")
    dec_error_arc_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="decErrorArcSeconds", description="Calculated error in Dec, in arc-seconds")
    total_error_arc_seconds: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="totalErrorArcSeconds", description="Total error in RA/Dec, in arc-seconds")
    center_time: datetime = Field(..., alias="centerTime")
    calibration_family: V1SatelliteCalibrationFamily = Field(..., alias="calibrationFamily")
    sp3_file: StrictStr = Field(..., alias="sp3File")
    created_at: datetime = Field(..., alias="createdAt")
    __properties = ["id", "nodeId", "targetId", "imageId", "calculatedRaRadians", "calculatedDecRadians", "groundTruthRaRadians", "groundTruthDecRadians", "raErrorArcSeconds", "decErrorArcSeconds", "totalErrorArcSeconds", "centerTime", "calibrationFamily", "sp3File", "createdAt"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> V1NodeCalibrationResult:
        """Create an instance of V1NodeCalibrationResult from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> V1NodeCalibrationResult:
        """Create an instance of V1NodeCalibrationResult from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return V1NodeCalibrationResult.parse_obj(obj)

        _obj = V1NodeCalibrationResult.parse_obj({
            "id": obj.get("id"),
            "node_id": obj.get("nodeId"),
            "target_id": obj.get("targetId"),
            "image_id": obj.get("imageId"),
            "calculated_ra_radians": obj.get("calculatedRaRadians"),
            "calculated_dec_radians": obj.get("calculatedDecRadians"),
            "ground_truth_ra_radians": obj.get("groundTruthRaRadians"),
            "ground_truth_dec_radians": obj.get("groundTruthDecRadians"),
            "ra_error_arc_seconds": obj.get("raErrorArcSeconds"),
            "dec_error_arc_seconds": obj.get("decErrorArcSeconds"),
            "total_error_arc_seconds": obj.get("totalErrorArcSeconds"),
            "center_time": obj.get("centerTime"),
            "calibration_family": obj.get("calibrationFamily"),
            "sp3_file": obj.get("sp3File"),
            "created_at": obj.get("createdAt")
        })
        return _obj


