Commit 1f1191b0 authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Fix issues with compressed FITS files.

parent c7bf6799
No related merge requests found
Showing with 27 additions and 13 deletions
+27 -13
......@@ -67,9 +67,9 @@ author = u'E. Bertin'
# built documents.
#
# The short X.Y version.
version = '2.27.0'
version = '2.27.1'
# The full version, including alpha/beta/rc tags.
release = '2.27.0'
release = '2.27.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......@@ -81,7 +81,7 @@ language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#
today = 'Sat Feb 25 2023'
today = 'Tue Mar 07 2023'
#
# Else, today_fmt is used as the format for a strftime call.
#
......@@ -144,7 +144,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'SExtractor v2.27.0'
# html_title = u'SExtractor v2.27.1'
# A shorter title for the navigation bar. Default is the same as html_title.
#
......
......@@ -70,23 +70,41 @@ picstruct *newfield(char *filename, int flags, int ext)
field->cat = cat;
nok = 0;
tab = cat->tab;
#ifdef HAVE_CFITSIO
if ((tab->isTileCompressed) ||
(tab->naxis >= 2
&& strncmp(tab->xtension, "BINTABLE", 8)
&& strncmp(tab->xtension, "ASCTABLE", 8)))
#else
if (tab->isTileCompressed)
warning(BANNER " has been compiled without CFITSIO support: "
"compressed image skipped in ", filename);
if (tab->naxis >= 2
&& strncmp(tab->xtension, "BINTABLE", 8)
&& strncmp(tab->xtension, "ASCTABLE", 8))
#endif
nok++;
ext2 = ext;
for (ntab=cat->ntab; ext2-- && ntab--;)
{
tab=tab->nexttab;
#ifdef HAVE_CFITSIO
if ((tab->isTileCompressed) ||
(tab->naxis >= 2
(tab->naxis >= 2
&& strncmp(tab->xtension, "BINTABLE", 8)
&& strncmp(tab->xtension, "ASCTABLE", 8)))
#else
if (tab->isTileCompressed)
warning(BANNER " has been compiled without CFITSIO support: "
"compressed image skipped in ", filename);
if (tab->naxis >= 2
&& strncmp(tab->xtension, "BINTABLE", 8)
&& strncmp(tab->xtension, "ASCTABLE", 8))
#endif
nok++;
}
if (!nok)
error(EXIT_FAILURE, "Not a valid FITS image in ",filename);
error(EXIT_FAILURE, "Not a valid FITS image in ", filename);
field->tab = tab;
if (ntab<0)
......
......@@ -22,7 +22,7 @@
* You should have received a copy of the GNU General Public License
* along with SExtractor. If not, see <http://www.gnu.org/licenses/>.
*
* Last modified: 25/02/2023
* Last modified: 07/03/2023
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
......@@ -707,8 +707,8 @@ INPUT Filename character string.
OUTPUT Extension number, or RETURN_ERROR if nos extension specified.
NOTES The bracket and its extension number are removed from the filename if
found.
AUTHOR E. Bertin (IAP)
VERSION 23/09/2020
AUTHOR E. Bertin (CFHT/IAP)
VERSION 07/03/2023
***/
static int selectext(char *filename)
{
......@@ -722,10 +722,6 @@ static int selectext(char *filename)
*bracr = '\0';
next = strtol(bracl+1, NULL, 0);
// VERY BAD HACK to check if this is tile-compressed, if so, add +1 to extension number requested
if (strstr(filename, ".fits.fz") != NULL)
next++;
return next;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment