diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d0e1f55c..cde7219fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Stopped calculating per-cube histogram unnecessarily when switching to a new Stokes value ([#1013](https://github.com/CARTAvis/carta-backend/issues/1013)). * Ensured that HTTP server returns error codes correctly ([#1011](https://github.com/CARTAvis/carta-backend/issues/1011)). * Fixed crash problems for compressed FITS files ([#999](https://github.com/CARTAvis/carta-backend/issues/999) and [#1014](https://github.com/CARTAvis/carta-backend/issues/1014)). +* Fixed incorrect spectral profiles for computed stokes ([#1122](https://github.com/CARTAvis/carta-backend/issues/1122)). ## [3.0.0-beta.3] diff --git a/src/Frame/Frame.cc b/src/Frame/Frame.cc index 4fc783b04..15e814d76 100644 --- a/src/Frame/Frame.cc +++ b/src/Frame/Frame.cc @@ -2211,8 +2211,9 @@ casacore::Slicer Frame::GetExportRegionSlicer(const CARTA::SaveFile& save_file_m bool Frame::GetStokesTypeIndex(const string& coordinate, int& stokes_index) { // Coordinate could be profile (x, y, z), stokes string (I, Q, U), or combination (Ix, Qy) bool is_stokes_string = StokesStringTypes.find(coordinate) != StokesStringTypes.end(); + bool is_combination = (coordinate.size() > 1 && (coordinate.back() == 'x' || coordinate.back() == 'y' || coordinate.back() == 'z')); - if (coordinate.size() == 2 || coordinate.size() == 3 || is_stokes_string) { + if (is_combination || is_stokes_string) { bool stokes_ok(false); std::string stokes_string;