Skip to content

Commit af90cdd

Browse files
authored
Merge pull request #568 from astrorama/develop
Release 0.21
2 parents 66ab295 + cde65f9 commit af90cdd

File tree

71 files changed

+1403
-280
lines changed

Some content is hidden

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

71 files changed

+1403
-280
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
# Run tests #
8383
#############
8484
litmus-test:
85+
if: ${{ always() }}
8586
needs: [ build, get_fedora_releases ]
8687
runs-on: ubuntu-latest
8788
strategy:

.jenkinsFile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!groovy
2+
@Library('integration-library@release-9') _
3+
pipelineElements(artifactId:"SourceXtractorPlusPlus", groupId:"EL", component:'eden.3.0')

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.19.2 USE Alexandria 2.28.2 DESCRIPTION "SourceXtractor++, the next generation SExtractor")
9+
elements_project(SourceXtractorPlusPlus 0.21 USE Alexandria 2.31.0 DESCRIPTION "SourceXtractor++, the next generation SExtractor")

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Documentation: https://astrorama.github.io/SourceXtractorPlusPlus/
1717
SourceXtractor++ is available on [Anaconda Cloud for Linux and MacOSX](https://anaconda.org/astrorama/sourcextractor)
1818

1919
```bash
20-
conda install -c conda-forge -c astrorama sourcextractor==0.19
20+
conda install -c conda-forge -c astrorama sourcextractor==0.19.2
2121
```
2222

2323
We would recommend, however, to install it into its own environment.
2424

2525
```bash
26-
conda create -n sourcex -c astrorama -c conda-forge sourcextractor==0.19
26+
conda create -n sourcex -c astrorama -c conda-forge sourcextractor==0.19.2
2727
conda activate sourcex
2828
```
2929

@@ -97,7 +97,7 @@ join the group (if a google account is at hand) or to ask us to add you as a mem
9797
While we are working on several refereed papers describing SourceXtractor++ and its software architecture, the software package can be referenced with two ADASS conference proceedings:
9898

9999
- [Bertin, E.; Schefer, M. ; Apostolakos, N. ; Álvarez-Ayllón, A.; Dubath, P. ; Kümmel, M.: 2020ASPC..527..461B](https://ui.adsabs.harvard.edu/abs/2020ASPC..527..461B/abstract)
100-
- [Kümmel, M. ; Bertin, E.; Schefer, M. ; Apostolakos, N. ; Álvarez-Ayllón, A.; Dubath, P.: 2020ASPC..527...29K](https://ui.adsabs.harvard.edu/abs/2020ASPC..527...29K/abstract)
100+
- [Kümmel, M.; Álvarez-Ayllón, A.; Bertin, E.; Dubath, P.; Gavazzi, R.; Hartley, W.; Schefer, M.: 2022arXiv221202428K](https://ui.adsabs.harvard.edu/abs/2022arXiv221202428K/abstract)
101101

102102
Resources for the SourceXtractor++ development are in most part provided by funding from the [Euclid satellite project](https://www.euclid-ec.org/) via the various national agencies.
103103
For Euclid Consortium papers it is sufficient to point to the [SourceXtractor++ webpage](https://github.com/astrorama/SourceXtractorPlusPlus) and add

SEFramework/SEFramework/Pipeline/Segmentation.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ class Segmentation::LabellingListener {
8787
m_detection_frame(detection_frame) {}
8888

8989
void publishSource(std::unique_ptr<SourceInterface> source) const {
90-
source->setProperty<DetectionFrame>(m_detection_frame);
90+
if (m_detection_frame) {
91+
source->setProperty<DetectionFrame>(m_detection_frame);
92+
}
9193
m_segmentation.sendSource(std::move(source));
9294
}
9395

SEFramework/SEFramework/Psf/VariablePsfStack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ class VariablePsfStack final : public Psf {
103103
std::vector<SeFloat> m_dec_values;
104104
std::vector<SeFloat> m_x_values;
105105
std::vector<SeFloat> m_y_values;
106-
std::vector<int> m_gridx_values;
107-
std::vector<int> m_gridy_values;
106+
std::vector<double> m_gridx_values;
107+
std::vector<double> m_gridy_values;
108108

109109
std::vector<std::string> m_components = {"X_IMAGE", "Y_IMAGE"};
110110

SEFramework/src/lib/CoordinateSystem/WCS.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,12 @@ ImageCoordinate WCS::worldToImage(WorldCoordinate world_coordinate) const {
253253

254254
int status = 0;
255255
int ret_val = wcss2p(&wcs_copy, 1, 1, wc_array, &phi, &theta, ic_array, pc_array, &status);
256-
wcsRaiseOnTransformError(&wcs_copy, ret_val);
256+
if (ret_val != WCSERR_SUCCESS) {
257+
logger.warn() << "Bad worldToImage from RA/Dec: " << wc_array[0] << "/" << wc_array[1];
258+
pc_array[0] = -std::numeric_limits<double>::infinity();
259+
pc_array[1] = -std::numeric_limits<double>::infinity();
260+
}
257261
wcsfree(&wcs_copy);
258-
259262
return ImageCoordinate(pc_array[0] - 1, pc_array[1] - 1); // -1 as fits standard coordinates start at 1
260263
}
261264

SEFramework/src/lib/FITS/FitsFile.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@
3636
#include <boost/regex.hpp>
3737

3838
#include "ElementsKernel/Exception.h"
39+
#include "ElementsKernel/Logging.h"
40+
3941
#include "SEFramework/FITS/FitsFile.h"
4042

4143
namespace SourceXtractor {
4244

45+
static Elements::Logging logger = Elements::Logging::getLogger("FitsFile");
46+
4347
/**
4448
* Cast a string to a C++ type depending on the format of the content.
4549
* - if only digits are present, it will be casted to int64_t
@@ -69,7 +73,8 @@ static typename MetadataEntry::value_t valueAutoCast(const std::string& value) {
6973
// We used to use boost::io::quoted here, but it seems that starting with 1.73 it
7074
// does not work well when the escape code and the delimiter are the same
7175
std::string unquoted;
72-
bool escape = false;
76+
bool escape = false;
77+
7378
unquoted.reserve(value.size());
7479
for (auto i = value.begin(); i != value.end(); ++i) {
7580
if (*i == '\'' && !escape) {
@@ -264,7 +269,7 @@ void FitsFile::loadHeadFile() {
264269
return;
265270
}
266271

267-
auto hdu_iter = m_image_hdus.begin();
272+
auto hdu_iter = m_image_hdus.begin();
268273
std::ifstream file;
269274

270275
// open the file and check
@@ -273,6 +278,11 @@ void FitsFile::loadHeadFile() {
273278
throw Elements::Exception() << "Cannot load ascii header file: " << head_filename;
274279
}
275280

281+
logger.info() << "Loading .head file: " << head_filename << " for fits: " << m_path;
282+
283+
int headers_nb = 0;
284+
int hdu_nb = 0;
285+
bool is_new_hdu = true;
276286
while (file.good() && hdu_iter != m_image_hdus.end()) {
277287
int current_hdu = *hdu_iter;
278288

@@ -287,6 +297,7 @@ void FitsFile::loadHeadFile() {
287297

288298
if (boost::to_upper_copy(line) == "END") {
289299
current_hdu = *(++hdu_iter);
300+
is_new_hdu = true;
290301
} else {
291302
static boost::regex regex("([^=]{1,8})=([^\\/]*)(\\/ (.*))?");
292303
boost::smatch sub_matches;
@@ -298,10 +309,17 @@ void FitsFile::loadHeadFile() {
298309
boost::trim(value);
299310
boost::trim(comment);
300311
m_headers.at(current_hdu - 1)[keyword] = MetadataEntry{valueAutoCast(value), {{"comment", comment}}};
301-
;
312+
headers_nb++;
313+
if (is_new_hdu) {
314+
hdu_nb++;
315+
is_new_hdu = false;
316+
}
302317
}
303318
}
304319
}
320+
if (headers_nb > 0) {
321+
logger.info() << "Headers overriden: " << headers_nb << " in " << hdu_nb << " hdu(s)";
322+
}
305323
}
306324

307325
std::vector<int> FitsFile::getDimensions(int hdu) const {

SEFramework/src/lib/FITS/FitsImageSource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ const std::map<std::string, MetadataEntry>& FitsImageSource::getMetadata() const
330330
}
331331

332332
void FitsImageSource::setMetadata(const std::string& key, const MetadataEntry& value) {
333-
auto acc = m_handler->getAccessor<FitsFile>();
333+
auto acc = m_handler->getAccessor<FitsFile>(FileHandler::kWrite);
334334
auto fptr = acc->m_fd.getFitsFilePtr();
335335
switchHdu(fptr, m_hdu_number);
336336

SEFramework/src/lib/Pipeline/Segmentation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Segmentation::Segmentation(std::shared_ptr<DetectionImageFrame::ImageFilter> ima
2929
}
3030

3131
void Segmentation::processFrame(std::shared_ptr<DetectionImageFrame> frame) const {
32-
if (m_filter_image_processing != nullptr) {
32+
if (m_filter_image_processing != nullptr && frame != nullptr) {
3333
frame->setFilter(m_filter_image_processing);
3434
}
3535

0 commit comments

Comments
 (0)