opihiexarata.opihi.solution module
This is the class for a collection of solutions which the GUI interacts with and acts as the complete solver. There is not engine as it just shuffles the solutions.
- class opihiexarata.opihi.solution.OpihiSolution(fits_filename: str, filter_name: str = None, exposure_time: float = None, observing_time: float = None, asteroid_name: str = None, asteroid_location: tuple[float, float] = None, asteroid_radius: float = None, asteroid_history: list[str] = None)[source]
Bases:
ExarataSolution
This is the main class which acts as a collection container of solution classes. It facilitates the interaction between the solution classes and the GUI.
- fits_filename
The fits filename of which is the image which this solution is solving.
- Type:
str
- filter_name
The filter_name which this image is taken in.
- Type:
str
- exposure_time
The exposure time of the image, in seconds.
- Type:
float
- observing_time
The time of observation, this is in Julian days.
- Type:
float
- asteroid_name
The name of the asteroid. This is used to group similar observations and to also retrieve data from the MPC.
- Type:
str
- asteroid_location
The pixel location of the asteroid. (Usually determined by a centroid around a user specified location.) If this is None, then asteroid calculations are disabled as there is no asteroid.
- Type:
tuple
- asteroid_radius
The pixel radius of the asteroid. This is used for aperture photometry.
- Type:
float
- asteroid_history
The total observational history of the asteroid provided. This includes previous observations done by Opihi and processed by OpihiExarata, but does not include the current data. This is the 80-column text file form of a MPC record. If this is None, then asteroid calculations are disabled as there is no asteroid.
- Type:
list
- asteroid_observations
The total observational history of the asteroid provided. This includes previous observations done by Opihi and processed by OpihiExarata, but does not include the current data. This is the table form of a MPC record. If this is None, then asteroid calculations are disabled as there is no asteroid.
- Type:
table
- header
The header of the fits file.
- Type:
Astropy Header
- data
The image data of the fits file itself.
- Type:
array
- asteroid_magnitude
The magnitude of the asteroid as determined by aperture photometry using the photometric solution. If there is no photometric solution, this is None.
- Type:
float
- asteroid_magnitude_error
The error of the magnitude, as propagated. If there is no photometric solution, this is None.
- Type:
float
- astrometricsAstrometricSolution
The astrometric solution; if it has not been solved yet, this is None.
- photometricsPhotometricSolution
The photometric solution; if it has not been solved yet, this is None.
- orbitalsOrbitalSolution
The orbit solution; if it has not been solved yet, this is None.
- ephemeriticsEphemeriticSolution
The ephemeris solution; if it has not been solved yet, this is None.
- propagativesPropagativeSolution
The propagation solution; if it has not been solved yet, this is None.
- astrometrics_statusbool
The status of the solving of the astrometric solution. It is True or False based on the success of the solve, None if a solve has not been attempted.
- photometrics_statusbool
The status of the solving of the photometric solution. It is True or False based on the success of the solve, None if a solve has not been attempted.
- orbitals_statusbool
The status of the solving of the orbital solution. It is True or False based on the success of the solve, None if a solve has not been attempted.
- ephemeritics_statusbool
The status of the solving of the ephemeris solution. It is True or False based on the success of the solve, None if a solve has not been attempted.
- propagatives_statusbool
The status of the solving of the propagative solution. It is True or False based on the success of the solve, None if a solve has not been attempted.
- astrometrics_engine_classExarataEngine
The engine class used for the solving of the astrometric solution.
- photometrics_engine_classExarataEngine
The engine class used for the solving of the photometric solution.
- orbitals_engine_classExarataEngine
The engine class used for the solving of the orbital solution.
- ephemeritics_engine_classExarataEngine
The engine class used for the solving of the ephemeritic solution.
- propagatives_engine_classExarataEngine
The engine class used for the solving of the propagative solution.
- __del_asteroid_observations() None
Property: delete asteroid observation table.
The table cannot be deleted.
- Parameters:
None –
- Return type:
None
- __get_asteroid_observations() Table
Property: get asteroid observation table.
We derive the observation table from the asteroid history data.
- Parameters:
None –
- Returns:
asteroid_observations – The Astropy table which is a copy of the data in asteroid history.
- Return type:
Table
- __init__(fits_filename: str, filter_name: str = None, exposure_time: float = None, observing_time: float = None, asteroid_name: str = None, asteroid_location: tuple[float, float] = None, asteroid_radius: float = None, asteroid_history: list[str] = None) None [source]
Creating the main solution class.
All of the data which is needed to derive the other solutions should be provided. The solutions, however, are only done when called. Overriding parameters can be applied when calling the solutions.
If the asteroid input values are not provided, then this class will prohibit calculations meant for asteroids because of the lack of an asteroid.
- Parameters:
fits_filename (str) – The fits filename of which is the image which this solution is solving.
filter_name (string, default=None) – The filter_name of the image which is contained within the data array. If None, we attempt to pull the value from the fits file.
exposure_time (float, default=None) – The exposure time of the image, in seconds. If None, we attempt to pull the value from the fits file.
observing_time (float, default=None) – The time of observation, this time must in Julian day. If None, we attempt to pull the value from the fits file.
asteroid_name (str, default = None) – The name of the asteroid.
asteroid_location (tuple, default = None) – The pixel location of the asteroid.
asteroid_radius (float) – The pixel radius of the asteroid. This is used for aperture photometry.
asteroid_history (list, default = None) – The history of observations of an asteroid written in a standard 80-column MPC record.
- __set_asteroid_observations(value: Any) None
Property: set asteroid observation table.
You cannot set the asteroid observations directly as it is determined from the asteroid history.
- Parameters:
None –
- Return type:
None
- _generate_opihiexarata_fits_entries_dictionary()[source]
We determine the OpihiExarata header entries here. We follow the specification for the OpihiExarata FITS header. We only add values which we have proper data for to the dictionary.
- Parameters:
None –
- Returns:
available_entries – The available entries which there exists
- Return type:
dict
- property asteroid_observations: Table
get asteroid observation table.
We derive the observation table from the asteroid history data.
- Parameters:
None –
- Returns:
asteroid_observations – The Astropy table which is a copy of the data in asteroid history.
- Return type:
Table
- Type:
Property
- compute_asteroid_magnitude(asteroid_location: tuple = None, overwrite: bool = True) tuple[float, float] [source]
This function computes the asteroid magnitude provided the location of the asteroid. This requires an asteroid location and a PhotometricSolution.
- Parameters:
asteroid_location (tuple, default = None) – The pixel location of the asteroid. If None, we default to using the current asteroid location stored in this instance.
overwrite (bool, default = True) – Overwrite and replace the information of this class with the new values. If False, we only return the values and do not overwrite the data in this class.
- Returns:
magnitude, float – The magnitude of the asteroid as computed by the photometric solution.
magnitude_error, float – The magnitude error of the asteroid as computed by the photometric solution.
- mpc_record_full() list[str] [source]
This creates a full MPC record from all observations, including the history and this current observation.
- Parameters:
None –
- Returns:
mpc_record – The MPC record as a list where each entry is a row.
- Return type:
list
- mpc_record_row() str [source]
Returns an 80-character record describing the observation of this object assuming it is an asteroid. It only uses information that is provided and does not attempt to compute any solutions.
- Parameters:
None –
- Returns:
record_row – The 80-character record as determined by the MPC specification.
- Return type:
str
- mpc_table_row() Table [source]
An MPC table of the current observation with information provided by solved solutions. This routine does not attempt to do any solutions.
- Parameters:
None –
- Returns:
table_row – The MPC table of the information. It is a single row table.
- Return type:
Astropy Table
- save_to_fits_file(filename: str, overwrite: bool = False) None [source]
We save all of the information that we can from this solution to a FITS file.
- Parameters:
filename (string) – The name of the fits file to save all of this data to.
overwrite (bool, default = False) – If True, this overwrites the file if there is a conflict.
- Return type:
None
- solve_astrometry(solver_engine: AstrometryEngine, overwrite: bool = True, raise_on_error: bool = False, vehicle_args: dict = {}) tuple[AstrometricSolution, bool] [source]
Solve the image astrometry by using an astrometric engine.
- Parameters:
solver_engine (AstrometryEngine) – The astrometric engine which the astrometry solver will use.
overwrite (bool, default = True) – Overwrite and replace the information of this class with the new values. If False, the returned solution is not also applied.
raise_on_error (bool, default = False) – If True, this disables the error handing and allows for errors from the solving engines/solutions to be propagated out.
vehicle_args (dictionary, default = {}) – If the vehicle function for the provided solver engine needs extra parameters not otherwise provided by the standard input, they are given here.
- Returns:
astrometric_solution (AstrometricSolution) – The astrometry solution for the image.
solve_status (bool) – The status of the solve. If True, the solving was successful.
- solve_ephemeris(solver_engine: EphemerisEngine, overwrite: bool = True, raise_on_error: bool = False, vehicle_args: dict = {}) tuple[EphemeriticSolution, bool] [source]
Solve for the ephemeris solution an asteroid using previous observations and derived orbital elements.
- Parameters:
solver_engine (EphemerisEngine) – The ephemeris engine which the ephemeris solver will use.
overwrite (bool, default = True) – Overwrite and replace the information of this class with the new values. If False, the returned solution is not also applied.
raise_on_error (bool, default = False) – If True, this disables the error handing and allows for errors from the solving engines/solutions to be propagated out.
vehicle_args (dictionary, default = {}) – If the vehicle function for the provided solver engine needs extra parameters not otherwise provided by the standard input, they are given here.
- Returns:
ephemeritics_solution (EphemeriticSolution) – The orbit solution for the asteroid and image.
solve_status (bool) – The status of the solve. If True, the solving was successful.
Warning .. – This requires that the orbital solution be computed before-hand. It will not be precomputed automatically; without it being called explicitly, this will instead raise an error.
- solve_orbit(solver_engine: OrbitEngine, overwrite: bool = True, raise_on_error: bool = False, asteroid_location: tuple = None, vehicle_args: dict = {}) tuple[OrbitalSolution, bool] [source]
Solve for the orbital elements an asteroid using previous observations.
- Parameters:
solver_engine (OrbitEngine) – The orbital engine which the orbit solver will use.
overwrite (bool, default = True) – Overwrite and replace the information of this class with the new values. If False, the returned solution is not also applied.
asteroid_location (tuple, default = None) – The pixel location of the asteroid in the image. Defaults to the value provided at instantiation.
raise_on_error (bool, default = False) – If True, this disables the error handing and allows for errors from the solving engines/solutions to be propagated out.
vehicle_args (dictionary, default = {}) – If the vehicle function for the provided solver engine needs extra parameters not otherwise provided by the standard input, they are given here.
- Returns:
orbital_solution (OrbitalSolution) – The orbit solution for the asteroid and image.
solve_status (bool) – The status of the solve. If True, the solving was successful.
Warning .. – This requires that the astrometric solution be computed before-hand. It will not be precomputed automatically; without it being called explicitly, this will instead raise an error.
- solve_photometry(solver_engine: PhotometryEngine, overwrite: bool = True, raise_on_error: bool = False, filter_name: str = None, exposure_time: float = None, vehicle_args: dict = {}) tuple[PhotometricSolution, bool] [source]
Solve the image photometry by using a photometric engine.
- Parameters:
solver_engine (PhotometryEngine) – The photometric engine which the photometry solver will use.
overwrite (bool, default = True) – Overwrite and replace the information of this class with the new values. If False, the returned solution is not also applied.
filter_name (string, default = None) – The filter name of the image, defaults to the value provided at instantiation.
exposure_time (float, default = None) – The exposure time of the image, in seconds. Defaults to the value provided at instantiation.
raise_on_error (bool, default = False) – If True, this disables the error handing and allows for errors from the solving engines/solutions to be propagated out.
vehicle_args (dictionary, default = {}) – If the vehicle function for the provided solver engine needs extra parameters not otherwise provided by the standard input, they are given here.
- Returns:
photometric_solution (PhotometrySolution) – The photometry solution for the image.
solve_status (bool) – The status of the solve. If True, the solving was successful.
Warning .. – This requires that the astrometric solution be computed before-hand. It will not be precomputed automatically; without it being called explicitly, this will instead raise an error.
- solve_propagate(solver_engine: PropagationEngine, overwrite: bool = True, raise_on_error: bool = False, asteroid_location: tuple[float, float] = None, vehicle_args: dict = {}) tuple[PropagativeSolution, bool] [source]
Solve for the location of an asteroid using a method of propagation.
- Parameters:
solver_engine (PropagationEngine) – The propagative engine which the propagation solver will use.
overwrite (bool, default = True) – Overwrite and replace the information of this class with the new values. If False, the returned solution is not also applied.
asteroid_location (tuple, default = None) – The pixel location of the asteroid in the image. Defaults to the value provided at instantiation.
raise_on_error (bool, default = False) – If True, this disables the error handing and allows for errors from the solving engines/solutions to be propagated out.
vehicle_args (dictionary, default = {}) – If the vehicle function for the provided solver engine needs extra parameters not otherwise provided by the standard input, they are given here.
- Returns:
propagative_solution (PropagativeSolution) – The propagation solution for the asteroid and image.
solve_status (bool) – The status of the solve. If True, the solving was successful.
Warning .. – This requires that the astrometric solution be computed before-hand. It will not be precomputed automatically; without it being called explicitly, this will instead raise an error.