SourceXtractorPlusPlus  0.10
Please provide a description of the project.
JacobianTask.cpp
Go to the documentation of this file.
1 
17 /*
18  * JacobianTask.cpp
19  *
20  * Created on: Oct 08, 2018
21  * Author: Alejandro Alvarez Ayllon
22  */
23 
31 
32 namespace SourceXtractor {
33 
35  auto frame = group.begin()->getProperty<MeasurementFrame>(m_instance).getFrame();
36  auto frame_coordinates = frame->getCoordinateSystem();
37  auto& detection_group_stamp = group.getProperty<DetectionFrameGroupStamp>();
38  auto detection_frame_coordinates = group.begin()->getProperty<DetectionFrame>().getFrame()->getCoordinateSystem();
39 
40  double x = detection_group_stamp.getTopLeft().m_x + detection_group_stamp.getStamp().getWidth() / 2.0;
41  double y = detection_group_stamp.getTopLeft().m_y + detection_group_stamp.getStamp().getHeight() / 2.0;
42 
43  auto frame_origin = frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(ImageCoordinate(x, y)));
44  auto frame_dx = frame_coordinates->worldToImage(
45  detection_frame_coordinates->imageToWorld(ImageCoordinate(x + 1.0, y)));
46  auto frame_dy = frame_coordinates->worldToImage(
47  detection_frame_coordinates->imageToWorld(ImageCoordinate(x, y + 1.0)));
48 
50  frame_dx.m_x - frame_origin.m_x, frame_dx.m_y - frame_origin.m_y,
51  frame_dy.m_x - frame_origin.m_x, frame_dy.m_y - frame_origin.m_y);
52 }
53 
55  auto frame = source.getProperty<MeasurementFrame>(m_instance).getFrame();
56  auto frame_coordinates = frame->getCoordinateSystem();
57  auto& detection_boundaries = source.getProperty<PixelBoundaries>();
58  auto detection_frame_coordinates = source.getProperty<DetectionFrame>().getFrame()->getCoordinateSystem();
59 
60  double x = detection_boundaries.getMin().m_x + detection_boundaries.getWidth() / 2.0;
61  double y = detection_boundaries.getMin().m_y + detection_boundaries.getHeight() / 2.0;
62 
63  auto frame_origin = frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(ImageCoordinate(x, y)));
64  auto frame_dx = frame_coordinates->worldToImage(
65  detection_frame_coordinates->imageToWorld(ImageCoordinate(x + 1.0, y)));
66  auto frame_dy = frame_coordinates->worldToImage(
67  detection_frame_coordinates->imageToWorld(ImageCoordinate(x, y + 1.0)));
68 
70  frame_dx.m_x - frame_origin.m_x, frame_dx.m_y - frame_origin.m_y,
71  frame_dy.m_x - frame_origin.m_x, frame_dy.m_y - frame_origin.m_y);
72 }
73 
74 } // end SourceXtractor
SourceXtractor::PixelBoundaries
The bounding box of all the pixels in the source. Both min and max coordinate are inclusive.
Definition: PixelBoundaries.h:37
MeasurementFrame.h
Jacobian.h
SourceXtractor::JacobianSourceTask::m_instance
unsigned m_instance
Definition: JacobianTask.h:54
PixelBoundaries.h
SourceXtractor::JacobianGroupTask::m_instance
unsigned m_instance
Definition: JacobianTask.h:42
SourceXtractor::JacobianGroup
Definition: Jacobian.h:56
DetectionFrame.h
SourceXtractor::JacobianSourceTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition: JacobianTask.cpp:54
SourceXtractor::SourceGroupInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition: SourceInterface.h:57
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::SourceInterface::setIndexedProperty
void setIndexedProperty(std::size_t index, Args... args)
Convenience template method to call setProperty() with a more user-friendly syntax.
Definition: SourceInterface.h:64
SourceXtractor::DetectionFrame
Definition: DetectionFrame.h:33
SourceXtractor::DetectionFrameGroupStamp
Definition: DetectionFrameGroupStamp.h:33
SourceXtractor::MeasurementFrame
Definition: MeasurementFrame.h:36
SourceXtractor::SourceGroupInterface::begin
virtual iterator begin()=0
SourceXtractor::ImageCoordinate
Definition: CoordinateSystem.h:42
SourceXtractor::JacobianSource
Definition: Jacobian.h:51
DetectionFrameSourceStamp.h
SourceXtractor::SourceGroupInterface
Defines the interface used to group sources.
Definition: SourceGroupInterface.h:37
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition: MoffatModelFittingTask.cpp:93
JacobianTask.h
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition: SourceInterface.h:57
SourceXtractor::SourceGroupInterface::setIndexedProperty
void setIndexedProperty(std::size_t index, Args... args)
Convenience template method to call setProperty() with a more user-friendly syntax.
Definition: SourceInterface.h:64
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition: SourceInterface.h:46
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition: MoffatModelFittingTask.cpp:93
SourceXtractor::JacobianGroupTask::computeProperties
void computeProperties(SourceGroupInterface &source) const override
Computes one or more properties for the SourceGroup and/or the Sources it contains.
Definition: JacobianTask.cpp:34
DetectionFrameGroupStamp.h