# 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 typing import List, Union
from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist

class V1SIPCoefficients(BaseModel):
    """
    V1SIPCoefficients
    """
    order: StrictInt = Field(..., description="Order of the SIP transformation")
    a: conlist(conlist(Union[StrictFloat, StrictInt])) = Field(..., alias="A", description="Forward SIP coefficients matrix A")
    b: conlist(conlist(Union[StrictFloat, StrictInt])) = Field(..., alias="B", description="Forward SIP coefficients matrix B")
    cd1_1: Union[StrictFloat, StrictInt] = Field(..., alias="CD1_1", description="Coordinate description matrix element (1,1) - maps pixel coordinates to sky coordinates in degrees, encapsulating scale, rotation and skew")
    cd1_2: Union[StrictFloat, StrictInt] = Field(..., alias="CD1_2", description="Coordinate description matrix element (1,2) - maps pixel coordinates to sky coordinates in degrees, encapsulating scale, rotation and skew")
    cd2_1: Union[StrictFloat, StrictInt] = Field(..., alias="CD2_1", description="Coordinate description matrix element (2,1) - maps pixel coordinates to sky coordinates in degrees, encapsulating scale, rotation and skew")
    cd2_2: Union[StrictFloat, StrictInt] = Field(..., alias="CD2_2", description="Coordinate description matrix element (2,2) - maps pixel coordinates to sky coordinates in degrees, encapsulating scale, rotation and skew")
    coordinate_reference_pixel_x: Union[StrictFloat, StrictInt] = Field(..., alias="coordinateReferencePixelX", description="X coordinate of the reference pixel")
    coordinate_reference_pixel_y: Union[StrictFloat, StrictInt] = Field(..., alias="coordinateReferencePixelY", description="Y coordinate of the reference pixel")
    coordinate_reference_ra_degrees: Union[StrictFloat, StrictInt] = Field(..., alias="coordinateReferenceRADegrees", description="Right ascension of the reference coordinate in degrees")
    coordinate_reference_dec_degrees: Union[StrictFloat, StrictInt] = Field(..., alias="coordinateReferenceDecDegrees", description="Declination of the reference coordinate in degrees")
    __properties = ["order", "A", "B", "CD1_1", "CD1_2", "CD2_1", "CD2_2", "coordinateReferencePixelX", "coordinateReferencePixelY", "coordinateReferenceRADegrees", "coordinateReferenceDecDegrees"]

    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) -> V1SIPCoefficients:
        """Create an instance of V1SIPCoefficients 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) -> V1SIPCoefficients:
        """Create an instance of V1SIPCoefficients from a dict"""
        if obj is None:
            return None

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

        _obj = V1SIPCoefficients.parse_obj({
            "order": obj.get("order"),
            "a": obj.get("A"),
            "b": obj.get("B"),
            "cd1_1": obj.get("CD1_1"),
            "cd1_2": obj.get("CD1_2"),
            "cd2_1": obj.get("CD2_1"),
            "cd2_2": obj.get("CD2_2"),
            "coordinate_reference_pixel_x": obj.get("coordinateReferencePixelX"),
            "coordinate_reference_pixel_y": obj.get("coordinateReferencePixelY"),
            "coordinate_reference_ra_degrees": obj.get("coordinateReferenceRADegrees"),
            "coordinate_reference_dec_degrees": obj.get("coordinateReferenceDecDegrees")
        })
        return _obj


