Skip to content

Commit 2b27136

Browse files
authored
Release 1.0 (#603)
* Update CMakeLists.txt Bump develop version number * Update README.md Update version in conda instructions * fix use of deprecated function * also update functions in frame config * fix for a bug in quadtree causing moffat grouping crash * Update main.yml to use v4 action * Update Alexandria 2.31.4 (#599) * Update Alexandria 2.31.4 To fix building on Fedora 41 * Add dnf to dependencies.txt * Restrict model fitting window to a disk (#596) * test: restrict fitting area to a disk * revert change in residual block * you can't fix stupid * fitting window with checkimage WIP * Fix python configuration problem * Implement all window types * fix code factor problem * wip: add extra parameter to store x and y source size * add configuration for width and height of sources in no detect mode * minor style fixes * Added rotated ellipse * added ellipse_scale config option, fixed windows on the borders * Allow disabling PSF renormalization in model fitting (#597) * psf renormalization on/off option WIP * DownSampledImagePsf renormalization * propagate renormalization configuration from MeasurementImage * remove unsued include, fix warnings in MoffatModelFitting * propagate config for and fix DownsampledPsf * Allows a reference image to be provided to provide the reference coordinate system (#598) * Fix PixelCentroid error with no detect mode (#602) * update version to 1.0
1 parent 4694bea commit 2b27136

File tree

47 files changed

+697
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+697
-183
lines changed

.github/workflows/dependencies.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ $PYTHON-numpy
33
$PYTHON-pytest
44
$PYTHON-sphinx
55
$PYTHON-setuptools
6+
$PYTHON-dnf
67
CCfits-devel
78
blas-devel
89
$BOOST-$PYTHON-devel

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
id: build
6363
uses: astrorama/actions/[email protected]
6464
- name: Upload RPM to GitHub
65-
uses: actions/upload-artifact@v2
65+
uses: actions/upload-artifact@v4
6666
with:
6767
name: ${{ matrix.os-type }}${{ matrix.os-version }}
6868
path: ${{ steps.build.outputs.rpm-dir }}/*.rpm
@@ -93,21 +93,21 @@ jobs:
9393
container: ${{ matrix.os-type }}:${{ matrix.os-version }}
9494
steps:
9595
- name: Checkout
96-
uses: actions/checkout@v2
96+
uses: actions/checkout@v4
9797
- name: Install dependencies
9898
uses: astrorama/actions/setup-dependencies@v3
9999
with:
100100
dependency-list: .github/workflows/test-dependencies.txt
101101
- name: Download RPM
102-
uses: actions/download-artifact@v2
102+
uses: actions/download-artifact@v4
103103
with:
104104
name: ${{ matrix.os-type }}${{ matrix.os-version }}
105105
- name: Install SourceXtractor++
106106
run: yum install -y SourceXtractorPlusPlus*.x86_64.rpm
107107
- name: Run tests
108108
run: ./.github/workflows/run-litmus.sh
109109
- name: Upload reports and logs
110-
uses: actions/upload-artifact@v2
110+
uses: actions/upload-artifact@v4
111111
with:
112112
name: ${{ matrix.os-type }}${{ matrix.os-version }}-test-results
113113
path: /tmp/sourcex/

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ find_package(ElementsProject)
66
#---------------------------------------------------------------
77

88
# Declare project name and version
9-
elements_project(SourceXtractorPlusPlus 0.22 USE Alexandria 2.31.0 DESCRIPTION "SourceXtractor++, the next generation SExtractor")
9+
elements_project(SourceXtractorPlusPlus 1.0 USE Alexandria 2.31.4 DESCRIPTION "SourceXtractor++, the next generation SExtractor")

SEImplementation/SEImplementation/CheckImages/CheckImages.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class CheckImages : public Configurable {
117117

118118
std::shared_ptr<WriteableImage<MeasurementImage::PixelType>> getModelFittingImage(unsigned int frame_number);
119119

120+
std::shared_ptr<WriteableImage<int>> getFittingWindowImage(unsigned int frame_number);
121+
120122
std::shared_ptr<WriteableImage<MeasurementImage::PixelType>> getPsfImage(unsigned int frame_number);
121123

122124
std::shared_ptr<WriteableImage<float>> getMLDetectionImage(unsigned int plane_number, size_t index);
@@ -186,6 +188,7 @@ class CheckImages : public Configurable {
186188
std::map<unsigned int, std::shared_ptr<WriteableImage<int>>> m_measurement_aperture_images;
187189
std::map<unsigned int, std::shared_ptr<WriteableImage<int>>> m_measurement_auto_aperture_images;
188190
std::map<unsigned int, std::shared_ptr<WriteableImage<MeasurementImage::PixelType>>> m_check_image_model_fitting, m_check_image_psf;
191+
std::map<unsigned int, std::shared_ptr<WriteableImage<int>>> m_check_image_fitting_window;
189192
std::vector<std::map<unsigned int, std::shared_ptr<WriteableImage<float>>>> m_check_image_ml_detection;
190193

191194
std::vector<std::shared_ptr<DetectionImage>> m_detection_images;
@@ -202,6 +205,7 @@ class CheckImages : public Configurable {
202205
std::vector<std::shared_ptr<CoordinateSystem>> m_coordinate_systems;
203206

204207
boost::filesystem::path m_model_fitting_image_filename;
208+
boost::filesystem::path m_fitting_window_image_filename;
205209
boost::filesystem::path m_residual_filename;
206210
boost::filesystem::path m_background_filename;
207211
boost::filesystem::path m_variance_filename;

SEImplementation/SEImplementation/Configuration/CheckImagesConfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ class CheckImagesConfig : public Euclid::Configuration::Configuration {
4545
return m_model_fitting_filename;
4646
}
4747

48+
const std::string& getFittingWindowImageFilename() const {
49+
return m_fitting_window_filename;
50+
}
51+
4852
const std::string& getModelFittingResidualFilename() const {
4953
return m_model_fitting_residual_filename;
5054
}
@@ -112,6 +116,7 @@ class CheckImagesConfig : public Euclid::Configuration::Configuration {
112116
private:
113117

114118
std::string m_model_fitting_filename;
119+
std::string m_fitting_window_filename;
115120
std::string m_model_fitting_residual_filename;
116121
std::string m_background_filename;
117122
std::string m_variance_filename;

SEImplementation/SEImplementation/Configuration/DetectionImageConfig.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class DetectionImageConfig : public Euclid::Configuration::Configuration {
5454

5555
std::shared_ptr<DetectionImage> getDetectionImage(size_t index = 0) const;
5656
std::shared_ptr<CoordinateSystem> getCoordinateSystem(size_t index = 0) const;
57+
bool isReferenceImage() const { return m_is_reference_image; }
5758

5859
double getGain(size_t index = 0) const { return m_extensions.at(index).m_gain; }
5960
double getSaturation(size_t index = 0) const { return m_extensions.at(index).m_saturation; }
@@ -69,7 +70,11 @@ class DetectionImageConfig : public Euclid::Configuration::Configuration {
6970
}
7071

7172
size_t getExtensionsNb() const {
72-
return m_extensions.size();
73+
if (m_is_reference_image) {
74+
return 0;
75+
} else {
76+
return m_extensions.size();
77+
}
7378
}
7479

7580
private:
@@ -89,6 +94,7 @@ class DetectionImageConfig : public Euclid::Configuration::Configuration {
8994

9095
std::vector<DetectionImageExtension> m_extensions;
9196

97+
bool m_is_reference_image {false};
9298
}; /* End of DetectionImageConfig class */
9399

94100
} /* namespace SourceXtractor */

SEImplementation/SEImplementation/Configuration/MeasurementImageConfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class MeasurementImageConfig : public Euclid::Configuration::Configuration {
6565
bool m_is_data_cube;
6666
int m_image_layer;
6767
int m_weight_layer;
68+
69+
bool m_psf_renormalize;
6870
};
6971

7072
explicit MeasurementImageConfig(long manager_id);

SEImplementation/SEImplementation/Configuration/ModelFittingConfig.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@
2323
#define _SEIMPLEMENTATION_CONFIGURATION_MODELFITTINGCONFIG_H
2424

2525
#include <vector>
26+
2627
#include <SEImplementation/Plugin/FlexibleModelFitting/FlexibleModelFittingParameter.h>
2728
#include <SEImplementation/Plugin/FlexibleModelFitting/FlexibleModelFittingModel.h>
2829
#include <SEImplementation/Plugin/FlexibleModelFitting/FlexibleModelFittingFrame.h>
2930
#include <SEImplementation/Plugin/FlexibleModelFitting/FlexibleModelFittingPrior.h>
31+
32+
#include <SEImplementation/Plugin/FlexibleModelFitting/FlexibleModelFittingIterativeTask.h>
33+
3034
#include <Configuration/Configuration.h>
3135

3236
namespace SourceXtractor {
@@ -60,6 +64,8 @@ class ModelFittingConfig : public Euclid::Configuration::Configuration {
6064
int getMetaIterations() const { return m_meta_iterations; }
6165
double getDeblendFactor() const { return m_deblend_factor; }
6266
double getMetaIterationStop() const { return m_meta_iteration_stop; }
67+
FlexibleModelFittingIterativeTask::WindowType getWindowType() const { return m_window_type; }
68+
double getEllipseScale() const { return m_ellipse_scale; }
6369

6470
private:
6571
std::string m_least_squares_engine;
@@ -69,6 +75,9 @@ class ModelFittingConfig : public Euclid::Configuration::Configuration {
6975
int m_meta_iterations { 3 };
7076
double m_deblend_factor { 1.0 };
7177
double m_meta_iteration_stop { 0.0001 };
78+
FlexibleModelFittingIterativeTask::WindowType m_window_type
79+
{ FlexibleModelFittingIterativeTask::WindowType::RECTANGLE };
80+
double m_ellipse_scale { 3.0 };
7281

7382
std::map<int, std::shared_ptr<FlexibleModelFittingParameter>> m_parameters;
7483
std::map<int, std::shared_ptr<FlexibleModelFittingModel>> m_models;

SEImplementation/SEImplementation/Image/DownSampledImagePsf.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ namespace SourceXtractor {
4141
class DownSampledImagePsf {
4242
public:
4343

44-
DownSampledImagePsf(double pixel_scale, std::shared_ptr<VectorImage<SeFloat>> image, double down_scaling=1.0);
44+
DownSampledImagePsf(double pixel_scale, std::shared_ptr<VectorImage<SeFloat>> image,
45+
double down_scaling=1.0, bool normalize_psf = true);
4546

4647
virtual ~DownSampledImagePsf() = default;
4748

4849
double getPixelScale() const;
50+
4951
std::size_t getSize() const;
5052
std::shared_ptr<VectorImage<SourceXtractor::SeFloat>> getScaledKernel(SeFloat scale) const;
5153
void convolve(std::shared_ptr<WriteableImage<float>> image) const;
@@ -57,6 +59,7 @@ class DownSampledImagePsf {
5759
private:
5860
double m_down_scaling;
5961
std::shared_ptr<ImagePsf> m_psf;
62+
bool m_normalize_psf { true };
6063
};
6164

6265
} // end of SourceXtractor

SEImplementation/SEImplementation/Plugin/AssocMode/AssocMode.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ class AssocMode : public Property {
4040
*/
4141
virtual ~AssocMode() = default;
4242

43-
AssocMode() : m_has_assoc(false), m_assoc_data(std::vector<size_t>({0})), m_ref_frame_pixel_radius(1), m_group_id(0) {
43+
AssocMode() : m_has_assoc(false), m_assoc_data(std::vector<size_t>({0})),
44+
m_ref_frame_pixel_width(1), m_ref_frame_pixel_height(1), m_group_id(0) {
4445
}
4546

4647
AssocMode(bool has_assoc, const std::vector<double>& assoc_data,
47-
double ref_frame_pixel_radius=0.0, unsigned int group_id=0) :
48+
double ref_frame_pixel_width=0.0, double ref_frame_pixel_height=0.0, unsigned int group_id=0) :
4849
m_has_assoc(has_assoc), m_assoc_data(std::vector<size_t>({assoc_data.size()})),
49-
m_ref_frame_pixel_radius(ref_frame_pixel_radius), m_group_id(group_id) {
50+
m_ref_frame_pixel_width(ref_frame_pixel_width), m_ref_frame_pixel_height(ref_frame_pixel_height),
51+
m_group_id(group_id) {
5052
for (size_t i=0; i<assoc_data.size(); i++) {
5153
m_assoc_data.at(i) = assoc_data[i];
5254
}
@@ -60,8 +62,12 @@ class AssocMode : public Property {
6062
return m_assoc_data;
6163
}
6264

63-
double getRefFramePixelRadius() const {
64-
return m_ref_frame_pixel_radius;
65+
double getRefFramePixelWidth() const {
66+
return m_ref_frame_pixel_width;
67+
}
68+
69+
double getRefFramePixelHeight() const {
70+
return m_ref_frame_pixel_height;
6571
}
6672

6773
unsigned int getGroupId() const {
@@ -72,7 +78,9 @@ class AssocMode : public Property {
7278
bool m_has_assoc;
7379

7480
NdArray<SeFloat> m_assoc_data;
75-
double m_ref_frame_pixel_radius;
81+
//double m_ref_frame_pixel_radius;
82+
double m_ref_frame_pixel_width;
83+
double m_ref_frame_pixel_height;
7684
unsigned int m_group_id;
7785
};
7886

0 commit comments

Comments
 (0)