Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
msc
sextractor
Commits
ece261cd
Commit
ece261cd
authored
Jan 28, 2009
by
Emmanuel Bertin
Browse files
merged with SExFIGI branch
parent
5ae55cd0
Changes
140
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
ece261cd
# configure.in for SExtractor
# (C) E.Bertin 2002-200
6
# (C) E.Bertin 2002-200
8
# Process this file with autoconf to produce a configure script.
# First, disable the annoying config.cache
define([AC_CACHE_LOAD],)
define([AC_CACHE_SAVE],)
# This is your standard Bertin source code...
AC_INIT(sextractor, 2.
5.0
, [bertin@iap.fr])
AC_INIT(sextractor, 2.
8.2
, [bertin@iap.fr])
AC_CONFIG_SRCDIR(src/makeit.c)
AC_CONFIG_AUX_DIR(autoconf)
AM_CONFIG_HEADER(config.h)
...
...
@@ -20,7 +20,11 @@ AC_SUBST(DATE2, "$date2")
AC_SUBST(DATE3, "$date3")
# Include macros
sinclude(acx_atlas.m4)
sinclude(acx_fftw.m4)
sinclude(acx_prog_cc_optim.m4)
sinclude(acx_pthread.m4)
sinclude(acx_urbi_resolve_dir.m4)
# Display pakage and version number
AC_MSG_RESULT([*********** Configuring: $PACKAGE $VERSION ($date) **********])
...
...
@@ -46,37 +50,17 @@ AC_ARG_ENABLE(icc,
use_icc="no"
AC_MSG_RESULT([no]))
# Provide special option for gprof profiling
AC_MSG_CHECKING([for gprof profiler mode])
AC_ARG_ENABLE(gprof,
[AC_HELP_STRING([--enable-gprof],
[Enable special mode for compilation with the gprof profiler \
(off by default)])],
use_gprof="yes"
AC_MSG_RESULT([yes]),
use_gprof="no"
AC_MSG_RESULT([no]))
# Enable static linking
AC_MSG_CHECKING([static linking])
AC_ARG_ENABLE(static,
[AC_HELP_STRING([--enable-static],
[Enable static linking \
(off by default)])],
use_static="yes"
AC_MSG_RESULT([yes]),
use_static="no"
AC_MSG_RESULT([no]))
# Checks for programs.
# GCC is chosen last because it is likely to yield less optimized code
AC_LANG(C)
AC_PROG_CC([$cclist])
# C Compiler: Check that it is ANSI C
# C Compiler: Check that it is ANSI C
and POSIX-compliant
AM_PROG_CC_STDC
# C Compiler: Check that it is POSIX-compliant
AC_ISC_POSIX
ACX_PROG_CC_OPTIM
AC_PROG_RANLIB
AC_DISABLE_STATIC
#AC_DISABLE_SHARED
AC_PROG_LIBTOOL
AC_PROG_INSTALL
# Checks for libraries.
...
...
@@ -84,7 +68,8 @@ AC_CHECK_LIB(m, sin)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/mman.h sys/types.h unistd.h])
AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/mman.h \
sys/types.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
...
...
@@ -95,24 +80,127 @@ AC_TYPE_UID_T
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
#
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([atexit getenv memcpy memmove memset mkdir munmap strstr])
AC_CHECK_FUNCS([atexit getenv memcpy memmove memset mkdir munmap strstr \
sincos logf])
# Check support for large files
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
########################### No multithreading yet! ###########################
#AC_DEFINE(USE_THREADS, 1, [Triggers multhreading])
AC_DEFINE_UNQUOTED(THREADS_NMAX, 1,[Maximum number of POSIX threads])
# Set the data directory to a true absolute path
datadir2=$(URBI_RESOLVE_DIR([$datadir]))
# Provide special options for ATLAS
AC_ARG_WITH(atlas,
[AC_HELP_STRING([--with-atlas=<ATLAS library path>],
[Provide an alternative path to the ATLAS library])],
atlas_libdir=$withval,
atlas_libdir=""
)
AC_ARG_WITH(atlas-incdir,
[AC_HELP_STRING([--with-atlas-incdir=<ATLAS include dir>],
[Provide an alternative path to the ATLAS include directory])],
atlas_incdir=$withval,
atlas_incdir=""
)
# Provide special options for FFTW
AC_ARG_WITH(fftw,
[AC_HELP_STRING([--with-fftw=<FFTW library path>],
[Provide an alternative path to the FFTW library])],
fftw_libdir=$withval,
fftw_libdir=""
)
AC_ARG_WITH(fftw-incdir,
[AC_HELP_STRING([--with-fftw-incdir=<FFTW include dir>],
[Provide an alternative path to the FFTW include directory])],
fftw_incdir=$withval,
fftw_incdir=""
)
# Provide a special option for the default XSLT URL
AC_ARG_WITH(xsl_url,
[AC_HELP_STRING([--with-xsl_url=<default URL for XSLT filter>],
[Provide an alternative default URL of the XSLT filter])],
[xsl_url=$withval],
[xsl_url="file://$datadir2/$PACKAGE_NAME/$PACKAGE_NAME.xsl"]
)
AC_DEFINE_UNQUOTED([XSL_URL], "$xsl_url",[Default URL of the XSLT filter])
# Set flags for multithreading
n_pthreads=16
AC_ARG_ENABLE(threads,
[AC_HELP_STRING([--enable-threads@<:@=<max_number_of_threads>@:>@],
[Enable multhreading (on with up to $n_pthreads threads by default)])],
if test "$enableval" = "no"; then
use_pthreads="no"
else
use_pthreads="yes"
if test "$enableval" != "yes"; then
n_pthreads=$enableval
fi
fi,
use_pthreads=yes
)
# Provide special option for gprof profiling
AC_MSG_CHECKING([for gprof profiler mode])
AC_ARG_ENABLE(gprof,
[AC_HELP_STRING([--enable-gprof],
[Enable special mode for compilation with the gprof profiler \
(off by default)])],
use_gprof="yes"
AC_MSG_RESULT([yes]),
use_gprof="no"
AC_MSG_RESULT([no]))
# Enable static linking
AC_MSG_CHECKING([static linking])
AC_ARG_ENABLE(static,
[AC_HELP_STRING([--enable-static],
[Enable static linking \
(off by default)])],
use_static="yes"
AC_MSG_RESULT([yes]),
use_static="no"
AC_MSG_RESULT([no]))
# Special optimization options for the INTEL C compiler
if test $use_icc = "yes" -a $CC = "icc"; then
CFLAGS="$CFLAGS -O3 -axiMKW -ipo -ipo_obj -unroll"
################# Actions to complete in case of multhreading ################
AC_DEFINE_UNQUOTED(THREADS_NMAX, $n_pthreads,[Maximum number of POSIX threads])
if test "$use_pthreads" = "yes"; then
AC_MSG_CHECKING([for multithreading])
AC_MSG_RESULT([maximum of $n_pthreads thread(s)])
AC_DEFINE(USE_THREADS, 1, [Triggers multhreading])
# CC, CFLAGS and LIBS are system and compiler-dependent
ACX_PTHREAD
CC="$PTHREAD_CC"
[CFLAGS="$CFLAGS $PTHREAD_CFLAGS -D_REENTRANT"]
LIBS="$PTHREAD_LIBS $LIBS"
fi
AM_CONDITIONAL(USE_THREADS, test $use_pthreads = "yes")
################ handle the FFTW library (Fourier transforms) ################
ACX_FFTW($fftw_libdir,$fftw_incdir,$use_pthreads,no,
[use_fftw=yes],[use_fftw=no])
if test "$use_fftw" = "yes"; then
LIBS="$FFTW_LIBS $LIBS"
else
AC_MSG_ERROR([$FFTW_ERROR Exiting.])
fi
################## handle the ATLAS library(linear algebra) ##################
ACX_ATLAS($atlas_libdir,$atlas_incdir,$use_pthreads,
[use_atlas=yes],[use_atlas=no])
if test "$use_atlas" = "yes"; then
LIBS="$ATLAS_LIB $LIBS"
else
AC_MSG_ERROR([$ATLAS_ERROR Exiting.])
fi
# Link with gprof option
...
...
@@ -120,26 +208,39 @@ if test "$use_gprof" = "yes"; then
if test "$use_icc" = "yes"; then
CFLAGS="$CFLAGS -pq"
else
CFLAGS="
-O3
-pg"
CFLAGS="
$CFLAGS
-pg"
fi
use_static="no"
fi
# Static linking option
if test "$use_static" = "yes"; then
LDFLAGS="$LDFLAGS
-static
"
LDFLAGS="
-static -shared-libgcc
$LDFLAGS"
fi
# Override automatic CFLAGS and LDFLAGS with those of user
if test -n "$mycflags"; then
CFLAGS="$mycflags"
fi
if test -n "$myldflags"; then
LDFLAGS="$myldflags"
fi
#
if test -n "$mycflags"; then
#
CFLAGS="$mycflags"
#
fi
#
if test -n "$myldflags"; then
#
LDFLAGS="$myldflags"
#
fi
# Display compiler and linker flags
AC_MSG_RESULT([I will compile using: $CC $CFLAGS])
AC_MSG_RESULT([I will link using: $CC $LDFLAGS $LIBS])
AC_CONFIG_FILES([Makefile man/Makefile src/Makefile src/fits/Makefile src/wcs/Makefile sextractor.spec sextractor-tpx.spec man/sex.1])
AC_MSG_RESULT([***************************************************************])
AC_MSG_RESULT([Compile cmdline: $CC $CFLAGS])
AC_MSG_RESULT([Link cmdline: $CC $LDFLAGS $LIBS])
AC_MSG_RESULT([Default XSLT URL: $xsl_url])
AC_MSG_RESULT([***************************************************************])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/fits/Makefile
src/levmar/Makefile
src/wcs/Makefile
man/Makefile
tests/Makefile
sextractor.spec
man/sex.1])
AC_OUTPUT
doc/Guide2source_extractor.pdf
0 → 100644
View file @
ece261cd
File added
doc/SE_Handbook.4.pdf
deleted
100644 → 0
View file @
5ae55cd0
File deleted
man/Makefile.in
View file @
ece261cd
# Makefile.in generated by automake 1.
9.6
from Makefile.am.
# Makefile.in generated by automake 1.
10.1
from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005
, 2006, 2007, 2008
Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
...
...
@@ -13,15 +13,11 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir
=
@srcdir@
top_srcdir
=
@top_srcdir@
VPATH
=
@srcdir@
pkgdatadir
=
$(datadir)
/@PACKAGE@
pkglibdir
=
$(libdir)
/@PACKAGE@
pkgincludedir
=
$(includedir)
/@PACKAGE@
top_builddir
=
..
am__cd
=
CDPATH
=
"
$
${
ZSH_VERSION
+.
}
$(PATH_SEPARATOR)
"
&&
cd
INSTALL
=
@INSTALL@
install_sh_DATA
=
$(install_sh)
-c
-m
644
install_sh_PROGRAM
=
$(install_sh)
-c
install_sh_SCRIPT
=
$(install_sh)
-c
...
...
@@ -33,11 +29,16 @@ POST_INSTALL = :
NORMAL_UNINSTALL
=
:
PRE_UNINSTALL
=
:
POST_UNINSTALL
=
:
build_triplet
=
@build@
host_triplet
=
@host@
subdir
=
man
DIST_COMMON
=
$(dist_man_MANS)
$(srcdir)
/Makefile.am
\
$(srcdir)
/Makefile.in
$(srcdir)
/sex.1.in
ACLOCAL_M4
=
$(top_srcdir)
/aclocal.m4
am__aclocal_m4_deps
=
$(top_srcdir)
/acx_prog_cc_optim.m4
\
am__aclocal_m4_deps
=
$(top_srcdir)
/acx_atlas.m4
\
$(top_srcdir)
/acx_fftw.m4
$(top_srcdir)
/acx_prog_cc_optim.m4
\
$(top_srcdir)
/acx_pthread.m4
\
$(top_srcdir)
/acx_urbi_resolve_dir.m4
\
$(top_srcdir)
/configure.ac
am__configure_deps
=
$(am__aclocal_m4_deps)
$(CONFIGURE_DEPENDENCIES)
\
$(ACLOCAL_M4)
...
...
@@ -53,9 +54,12 @@ NROFF = nroff
MANS
=
$(dist_man_MANS)
DISTFILES
=
$(DIST_COMMON)
$(DIST_SOURCES)
$(TEXINFOS)
$(EXTRA_DIST)
ACLOCAL
=
@ACLOCAL@
AMDEP_FALSE
=
@AMDEP_FALSE@
AMDEP_TRUE
=
@AMDEP_TRUE@
AMTAR
=
@AMTAR@
AR
=
@AR@
ATLAS_CFLAGS
=
@ATLAS_CFLAGS@
ATLAS_ERROR
=
@ATLAS_ERROR@
ATLAS_LIB
=
@ATLAS_LIB@
ATLAS_LIBPATH
=
@ATLAS_LIBPATH@
AUTOCONF
=
@AUTOCONF@
AUTOHEADER
=
@AUTOHEADER@
AUTOMAKE
=
@AUTOMAKE@
...
...
@@ -65,16 +69,27 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS
=
@CFLAGS@
CPP
=
@CPP@
CPPFLAGS
=
@CPPFLAGS@
CXX
=
@CXX@
CXXCPP
=
@CXXCPP@
CXXDEPMODE
=
@CXXDEPMODE@
CXXFLAGS
=
@CXXFLAGS@
CYGPATH_W
=
@CYGPATH_W@
DATE2
=
@DATE2@
DATE3
=
@DATE3@
DEFS
=
@DEFS@
DEPDIR
=
@DEPDIR@
ECHO
=
@ECHO@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
EGREP
=
@EGREP@
EXEEXT
=
@EXEEXT@
F77
=
@F77@
FFLAGS
=
@FFLAGS@
FFTW_ERROR
=
@FFTW_ERROR@
FFTW_LIBS
=
@FFTW_LIBS@
GREP
=
@GREP@
INSTALL
=
@INSTALL@
INSTALL_DATA
=
@INSTALL_DATA@
INSTALL_PROGRAM
=
@INSTALL_PROGRAM@
INSTALL_SCRIPT
=
@INSTALL_SCRIPT@
...
...
@@ -82,8 +97,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS
=
@LDFLAGS@
LIBOBJS
=
@LIBOBJS@
LIBS
=
@LIBS@
LIBTOOL
=
@LIBTOOL@
LN_S
=
@LN_S@
LTLIBOBJS
=
@LTLIBOBJS@
MAKEINFO
=
@MAKEINFO@
MKDIR_P
=
@MKDIR_P@
OBJEXT
=
@OBJEXT@
PACKAGE
=
@PACKAGE@
PACKAGER
=
@PACKAGER@
...
...
@@ -93,41 +111,66 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME
=
@PACKAGE_TARNAME@
PACKAGE_VERSION
=
@PACKAGE_VERSION@
PATH_SEPARATOR
=
@PATH_SEPARATOR@
PTHREAD_CC
=
@PTHREAD_CC@
PTHREAD_CFLAGS
=
@PTHREAD_CFLAGS@
PTHREAD_LIBS
=
@PTHREAD_LIBS@
RANLIB
=
@RANLIB@
SED
=
@SED@
SET_MAKE
=
@SET_MAKE@
SHELL
=
@SHELL@
STRIP
=
@STRIP@
VERSION
=
@VERSION@
abs_builddir
=
@abs_builddir@
abs_srcdir
=
@abs_srcdir@
abs_top_builddir
=
@abs_top_builddir@
abs_top_srcdir
=
@abs_top_srcdir@
ac_ct_CC
=
@ac_ct_CC@
ac_ct_RANLIB
=
@ac_ct_RANLIB@
ac_ct_STRIP
=
@ac_ct_STRIP@
am__fastdepCC_FALSE
=
@am__fastdepCC_FALSE@
am__fastdepCC_TRUE
=
@am__fastdepCC_TRUE@
ac_ct_CXX
=
@ac_ct_CXX@
ac_ct_F77
=
@ac_ct_F77@
am__include
=
@am__include@
am__leading_dot
=
@am__leading_dot@
am__quote
=
@am__quote@
am__tar
=
@am__tar@
am__untar
=
@am__untar@
bindir
=
@bindir@
build
=
@build@
build_alias
=
@build_alias@
build_cpu
=
@build_cpu@
build_os
=
@build_os@
build_vendor
=
@build_vendor@
builddir
=
@builddir@
datadir
=
@datadir@
datarootdir
=
@datarootdir@
docdir
=
@docdir@
dvidir
=
@dvidir@
exec_prefix
=
@exec_prefix@
host
=
@host@
host_alias
=
@host_alias@
host_cpu
=
@host_cpu@
host_os
=
@host_os@
host_vendor
=
@host_vendor@
htmldir
=
@htmldir@
includedir
=
@includedir@
infodir
=
@infodir@
install_sh
=
@install_sh@
libdir
=
@libdir@
libexecdir
=
@libexecdir@
localedir
=
@localedir@
localstatedir
=
@localstatedir@
mandir
=
@mandir@
mkdir_p
=
@mkdir_p@
oldincludedir
=
@oldincludedir@
pdfdir
=
@pdfdir@
prefix
=
@prefix@
program_transform_name
=
@program_transform_name@
psdir
=
@psdir@
sbindir
=
@sbindir@
sharedstatedir
=
@sharedstatedir@
srcdir
=
@srcdir@
sysconfdir
=
@sysconfdir@
target_alias
=
@target_alias@
top_builddir
=
@top_builddir@
top_srcdir
=
@top_srcdir@
# Manpage Makefile for SExtractor
# Copyright (C) 2002 Emmanuel Bertin.
...
...
@@ -144,9 +187,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit
1
;;
\
esac
;
\
done
;
\
echo
' cd
$(top_srcdir)
&&
$(AUTOMAKE)
--gn
u
man/Makefile'
;
\
echo
' cd
$(top_srcdir)
&&
$(AUTOMAKE)
--
forei
gn man/Makefile'
;
\
cd
$(top_srcdir)
&&
\
$(AUTOMAKE)
--gn
u
man/Makefile
$(AUTOMAKE)
--
forei
gn
man/Makefile
.PRECIOUS
:
Makefile
Makefile
:
$(srcdir)/Makefile.in $(top_builddir)/config.status
@
case
'$?'
in
\
...
...
@@ -166,10 +209,15 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd
$(top_builddir)
&&
$(MAKE)
$(AM_MAKEFLAGS)
am--refresh
sex.1
:
$(top_builddir)/config.status $(srcdir)/sex.1.in
cd
$(top_builddir)
&&
$(SHELL)
./config.status
$(subdir)
/
$@
uninstall-info-am
:
mostlyclean-libtool
:
-
rm
-f
*
.lo
clean-libtool
:
-
rm
-rf
.libs _libs
install-man1
:
$(man1_MANS) $(man_MANS)
@
$(NORMAL_INSTALL)
test
-z
"
$(man1dir)
"
||
$(
mkdir_p
)
"
$(DESTDIR)$(man1dir)
"
test
-z
"
$(man1dir)
"
||
$(
MKDIR_P
)
"
$(DESTDIR)$(man1dir)
"
@
list
=
'
$(man1_MANS)
$(dist_man1_MANS)
$(nodist_man1_MANS)
'
;
\
l2
=
'
$(man_MANS)
$(dist_man_MANS)
$(nodist_man_MANS)
'
;
\
for
i
in
$$
l2
;
do
\
...
...
@@ -214,7 +262,7 @@ uninstall-man1:
done
install-manx
:
$(manx_MANS) $(man_MANS)
@
$(NORMAL_INSTALL)
test
-z
"
$(manxdir)
"
||
$(
mkdir_p
)
"
$(DESTDIR)$(manxdir)
"
test
-z
"
$(manxdir)
"
||
$(
MKDIR_P
)
"
$(DESTDIR)$(manxdir)
"
@
list
=
'
$(manx_MANS)
$(dist_manx_MANS)
$(nodist_manx_MANS)
'
;
\
l2
=
'
$(man_MANS)
$(dist_man_MANS)
$(nodist_man_MANS)
'
;
\
for
i
in
$$
l2
;
do
\
...
...
@@ -265,22 +313,21 @@ CTAGS:
distdir
:
$(DISTFILES)
@
srcdirstrip
=
`
echo
"
$(srcdir)
"
|
sed
's|.|.|g'
`
;
\
topsrcdirstrip
=
`
echo
"
$(top_srcdir)
"
|
sed
's|.|.|g'
`
;
\
list
=
'
$(DISTFILES)
'
;
for
file
in
$$
list
;
do
\
case
$$
file
in
\
$(srcdir)
/
*
)
file
=
`
echo
"
$$
file"
|
sed
"s|^
$$
srcdirstrip/||"
`
;;
\
$(top_srcdir)
/
*
)
file
=
`
echo
"
$$
file"
|
sed
"s|^
$$
topsrcdirstrip/|
$(top_builddir)
/|"
`
;;
\
esac
;
\
@
srcdirstrip
=
`
echo
"
$(srcdir)
"
|
sed
's/[].[^$$\\*]/\\\\&/g'
`
;
\
topsrcdirstrip
=
`
echo
"
$(top_srcdir)
"
|
sed
's/[].[^$$\\*]/\\\\&/g'
`
;
\
list
=
'
$(DISTFILES)
'
;
\
dist_files
=
`
for
file
in
$$
list
;
do
echo
$$
file
;
done
|
\
sed
-e
"s|^
$$
srcdirstrip/||;t"
\
-e
"s|^
$$
topsrcdirstrip/|
$(top_builddir)
/|;t"
`
;
\
case
$$
dist_files
in
\
*
/
*
)
$(MKDIR_P)
`
echo
"
$$
dist_files"
|
\
sed
'/\//!d;s|^|
$(distdir)
/|;s,/[^/]*$$,,'
|
\
sort
-u
`
;;
\
esac
;
\
for
file
in
$$
dist_files
;
do
\
if
test
-f
$$
file
||
test
-d
$$
file
;
then
d
=
.
;
else
d
=
$(srcdir)
;
fi
;
\
dir
=
`
echo
"
$$
file"
|
sed
-e
's,/[^/]*$$,,'
`
;
\
if
test
"
$$
dir"
!=
"
$$
file"
&&
test
"
$$
dir"
!=
"."
;
then
\
dir
=
"/
$$
dir"
;
\
$(mkdir_p)
"
$(distdir)$$
dir"
;
\
else
\
dir
=
''
;
\
fi
;
\
if
test
-d
$$
d/
$$
file
;
then
\
dir
=
`
echo
"/
$$
file"
|
sed
-e
's,/[^/]*$$,,'
`
;
\
if
test
-d
$(srcdir)
/
$$
file
&&
test
$$
d
!=
$(srcdir)
;
then
\
cp
-pR
$(srcdir)
/
$$
file
$(distdir)$$
dir
||
exit
1
;
\
fi
;
\
...
...
@@ -296,7 +343,7 @@ check: check-am
all-am
:
Makefile $(MANS)
installdirs
:
for
dir
in
"
$(DESTDIR)$(man1dir)
"
"
$(DESTDIR)$(manxdir)
"
;
do
\
test
-z
"
$$
dir"
||
$(
mkdir_p
)
"
$$
dir"
;
\
test
-z
"
$$
dir"
||
$(
MKDIR_P
)
"
$$
dir"
;
\
done
install
:
install-am
install-exec
:
install-exec-am
...
...
@@ -324,7 +371,7 @@ maintainer-clean-generic:
@
echo
"it deletes files that may require special tools to rebuild."
clean
:
clean-am
clean-am
:
clean-generic mostlyclean-am
clean-am
:
clean-generic
clean-libtool
mostlyclean-am
distclean
:
distclean-am
-
rm
-f
Makefile
...
...
@@ -342,12 +389,20 @@ info-am:
install-data-am
:
install-man
install-dvi
:
install-dvi-am
install-exec-am
:
install-html
:
install-html-am
install-info
:
install-info-am
install-man
:
install-man1 install-manx
install-pdf
:
install-pdf-am
install-ps
:
install-ps-am
installcheck-am
:
maintainer-clean
:
maintainer-clean-am
...
...
@@ -356,7 +411,7 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean
:
mostlyclean-am
mostlyclean-am
:
mostlyclean-generic
mostlyclean-am
:
mostlyclean-generic
mostlyclean-libtool
pdf
:
pdf-am
...
...
@@ -366,19 +421,24 @@ ps: ps-am
ps-am
:
uninstall-am
:
uninstall-info-am
uninstall-man
uninstall-am
:
uninstall-man
uninstall-man
:
uninstall-man1 uninstall-manx
.PHONY
:
all all-am check check-am clean clean-generic distclean
\
distclean-generic distdir dvi dvi-am html html-am info info-am
\
install install-am install-data install-data-am install-exec
\
install-exec-am install-info install-info-am install-man
\
install-man1 install-manx install-strip installcheck
\
installcheck-am installdirs maintainer-clean
\
maintainer-clean-generic mostlyclean mostlyclean-generic pdf
\
pdf-am ps ps-am uninstall uninstall-am uninstall-info-am
\
uninstall-man uninstall-man1 uninstall-manx
.MAKE
:
install-am install-strip
.PHONY
:
all all-am check check-am clean clean-generic clean-libtool
\
distclean distclean-generic distclean-libtool distdir dvi
\
dvi-am html html-am info info-am install install-am
\
install-data install-data-am install-dvi install-dvi-am
\
install-exec install-exec-am install-html install-html-am
\
install-info install-info-am install-man install-man1
\
install-manx install-pdf install-pdf-am install-ps
\
install-ps-am install-strip installcheck installcheck-am
\
installdirs maintainer-clean maintainer-clean-generic
\
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am
\
ps ps-am uninstall uninstall-am uninstall-man uninstall-man1
\
uninstall-manx
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
...
...
man/sex.1
View file @
ece261cd
.TH SEXTRACTOR "1" "
Octo
ber 200
6
" "SWarp 2.
5.0
" "User Commands"
.TH SEXTRACTOR "1" "
Novem
ber 200
8
" "SWarp 2.
8.2
" "User Commands"
.SH NAME
sex \- extract a source catalog from an astronomical FITS image
.SH SYNOPSIS
...
...
sextractor-tpx.spec.in
View file @
ece261cd
...
...
@@ -20,7 +20,7 @@ SExtractor stands for ``Source Extractor'': a software for making catalog of sou
%setup -q
%build
./configure --prefix=$RPM_BUILD_ROOT/usr/local/ --mandir=$RPM_BUILD_ROOT/usr/local/man/ --enable-static
./configure --prefix=$RPM_BUILD_ROOT/usr/local/ --mandir=$RPM_BUILD_ROOT/usr/local/man/
--with-xsl_url=file:///usr/local/share/@PACKAGE_NAME@/sextractor.xsl
--enable-static
make
...
...
@@ -35,6 +35,7 @@ rm -rf $RPM_BUILD_ROOT
/usr/local/bin/sex
/usr/local/man/man1/sex.1
/usr/local/man/manx/sex.x
/usr/local/share/@PACKAGE_NAME@
%doc AUTHORS BUGS ChangeLog COPYING HISTORY INSTALL README THANKS doc/README.DOC doc/sextractor.ps
%changelog
...
...
sextractor.spec.in
View file @
ece261cd
...
...
@@ -8,10 +8,12 @@ Version: %{version}
Release: %{release}
Source0: ftp://ftp.iap.fr/pub/from_users/bertin/sextractor/%{name}-%{version}.tar.gz
URL: http://terapix.iap.fr/soft/%{name}
License:
L
GPL
License: GPL
v3+
Group: Sciences/Astronomy
BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}
BuildRequires: pkgconfig
BuildRequires: fftw-devel >= 3.1
BuildRequires: atlas-devel >= 3.6.0
%description
SExtractor stands for ``Source Extractor'': a software for making catalog of sources from astronomical images.
...
...
@@ -20,26 +22,28 @@ SExtractor stands for ``Source Extractor'': a software for making catalog of sou
%setup -q
%build
if test "$GCCFLAGS"; then
./configure --enable-static --prefix=$RPM_BUILD_ROOT/usr/local/ --mandir=$RPM_BUILD_ROOT/usr/local/man/
make CFLAGS="$GCCFLAGS"
if test "$USE_ICC"; then
%configure --enable-icc
else
./configure --prefix=$RPM_BUILD_ROOT/usr/local/ --mandir=$RPM_BUILD_ROOT/usr/local/man/
make
%configure
fi
make %{?_smp_mflags}
%install
make install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/local/bin/sex
/usr/local/man/man1/sex.1
/usr/local/man/manx/sex.x
%doc AUTHORS BUGS ChangeLog COPYING HISTORY INSTALL README THANKS doc/README.DOC doc/sextractor.pdf
%{_bindir}/sex
%{_bindir}/ldactoasc
%{_mandir}/man1/sex.1*
%{_mandir}/manx/sex.x*
%{_datadir}/@PACKAGE_NAME@
%changelog
* @DATE2@ @PACKAGER@ <@PACKAGE_BUGREPORT@>
...
...
src/Makefile.am
View file @
ece261cd
# Program Makefile for SEx
# Copyright (C) 2004-2006 Emmanuel Bertin.
SUBDIRS
=
fits wcs
bin_PROGRAMS
=
sex
# Copyright (C) 2004-2008 Emmanuel Bertin.
SUBDIRS
=
fits levmar wcs
bin_PROGRAMS
=
sex ldactoasc
check_PROGRAMS
=
sex
sex_SOURCES
=
analyse.c assoc.c astrom.c back.c bpro.c catout.c
\
check.c clean.c extract.c field.c filter.c
\
flag.c graph.c growth.c image.c
interpolate.c
\
main.c makeit.c manobjlist.c misc.c
neurro.c pc.c
\
photom.c plist
.c p
oly
.c p
refs.c psf
.c re
adimage
.c
\
refine.c retina.c scan.c som.c weight.c winpos
.c
\
xml.c
\
check.c clean.c extract.c
fft.c
field.c filter.c
\
fitswcs.c
flag.c graph.c growth.c image.c
\
interpolate.c
main.c makeit.c manobjlist.c misc.c
\
neurro.c pattern
.c p
c
.c p
hotom.c plist
.c
p
re
fs
.c
\
profit.c psf.c readimage.c refine.c retina.c scan
.c
\
som.c weight.c winpos.c
xml.c
\
assoc.h astrom.h back.h bpro.h check.h clean.h
\
define.h extract.h field.h filter.h flag.h
\
globals.h growth.h image.h interpolate.h key.h
\
neurro.h param.h photom.h plist.h poly.h prefs.h
\
preflist.h psf.h retina.h sexhead1.h sexhead.h
\
sexheadsc.h som.h types.h weight.h winpos.h xml.h
AM_CPPFLAGS
=
-DXSL_URL
=
\"
file://
$(pkgdatadir)
/
${PACKAGE_NAME}
.xsl
\"
sex_LDADD
=
$(top_builddir)
/src/fits/libfits.a
$(top_builddir)
/src/wcs/libwcs_c.a
define.h extract.h fft.h field.h filter.h fitswcs.h
\
flag.h globals.h growth.h image.h interpolate.h
\
key.h neurro.h param.h paramprofit.h pattern.h
\
photom.h plist.h prefs.h preflist.h profit.h psf.h
\
retina.h sexhead1.h sexhead.h sexheadsc.h som.h
\
threads.h types.h wcscelsys.h weight.h winpos.h xml.h
ldactoasc_SOURCES
=
ldactoasc.c ldactoasc.h
sex_LDADD
=
$(top_builddir)
/src/fits/libfits.a
\
$(top_builddir)
/src/wcs/libwcs_c.a
\
$(top_builddir)
/src/levmar/liblevmar.a
ldactoasc_LDADD
=
$(top_builddir)
/src/fits/libfits.a
DATE
=
`
date
+
"%Y-%m-%d"
`
src/Makefile.in
View file @
ece261cd
# Makefile.in generated by automake 1.
9.6
from Makefile.am.
# Makefile.in generated by automake 1.
10.1
from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# 2003, 2004, 2005
, 2006, 2007, 2008
Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
...
...
@@ -14,15 +14,11 @@
@SET_MAKE@
srcdir
=
@srcdir@
top_srcdir
=
@top_srcdir@
VPATH
=
@srcdir@
pkgdatadir
=
$(datadir)
/@PACKAGE@
pkglibdir
=
$(libdir)
/@PACKAGE@
pkgincludedir
=
$(includedir)
/@PACKAGE@
top_builddir
=
..
am__cd
=
CDPATH
=
"
$
${
ZSH_VERSION
+.
}
$(PATH_SEPARATOR)
"
&&
cd
INSTALL
=
@INSTALL@
install_sh_DATA
=
$(install_sh)
-c
-m
644
install_sh_PROGRAM
=
$(install_sh)
-c
install_sh_SCRIPT
=
$(install_sh)
-c
...
...
@@ -34,11 +30,17 @@ POST_INSTALL = :
NORMAL_UNINSTALL
=
:
PRE_UNINSTALL
=
:
POST_UNINSTALL
=
:
bin_PROGRAMS
=
sex
$(EXEEXT)
build_triplet
=
@build@
host_triplet
=
@host@
bin_PROGRAMS
=
sex
$(EXEEXT)
ldactoasc
$(EXEEXT)
check_PROGRAMS
=
sex
$(EXEEXT)
subdir
=
src
DIST_COMMON
=
$(srcdir)
/Makefile.am
$(srcdir)
/Makefile.in
ACLOCAL_M4
=
$(top_srcdir)
/aclocal.m4
am__aclocal_m4_deps
=
$(top_srcdir)
/acx_prog_cc_optim.m4
\
am__aclocal_m4_deps
=
$(top_srcdir)
/acx_atlas.m4
\
$(top_srcdir)
/acx_fftw.m4
$(top_srcdir)
/acx_prog_cc_optim.m4
\
$(top_srcdir)
/acx_pthread.m4
\
$(top_srcdir)
/acx_urbi_resolve_dir.m4
\
$(top_srcdir)
/configure.ac
am__configure_deps
=
$(am__aclocal_m4_deps)
$(CONFIGURE_DEPENDENCIES)
\
$(ACLOCAL_M4)
...
...
@@ -48,43 +50,59 @@ CONFIG_CLEAN_FILES =
am__installdirs
=
"
$(DESTDIR)$(bindir)
"
binPROGRAMS_INSTALL
=
$(INSTALL_PROGRAM)
PROGRAMS
=
$(bin_PROGRAMS)
am_ldactoasc_OBJECTS
=
ldactoasc.
$(OBJEXT)
ldactoasc_OBJECTS
=
$(am_ldactoasc_OBJECTS)
ldactoasc_DEPENDENCIES
=
$(top_builddir)
/src/fits/libfits.a
am_sex_OBJECTS
=
analyse.
$(OBJEXT)
assoc.
$(OBJEXT)
astrom.
$(OBJEXT)
\
back.
$(OBJEXT)
bpro.
$(OBJEXT)
catout.
$(OBJEXT)
check.
$(OBJEXT)
\
clean.
$(OBJEXT)
extract.
$(OBJEXT)
field.
$(OBJEXT)
\
filter.
$(OBJEXT)
flag.
$(OBJEXT)
graph.
$(OBJEXT)
\
growth.
$(OBJEXT)
image.
$(OBJEXT)
interpolate.
$(OBJEXT)
\
main.
$(OBJEXT)
makeit.
$(OBJEXT)
manobjlist.
$(OBJEXT)
\
misc.
$(OBJEXT)
neurro.
$(OBJEXT)
pc.
$(OBJEXT)
photom.
$(OBJEXT)
\
plist.
$(OBJEXT)
poly.
$(OBJEXT)
prefs.
$(OBJEXT)
psf.
$(OBJEXT)
\
readimage.
$(OBJEXT)
refine.
$(OBJEXT)
retina.
$(OBJEXT)
\
scan.
$(OBJEXT)
som.
$(OBJEXT)
weight.
$(OBJEXT)
winpos.
$(OBJEXT)
\
xml.
$(OBJEXT)
clean.
$(OBJEXT)
extract.
$(OBJEXT)
fft.
$(OBJEXT)
\
field.
$(OBJEXT)
filter.
$(OBJEXT)
fitswcs.
$(OBJEXT)
\
flag.
$(OBJEXT)
graph.
$(OBJEXT)
growth.
$(OBJEXT)
\
image.
$(OBJEXT)
interpolate.
$(OBJEXT)
main.
$(OBJEXT)
\
makeit.
$(OBJEXT)
manobjlist.
$(OBJEXT)
misc.
$(OBJEXT)
\
neurro.
$(OBJEXT)
pattern.
$(OBJEXT)
pc.
$(OBJEXT)
\
photom.
$(OBJEXT)
plist.
$(OBJEXT)
prefs.
$(OBJEXT)
\
profit.
$(OBJEXT)
psf.
$(OBJEXT)
readimage.
$(OBJEXT)
\
refine.
$(OBJEXT)
retina.
$(OBJEXT)
scan.
$(OBJEXT)
som.
$(OBJEXT)
\
weight.
$(OBJEXT)
winpos.
$(OBJEXT)
xml.
$(OBJEXT)
sex_OBJECTS
=
$(am_sex_OBJECTS)
sex_DEPENDENCIES
=
$(top_builddir)
/src/fits/libfits.a
\
$(top_builddir)
/src/wcs/libwcs_c.a
DEFAULT_INCLUDES
=
-I
.
-I
$(srcdir)
-I
$(top_builddir)
$(top_builddir)
/src/wcs/libwcs_c.a
\
$(top_builddir)
/src/levmar/liblevmar.a
DEFAULT_INCLUDES
=
-I
.@am__isrc@
-I
$(top_builddir)
depcomp
=
$(SHELL)
$(top_srcdir)
/autoconf/depcomp
am__depfiles_maybe
=
depfiles
COMPILE
=
$(CC)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
$(AM_CPPFLAGS)
\
$(CPPFLAGS)
$(AM_CFLAGS)
$(CFLAGS)
LTCOMPILE
=
$(LIBTOOL)
--tag
=
CC
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
\
--mode
=
compile
$(CC)
$(DEFS)
$(DEFAULT_INCLUDES)
$(INCLUDES)
\
$(AM_CPPFLAGS)
$(CPPFLAGS)
$(AM_CFLAGS)
$(CFLAGS)
CCLD
=
$(CC)
LINK
=
$(CCLD)
$(AM_CFLAGS)
$(CFLAGS)
$(AM_LDFLAGS)
$(LDFLAGS)
-o
$@
SOURCES
=
$(sex_SOURCES)
DIST_SOURCES
=
$(sex_SOURCES)
LINK
=
$(LIBTOOL)
--tag
=
CC
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
\
--mode
=
link
$(CCLD)
$(AM_CFLAGS)
$(CFLAGS)
$(AM_LDFLAGS)
\
$(LDFLAGS)
-o
$@
SOURCES
=
$(ldactoasc_SOURCES)
$(sex_SOURCES)
DIST_SOURCES
=
$(ldactoasc_SOURCES)
$(sex_SOURCES)
RECURSIVE_TARGETS
=
all-recursive check-recursive dvi-recursive
\
html-recursive info-recursive install-data-recursive
\
install-exec-recursive install-info-recursive
\
install-recursive installcheck-recursive installdirs-recursive
\
pdf-recursive ps-recursive uninstall-info-recursive
\
uninstall-recursive
install-dvi-recursive install-exec-recursive
\
install-html-recursive install-info-recursive
\
install-pdf-recursive install-ps-recursive install-recursive
\
installcheck-recursive installdirs-recursive pdf-recursive
\
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS
=
mostlyclean-recursive clean-recursive
\
distclean-recursive maintainer-clean-recursive
ETAGS
=
etags
CTAGS
=
ctags
DIST_SUBDIRS
=
$(SUBDIRS)
DISTFILES
=
$(DIST_COMMON)
$(DIST_SOURCES)
$(TEXINFOS)
$(EXTRA_DIST)
ACLOCAL
=
@ACLOCAL@
AMDEP_FALSE
=
@AMDEP_FALSE@
AMDEP_TRUE
=
@AMDEP_TRUE@
AMTAR
=
@AMTAR@
AR
=
@AR@
ATLAS_CFLAGS
=
@ATLAS_CFLAGS@
ATLAS_ERROR
=
@ATLAS_ERROR@
ATLAS_LIB
=
@ATLAS_LIB@
ATLAS_LIBPATH
=
@ATLAS_LIBPATH@
AUTOCONF
=
@AUTOCONF@
AUTOHEADER
=
@AUTOHEADER@
AUTOMAKE
=
@AUTOMAKE@
...
...
@@ -94,16 +112,27 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS
=
@CFLAGS@
CPP
=
@CPP@
CPPFLAGS
=
@CPPFLAGS@
CXX
=
@CXX@
CXXCPP
=
@CXXCPP@
CXXDEPMODE
=
@CXXDEPMODE@
CXXFLAGS
=
@CXXFLAGS@
CYGPATH_W
=
@CYGPATH_W@
DATE2
=
@DATE2@
DATE3
=
@DATE3@
DEFS
=
@DEFS@
DEPDIR
=
@DEPDIR@
ECHO
=
@ECHO@
ECHO_C
=
@ECHO_C@
ECHO_N
=
@ECHO_N@
ECHO_T
=
@ECHO_T@
EGREP
=
@EGREP@
EXEEXT
=
@EXEEXT@
F77
=
@F77@
FFLAGS
=
@FFLAGS@
FFTW_ERROR
=
@FFTW_ERROR@
FFTW_LIBS
=
@FFTW_LIBS@
GREP
=
@GREP@
INSTALL
=
@INSTALL@
INSTALL_DATA
=
@INSTALL_DATA@
INSTALL_PROGRAM
=
@INSTALL_PROGRAM@
INSTALL_SCRIPT
=
@INSTALL_SCRIPT@
...
...
@@ -111,8 +140,11 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS
=
@LDFLAGS@
LIBOBJS
=
@LIBOBJS@
LIBS
=
@LIBS@
LIBTOOL
=
@LIBTOOL@
LN_S
=
@LN_S@
LTLIBOBJS
=
@LTLIBOBJS@
MAKEINFO
=
@MAKEINFO@
MKDIR_P
=
@MKDIR_P@
OBJEXT
=
@OBJEXT@
PACKAGE
=
@PACKAGE@
PACKAGER
=
@PACKAGER@
...
...
@@ -122,65 +154,96 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME
=
@PACKAGE_TARNAME@
PACKAGE_VERSION
=
@PACKAGE_VERSION@
PATH_SEPARATOR
=
@PATH_SEPARATOR@
PTHREAD_CC
=
@PTHREAD_CC@
PTHREAD_CFLAGS
=
@PTHREAD_CFLAGS@
PTHREAD_LIBS
=
@PTHREAD_LIBS@
RANLIB
=
@RANLIB@
SED
=
@SED@
SET_MAKE
=
@SET_MAKE@
SHELL
=
@SHELL@
STRIP
=
@STRIP@
VERSION
=
@VERSION@
abs_builddir
=
@abs_builddir@
abs_srcdir
=
@abs_srcdir@
abs_top_builddir
=
@abs_top_builddir@
abs_top_srcdir
=
@abs_top_srcdir@
ac_ct_CC
=
@ac_ct_CC@
ac_ct_RANLIB
=
@ac_ct_RANLIB@
ac_ct_STRIP
=
@ac_ct_STRIP@
am__fastdepCC_FALSE
=
@am__fastdepCC_FALSE@
am__fastdepCC_TRUE
=
@am__fastdepCC_TRUE@
ac_ct_CXX
=
@ac_ct_CXX@
ac_ct_F77
=
@ac_ct_F77@
am__include
=
@am__include@
am__leading_dot
=
@am__leading_dot@
am__quote
=
@am__quote@
am__tar
=
@am__tar@
am__untar
=
@am__untar@
bindir
=
@bindir@
build
=
@build@
build_alias
=
@build_alias@
build_cpu
=
@build_cpu@
build_os
=
@build_os@
build_vendor
=
@build_vendor@
builddir
=
@builddir@
datadir
=
@datadir@
datarootdir
=
@datarootdir@
docdir
=
@docdir@
dvidir
=
@dvidir@
exec_prefix
=
@exec_prefix@
host
=
@host@
host_alias
=
@host_alias@
host_cpu
=
@host_cpu@
host_os
=
@host_os@
host_vendor
=
@host_vendor@
htmldir
=
@htmldir@
includedir
=
@includedir@
infodir
=
@infodir@
install_sh
=
@install_sh@
libdir
=
@libdir@
libexecdir
=
@libexecdir@
localedir
=
@localedir@
localstatedir
=
@localstatedir@
mandir
=
@mandir@
mkdir_p
=
@mkdir_p@
oldincludedir
=
@oldincludedir@
pdfdir
=
@pdfdir@
prefix
=
@prefix@
program_transform_name
=
@program_transform_name@
psdir
=
@psdir@
sbindir
=
@sbindir@
sharedstatedir
=
@sharedstatedir@
srcdir
=
@srcdir@
sysconfdir
=
@sysconfdir@
target_alias
=
@target_alias@
top_builddir
=
@top_builddir@
top_srcdir
=
@top_srcdir@
# Program Makefile for SEx
# Copyright (C) 2004-200
6
Emmanuel Bertin.
SUBDIRS
=
fits wcs
# Copyright (C) 2004-200
8
Emmanuel Bertin.
SUBDIRS
=
fits
levmar
wcs
sex_SOURCES
=
analyse.c assoc.c astrom.c back.c bpro.c catout.c
\
check.c clean.c extract.c field.c filter.c
\
flag.c graph.c growth.c image.c
interpolate.c
\
main.c makeit.c manobjlist.c misc.c
neurro.c pc.c
\
photom.c plist
.c p
oly
.c p
refs.c psf
.c re
adimage
.c
\
refine.c retina.c scan.c som.c weight.c winpos
.c
\
xml.c
\
check.c clean.c extract.c
fft.c
field.c filter.c
\
fitswcs.c
flag.c graph.c growth.c image.c
\
interpolate.c
main.c makeit.c manobjlist.c misc.c
\
neurro.c pattern
.c p
c
.c p
hotom.c plist
.c
p
re
fs
.c
\
profit.c psf.c readimage.c refine.c retina.c scan
.c
\
som.c weight.c winpos.c
xml.c
\
assoc.h astrom.h back.h bpro.h check.h clean.h
\
define.h extract.h field.h filter.h flag.h
\
globals.h growth.h image.h interpolate.h key.h
\
neurro.h param.h photom.h plist.h poly.h prefs.h
\
preflist.h psf.h retina.h sexhead1.h sexhead.h
\
sexheadsc.h som.h types.h weight.h winpos.h xml.h
sex_LDADD
=
$(top_builddir)
/src/fits/libfits.a
$(top_builddir)
/src/wcs/libwcs_c.a
define.h extract.h fft.h field.h filter.h fitswcs.h
\
flag.h globals.h growth.h image.h interpolate.h
\
key.h neurro.h param.h paramprofit.h pattern.h
\
photom.h plist.h prefs.h preflist.h profit.h psf.h
\
retina.h sexhead1.h sexhead.h sexheadsc.h som.h
\
threads.h types.h wcscelsys.h weight.h winpos.h xml.h
ldactoasc_SOURCES
=
ldactoasc.c ldactoasc.h
sex_LDADD
=
$(top_builddir)
/src/fits/libfits.a
\
$(top_builddir)
/src/wcs/libwcs_c.a
\
$(top_builddir)
/src/levmar/liblevmar.a
ldactoasc_LDADD
=
$(top_builddir)
/src/fits/libfits.a
DATE
=
`
date
+
"%Y-%m-%d"
`
all
:
all-recursive
.SUFFIXES
:
.SUFFIXES
:
.c .o .obj
.SUFFIXES
:
.c
.lo
.o .obj
$(srcdir)/Makefile.in
:
$(srcdir)/Makefile.am $(am__configure_deps)
@
for
dep
in
$?
;
do
\
case
'
$(am__configure_deps)
'
in
\
...
...
@@ -190,9 +253,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit
1
;;
\
esac
;
\
done
;
\
echo
' cd
$(top_srcdir)
&&
$(AUTOMAKE)
--gn
u
src/Makefile'
;
\
echo
' cd
$(top_srcdir)
&&
$(AUTOMAKE)
--
forei
gn src/Makefile'
;
\
cd
$(top_srcdir)
&&
\
$(AUTOMAKE)
--gn
u
src/Makefile
$(AUTOMAKE)
--
forei
gn
src/Makefile
.PRECIOUS
:
Makefile
Makefile
:
$(srcdir)/Makefile.in $(top_builddir)/config.status
@
case
'$?'
in
\
...
...
@@ -212,14 +275,15 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd
$(top_builddir)
&&
$(MAKE)
$(AM_MAKEFLAGS)
am--refresh
install-binPROGRAMS
:
$(bin_PROGRAMS)
@
$(NORMAL_INSTALL)
test
-z
"
$(bindir)
"
||
$(
mkdir_p
)
"
$(DESTDIR)$(bindir)
"
test
-z
"
$(bindir)
"
||
$(
MKDIR_P
)
"
$(DESTDIR)$(bindir)
"
@
list
=
'
$(bin_PROGRAMS)
'
;
for
p
in
$$
list
;
do
\
p1
=
`
echo
$$
p|sed
's/
$(EXEEXT)
$$//'
`
;
\
if
test
-f
$$
p
\
||
test
-f
$$
p1
\
;
then
\
f
=
`
echo
"
$$
p1"
|
sed
's,^.*/,,;
$(transform)
;s/$$/
$(EXEEXT)
/'
`
;
\
echo
"
$(INSTALL_PROGRAM_ENV)
$(binPROGRAMS_INSTALL)
'
$$
p' '
$(DESTDIR)$(bindir)
/
$$
f'"
;
\
$(INSTALL_PROGRAM_ENV)
$(binPROGRAMS_INSTALL)
"
$$
p"
"
$(DESTDIR)$(bindir)
/
$$
f"
||
exit
1
;
\
echo
"
$(INSTALL_PROGRAM_ENV)
$(LIBTOOL)
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode=install
$(binPROGRAMS_INSTALL)
'
$$
p' '
$(DESTDIR)$(bindir)
/
$$
f'"
;
\
$(INSTALL_PROGRAM_ENV)
$(LIBTOOL)
$(AM_LIBTOOLFLAGS)
$(LIBTOOLFLAGS)
--mode
=
install
$(binPROGRAMS_INSTALL)
"
$$
p"
"
$(DESTDIR)$(bindir)
/
$$
f"
||
exit
1
;
\
else
:
;
fi
;
\
done
...
...
@@ -232,10 +296,24 @@ uninstall-binPROGRAMS:
done
clean-binPROGRAMS
:
-
test
-z
"
$(bin_PROGRAMS)
"
||
rm
-f
$(bin_PROGRAMS)
@
list
=
'
$(bin_PROGRAMS)
'
;
for
p
in
$$
list
;
do
\
f
=
`
echo
$$
p|sed
's/
$(EXEEXT)
$$//'
`
;
\
echo
" rm -f
$$
p
$$
f"
;
\
rm
-f
$$
p
$$
f
;
\
done
clean-checkPROGRAMS
:
@
list
=
'
$(check_PROGRAMS)
'
;
for
p
in
$$
list
;
do
\
f
=
`
echo
$$
p|sed
's/
$(EXEEXT)
$$//'
`
;
\
echo
" rm -f
$$
p
$$
f"
;
\
rm
-f
$$
p
$$
f
;
\
done
ldactoasc$(EXEEXT)
:
$(ldactoasc_OBJECTS) $(ldactoasc_DEPENDENCIES)
@
rm
-f
ldactoasc
$(EXEEXT)
$(LINK)
$(ldactoasc_OBJECTS)
$(ldactoasc_LDADD)
$(LIBS)
sex$(EXEEXT)
:
$(sex_OBJECTS) $(sex_DEPENDENCIES)
@
rm
-f
sex
$(EXEEXT)
$(LINK)
$(sex_LDFLAGS)
$(sex_OBJECTS)
$(sex_LDADD)
$(LIBS)
$(LINK)
$(sex_OBJECTS)
$(sex_LDADD)
$(LIBS)
mostlyclean-compile
:
-
rm
-f
*
.
$(OBJEXT)
...
...
@@ -252,23 +330,27 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/check.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/clean.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/extract.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/fft.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/field.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/filter.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/fitswcs.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/flag.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/graph.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/growth.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/image.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/interpolate.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/ldactoasc.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/makeit.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/manobjlist.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/misc.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/neurro.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pattern.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/pc.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/photom.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/plist.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/poly.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/prefs.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/profit.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/psf.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/readimage.Po@am__quote@
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/refine.Po@am__quote@
...
...
@@ -280,19 +362,31 @@ distclean-compile:
@AMDEP_TRUE@@am__include@
@am__quote@./$(DEPDIR)/xml.Po@am__quote@
.c.o
:
@am__fastdepCC_TRUE@
if
$(COMPILE)
-MT
$@
-MD
-MP
-MF
"
$(DEPDIR)/$*.Tpo
"
-c
-o
$@
$<
;
\
@am__fastdepCC_TRUE@
then
mv
-f
"
$(DEPDIR)/$*.Tpo
"
"
$(DEPDIR)/$*.Po
"
;
else
rm
-f
"$(DEPDIR)/$*.Tpo"
;
exit
1;
fi
@am__fastdepCC_TRUE@
$(COMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
$<
@am__fastdepCC_TRUE@
mv
-f
$(DEPDIR)/$*.Tpo
$(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@
source
=
'$<'
object
=
'$@'
libtool
=
no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@
DEPDIR
=
$(DEPDIR)
$(CCDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCC_FALSE@
$(COMPILE)
-c
$<
.c.obj
:
@am__fastdepCC_TRUE@
if
$(COMPILE)
-MT
$@
-MD
-MP
-MF
"
$(DEPDIR)/$*.Tpo
"
-c
-o
$@
`$(CYGPATH_W)
'$<'
`
;
\
@am__fastdepCC_TRUE@
then
mv
-f
"
$(DEPDIR)/$*.Tpo
"
"
$(DEPDIR)/$*.Po
"
;
else
rm
-f
"$(DEPDIR)/$*.Tpo"
;
exit
1;
fi
@am__fastdepCC_TRUE@
$(COMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
`$(CYGPATH_W)
'$<'
`
@am__fastdepCC_TRUE@
mv
-f
$(DEPDIR)/$*.Tpo
$(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@
source
=
'$<'
object
=
'$@'
libtool
=
no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@
DEPDIR
=
$(DEPDIR)
$(CCDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCC_FALSE@
$(COMPILE)
-c
`$(CYGPATH_W)
'$<'
`
uninstall-info-am
:
.c.lo
:
@am__fastdepCC_TRUE@
$(LTCOMPILE)
-MT
$@
-MD
-MP
-MF
$(DEPDIR)/$*.Tpo
-c
-o
$@
$<
@am__fastdepCC_TRUE@
mv
-f
$(DEPDIR)/$*.Tpo
$(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@
source
=
'$<'
object
=
'$@'
libtool
=
yes
@AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@
DEPDIR
=
$(DEPDIR)
$(CCDEPMODE)
$(depcomp)
@AMDEPBACKSLASH@
@am__fastdepCC_FALSE@
$(LTCOMPILE)
-c
-o
$@
$<
mostlyclean-libtool
:
-
rm
-f
*
.lo
clean-libtool
:
-
rm
-rf
.libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
...
...
@@ -325,8 +419,7 @@ $(RECURSIVE_TARGETS):
$(MAKE)
$(AM_MAKEFLAGS)
"
$$
target-am"
||
exit
1
;
\
fi
;
test
-z
"
$$
fail"
mostlyclean-recursive
clean-recursive
distclean-recursive
\
maintainer-clean-recursive
:
$(RECURSIVE_CLEAN_TARGETS)
:
@
failcom
=
'exit 1'
;
\
for
f
in
x
$$
MAKEFLAGS
;
do
\
case
$$
f
in
\
...
...
@@ -370,8 +463,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique
=
`
for
i
in
$$
list
;
do
\
if
test
-f
"
$$
i"
;
then
echo
$$
i
;
else
echo
$(srcdir)
/
$$
i
;
fi
;
\
done
|
\
$(AWK)
'
{ files[$$0] = 1; } \
END { for (i in files) print i; }'
`
;
\
$(AWK)
'{ files[$$0] = 1;
nonemtpy = 1;
} \
END {
if (nonempty) {
for (i in files) print i;
};
}'
`
;
\
mkid
-fID
$$
unique
tags
:
TAGS
...
...
@@ -396,8 +489,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique
=
`
for
i
in
$$
list
;
do
\
if
test
-f
"
$$
i"
;
then
echo
$$
i
;
else
echo
$(srcdir)
/
$$
i
;
fi
;
\
done
|
\
$(AWK)
'
{ files[$$0] = 1; } \
END { for (i in files) print i; }'
`
;
\
$(AWK)
'{ files[$$0] = 1;
nonempty = 1;
} \
END {
if (nonempty) {
for (i in files) print i;
};
}'
`
;
\
if
test
-z
"
$(ETAGS_ARGS)$$
tags
$$
unique"
;
then
:
;
else
\
test
-n
"
$$
unique"
||
unique
=
$$
empty_fix
;
\
$(ETAGS)
$(ETAGSFLAGS)
$(AM_ETAGSFLAGS)
$(ETAGS_ARGS)
\
...
...
@@ -407,13 +500,12 @@ ctags: CTAGS
CTAGS
:
ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
\
$(TAGS_FILES) $(LISP)
tags
=
;
\
here
=
`
pwd
`
;
\
list
=
'
$(SOURCES)
$(HEADERS)
$(LISP)
$(TAGS_FILES)
'
;
\
unique
=
`
for
i
in
$$
list
;
do
\
if
test
-f
"
$$
i"
;
then
echo
$$
i
;
else
echo
$(srcdir)
/
$$
i
;
fi
;
\
done
|
\
$(AWK)
'
{ files[$$0] = 1; } \
END { for (i in files) print i; }'
`
;
\
$(AWK)
'{ files[$$0] = 1;
nonempty = 1;
} \
END {
if (nonempty) {
for (i in files) print i;
};
}'
`
;
\
test
-z
"
$(CTAGS_ARGS)$$
tags
$$
unique"
\
||
$(CTAGS)
$(CTAGSFLAGS)
$(AM_CTAGSFLAGS)
$(CTAGS_ARGS)
\
$$
tags
$$
unique
...
...
@@ -427,22 +519,21 @@ distclean-tags:
-
rm
-f
TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir
:
$(DISTFILES)
@
srcdirstrip
=
`
echo
"
$(srcdir)
"
|
sed
's|.|.|g'
`
;
\
topsrcdirstrip
=
`
echo
"
$(top_srcdir)
"
|
sed
's|.|.|g'
`
;
\
list
=
'
$(DISTFILES)
'
;
for
file
in
$$
list
;
do
\
case
$$
file
in
\
$(srcdir)
/
*
)
file
=
`
echo
"
$$
file"
|
sed
"s|^
$$
srcdirstrip/||"
`
;;
\
$(top_srcdir)
/
*
)
file
=
`
echo
"
$$
file"
|
sed
"s|^
$$
topsrcdirstrip/|
$(top_builddir)
/|"
`
;;
\
esac
;
\
@
srcdirstrip
=
`
echo
"
$(srcdir)
"
|
sed
's/[].[^$$\\*]/\\\\&/g'
`
;
\
topsrcdirstrip
=
`
echo
"
$(top_srcdir)
"
|
sed
's/[].[^$$\\*]/\\\\&/g'
`
;
\
list
=
'
$(DISTFILES)
'
;
\
dist_files
=
`
for
file
in
$$
list
;
do
echo
$$
file
;
done
|
\
sed
-e
"s|^
$$
srcdirstrip/||;t"
\
-e
"s|^
$$
topsrcdirstrip/|
$(top_builddir)
/|;t"
`
;
\
case
$$
dist_files
in
\
*
/
*
)
$(MKDIR_P)
`
echo
"
$$
dist_files"
|
\
sed
'/\//!d;s|^|
$(distdir)
/|;s,/[^/]*$$,,'
|
\
sort
-u
`
;;
\
esac
;
\
for
file
in
$$
dist_files
;
do
\
if
test
-f
$$
file
||
test
-d
$$
file
;
then
d
=
.
;
else
d
=
$(srcdir)
;
fi
;
\
dir
=
`
echo
"
$$
file"
|
sed
-e
's,/[^/]*$$,,'
`
;
\
if
test
"
$$
dir"
!=
"
$$
file"
&&
test
"
$$
dir"
!=
"."
;
then
\
dir
=
"/
$$
dir"
;
\
$(mkdir_p)
"
$(distdir)$$
dir"
;
\
else
\
dir
=
''
;
\
fi
;
\
if
test
-d
$$
d/
$$
file
;
then
\
dir
=
`
echo
"/
$$
file"
|
sed
-e
's,/[^/]*$$,,'
`
;
\
if
test
-d
$(srcdir)
/
$$
file
&&
test
$$
d
!=
$(srcdir)
;
then
\
cp
-pR
$(srcdir)
/
$$
file
$(distdir)$$
dir
||
exit
1
;
\
fi
;
\
...
...
@@ -456,7 +547,7 @@ distdir: $(DISTFILES)
list
=
'
$(DIST_SUBDIRS)
'
;
for
subdir
in
$$
list
;
do
\
if
test
"
$$
subdir"
=
.
;
then
:
;
else
\
test
-d
"
$(distdir)
/
$$
subdir"
\
||
$(
mkdir_p
)
"
$(distdir)
/
$$
subdir"
\
||
$(
MKDIR_P
)
"
$(distdir)
/
$$
subdir"
\
||
exit
1
;
\
distdir
=
`
$(am__cd)
$(distdir)
&&
pwd
`
;
\
top_distdir
=
`
$(am__cd)
$(top_distdir)
&&
pwd
`
;
\
...
...
@@ -464,17 +555,20 @@ distdir: $(DISTFILES)
$(MAKE)
$(AM_MAKEFLAGS)
\
top_distdir
=
"
$$
top_distdir"
\
distdir
=
"
$$
distdir/
$$
subdir"
\
am__remove_distdir
=
:
\
am__skip_length_check
=
:
\
distdir
)
\
||
exit
1
;
\
fi
;
\
done
check-am
:
all-am
$(MAKE)
$(AM_MAKEFLAGS)
$(check_PROGRAMS)
check
:
check-recursive
all-am
:
Makefile $(PROGRAMS)
installdirs
:
installdirs-recursive
installdirs-am
:
for
dir
in
"
$(DESTDIR)$(bindir)
"
;
do
\
test
-z
"
$$
dir"
||
$(
mkdir_p
)
"
$$
dir"
;
\
test
-z
"
$$
dir"
||
$(
MKDIR_P
)
"
$$
dir"
;
\
done
install
:
install-recursive
install-exec
:
install-exec-recursive
...
...
@@ -502,7 +596,8 @@ maintainer-clean-generic:
@
echo
"it deletes files that may require special tools to rebuild."
clean
:
clean-recursive
clean-am
:
clean-binPROGRAMS clean-generic mostlyclean-am
clean-am
:
clean-binPROGRAMS clean-checkPROGRAMS clean-generic
\
clean-libtool mostlyclean-am
distclean
:
distclean-recursive
-
rm
-rf
./
$(DEPDIR)
...
...
@@ -522,12 +617,20 @@ info-am:
install-data-am
:
install-dvi
:
install-dvi-recursive
install-exec-am
:
install-binPROGRAMS
install-html
:
install-html-recursive
install-info
:
install-info-recursive
install-man
:
install-pdf
:
install-pdf-recursive
install-ps
:
install-ps-recursive
installcheck-am
:
maintainer-clean
:
maintainer-clean-recursive
...
...
@@ -537,7 +640,8 @@ maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean
:
mostlyclean-recursive
mostlyclean-am
:
mostlyclean-compile mostlyclean-generic
mostlyclean-am
:
mostlyclean-compile mostlyclean-generic
\
mostlyclean-libtool
pdf
:
pdf-recursive
...
...
@@ -547,23 +651,26 @@ ps: ps-recursive
ps-am
:
uninstall-am
:
uninstall-binPROGRAMS
uninstall-info-am
uninstall-am
:
uninstall-binPROGRAMS
uninstall-info
:
uninstall-info-recursive
.MAKE
:
$(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am
\
install-strip
.PHONY
:
$(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am
\
clean clean-binPROGRAMS clean-generic clean-recursive ctags
\
.PHONY
:
$(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS
\
all all-am check check-am clean clean-binPROGRAMS
\
clean-checkPROGRAMS clean-generic clean-libtool ctags
\
ctags-recursive distclean distclean-compile distclean-generic
\
distclean-
recursive
distclean-tags distdir dvi dvi-am html
\
distclean-
libtool
distclean-tags distdir dvi dvi-am html
\
html-am info info-am install install-am install-binPROGRAMS
\
install-data install-data-am install-exec install-exec-am
\
install-info install-info-am install-man install-strip
\
install-data install-data-am install-dvi install-dvi-am
\
install-exec install-exec-am install-html install-html-am
\
install-info install-info-am install-man install-pdf
\
install-pdf-am install-ps install-ps-am install-strip
\
installcheck installcheck-am installdirs installdirs-am
\
maintainer-clean maintainer-clean-generic
\
maintainer-clean-recursive mostlyclean mostlyclean-compile
\
mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am
\
tags tags-recursive uninstall uninstall-am
\
uninstall-binPROGRAMS uninstall-info-am
maintainer-clean maintainer-clean-generic mostlyclean
\
mostlyclean-compile mostlyclean-generic mostlyclean-libtool
\
pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
\
uninstall-binPROGRAMS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
...
...
src/analyse.c
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: analyse(), endobject()...: measurements on detections.
*
* Last modify: 1
2/0
1/200
6
* Last modify: 1
8/1
1/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -37,11 +37,13 @@
#include
"image.h"
#include
"photom.h"
#include
"psf.h"
#include
"profit.h"
#include
"retina.h"
#include
"som.h"
#include
"winpos.h"
static
obj2struct
*
obj2
=
&
outobj2
;
extern
profitstruct
*
theprofit
;
/********************************* analyse ***********************************/
void
analyse
(
picstruct
*
field
,
picstruct
*
dfield
,
int
objnb
,
...
...
@@ -88,10 +90,10 @@ void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
checkstruct
*
check
;
pliststruct
*
pixt
;
int
i
,
j
,
k
,
h
,
photoflag
,
area
,
errflag
,
cleanflag
,
pospeakflag
,
profflag
,
minarea
,
gainflag
;
pospeakflag
,
minarea
,
gainflag
;
double
tv
,
sigtv
,
ngamma
,
esum
,
emx2
,
emy2
,
emxy
,
err
,
gain
,
backnoise2
,
dbacknoise2
,
xm
,
ym
,
x
,
y
,
var
,
var2
,
profflux
,
proffluxvar
;
xm
,
ym
,
x
,
y
,
var
,
var2
;
float
*
heap
,
*
heapt
,
*
heapj
,
*
heapk
,
swap
;
PIXTYPE
pix
,
cdpix
,
tpix
,
peak
,
cdpeak
,
thresh
,
dthresh
;
static
PIXTYPE
threshs
[
NISO
];
...
...
@@ -112,8 +114,7 @@ void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
xm
=
ym
=
dbacknoise2
=
0
.
0
;
/* to avoid gcc -Wall warnings */
pospeakflag
=
FLAG
(
obj
.
peakx
);
profflag
=
FLAG
(
obj
.
flux_prof
);
gain
=
prefs
.
gain
;
gain
=
field
->
gain
;
ngamma
=
field
->
ngamma
;
photoflag
=
(
prefs
.
detect_type
==
PHOTO
);
gainflag
=
PLISTEXIST
(
var
)
&&
prefs
.
weightgain_flag
;
...
...
@@ -143,7 +144,7 @@ void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
/* Measure essential isophotal parameters in the measurement image... */
tv
=
sigtv
=
profflux
=
proffluxvar
=
0
.
0
;
tv
=
sigtv
=
0
.
0
;
var
=
backnoise2
=
field
->
backsig
*
field
->
backsig
;
peak
=
-
BIG
;
cdpeak
=
-
BIG
;
...
...
@@ -178,12 +179,6 @@ void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
sigtv
+=
var2
;
if
(
profflag
&&
cdpix
>
0
.
0
)
{
profflux
+=
cdpix
*
pix
;
proffluxvar
+=
cdpix
*
var2
;
}
if
(
pix
>
thresh
)
area
++
;
tv
+=
pix
;
...
...
@@ -245,12 +240,6 @@ void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
free
(
heap
);
}
if
(
profflag
)
{
obj
->
flux_prof
=
obj
->
fdflux
>
0
.
0
?
(
float
)(
profflux
/
obj
->
fdflux
)
:
0
.
0
;
obj
->
fluxerr_prof
=
obj
->
fdflux
>
0
.
0
?
(
float
)(
proffluxvar
/
obj
->
fdflux
)
:
0
.
0
;
}
if
(
errflag
)
{
double
flux2
;
...
...
@@ -348,7 +337,7 @@ void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
mx
=
obj
->
mx
;
my
=
obj
->
my
;
dbkg
=
obj
->
dbkg
;
sat
=
(
double
)(
prefs
.
satur_level
-
obj
->
bkg
);
sat
=
(
double
)(
field
->
satur_level
-
obj
->
bkg
);
s
=
sx
=
sy
=
sxx
=
sxy
=
0
.
0
;
for
(
pixt
=
pixel
+
obj
->
firstpix
;
pixt
>=
pixel
;
pixt
=
pixel
+
PLIST
(
pixt
,
nextpix
))
{
...
...
@@ -484,11 +473,6 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
/*-- Convert the father of photom. error estimates from variance to RMS */
obj2
->
flux_iso
=
obj
->
flux
;
obj2
->
fluxerr_iso
=
sqrt
(
obj
->
fluxerr
);
if
(
FLAG
(
obj
.
flux_prof
))
{
obj2
->
flux_prof
=
obj
->
flux_prof
;
obj2
->
fluxerr_prof
=
sqrt
(
obj
->
fluxerr_prof
);
}
if
(
FLAG
(
obj2
.
flux_isocor
))
computeisocorflux
(
field
,
obj
);
...
...
@@ -512,7 +496,7 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
compute_winpos
(
field
,
wfield
,
obj
);
/*-- What about the peak of the profile? */
if
(
obj
->
peak
+
obj
->
bkg
>=
prefs
.
satur_level
)
if
(
obj
->
peak
+
obj
->
bkg
>=
field
->
satur_level
)
obj
->
flag
|=
OBJ_SATUR
;
/*-- Check-image CHECK_APERTURES option */
...
...
@@ -602,7 +586,7 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
}
som_phot
(
thesom
,
obj
->
bkg
,
field
->
backsig
,
(
float
)
prefs
.
gain
,
obj
->
mx
-
ix
,
obj
->
my
-
iy
,
(
float
)
field
->
gain
,
obj
->
mx
-
ix
,
obj
->
my
-
iy
,
FLAG
(
obj2
.
vector_somfit
)
?
outobj2
.
vector_somfit
:
NULL
,
-
1
.
0
);
obj2
->
stderr_somfit
=
thesom
->
stderror
;
obj2
->
flux_somfit
=
thesom
->
amp
;
...
...
@@ -617,9 +601,6 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
copyimage_center
(
field
,
outobj2
.
vigshift
,
prefs
.
vigshiftsize
[
0
],
prefs
.
vigshiftsize
[
1
],
obj
->
mx
,
obj
->
my
);
/*--- Express everything in magnitude units */
computemags
(
field
,
obj
);
/*------------------------------- PSF fitting ------------------------------*/
nsub
=
1
;
if
(
prefs
.
psf_flag
)
...
...
@@ -655,6 +636,14 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
}
}
/*----------------------------- Profile fitting -----------------------------*/
nsub
=
1
;
if
(
prefs
.
prof_flag
)
profit_fit
(
theprofit
,
field
,
wfield
,
obj
,
obj2
);
/*--- Express everything in magnitude units */
computemags
(
field
,
obj
);
/*-------------------------------- Astrometry ------------------------------*/
if
(
prefs
.
world_flag
)
computeastrom
(
field
,
obj
);
...
...
@@ -704,6 +693,25 @@ void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
writecat
(
n
,
objlist
);
}
}
else
{
/*-- Treatment of discarded detections */
/*-- update segmentation map */
if
((
check
=
prefs
.
check
[
CHECK_SEGMENTATION
]))
{
ULONG
*
pix
;
ULONG
oldsnumber
=
obj
->
number
;
int
dx
,
dx0
,
dy
,
dpix
;
pix
=
(
ULONG
*
)
check
->
pix
+
check
->
width
*
obj
->
ymin
+
obj
->
xmin
;
dx0
=
obj
->
xmax
-
obj
->
xmin
+
1
;
dpix
=
check
->
width
-
dx0
;
for
(
dy
=
obj
->
ymax
-
obj
->
ymin
+
1
;
dy
--
;
pix
+=
dpix
)
for
(
dx
=
dx0
;
dx
--
;
pix
++
)
if
(
*
pix
==
oldsnumber
)
*
pix
=
0
;
}
}
/* Remove again from the image the object's pixels if BLANKing is on ... */
/*-- ... and free memory */
...
...
src/assoc.h
View file @
ece261cd
...
...
@@ -9,13 +9,13 @@
*
* Contents: Include file for assoc.c.
*
* Last modify:
25/06/9
7
* Last modify:
14/10/200
7
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#define ASSOC_BUFINC
65536
/* Assoc buffer increment (bytes) */
#define ASSOC_BUFINC
131072
/* Assoc buffer increment (bytes) */
/*--------------------------------- typedefs --------------------------------*/
...
...
src/astrom.c
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: Astrometrical computations.
*
* Last modify: 1
3
/0
7
/200
6
* Last modify: 1
9
/0
5
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -27,6 +27,7 @@
#include
"globals.h"
#include
"prefs.h"
#include
"astrom.h"
#include
"fitswcs.h"
#include
"wcs/tnx.h"
static
obj2struct
*
obj2
=
&
outobj2
;
...
...
@@ -38,114 +39,41 @@ Initialize astrometrical structures.
void
initastrom
(
picstruct
*
field
)
{
astromstruct
*
as
;
double
*
lm
;
int
l
,
n
,
lng
,
lat
,
naxis
;
wcsstruct
*
wcs
;
as
=
field
->
astrom
;
naxis
=
as
->
naxis
;
wcs
=
field
->
wcs
;
/* Test if the WCS is in use */
if
(
as
->
wcs_flag
)
/*-- ...Yes: launch the WCS stuff! */
if
(
wcs
->
lng
!=
wcs
->
lat
)
{
QCALLOC
(
as
->
lin
,
struct
linprm
,
1
);
QMALLOC
(
as
->
cel
,
struct
celprm
,
1
);
QMALLOC
(
as
->
prj
,
struct
prjprm
,
1
);
QMALLOC
(
as
->
lin
->
cdelt
,
double
,
naxis
);
QMALLOC
(
as
->
lin
->
crpix
,
double
,
naxis
);
QMALLOC
(
as
->
lin
->
pc
,
double
,
naxis
*
naxis
);
/* Set WCS flags to 0: structures will be reinitialized by the WCS library */
as
->
wcs
->
flag
=
as
->
lin
->
flag
=
as
->
cel
->
flag
=
as
->
prj
->
flag
=
0
;
as
->
lin
->
naxis
=
as
->
naxis
;
/* wcsprm structure */
lng
=
as
->
lng
=
as
->
wcs
->
lng
;
lat
=
as
->
lat
=
as
->
wcs
->
lat
;
/*-- linprm structure */
for
(
l
=
0
;
l
<
naxis
;
l
++
)
{
as
->
lin
->
crpix
[
l
]
=
as
->
crpix
[
l
];
as
->
lin
->
cdelt
[
l
]
=
as
->
cdelt
[
l
];
as
->
cel
->
ref
[
l
]
=
as
->
crval
[
l
];
}
for
(
l
=
0
;
l
<
naxis
*
naxis
;
l
++
)
as
->
lin
->
pc
[
l
]
=
as
->
pc
[
l
];
/*-- celprm structure */
if
(
lng
>=
0
)
{
as
->
cel
->
ref
[
0
]
=
as
->
crval
[
lng
];
as
->
cel
->
ref
[
1
]
=
as
->
crval
[
lat
];
}
else
{
as
->
cel
->
ref
[
0
]
=
as
->
crval
[
0
];
as
->
cel
->
ref
[
1
]
=
as
->
crval
[
1
];
}
as
->
cel
->
ref
[
2
]
=
as
->
longpole
;
as
->
cel
->
ref
[
3
]
=
as
->
latpole
;
/* prjprm structure */
as
->
prj
->
r0
=
as
->
r0
;
as
->
prj
->
tnx_lngcor
=
as
->
tnx_lngcor
;
as
->
prj
->
tnx_latcor
=
as
->
tnx_latcor
;
if
(
lng
>=
0
)
{
n
=
0
;
for
(
l
=
100
;
l
--
;)
{
as
->
prj
->
p
[
l
]
=
as
->
projp
[
l
+
lng
*
100
];
as
->
prj
->
p
[
l
+
100
]
=
as
->
projp
[
l
+
lat
*
100
];
if
(
!
n
&&
(
as
->
prj
->
p
[
l
]
||
as
->
prj
->
p
[
l
+
100
]))
n
=
l
+
1
;
}
}
/*-- Compute an "average linear matrix" (at field center) */
compute_wcs
(
field
,
(
field
->
width
+
1
)
/
2
.
0
,
(
field
->
height
+
1
)
/
2
.
0
);
/*---- Compute Pole coordinates in J2000 and/or B1950 for THETAs */
if
(
FLAG
(
obj2
.
theta2000
)
||
FLAG
(
obj2
.
theta1950
)
||
FLAG
(
obj2
.
poserr_theta2000
)
||
FLAG
(
obj2
.
poserr_theta1950
)
||
FLAG
(
obj2
.
win_theta2000
)
||
FLAG
(
obj2
.
win_theta1950
)
||
FLAG
(
obj2
.
winposerr_theta2000
)
||
FLAG
(
obj2
.
winposerr_theta1950
))
||
FLAG
(
obj2
.
winposerr_theta2000
)
||
FLAG
(
obj2
.
winposerr_theta1950
)
||
FLAG
(
obj2
.
prof_spheroid_theta2000
)
||
FLAG
(
obj2
.
prof_spheroid_theta1950
)
||
FLAG
(
obj2
.
prof_disk_theta2000
)
||
FLAG
(
obj2
.
prof_disk_theta1950
)
// || FLAG(obj2.prof_arms_theta2000) || FLAG(obj2.prof_arms_theta1950)
||
FLAG
(
obj2
.
prof_bar_theta2000
)
||
FLAG
(
obj2
.
prof_bar_theta1950
))
{
if
(
fabs
(
a
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
a
s
->
equinox
,
0
.
0
,
90
.
0
,
2000
.
0
,
&
a
s
->
ap2000
,
&
a
s
->
dp2000
);
if
(
fabs
(
wc
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
wc
s
->
equinox
,
0
.
0
,
90
.
0
,
2000
.
0
,
&
wc
s
->
ap2000
,
&
wc
s
->
dp2000
);
else
{
a
s
->
ap2000
=
0
.
0
;
a
s
->
dp2000
=
90
.
0
;
wc
s
->
ap2000
=
0
.
0
;
wc
s
->
dp2000
=
90
.
0
;
}
if
(
FLAG
(
obj2
.
theta1950
)
||
FLAG
(
obj2
.
poserr_theta1950
))
j2b
(
a
s
->
equinox
,
a
s
->
ap2000
,
a
s
->
dp2000
,
&
a
s
->
ap1950
,
&
a
s
->
dp1950
);
j2b
(
wc
s
->
equinox
,
wc
s
->
ap2000
,
wc
s
->
dp2000
,
&
wc
s
->
ap1950
,
&
wc
s
->
dp1950
);
}
}
else
/*-- ...No: compute only the determinant */
{
/*-- Simplify the original FITS PC matrix */
lm
=
as
->
linmat
;
for
(
l
=
0
;
l
<
naxis
*
naxis
;
l
++
)
lm
[
l
]
=
as
->
pc
[
l
]
*
as
->
cdelt
[
l
/
naxis
];
/*-- Check valid only in 2D */
if
((
as
->
lindet
=
lm
[
0
]
*
lm
[
3
]
-
lm
[
1
]
*
lm
[
2
])
==
0
.
0
)
warning
(
"Null determinant in the global distortion matrix:
\n
"
,
" Some WORLD-parameters will be incorrect"
);
}
/* Override astrometric definitions only if user supplies a pixel-scale */
if
(
prefs
.
pixel_scale
==
0
.
0
)
{
as
->
pixscale
=
sqrt
(
fabs
(
as
->
lindet
));
field
->
pixscale
=
3600
.
0
*
as
->
pixscale
;
/* in arcsec2 */
}
field
->
pixscale
=
wcs
->
pixscale
*
3600
.
0
;
/* in arcsec */
else
as
->
pixscale
=
(
field
->
pixscale
=
prefs
.
pixel_scale
)
/
3600
.
0
;
field
->
pixscale
=
prefs
.
pixel_scale
;
return
;
}
...
...
@@ -158,124 +86,175 @@ Compute real WORLD coordinates and dimensions according to FITS info.
void
computeastrom
(
picstruct
*
field
,
objstruct
*
obj
)
{
astromstruct
*
as
;
double
*
lm
,
*
wcspos
;
wcsstruct
*
wcs
;
double
rawpos
[
NAXIS
],
wcspos
[
NAXIS
],
pixscale2
,
da
,
dd
;
int
lng
,
lat
;
as
=
field
->
astrom
;
lm
=
as
->
linmat
;
wcs
=
field
->
wcs
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
pixscale2
=
0
.
0
;
/* To avoid gcc -Wall warnings */
/* If working with WCS, compute WORLD coordinates and local matrix */
if
(
FLAG
(
obj2
.
mxw
))
{
if
(
as
->
wcs_flag
)
rawpos
[
0
]
=
obj2
->
posx
;
rawpos
[
1
]
=
obj2
->
posy
;
raw_to_wcs
(
wcs
,
rawpos
,
wcspos
);
obj2
->
mxw
=
wcspos
[
0
];
obj2
->
myw
=
wcspos
[
1
];
if
(
lng
!=
lat
)
{
wcspos
=
compute_wcs
(
field
,
obj2
->
posx
,
obj2
->
posy
);
obj2
->
alphas
=
obj2
->
mxw
=
wcspos
[
0
];
obj2
->
deltas
=
obj2
->
myw
=
wcspos
[
1
];
obj2
->
alphas
=
lng
<
lat
?
obj2
->
mxw
:
obj2
->
myw
;
obj2
->
deltas
=
lng
<
lat
?
obj2
->
myw
:
obj2
->
mxw
;
if
(
FLAG
(
obj2
.
alpha2000
))
{
if
(
fabs
(
a
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
a
s
->
equinox
,
wcspos
[
0
],
wcspos
[
1
],
if
(
fabs
(
wc
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
wc
s
->
equinox
,
wcspos
[
lng
<
lat
?
0
:
1
],
wcspos
[
lng
<
lat
?
1
:
0
],
2000
.
0
,
&
obj2
->
alpha2000
,
&
obj2
->
delta2000
);
else
{
obj2
->
alpha2000
=
obj2
->
mxw
;
obj2
->
delta2000
=
obj2
->
myw
;
obj2
->
alpha2000
=
lng
<
lat
?
obj2
->
mxw
:
obj2
->
myw
;
obj2
->
delta2000
=
lng
<
lat
?
obj2
->
myw
:
obj2
->
mxw
;
}
if
(
FLAG
(
obj2
.
dtheta2000
))
{
da
=
wcs
->
ap2000
-
obj2
->
alpha2000
;
dd
=
(
sin
(
wcs
->
dp2000
*
DEG
)
-
sin
(
obj2
->
delta2000
*
DEG
)
*
sin
(
obj2
->
deltas
*
DEG
))
/
(
cos
(
obj2
->
delta2000
*
DEG
)
*
cos
(
obj2
->
deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
dtheta2000
=
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
if
(
FLAG
(
obj2
.
alpha1950
))
j2b
(
as
->
equinox
,
obj2
->
alpha2000
,
obj2
->
delta2000
,
{
j2b
(
wcs
->
equinox
,
obj2
->
alpha2000
,
obj2
->
delta2000
,
&
obj2
->
alpha1950
,
&
obj2
->
delta1950
);
if
(
FLAG
(
obj2
.
dtheta1950
))
{
da
=
wcs
->
ap1950
-
obj2
->
alpha1950
;
dd
=
(
sin
(
wcs
->
dp1950
*
DEG
)
-
sin
(
obj2
->
delta1950
*
DEG
)
*
sin
(
obj2
->
deltas
*
DEG
))
/
(
cos
(
obj2
->
delta1950
*
DEG
)
*
cos
(
obj2
->
deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
dtheta1950
=
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
}
}
}
else
{
double
dx
,
dy
;
dx
=
obj2
->
posx
-
as
->
crpix
[
0
];
dy
=
obj2
->
posy
-
as
->
crpix
[
1
];
obj2
->
mxw
=
as
->
crval
[
0
]
+
lm
[
0
]
*
dx
+
lm
[
1
]
*
dy
;
/* CDELT included! */
obj2
->
myw
=
as
->
crval
[
1
]
+
lm
[
2
]
*
dx
+
lm
[
3
]
*
dy
;
/* CDELT included! */
}
}
/* Idem for peak-flux positions */
if
(
FLAG
(
obj2
.
peakxw
))
{
if
(
as
->
wcs_flag
)
rawpos
[
0
]
=
obj
->
peakx
;
rawpos
[
1
]
=
obj
->
peaky
;
raw_to_wcs
(
wcs
,
rawpos
,
wcspos
);
obj2
->
peakxw
=
wcspos
[
0
];
obj2
->
peakyw
=
wcspos
[
1
];
if
(
lng
!=
lat
)
{
wcspos
=
compute_wcs
(
field
,
(
double
)
obj
->
peakx
,
(
double
)
obj
->
peaky
);
obj2
->
peakalphas
=
obj2
->
peakxw
=
wcspos
[
0
];
obj2
->
peakdeltas
=
obj2
->
peakyw
=
wcspos
[
1
];
obj2
->
peakalphas
=
lng
<
lat
?
obj2
->
peakxw
:
obj2
->
peakyw
;
obj2
->
peakdeltas
=
lng
<
lat
?
obj2
->
peakyw
:
obj2
->
peakxw
;
if
(
FLAG
(
obj2
.
peakalpha2000
))
{
if
(
fabs
(
a
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
a
s
->
equinox
,
wcspos
[
0
],
wcspos
[
1
],
if
(
fabs
(
wc
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
wc
s
->
equinox
,
wcspos
[
lng
<
lat
?
0
:
1
],
wcspos
[
lng
<
lat
?
1
:
0
],
2000
.
0
,
&
obj2
->
peakalpha2000
,
&
obj2
->
peakdelta2000
);
else
{
obj2
->
peakalpha2000
=
obj2
->
peakxw
;
obj2
->
peakdelta2000
=
obj2
->
peakyw
;
obj2
->
peakalpha2000
=
lng
<
lat
?
obj2
->
peakxw
:
obj2
->
peakyw
;
obj2
->
peakdelta2000
=
lng
<
lat
?
obj2
->
peakyw
:
obj2
->
peakxw
;
}
if
(
FLAG
(
obj2
.
peakalpha1950
))
j2b
(
a
s
->
equinox
,
obj2
->
peakalpha2000
,
obj2
->
peakdelta2000
,
j2b
(
wc
s
->
equinox
,
obj2
->
peakalpha2000
,
obj2
->
peakdelta2000
,
&
obj2
->
peakalpha1950
,
&
obj2
->
peakdelta1950
);
}
}
else
{
double
dx
,
dy
;
dx
=
obj
->
peakx
-
as
->
crpix
[
0
];
dy
=
obj
->
peaky
-
as
->
crpix
[
1
];
obj2
->
peakxw
=
as
->
crval
[
0
]
+
lm
[
0
]
*
dx
+
lm
[
1
]
*
dy
;
/* CDELT included! */
obj2
->
peakyw
=
as
->
crval
[
1
]
+
lm
[
2
]
*
dx
+
lm
[
3
]
*
dy
;
/* CDELT included! */
}
}
/* Idem for Windowed positions */
if
(
FLAG
(
obj2
.
winpos_xw
))
{
if
(
as
->
wcs_flag
)
rawpos
[
0
]
=
obj2
->
winpos_x
;
rawpos
[
1
]
=
obj2
->
winpos_y
;
raw_to_wcs
(
wcs
,
rawpos
,
wcspos
);
obj2
->
winpos_xw
=
wcspos
[
0
];
obj2
->
winpos_yw
=
wcspos
[
1
];
if
(
lng
!=
lat
)
{
wcspos
=
compute_wcs
(
field
,
obj2
->
winpos_x
,
obj2
->
winpos_y
);
obj2
->
winpos_alphas
=
obj2
->
winpos_xw
=
wcspos
[
0
];
obj2
->
winpos_deltas
=
obj2
->
winpos_yw
=
wcspos
[
1
];
obj2
->
winpos_alphas
=
lng
<
lat
?
obj2
->
winpos_xw
:
obj2
->
winpos_yw
;
obj2
->
winpos_deltas
=
lng
<
lat
?
obj2
->
winpos_yw
:
obj2
->
winpos_xw
;
if
(
FLAG
(
obj2
.
winpos_alpha2000
))
{
if
(
fabs
(
a
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
a
s
->
equinox
,
wcspos
[
0
],
wcspos
[
1
],
if
(
fabs
(
wc
s
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
wc
s
->
equinox
,
wcspos
[
0
],
wcspos
[
1
],
2000
.
0
,
&
obj2
->
winpos_alpha2000
,
&
obj2
->
winpos_delta2000
);
else
{
obj2
->
winpos_alpha2000
=
obj2
->
winpos_xw
;
obj2
->
winpos_delta2000
=
obj2
->
winpos_yw
;
obj2
->
winpos_alpha2000
=
lng
<
lat
?
obj2
->
winpos_xw
:
obj2
->
winpos_yw
;
obj2
->
winpos_delta2000
=
lng
<
lat
?
obj2
->
winpos_yw
:
obj2
->
winpos_xw
;
}
if
(
FLAG
(
obj2
.
winpos_alpha1950
))
j2b
(
a
s
->
equinox
,
obj2
->
winpos_alpha2000
,
obj2
->
winpos_delta2000
,
j2b
(
wc
s
->
equinox
,
obj2
->
winpos_alpha2000
,
obj2
->
winpos_delta2000
,
&
obj2
->
winpos_alpha1950
,
&
obj2
->
winpos_delta1950
);
}
}
else
{
double
dx
,
dy
;
}
dx
=
obj2
->
winpos_x
-
as
->
crpix
[
0
];
dy
=
obj2
->
winpos_y
-
as
->
crpix
[
1
];
obj2
->
winpos_xw
=
as
->
crval
[
0
]
+
lm
[
0
]
*
dx
+
lm
[
1
]
*
dy
;
/* CDELT included! */
obj2
->
winpos_yw
=
as
->
crval
[
1
]
+
lm
[
2
]
*
dx
+
lm
[
3
]
*
dy
;
/* CDELT included! */
/* Idem for Model-fitted positions */
if
(
FLAG
(
obj2
.
xw_prof
))
{
rawpos
[
0
]
=
obj2
->
x_prof
;
rawpos
[
1
]
=
obj2
->
y_prof
;
raw_to_wcs
(
wcs
,
rawpos
,
wcspos
);
obj2
->
xw_prof
=
wcspos
[
0
];
obj2
->
yw_prof
=
wcspos
[
1
];
if
(
lng
!=
lat
)
{
obj2
->
alphas_prof
=
lng
<
lat
?
obj2
->
xw_prof
:
obj2
->
yw_prof
;
obj2
->
deltas_prof
=
lng
<
lat
?
obj2
->
yw_prof
:
obj2
->
xw_prof
;
if
(
FLAG
(
obj2
.
alpha2000_prof
))
{
if
(
fabs
(
wcs
->
equinox
-
2000
.
0
)
>
0
.
003
)
precess
(
wcs
->
equinox
,
wcspos
[
0
],
wcspos
[
1
],
2000
.
0
,
&
obj2
->
alpha2000_prof
,
&
obj2
->
delta2000_prof
);
else
{
obj2
->
alpha2000_prof
=
lng
<
lat
?
obj2
->
xw_prof
:
obj2
->
yw_prof
;
obj2
->
delta2000_prof
=
lng
<
lat
?
obj2
->
yw_prof
:
obj2
->
xw_prof
;
}
if
(
FLAG
(
obj2
.
alpha1950_prof
))
j2b
(
wcs
->
equinox
,
obj2
->
alpha2000_prof
,
obj2
->
delta2000_prof
,
&
obj2
->
alpha1950_prof
,
&
obj2
->
delta1950_prof
);
}
}
}
/* Custom coordinate system for the MAMA machine */
if
(
FLAG
(
obj2
.
mamaposx
))
{
double
dx
,
dy
;
rawpos
[
0
]
=
obj2
->
posx
-
0
.
5
;
rawpos
[
1
]
=
obj2
->
posy
-
0
.
5
;
raw_to_wcs
(
wcs
,
rawpos
,
wcspos
);
obj2
->
mamaposx
=
wcspos
[
1
]
*
(
MAMA_CORFLEX
+
1
.
0
);
obj2
->
mamaposy
=
wcspos
[
0
]
*
(
MAMA_CORFLEX
+
1
.
0
);
}
dx
=
obj2
->
posx
-
0
.
5
;
dy
=
obj2
->
posy
-
0
.
5
;
obj2
->
mamaposx
=
(
as
->
crval
[
1
]
+
lm
[
2
]
*
dx
+
lm
[
3
]
*
dy
)
*
(
MAMA_CORFLEX
+
1
.
0
);
/* CDELT included! */
obj2
->
mamaposy
=
(
as
->
crval
[
0
]
+
lm
[
0
]
*
dx
+
lm
[
1
]
*
dy
);
/* CDELT included! */
if
(
FLAG
(
obj2
.
mx2w
)
||
FLAG
(
obj2
.
win_mx2w
)
||
FLAG
(
obj2
.
poserr_mx2w
)
||
FLAG
(
obj2
.
winposerr_mx2w
)
||
FLAG
(
obj2
.
poserrmx2w_prof
)
||
FLAG
(
obj2
.
prof_flagw
)
||
((
!
prefs
.
pixel_scale
)
&&
(
FLAG
(
obj2
.
npixw
)
||
FLAG
(
obj2
.
fdnpixw
)
||
FLAG
(
obj2
.
fwhmw
))))
{
rawpos
[
0
]
=
obj2
->
posx
;
rawpos
[
1
]
=
obj2
->
posy
;
pixscale2
=
wcs_jacobian
(
wcs
,
rawpos
,
obj2
->
jacob
);
}
/* Express shape parameters in WORLD frame */
...
...
@@ -283,134 +262,55 @@ void computeastrom(picstruct *field, objstruct *obj)
astrom_shapeparam
(
field
,
obj
);
if
(
FLAG
(
obj2
.
win_mx2w
))
astrom_winshapeparam
(
field
,
obj
);
if
(
FLAG
(
obj2
.
prof_flagw
))
astrom_profshapeparam
(
field
,
obj
);
/* Express position error parameters in WORLD frame */
if
(
FLAG
(
obj2
.
poserr_mx2w
))
astrom_errparam
(
field
,
obj
);
if
(
FLAG
(
obj2
.
winposerr_mx2w
))
astrom_winerrparam
(
field
,
obj
);
if
(
FLAG
(
obj2
.
poserrmx2w_prof
))
astrom_proferrparam
(
field
,
obj
);
if
(
FLAG
(
obj2
.
npixw
))
obj2
->
npixw
=
obj
->
npix
*
as
->
pixscale
*
as
->
pixscale
;
obj2
->
npixw
=
obj
->
npix
*
(
prefs
.
pixel_scale
?
field
->
pixscale
/
3600
.
0
*
field
->
pixscale
/
3600
.
0
:
pixscale2
);
if
(
FLAG
(
obj2
.
fdnpixw
))
obj2
->
fdnpixw
=
obj
->
fdnpix
*
as
->
pixscale
*
as
->
pixscale
;
obj2
->
fdnpixw
=
obj
->
fdnpix
*
(
prefs
.
pixel_scale
?
field
->
pixscale
/
3600
.
0
*
field
->
pixscale
/
3600
.
0
:
pixscale2
);
if
(
FLAG
(
obj2
.
fwhmw
))
obj2
->
fwhmw
=
obj
->
fwhm
*
as
->
pixscale
;
obj2
->
fwhmw
=
obj
->
fwhm
*
(
prefs
.
pixel_scale
?
field
->
pixscale
/
3600
.
0
:
sqrt
(
pixscale2
));
return
;
}
/****************************** compute_wcs *********************************/
/*
Compute real WORLD coordinates and local distortion matrix according to the
WCS info.
*/
double
*
compute_wcs
(
picstruct
*
field
,
double
mx
,
double
my
)
{
astromstruct
*
as
;
static
double
pixpos
[
NAXIS
],
wcspos
[
NAXIS
],
wcspos0
[
2
],
imgcrd
[
NAXIS
],
phi
,
theta
;
double
*
lm
,
al
,
da
,
de
,
cde
;
int
rcode
,
lng
,
lat
,
naxis
;
as
=
field
->
astrom
;
lm
=
as
->
linmat
;
naxis
=
as
->
naxis
;
lng
=
as
->
lng
;
lat
=
as
->
lat
;
if
(
lng
==
lat
)
{
lng
=
0
;
lat
=
1
;
}
pixpos
[
lng
]
=
mx
;
pixpos
[
lat
]
=
my
;
if
((
rcode
=
wcsrev
((
const
char
(
*
)[
9
])
as
->
ctype
,
as
->
wcs
,
pixpos
,
as
->
lin
,
imgcrd
,
as
->
prj
,
&
phi
,
&
theta
,
as
->
crval
,
as
->
cel
,
wcspos
)))
error
(
EXIT_FAILURE
,
"*Error* in WCSlib: "
,
(
char
*
)
wcsrev_errmsg
[
rcode
]);
/* Compute the local distortion matrix */
al
=
wcspos0
[
lng
<
lat
?
0
:
1
]
=
wcspos
[
lng
];
de
=
wcspos0
[
lng
<
lat
?
1
:
0
]
=
wcspos
[
lat
];
/* Get world coordinates for vector 1,0 */
pixpos
[
lng
]
=
mx
+
1
.
0
;
pixpos
[
lat
]
=
my
;
if
((
rcode
=
wcsrev
((
const
char
(
*
)[
9
])
as
->
ctype
,
as
->
wcs
,
pixpos
,
as
->
lin
,
imgcrd
,
as
->
prj
,
&
phi
,
&
theta
,
as
->
crval
,
as
->
cel
,
wcspos
)))
error
(
EXIT_FAILURE
,
"*Error* in WCSlib: "
,
(
char
*
)
wcsrev_errmsg
[
rcode
]);
da
=
wcspos
[
lng
]
-
al
;
if
(
da
>
180
.
0
)
da
-=
360
.
0
;
else
if
(
da
<-
180
.
0
)
da
+=
360
.
0
;
lm
[
lng
]
=
da
*
(
cde
=
cos
(
de
*
DEG
));
lm
[
lat
]
=
wcspos
[
lat
]
-
de
;
/* Get world coordinates for vector 0,1 */
/* Second one */
pixpos
[
lng
]
=
mx
;
pixpos
[
lat
]
=
my
+
1
.
0
;
if
((
rcode
=
wcsrev
((
const
char
(
*
)[
9
])
as
->
ctype
,
as
->
wcs
,
pixpos
,
as
->
lin
,
imgcrd
,
as
->
prj
,
&
phi
,
&
theta
,
as
->
crval
,
as
->
cel
,
wcspos
)))
error
(
EXIT_FAILURE
,
"*Error* in WCSlib: "
,
(
char
*
)
wcsrev_errmsg
[
rcode
]);
da
=
wcspos
[
lng
]
-
al
;
if
(
da
>
180
.
0
)
da
-=
360
.
0
;
else
if
(
da
<-
180
.
0
)
da
+=
360
.
0
;
lm
[
2
]
=
da
*
cde
;
lm
[
3
]
=
wcspos
[
lat
]
-
de
;
as
->
lindet
=
lm
[
lng
+
lng
*
naxis
]
*
lm
[
lat
+
lat
*
naxis
]
-
lm
[
lng
+
lat
*
naxis
]
*
lm
[
lat
+
lng
*
naxis
];
if
(
as
->
lindet
==
0
.
0
)
warning
(
"Null determinant in the local distortion matrix:
\n
"
,
" Some WORLD-parameters will be incorrect"
);
if
(
prefs
.
pixel_scale
==
0
.
0
)
as
->
pixscale
=
sqrt
(
fabs
(
as
->
lindet
));
return
wcspos0
;
}
/****************************** astrom_shapeparam ****************************/
/*
Compute shape parameters in WORLD and SKY coordinates.
*/
void
astrom_shapeparam
(
picstruct
*
field
,
objstruct
*
obj
)
{
astromstruct
*
as
;
double
*
lm
,
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
wcsstruct
*
wcs
;
double
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
int
lng
,
lat
,
naxis
;
as
=
field
->
astrom
;
lm
=
as
->
linmat
;
naxis
=
as
->
naxis
;
lng
=
as
->
lng
;
lat
=
as
->
lat
;
wcs
=
field
->
wcs
;
naxis
=
wcs
->
naxis
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
if
(
lng
==
lat
)
{
lng
=
0
;
lat
=
1
;
}
lm0
=
lm
[
lng
+
naxis
*
lng
];
lm1
=
lm
[
lat
+
naxis
*
lng
];
lm2
=
lm
[
lng
+
naxis
*
lat
];
lm3
=
lm
[
lat
+
naxis
*
lat
];
lm0
=
obj2
->
jacob
[
lng
+
naxis
*
lng
];
lm1
=
obj2
->
jacob
[
lat
+
naxis
*
lng
];
lm2
=
obj2
->
jacob
[
lng
+
naxis
*
lat
];
lm3
=
obj2
->
jacob
[
lat
+
naxis
*
lat
];
/* All WORLD params based on 2nd order moments have to pass through here */
...
...
@@ -423,36 +323,20 @@ void astrom_shapeparam(picstruct *field, objstruct *obj)
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
thetaw
))
{
obj2
->
thetaw
=
(
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
);
if
(
as
->
wcs_flag
&&
FLAG
(
obj2
.
thetas
))
obj2
->
thetas
=
obj2
->
thetaw
+
(
obj2
->
thetaw
>
0
.
0
?-
90
:
90
.
0
);
obj2
->
thetaw
=
fmod_m90_p90
((
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
/*-- Compute position angles in J2000 or B1950 reference frame */
if
(
a
s
->
wcs
_f
la
g
)
if
(
wc
s
->
lng
!=
wcs
->
la
t
)
{
double
da
,
dd
;
if
(
FLAG
(
obj2
.
thetas
))
obj2
->
thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
thetaw
)
:
obj2
->
thetaw
);
if
(
FLAG
(
obj2
.
theta2000
))
{
da
=
as
->
ap2000
-
obj2
->
alpha2000
;
dd
=
(
sin
(
as
->
dp2000
*
DEG
)
-
sin
(
obj2
->
delta2000
*
DEG
)
*
sin
(
obj2
->
deltas
*
DEG
))
/
(
cos
(
obj2
->
delta2000
*
DEG
)
*
cos
(
obj2
->
deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
theta2000
=
obj2
->
thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
theta2000
=
fmod_m90_p90
(
obj2
->
thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
theta1950
))
{
da
=
as
->
ap1950
-
obj2
->
alpha1950
;
dd
=
(
sin
(
as
->
dp1950
*
DEG
)
-
sin
(
obj2
->
delta1950
*
DEG
)
*
sin
(
obj2
->
deltas
*
DEG
))
/
(
cos
(
obj2
->
delta1950
*
DEG
)
*
cos
(
obj2
->
deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
theta1950
=
obj2
->
thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
theta1950
=
fmod_m90_p90
(
obj2
->
thetas
+
obj2
->
dtheta1950
);
}
}
...
...
@@ -488,26 +372,23 @@ Compute shape parameters in WORLD and SKY coordinates.
*/
void
astrom_winshapeparam
(
picstruct
*
field
,
objstruct
*
obj
)
{
astromstruct
*
as
;
double
*
lm
,
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
wcsstruct
*
wcs
;
double
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
int
lng
,
lat
,
naxis
;
as
=
field
->
astrom
;
lm
=
as
->
linmat
;
naxis
=
as
->
naxis
;
lng
=
as
->
lng
;
lat
=
as
->
lat
;
wcs
=
field
->
wcs
;
naxis
=
wcs
->
naxis
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
if
(
lng
==
lat
)
{
lng
=
0
;
lat
=
1
;
}
lm0
=
lm
[
lng
+
naxis
*
lng
];
lm1
=
lm
[
lat
+
naxis
*
lng
];
lm2
=
lm
[
lng
+
naxis
*
lat
];
lm3
=
lm
[
lat
+
naxis
*
lat
];
lm0
=
obj2
->
jacob
[
lng
+
naxis
*
lng
];
lm1
=
obj2
->
jacob
[
lat
+
naxis
*
lng
];
lm2
=
obj2
->
jacob
[
lng
+
naxis
*
lat
];
lm3
=
obj2
->
jacob
[
lat
+
naxis
*
lat
];
/* All WORLD params based on 2nd order moments have to pass through here */
dx2
=
obj2
->
win_mx2
;
...
...
@@ -519,37 +400,20 @@ void astrom_winshapeparam(picstruct *field, objstruct *obj)
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
win_thetaw
))
{
obj2
->
win_thetaw
=
(
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
);
if
(
as
->
wcs_flag
&&
FLAG
(
obj2
.
win_thetas
))
obj2
->
win_thetas
=
obj2
->
win_thetaw
+
(
obj2
->
win_thetaw
>
0
.
0
?-
90
:
90
.
0
);
obj2
->
win_thetaw
=
fmod_m90_p90
((
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
/*-- Compute position angles in J2000 or B1950 reference frame */
if
(
a
s
->
wcs
_f
la
g
)
if
(
wc
s
->
lng
!=
wcs
->
la
t
)
{
double
da
,
dd
;
if
(
FLAG
(
obj2
.
win_thetas
))
obj2
->
win_thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
win_thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
win_thetaw
)
:
obj2
->
win_thetaw
);
if
(
FLAG
(
obj2
.
win_theta2000
))
{
da
=
as
->
ap2000
-
obj2
->
winpos_alpha2000
;
dd
=
(
sin
(
as
->
dp2000
*
DEG
)
-
sin
(
obj2
->
winpos_delta2000
*
DEG
)
*
sin
(
obj2
->
winpos_deltas
*
DEG
))
/
(
cos
(
obj2
->
winpos_delta2000
*
DEG
)
*
cos
(
obj2
->
winpos_deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
win_theta2000
=
obj2
->
win_thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
win_theta2000
=
fmod_m90_p90
(
obj2
->
win_thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
win_theta1950
))
{
da
=
as
->
ap1950
-
obj2
->
winpos_alpha1950
;
dd
=
(
sin
(
as
->
dp1950
*
DEG
)
-
sin
(
obj2
->
winpos_delta1950
*
DEG
)
*
sin
(
obj2
->
winpos_deltas
*
DEG
))
/
(
cos
(
obj2
->
winpos_delta1950
*
DEG
)
*
cos
(
obj2
->
winpos_deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
win_theta1950
=
obj2
->
win_thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
win_theta1950
=
fmod_m90_p90
(
obj2
->
win_thetas
+
obj2
->
dtheta1950
);
}
}
...
...
@@ -585,26 +449,23 @@ Compute error ellipse parameters in WORLD and SKY coordinates.
*/
void
astrom_errparam
(
picstruct
*
field
,
objstruct
*
obj
)
{
astromstruct
*
as
;
double
*
lm
,
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
wcsstruct
*
wcs
;
double
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
int
lng
,
lat
,
naxis
;
as
=
field
->
astrom
;
lm
=
as
->
linmat
;
naxis
=
as
->
naxis
;
lng
=
as
->
lng
;
lat
=
as
->
lat
;
wcs
=
field
->
wcs
;
naxis
=
wcs
->
naxis
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
if
(
lng
==
lat
)
{
lng
=
0
;
lat
=
1
;
}
lm0
=
lm
[
lng
+
naxis
*
lng
];
lm1
=
lm
[
lat
+
naxis
*
lng
];
lm2
=
lm
[
lng
+
naxis
*
lat
];
lm3
=
lm
[
lat
+
naxis
*
lat
];
lm0
=
obj2
->
jacob
[
lng
+
naxis
*
lng
];
lm1
=
obj2
->
jacob
[
lat
+
naxis
*
lng
];
lm2
=
obj2
->
jacob
[
lng
+
naxis
*
lat
];
lm3
=
obj2
->
jacob
[
lat
+
naxis
*
lat
];
/* All WORLD params based on 2nd order moments have to pass through here */
dx2
=
obj
->
poserr_mx2
;
...
...
@@ -616,37 +477,22 @@ void astrom_errparam(picstruct *field, objstruct *obj)
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
poserr_thetaw
))
{
obj2
->
poserr_thetaw
=
(
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
);
if
(
as
->
wcs_flag
&&
FLAG
(
obj2
.
poserr_thetas
))
obj2
->
poserr_thetas
=
obj2
->
poserr_thetaw
+
(
obj2
->
poserr_thetaw
>
0
.
0
?
-
90
:
90
.
0
);
obj2
->
poserr_thetaw
=
fmod_m90_p90
((
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
/*-- Compute position angles in J2000 or B1950 reference frame */
if
(
a
s
->
wcs
_f
la
g
)
if
(
wc
s
->
lng
!=
wcs
->
la
t
)
{
double
da
,
dd
;
if
(
FLAG
(
obj2
.
poserr_thetas
))
obj2
->
poserr_thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
poserr_thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
poserr_thetaw
)
:
obj2
->
poserr_thetaw
);
if
(
FLAG
(
obj2
.
poserr_theta2000
))
{
da
=
as
->
ap2000
-
obj2
->
alpha2000
;
dd
=
(
sin
(
as
->
dp2000
*
DEG
)
-
sin
(
obj2
->
delta2000
*
DEG
)
*
sin
(
obj2
->
deltas
*
DEG
))
/
(
cos
(
obj2
->
delta2000
*
DEG
)
*
cos
(
obj2
->
deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
poserr_theta2000
=
obj2
->
poserr_thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
poserr_theta2000
=
fmod_m90_p90
(
obj2
->
poserr_thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
poserr_theta1950
))
{
da
=
as
->
ap1950
-
obj2
->
alpha1950
;
dd
=
(
sin
(
as
->
dp1950
*
DEG
)
-
sin
(
obj2
->
delta1950
*
DEG
)
*
sin
(
obj2
->
deltas
*
DEG
))
/
(
cos
(
obj2
->
delta1950
*
DEG
)
*
cos
(
obj2
->
deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
poserr_theta1950
=
obj2
->
poserr_thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
poserr_theta1950
=
fmod_m90_p90
(
obj2
->
poserr_thetas
+
obj2
->
dtheta1950
);
}
}
...
...
@@ -681,26 +527,23 @@ Compute error ellipse parameters in WORLD and SKY coordinates.
*/
void
astrom_winerrparam
(
picstruct
*
field
,
objstruct
*
obj
)
{
astromstruct
*
as
;
double
*
lm
,
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
wcsstruct
*
wcs
;
double
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
int
lng
,
lat
,
naxis
;
as
=
field
->
astrom
;
lm
=
as
->
linmat
;
naxis
=
as
->
naxis
;
lng
=
as
->
lng
;
lat
=
as
->
lat
;
wcs
=
field
->
wcs
;
naxis
=
wcs
->
naxis
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
if
(
lng
==
lat
)
{
lng
=
0
;
lat
=
1
;
}
lm0
=
lm
[
lng
+
naxis
*
lng
];
lm1
=
lm
[
lat
+
naxis
*
lng
];
lm2
=
lm
[
lng
+
naxis
*
lat
];
lm3
=
lm
[
lat
+
naxis
*
lat
];
lm0
=
obj2
->
jacob
[
lng
+
naxis
*
lng
];
lm1
=
obj2
->
jacob
[
lat
+
naxis
*
lng
];
lm2
=
obj2
->
jacob
[
lng
+
naxis
*
lat
];
lm3
=
obj2
->
jacob
[
lat
+
naxis
*
lat
];
/* All WORLD params based on 2nd order moments have to pass through here */
dx2
=
obj2
->
winposerr_mx2
;
...
...
@@ -712,37 +555,22 @@ void astrom_winerrparam(picstruct *field, objstruct *obj)
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
winposerr_thetaw
))
{
obj2
->
winposerr_thetaw
=
(
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
);
if
(
as
->
wcs_flag
&&
FLAG
(
obj2
.
winposerr_thetas
))
obj2
->
winposerr_thetas
=
obj2
->
winposerr_thetaw
+
(
obj2
->
winposerr_thetaw
>
0
.
0
?
-
90
:
90
.
0
);
obj2
->
winposerr_thetaw
=
(
fmod_m90_p90
(
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
/*-- Compute position angles in J2000 or B1950 reference frame */
if
(
a
s
->
wcs
_f
la
g
)
if
(
wc
s
->
lng
!=
wcs
->
la
t
)
{
double
da
,
dd
;
if
(
FLAG
(
obj2
.
winposerr_thetas
))
obj2
->
winposerr_thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
winposerr_thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
winposerr_thetaw
)
:
obj2
->
winposerr_thetaw
);
if
(
FLAG
(
obj2
.
winposerr_theta2000
))
{
da
=
as
->
ap2000
-
obj2
->
winpos_alpha2000
;
dd
=
(
sin
(
as
->
dp2000
*
DEG
)
-
sin
(
obj2
->
winpos_delta2000
*
DEG
)
*
sin
(
obj2
->
winpos_deltas
*
DEG
))
/
(
cos
(
obj2
->
winpos_delta2000
*
DEG
)
*
cos
(
obj2
->
winpos_deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
winposerr_theta2000
=
obj2
->
winposerr_thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
winposerr_theta2000
=
fmod_m90_p90
(
obj2
->
winposerr_thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
winposerr_theta1950
))
{
da
=
as
->
ap1950
-
obj2
->
winpos_alpha1950
;
dd
=
(
sin
(
as
->
dp1950
*
DEG
)
-
sin
(
obj2
->
winpos_delta1950
*
DEG
)
*
sin
(
obj2
->
winpos_deltas
*
DEG
))
/
(
cos
(
obj2
->
winpos_delta1950
*
DEG
)
*
cos
(
obj2
->
winpos_deltas
*
DEG
));
dd
=
dd
<
1
.
0
?
(
dd
>-
1
.
0
?
acos
(
dd
)
/
DEG
:
180
.
0
)
:
0
.
0
;
obj2
->
winposerr_theta1950
=
obj2
->
winposerr_thetas
+
(((
da
>
0
.
0
&&
da
<
180
.
0
)
||
da
<-
180
.
0
)
?-
dd
:
dd
);
}
obj2
->
winposerr_theta1950
=
fmod_m90_p90
(
obj2
->
winposerr_thetas
+
obj2
->
dtheta1950
);
}
}
...
...
@@ -771,184 +599,277 @@ void astrom_winerrparam(picstruct *field, objstruct *obj)
}
/*****************************
** copyastrom ******
***************************/
/*****************************
astrom_proferrparam
***************************/
/*
Co
py astrometrical structur
es.
Co
mpute error ellipse parameters in WORLD and SKY coordinat
es.
*/
void
copyastrom
(
picstruct
*
infield
,
picstruct
*
outfield
)
void
astrom_proferrparam
(
picstruct
*
field
,
objstruct
*
obj
)
{
astromstruct
*
inas
,
*
outas
;
int
naxis
;
wcsstruct
*
wcs
;
double
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
;
int
lng
,
lat
,
naxis
;
if
(
infield
->
astrom
)
wcs
=
field
->
wcs
;
naxis
=
wcs
->
naxis
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
if
(
lng
==
lat
)
{
QMEMCPY
(
infield
->
astrom
,
outfield
->
astrom
,
astromstruct
,
1
);
inas
=
infield
->
astrom
;
outas
=
outfield
->
astrom
;
naxis
=
inas
->
naxis
;
if
(
inas
->
wcs_flag
)
{
QMEMCPY
(
inas
->
wcs
,
outas
->
wcs
,
struct
wcsprm
,
1
);
QMEMCPY
(
inas
->
lin
,
outas
->
lin
,
struct
linprm
,
1
);
QMEMCPY
(
inas
->
cel
,
outas
->
cel
,
struct
celprm
,
1
);
QMEMCPY
(
inas
->
prj
,
outas
->
prj
,
struct
prjprm
,
1
);
QMEMCPY
(
inas
->
lin
->
cdelt
,
outas
->
lin
->
cdelt
,
double
,
naxis
);
QMEMCPY
(
inas
->
lin
->
crpix
,
outas
->
lin
->
crpix
,
double
,
naxis
);
QMEMCPY
(
inas
->
lin
->
pc
,
outas
->
lin
->
pc
,
double
,
naxis
*
naxis
);
outas
->
tnx_lngcor
=
copy_tnxaxis
(
inas
->
tnx_lngcor
);
outas
->
tnx_latcor
=
copy_tnxaxis
(
inas
->
tnx_latcor
);
}
lng
=
0
;
lat
=
1
;
}
lm0
=
obj2
->
jacob
[
lng
+
naxis
*
lng
];
lm1
=
obj2
->
jacob
[
lat
+
naxis
*
lng
];
lm2
=
obj2
->
jacob
[
lng
+
naxis
*
lat
];
lm3
=
obj2
->
jacob
[
lat
+
naxis
*
lat
];
return
;
}
/******************************* endastrom ***********************************/
/*
Free astrometrical structures.
*/
void
endastrom
(
picstruct
*
field
)
/* All WORLD params based on 2nd order moments have to pass through here */
dx2
=
obj2
->
poserrmx2_prof
;
dy2
=
obj2
->
poserrmy2_prof
;
dxy
=
obj2
->
poserrmxy_prof
;
obj2
->
poserrmx2w_prof
=
xm2
=
lm0
*
lm0
*
dx2
+
lm1
*
lm1
*
dy2
+
lm0
*
lm1
*
dxy
;
obj2
->
poserrmy2w_prof
=
ym2
=
lm2
*
lm2
*
dx2
+
lm3
*
lm3
*
dy2
+
lm2
*
lm3
*
dxy
;
obj2
->
poserrmxyw_prof
=
xym
=
lm0
*
lm2
*
dx2
+
lm1
*
lm3
*
dy2
+
(
lm0
*
lm3
+
lm1
*
lm2
)
*
dxy
;
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
poserrthetaw_prof
))
{
obj2
->
poserrthetaw_prof
=
(
fmod_m90_p90
(
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
{
astromstruct
*
as
;
/*-- Compute position angles in J2000 or B1950 reference frame */
if
(
wcs
->
lng
!=
wcs
->
lat
)
{
if
(
FLAG
(
obj2
.
poserrthetas_prof
))
obj2
->
poserrthetas_prof
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
poserrthetaw_prof
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
poserrthetaw_prof
)
:
obj2
->
poserrthetaw_prof
);
if
(
FLAG
(
obj2
.
poserrtheta2000_prof
))
obj2
->
poserrtheta2000_prof
=
fmod_m90_p90
(
obj2
->
poserrthetas_prof
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
poserrtheta1950_prof
))
obj2
->
poserrtheta1950_prof
=
fmod_m90_p90
(
obj2
->
poserrthetas_prof
+
obj2
->
dtheta1950
);
}
}
as
=
field
->
astrom
;
if
(
as
->
wcs_flag
)
if
(
FLAG
(
obj2
.
poserraw_prof
))
{
free
(
as
->
lin
->
cdelt
);
free
(
as
->
lin
->
crpix
);
free
(
as
->
lin
->
pc
);
free
(
as
->
wcs
);
free
(
as
->
lin
);
free
(
as
->
cel
);
free
(
as
->
prj
);
free_tnxaxis
(
as
->
tnx_lngcor
);
free_tnxaxis
(
as
->
tnx_latcor
);
temp
=
sqrt
(
0
.
25
*
temp
*
temp
+
xym
*
xym
);
pm2
=
0
.
5
*
(
xm2
+
ym2
);
obj2
->
poserraw_prof
=
(
float
)
sqrt
(
pm2
+
temp
);
obj2
->
poserrbw_prof
=
(
float
)
sqrt
(
pm2
-
temp
);
}
free
(
as
);
if
(
FLAG
(
obj2
.
poserrcxxw_prof
))
{
/*-- Handle large, fully correlated profiles (can cause a singularity...) */
if
((
temp
=
xm2
*
ym2
-
xym
*
xym
)
<
1e-6
)
{
temp
=
1e-6
;
xym
*=
0
.
99999
;
}
obj2
->
poserrcxxw_prof
=
(
float
)(
ym2
/
temp
);
obj2
->
poserrcyyw_prof
=
(
float
)(
xm2
/
temp
);
obj2
->
poserrcxyw_prof
=
(
float
)(
-
2
*
xym
/
temp
);
}
return
;
}
/***************************
****** precess ********
***************************/
/***************************
astrom_profshapeparam
***************************/
/*
precess equatorial coordinates according to the equinox (from Ephemerides du
Bureau des Longitudes 1992). Epoch for coordinates should be J2000
(FK5 system).
Compute profile-fitting shape parameters in WORLD and SKY coordinates.
*/
void
precess
(
double
yearin
,
double
alphain
,
double
deltain
,
double
yearout
,
double
*
alphaout
,
double
*
deltaout
)
void
astrom_profshapeparam
(
picstruct
*
field
,
objstruct
*
obj
)
{
double
dzeta
,
theta
,
z
,
t1
,
t1t1
,
t2
,
t2t2
,
t2t2t2
,
cddsadz
,
cddcadz
,
cdd
,
sdd
,
adz
,
cdin
,
sdin
,
ct
,
st
,
caindz
;
alphain
*=
DEG
;
deltain
*=
DEG
;
t1
=
(
yearin
-
2000
.
0
)
/
1000
.
0
;
t2
=
(
yearout
-
yearin
)
/
1000
.
0
;
t1t1
=
t1
*
t1
;
t2t2t2
=
(
t2t2
=
t2
*
t2
)
*
t2
;
theta
=
(
97171.735e-06
-
413.691e-06
*
t1
-
1.052e-06
*
t1t1
)
*
t2
+
(
-
206.846e-06
-
1.052e-06
*
t1
)
*
t2t2
-
202.812e-06
*
t2t2t2
;
dzeta
=
(
111808.609e-06
+
677.071e-06
*
t1
-
0.674e-06
*
t1t1
)
*
t2
+
(
146.356e-06
-
1.673e-06
*
t1
)
*
t2t2
+
87.257e-06
*
t2t2t2
;
z
=
(
111808.609e-06
+
677.071e-06
*
t1
-
0.674e-06
*
t1t1
)
*
t2
+
(
530.716e-06
+
0.320e-06
*
t1
)
*
t2t2
+
88.251e-06
*
t2t2t2
;
cddsadz
=
(
cdin
=
cos
(
deltain
))
*
sin
(
alphain
+
dzeta
);
cddcadz
=
-
(
sdin
=
sin
(
deltain
))
*
(
st
=
sin
(
theta
))
+
cdin
*
(
ct
=
cos
(
theta
))
*
(
caindz
=
cos
(
alphain
+
dzeta
));
sdd
=
sdin
*
ct
+
cdin
*
st
*
caindz
;
cdd
=
cos
(
*
deltaout
=
asin
(
sdd
));
adz
=
asin
(
cddsadz
/
cdd
);
if
(
cddcadz
<
0
.
0
)
adz
=
PI
-
adz
;
if
(
adz
<
0
.
0
)
adz
+=
2
.
0
*
PI
;
adz
+=
z
;
*
alphaout
=
adz
/
DEG
;
*
deltaout
/=
DEG
;
return
;
}
wcsstruct
*
wcs
;
double
dx2
,
dy2
,
dxy
,
xm2
,
ym2
,
xym
,
temp
,
pm2
,
lm0
,
lm1
,
lm2
,
lm3
,
ct
,
st
;
int
lng
,
lat
,
naxis
;
/*********************************** j2b *************************************/
/*
conver equatorial coordinates from equinox and epoch J2000 to equinox and
epoch B1950 for extragalactic sources (from Aoki et al. 1983, after
inversion of their matrix and some custom arrangements).
*/
void
j2b
(
double
yearobs
,
double
alphain
,
double
deltain
,
double
*
alphaout
,
double
*
deltaout
)
{
int
i
,
j
;
static
double
a
[
3
]
=
{
-
1.62557e-6
,
-
0.31919e-6
,
-
0.13843e-6
},
ap
[
3
]
=
{
1.245e-3
,
-
1.580e-3
,
-
0.659e-3
},
m
[
6
][
6
]
=
{
{
0
.
9999256794678425
,
0
.
0111
8148281196562
,
0
.
004
859003848996022
,
-
2.423898417033081e-06
,
-
2.710547600126671e-08
,
-
1.177738063266745e-08
},
{
-
0
.
0111
8148272969232
,
0
.
9999374849247641
,
-
2.717708936468247e-05
,
2.710547578707874e-08
,
-
2.423927042585208e-06
,
6.588254898401055e-11
},
{
-
0
.
004
85900399622881
,
-
2.715579322970546e-05
,
0
.
999988194643078
,
1.177738102358923e-08
,
6.582788892816657e-11
,
-
2.424049920613325e-06
},
{
-
0
.
000550
8458576414713
,
0
.
2384844384742432
,
-
0
.
4356144527773499
,
0
.
9999043171308133
,
0
.
0111
8145410120206
,
0
.
004
858518651645554
},
{
-
0
.
2385354433560954
,
-
0
.
002664266
996872802
,
0
.
012252
82765749546
,
-
0
.
0111
8145417187502
,
0
.
9999161290795875
,
-
2.717034576263522e-05
},
{
0
.
4357269351676567
,
-
0
.
00
8536768476441086
,
0
.
0021134207
99663768
,
-
0
.
004
858518477064975
,
-
2.715994547222661e-05
,
0
.
9999668385070383
}},
a1
[
3
],
r
[
3
],
ro
[
3
],
r1
[
3
],
r2
[
3
],
v1
[
3
],
v
[
3
];
static
double
cai
,
sai
,
cdi
,
sdi
,
dotp
,
rmod
,
alpha
,
delta
,
t1
;
/* Convert Julian years from J2000.0 to tropic centuries from B1950.0 */
t1
=
((
yearobs
-
2000
.
0
)
+
(
MJD2000
-
MJD1950
)
/
365
.
25
)
*
JU2TROP
/
100
.
0
;
alphain
*=
DEG
;
deltain
*=
DEG
;
cai
=
cos
(
alphain
);
sai
=
sin
(
alphain
);
cdi
=
cos
(
deltain
);
sdi
=
sin
(
deltain
);
r
[
0
]
=
cdi
*
cai
;
r
[
1
]
=
cdi
*
sai
;
r
[
2
]
=
sdi
;
for
(
i
=
0
;
i
<
3
;
i
++
)
v
[
i
]
=
r2
[
i
]
=
v1
[
i
]
=
0
.
0
;
for
(
j
=
0
;
j
<
6
;
j
++
)
for
(
i
=
0
;
i
<
6
;
i
++
)
if
(
j
<
3
)
r2
[
j
]
+=
m
[
j
][
i
]
*
(
i
<
3
?
r
[
i
]
:
v
[
i
-
3
]);
else
v1
[
j
-
3
]
+=
m
[
j
][
i
]
*
(
i
<
3
?
r
[
i
]
:
v
[
i
-
3
]);
wcs
=
field
->
wcs
;
naxis
=
wcs
->
naxis
;
lng
=
wcs
->
lng
;
lat
=
wcs
->
lat
;
if
(
lng
==
lat
)
{
lng
=
0
;
lat
=
1
;
}
lm0
=
obj2
->
jacob
[
lng
+
naxis
*
lng
];
lm1
=
obj2
->
jacob
[
lat
+
naxis
*
lng
];
lm2
=
obj2
->
jacob
[
lng
+
naxis
*
lat
];
lm3
=
obj2
->
jacob
[
lat
+
naxis
*
lat
];
/* Spheroid World coordinates */
obj2
->
prof_spheroid_thetaerrw
=
obj2
->
prof_spheroid_thetaerr
;
/* quick & dirty*/
if
(
FLAG
(
obj2
.
prof_spheroid_reffw
))
{
ct
=
cos
(
obj2
->
prof_spheroid_theta
*
DEG
);
st
=
sin
(
obj2
->
prof_spheroid_theta
*
DEG
);
dx2
=
obj2
->
prof_spheroid_reff
*
obj2
->
prof_spheroid_reff
*
(
ct
*
ct
+
st
*
st
*
obj2
->
prof_spheroid_aspect
*
obj2
->
prof_spheroid_aspect
);
dy2
=
obj2
->
prof_spheroid_reff
*
obj2
->
prof_spheroid_reff
*
(
st
*
st
+
ct
*
ct
*
obj2
->
prof_spheroid_aspect
*
obj2
->
prof_spheroid_aspect
);
dxy
=
ct
*
st
*
obj2
->
prof_spheroid_reff
*
obj2
->
prof_spheroid_reff
*
(
1
.
0
-
obj2
->
prof_spheroid_aspect
*
obj2
->
prof_spheroid_aspect
);
xm2
=
lm0
*
lm0
*
dx2
+
lm1
*
lm1
*
dy2
+
lm0
*
lm1
*
dxy
;
ym2
=
lm2
*
lm2
*
dx2
+
lm3
*
lm3
*
dy2
+
lm2
*
lm3
*
dxy
;
xym
=
lm0
*
lm2
*
dx2
+
lm1
*
lm3
*
dy2
+
(
lm0
*
lm3
+
lm1
*
lm2
)
*
dxy
;
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
prof_spheroid_thetaw
))
{
obj2
->
prof_spheroid_thetaw
=
fmod_m90_p90
((
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
for
(
i
=
0
;
i
<
3
;
i
++
)
r1
[
i
]
=
r2
[
i
]
+
v1
[
i
]
*
ARCSEC
*
t1
;
if
(
wcs
->
lng
!=
wcs
->
lat
)
{
if
(
FLAG
(
obj2
.
prof_spheroid_thetas
))
obj2
->
prof_spheroid_thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
prof_spheroid_thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
prof_spheroid_thetaw
)
:
obj2
->
prof_spheroid_thetaw
);
if
(
FLAG
(
obj2
.
prof_spheroid_theta2000
))
obj2
->
prof_spheroid_theta2000
=
fmod_m90_p90
(
obj2
->
prof_spheroid_thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
prof_spheroid_theta1950
))
obj2
->
prof_spheroid_theta1950
=
fmod_m90_p90
(
obj2
->
prof_spheroid_thetas
+
obj2
->
dtheta1950
);
}
}
temp
=
sqrt
(
0
.
25
*
temp
*
temp
+
xym
*
xym
);
pm2
=
0
.
5
*
(
xm2
+
ym2
);
obj2
->
prof_spheroid_reffw
=
sqrt
(
pm2
+
temp
);
obj2
->
prof_spheroid_refferrw
=
obj2
->
prof_spheroid_reff
>
0
.
0
?
obj2
->
prof_spheroid_refferr
/
obj2
->
prof_spheroid_reff
*
obj2
->
prof_spheroid_reffw
:
0
.
0
;
obj2
->
prof_spheroid_aspectw
=
obj2
->
prof_spheroid_reffw
>
0
.
0
?
sqrt
(
pm2
-
temp
)
/
obj2
->
prof_spheroid_reffw
:
obj2
->
prof_spheroid_aspect
;
obj2
->
prof_spheroid_aspecterrw
=
obj2
->
prof_spheroid_aspect
>
0
.
0
?
obj2
->
prof_spheroid_aspecterr
/
obj2
->
prof_spheroid_aspect
*
obj2
->
prof_spheroid_aspectw
:
0
.
0
;
}
dotp
=
0
.
0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
/* Disk World coordinates */
obj2
->
prof_disk_thetaerrw
=
obj2
->
prof_disk_thetaerr
;
/* quick & dirty*/
if
(
FLAG
(
obj2
.
prof_disk_scalew
))
{
a1
[
i
]
=
a
[
i
]
+
ap
[
i
]
*
ARCSEC
*
t1
;
dotp
+=
a1
[
i
]
*
(
r1
[
i
]
+
a1
[
i
]);
ct
=
cos
(
obj2
->
prof_disk_theta
*
DEG
);
st
=
sin
(
obj2
->
prof_disk_theta
*
DEG
);
dx2
=
obj2
->
prof_disk_scale
*
obj2
->
prof_disk_scale
*
(
ct
*
ct
+
st
*
st
*
obj2
->
prof_disk_aspect
*
obj2
->
prof_disk_aspect
);
dy2
=
obj2
->
prof_disk_scale
*
obj2
->
prof_disk_scale
*
(
st
*
st
+
ct
*
ct
*
obj2
->
prof_disk_aspect
*
obj2
->
prof_disk_aspect
);
dxy
=
ct
*
st
*
obj2
->
prof_disk_scale
*
obj2
->
prof_disk_scale
*
(
1
.
0
-
obj2
->
prof_disk_aspect
*
obj2
->
prof_disk_aspect
);
xm2
=
lm0
*
lm0
*
dx2
+
lm1
*
lm1
*
dy2
+
lm0
*
lm1
*
dxy
;
ym2
=
lm2
*
lm2
*
dx2
+
lm3
*
lm3
*
dy2
+
lm2
*
lm3
*
dxy
;
xym
=
lm0
*
lm2
*
dx2
+
lm1
*
lm3
*
dy2
+
(
lm0
*
lm3
+
lm1
*
lm2
)
*
dxy
;
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
prof_disk_thetaw
))
{
obj2
->
prof_disk_thetaw
=
fmod_m90_p90
((
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
/*---- Compute position angles in J2000 or B1950 reference frame */
if
(
wcs
->
lng
!=
wcs
->
lat
)
{
if
(
FLAG
(
obj2
.
prof_disk_thetas
))
obj2
->
prof_disk_thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
prof_disk_thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
prof_disk_thetaw
)
:
obj2
->
prof_disk_thetaw
);
if
(
FLAG
(
obj2
.
prof_disk_theta2000
))
obj2
->
prof_disk_theta2000
=
fmod_m90_p90
(
obj2
->
prof_disk_thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
prof_disk_theta1950
))
obj2
->
prof_disk_theta1950
=
fmod_m90_p90
(
obj2
->
prof_disk_thetas
+
obj2
->
dtheta1950
);
}
}
temp
=
sqrt
(
0
.
25
*
temp
*
temp
+
xym
*
xym
);
pm2
=
0
.
5
*
(
xm2
+
ym2
);
obj2
->
prof_disk_scalew
=
sqrt
(
pm2
+
temp
);
obj2
->
prof_disk_scaleerrw
=
obj2
->
prof_disk_scale
>
0
.
0
?
obj2
->
prof_disk_scaleerr
/
obj2
->
prof_disk_scale
*
obj2
->
prof_disk_scalew
:
0
.
0
;
obj2
->
prof_disk_aspectw
=
obj2
->
prof_disk_scalew
>
0
.
0
?
sqrt
(
pm2
-
temp
)
/
obj2
->
prof_disk_scalew
:
obj2
->
prof_disk_aspect
;
obj2
->
prof_disk_aspecterrw
=
obj2
->
prof_disk_aspect
>
0
.
0
?
obj2
->
prof_disk_aspecterr
/
obj2
->
prof_disk_aspect
*
obj2
->
prof_disk_aspectw
:
0
.
0
;
/*-- Arms World coordinates */
if
(
FLAG
(
obj2
.
prof_arms_scalew
))
{
obj2
->
prof_arms_scalew
=
(
obj2
->
prof_disk_scale
>
0
.
0
)
?
obj2
->
prof_arms_scale
*
obj2
->
prof_disk_scalew
/
obj2
->
prof_disk_scale
:
0
.
0
;
obj2
->
prof_arms_scaleerrw
=
(
obj2
->
prof_arms_scale
>
0
.
0
)
?
obj2
->
prof_arms_scaleerr
/
obj2
->
prof_arms_scale
*
obj2
->
prof_arms_scalew
:
0
.
0
;
obj2
->
prof_arms_startw
=
(
obj2
->
prof_disk_scale
>
0
.
0
)
?
obj2
->
prof_arms_start
*
obj2
->
prof_disk_scalew
/
obj2
->
prof_disk_scale
:
0
.
0
;
obj2
->
prof_arms_starterrw
=
(
obj2
->
prof_arms_start
>
0
.
0
)
?
obj2
->
prof_arms_starterr
/
obj2
->
prof_arms_start
*
obj2
->
prof_arms_startw
:
0
.
0
;
}
}
dotp
=
2
.
0
/
(
sqrt
(
1
+
4
.
0
*
dotp
)
+
1
.
0
);
rmod
=
0
.
0
;
for
(
i
=
0
;
i
<
3
;
i
++
)
/* Bar World coordinates */
obj2
->
prof_bar_thetaerrw
=
obj2
->
prof_bar_thetaerr
;
if
(
FLAG
(
obj2
.
prof_bar_lengthw
))
{
ro
[
i
]
=
dotp
*
(
r1
[
i
]
+
a1
[
i
]);
rmod
+=
ro
[
i
]
*
ro
[
i
];
ct
=
cos
(
obj2
->
prof_bar_theta
*
DEG
);
st
=
sin
(
obj2
->
prof_bar_theta
*
DEG
);
dx2
=
obj2
->
prof_bar_length
*
obj2
->
prof_bar_length
*
(
ct
*
ct
+
st
*
st
*
obj2
->
prof_bar_aspect
*
obj2
->
prof_bar_aspect
);
dy2
=
obj2
->
prof_bar_length
*
obj2
->
prof_bar_length
*
(
st
*
st
+
ct
*
ct
*
obj2
->
prof_bar_aspect
*
obj2
->
prof_bar_aspect
);
dxy
=
ct
*
st
*
obj2
->
prof_bar_length
*
obj2
->
prof_bar_length
*
(
1
.
0
-
obj2
->
prof_bar_aspect
*
obj2
->
prof_bar_aspect
);
xm2
=
lm0
*
lm0
*
dx2
+
lm1
*
lm1
*
dy2
+
lm0
*
lm1
*
dxy
;
ym2
=
lm2
*
lm2
*
dx2
+
lm3
*
lm3
*
dy2
+
lm2
*
lm3
*
dxy
;
xym
=
lm0
*
lm2
*
dx2
+
lm1
*
lm3
*
dy2
+
(
lm0
*
lm3
+
lm1
*
lm2
)
*
dxy
;
temp
=
xm2
-
ym2
;
if
(
FLAG
(
obj2
.
prof_bar_thetaw
))
{
obj2
->
prof_bar_thetaw
=
fmod_m90_p90
((
temp
==
0
.
0
)
?
(
45
.
0
)
:
(
0
.
5
*
atan2
(
2
.
0
*
xym
,
temp
)
/
DEG
));
/*---- Compute position angles in J2000 or B1950 reference frame */
if
(
wcs
->
lng
!=
wcs
->
lat
)
{
if
(
FLAG
(
obj2
.
prof_bar_thetas
))
obj2
->
prof_bar_thetas
=
fmod_m90_p90
(
lng
<
lat
?
((
obj2
->
prof_bar_thetaw
>
0
.
0
?
90
:-
90
.
0
)
-
obj2
->
prof_bar_thetaw
)
:
obj2
->
prof_bar_thetaw
);
if
(
FLAG
(
obj2
.
prof_bar_theta2000
))
obj2
->
prof_bar_theta2000
=
fmod_m90_p90
(
obj2
->
prof_bar_thetas
+
obj2
->
dtheta2000
);
if
(
FLAG
(
obj2
.
prof_bar_theta1950
))
obj2
->
prof_bar_theta1950
=
fmod_m90_p90
(
obj2
->
prof_bar_thetas
+
obj2
->
dtheta1950
);
}
}
temp
=
sqrt
(
0
.
25
*
temp
*
temp
+
xym
*
xym
);
pm2
=
0
.
5
*
(
xm2
+
ym2
);
obj2
->
prof_bar_lengthw
=
sqrt
(
pm2
+
temp
);
obj2
->
prof_bar_lengtherrw
=
obj2
->
prof_bar_length
>
0
.
0
?
obj2
->
prof_bar_lengtherr
/
obj2
->
prof_bar_length
*
obj2
->
prof_bar_lengthw
:
0
.
0
;
obj2
->
prof_bar_aspectw
=
obj2
->
prof_bar_lengthw
>
0
.
0
?
sqrt
(
pm2
-
temp
)
/
obj2
->
prof_bar_lengthw
:
obj2
->
prof_bar_aspect
;
obj2
->
prof_bar_aspecterrw
=
obj2
->
prof_bar_aspect
>
0
.
0
?
obj2
->
prof_bar_aspecterr
/
obj2
->
prof_bar_aspect
*
obj2
->
prof_bar_aspectw
:
0
.
0
;
}
rmod
=
sqrt
(
rmod
);
delta
=
asin
(
ro
[
2
]
/
rmod
);
alpha
=
acos
(
ro
[
0
]
/
cos
(
delta
)
/
rmod
);
if
(
ro
[
1
]
<
0
)
alpha
=
2
.
0
*
PI
-
alpha
;
*
alphaout
=
alpha
/
DEG
;
*
deltaout
=
delta
/
DEG
;
return
;
}
...
...
src/astrom.h
View file @
ece261cd
...
...
@@ -9,11 +9,15 @@
*
* Contents: Astrometrical stuff.
*
* Last modify: 1
3
/0
7
/200
6
* Last modify: 1
8
/0
5
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#ifndef _FITSWCS_H_
#include
"fitswcs.h"
#endif
/*----------------------------- Internal constants --------------------------*/
#define DEG (PI/180.0)
/* 1 deg in radians */
...
...
@@ -21,50 +25,17 @@
#define MJD2000 51544.50000
/* Modified Julian date for J2000.0 */
#define MJD1950 33281.92346
/* Modified Julian date for B1950.0 */
#define JU2TROP 1.0000214
/* 1 Julian century in tropical units*/
#define NAXIS 3
/* Max number of FITS axes */
#define MAMA_CORFLEX 3.3e-5
/* MAMA coordinate correction factor */
/*------------------------------- structures --------------------------------*/
typedef
struct
structastrom
{
int
naxis
;
/* Number of image axes */
char
ctype
[
NAXIS
][
9
];
/* FITS CTYPE strings */
char
cunit
[
NAXIS
][
32
];
/* FITS CUNIT strings */
double
crval
[
NAXIS
];
/* FITS CRVAL parameters */
double
cdelt
[
NAXIS
];
/* FITS CDELT parameters */
double
crpix
[
NAXIS
];
/* FITS CRPIX parameters */
double
projp
[
100
*
NAXIS
];
/* FITS PROJP parameters */
double
longpole
,
latpole
;
/* FITS LONGPOLE and LATPOLE */
double
pc
[
NAXIS
*
NAXIS
];
/* FITS PC matrix */
double
linmat
[
NAXIS
*
NAXIS
];
/* Local linear mapping matrix */
double
lindet
;
/* Determinant of the local matrix */
double
pixscale
;
/* (Local) pixel scale */
double
ap2000
,
dp2000
;
/* J2000 coordinates of pole */
double
ap1950
,
dp1950
;
/* B1950 coordinates of pole */
double
equinox
;
/* Equinox of observations */
enum
{
RDSYS_ICRS
,
RDSYS_FK5
,
RDSYS_FK4
,
RDSYS_FK4_NO_E
,
RDSYS_GAPPT
}
radecsys
;
/* FITS RADECSYS reference frame */
int
wcs_flag
;
/* WCSLIB: can it be used? */
int
lat
,
lng
;
/* longitude and latitude axes # */
double
r0
;
/* projection "radius" */
struct
wcsprm
*
wcs
;
/* WCSLIB's wcsprm structure */
struct
linprm
*
lin
;
/* WCSLIB's linprm structure */
struct
celprm
*
cel
;
/* WCSLIB's celprm structure */
struct
prjprm
*
prj
;
/* WCSLIB's prjprm structure */
struct
tnxaxis
*
tnx_latcor
;
/* IRAF's TNX latitude corrections */
struct
tnxaxis
*
tnx_lngcor
;
/* IRAF's TNX longitude corrections */
}
astromstruct
;
/*------------------------------- functions ---------------------------------*/
extern
void
astrom_errparam
(
picstruct
*
,
objstruct
*
),
astrom_winerrparam
(
picstruct
*
,
objstruct
*
),
astrom_proferrparam
(
picstruct
*
,
objstruct
*
),
astrom_profshapeparam
(
picstruct
*
,
objstruct
*
),
astrom_shapeparam
(
picstruct
*
,
objstruct
*
),
astrom_winerrparam
(
picstruct
*
,
objstruct
*
),
astrom_winshapeparam
(
picstruct
*
,
objstruct
*
),
computeastrom
(
picstruct
*
,
objstruct
*
),
copyastrom
(
picstruct
*
infield
,
picstruct
*
outfield
),
endastrom
(
picstruct
*
),
initastrom
(
picstruct
*
),
j2b
(
double
,
double
,
double
,
double
*
,
double
*
),
precess
(
double
,
double
,
double
,
double
,
double
*
,
double
*
);
...
...
src/back.c
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: functions dealing with background computation.
*
* Last modify:
16/08
/200
6
* Last modify:
27/10
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -129,10 +129,10 @@ void makeback(picstruct *field, picstruct *wfield)
/*---- The image is small enough so that we can make exhaustive stats */
if
(
j
==
ny
-
1
&&
field
->
npix
%
bufsize
)
bufsize
=
field
->
npix
%
bufsize
;
read
data
(
field
,
buf
,
bufsize
);
read
_body
(
field
->
tab
,
buf
,
bufsize
);
if
(
wfield
)
{
read
data
(
wfield
,
wbuf
,
bufsize
);
read
_body
(
wfield
->
tab
,
wbuf
,
bufsize
);
weight_to_var
(
wfield
,
wbuf
,
bufsize
);
}
/*---- Build the histograms */
...
...
@@ -185,7 +185,7 @@ void makeback(picstruct *field, picstruct *wfield)
buft
=
buf
;
for
(
i
=
nlines
;
i
--
;
buft
+=
w
)
{
read
data
(
field
,
buft
,
w
);
read
_body
(
field
->
tab
,
buft
,
w
);
if
(
i
)
QFSEEK
(
field
->
file
,
jumpsize
*
(
OFF_T
)
field
->
bytepix
,
SEEK_CUR
,
field
->
filename
);
...
...
@@ -199,7 +199,7 @@ void makeback(picstruct *field, picstruct *wfield)
wbuft
=
wbuf
;
for
(
i
=
nlines
;
i
--
;
wbuft
+=
w
)
{
read
data
(
wfield
,
wbuft
,
w
);
read
_body
(
wfield
->
tab
,
wbuft
,
w
);
weight_to_var
(
wfield
,
wbuft
,
w
);
if
(
i
)
QFSEEK
(
wfield
->
file
,
jumpsize
*
(
OFF_T
)
wfield
->
bytepix
,
SEEK_CUR
,
...
...
@@ -230,10 +230,10 @@ void makeback(picstruct *field, picstruct *wfield)
{
if
(
bufsize2
>
size
)
bufsize2
=
size
;
read
data
(
field
,
buf
,
bufsize2
);
read
_body
(
field
->
tab
,
buf
,
bufsize2
);
if
(
wfield
)
{
read
data
(
wfield
,
wbuf
,
bufsize2
);
read
_body
(
wfield
->
tab
,
wbuf
,
bufsize2
);
weight_to_var
(
wfield
,
wbuf
,
bufsize2
);
}
backhisto
(
backmesh
,
wbackmesh
,
buf
,
wbuf
,
bufsize2
,
nx
,
w
,
bw
,
...
...
@@ -676,21 +676,18 @@ void filterback(picstruct *field)
{
float
*
back
,
*
sigma
,
*
back2
,
*
sigma2
,
*
bmask
,
*
smask
,
*
sigmat
,
d2
,
d2min
,
fthresh
,
med
,
val
,
sval
;
int
i
,
j
,
px
,
py
,
np
,
nx
,
ny
,
npx
m
,
npx
p
,
npy
m
,
npy
p
,
dpx
,
dpy
,
x
,
y
,
nmin
;
int
i
,
j
,
px
,
py
,
np
,
nx
,
ny
,
npx
,
npx
2
,
npy
,
npy
2
,
dpx
,
dpy
,
x
,
y
,
nmin
;
fthresh
=
prefs
.
backfthresh
;
nx
=
field
->
nbackx
;
ny
=
field
->
nbacky
;
np
=
field
->
nback
;
npxm
=
field
->
nbackfx
/
2
;
npxp
=
field
->
nbackfx
-
npxm
;
npym
=
field
->
nbackfy
/
2
;
npyp
=
field
->
nbackfy
-
npym
;
npym
*=
nx
;
npyp
*=
nx
;
QMALLOC
(
bmask
,
float
,
field
->
nbackfx
*
field
->
nbackfy
);
QMALLOC
(
smask
,
float
,
field
->
nbackfx
*
field
->
nbackfy
);
npx
=
field
->
nbackfx
/
2
;
npy
=
field
->
nbackfy
/
2
;
npy
*=
nx
;
QMALLOC
(
bmask
,
float
,
(
2
*
npx
+
1
)
*
(
2
*
npy
+
1
));
QMALLOC
(
smask
,
float
,
(
2
*
npx
+
1
)
*
(
2
*
npy
+
1
));
QMALLOC
(
back2
,
float
,
np
);
QMALLOC
(
sigma2
,
float
,
np
);
...
...
@@ -732,20 +729,30 @@ void filterback(picstruct *field)
/* Do the actual filtering */
for
(
py
=
0
;
py
<
np
;
py
+=
nx
)
{
npy2
=
np
-
py
-
nx
;
if
(
npy2
>
npy
)
npy2
=
npy
;
if
(
npy2
>
py
)
npy2
=
py
;
for
(
px
=
0
;
px
<
nx
;
px
++
)
{
npx2
=
nx
-
px
-
1
;
if
(
npx2
>
npx
)
npx2
=
npx
;
if
(
npx2
>
px
)
npx2
=
px
;
i
=
0
;
for
(
dpy
=
-
npym
;
dpy
<
npyp
;
dpy
+=
nx
)
for
(
dpx
=
-
npxm
;
dpx
<
npxp
;
dpx
++
)
for
(
dpy
=
-
npy2
;
dpy
<=
npy2
;
dpy
+=
nx
)
{
y
=
py
+
dpy
;
for
(
dpx
=
-
npx2
;
dpx
<=
npx2
;
dpx
++
)
{
y
=
py
+
dpy
;
x
=
px
+
dpx
;
if
(
y
>=
0
&&
y
<
np
&&
x
>=
0
&&
x
<
nx
)
{
bmask
[
i
]
=
back
[
x
+
y
];
smask
[
i
++
]
=
sigma
[
x
+
y
];
}
bmask
[
i
]
=
back
[
x
+
y
];
smask
[
i
++
]
=
sigma
[
x
+
y
];
}
}
if
(
fabs
((
med
=
hmedian
(
bmask
,
i
))
-
back
[
px
+
py
])
>=
fthresh
)
{
back2
[
px
+
py
]
=
med
;
...
...
@@ -757,6 +764,7 @@ void filterback(picstruct *field)
sigma2
[
px
+
py
]
=
sigma
[
px
+
py
];
}
}
}
free
(
bmask
);
free
(
smask
);
...
...
src/catout.c
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: functions for output of catalog data.
*
* Last modify:
13
/0
7
/200
6
* Last modify:
25
/0
9
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -103,6 +103,19 @@ void readcatparams(char *filename)
memset
(
&
outobj2
,
0
,
sizeof
(
outobj2
));
updateparamflags
();
return
;
}
/******************************* alloccatparams ******************************/
/*
Allocate memory for parameter arrays
*/
void
alloccatparams
(
void
)
{
keystruct
*
key
;
int
i
;
/* Go back to multi-dimensional arrays for memory allocation */
if
(
thecat
.
nparam
)
for
(
i
=
objtab
->
nkey
,
key
=
objtab
->
key
;
i
--
;
key
=
key
->
nextkey
)
...
...
@@ -120,6 +133,30 @@ void readcatparams(char *filename)
return
;
}
/*************************** changecatparamarrays ****************************/
/*
Change parameter array dimensions
*/
void
changecatparamarrays
(
char
*
keyword
,
int
*
axisn
,
int
naxis
)
{
keystruct
*
key
;
int
d
,
i
,
size
;
if
(
thecat
.
nparam
)
for
(
i
=
objtab
->
nkey
,
key
=
objtab
->
key
;
i
--
;
key
=
key
->
nextkey
)
if
(
key
->
naxis
&&
!
strcmp
(
keyword
,
key
->
name
))
{
size
=
t_size
[
key
->
ttype
];
if
(
key
->
naxis
!=
naxis
)
key
->
naxis
=
naxis
;
for
(
d
=
0
;
d
<
naxis
;
d
++
)
size
*=
(
key
->
naxisn
[
d
]
=
axisn
[
d
]);
key
->
nbytes
=
size
;
break
;
}
return
;
}
/***************************** updateparamflags ******************************/
/*
...
...
@@ -130,6 +167,178 @@ void updateparamflags()
{
int
i
;
/*----------------------------- Model-fitting -----------------------------*/
prefs
.
pattern_flag
|=
FLAG
(
obj2
.
prof_disk_patternvector
)
|
FLAG
(
obj2
.
prof_disk_patternmodvector
)
|
FLAG
(
obj2
.
prof_disk_patternargvector
)
|
FLAG
(
obj2
.
prof_disk_patternspiral
);
FLAG
(
obj2
.
prof_disk_scale
)
|=
prefs
.
pattern_flag
;
FLAG
(
obj2
.
poserraw_prof
)
|=
FLAG
(
obj2
.
poserrbw_prof
);
FLAG
(
obj2
.
poserrcxxw_prof
)
|=
FLAG
(
obj2
.
poserrcyyw_prof
)
|
FLAG
(
obj2
.
poserrcxyw_prof
);
FLAG
(
obj2
.
poserrthetas_prof
)
|=
FLAG
(
obj2
.
poserrtheta1950_prof
)
|
FLAG
(
obj2
.
poserrtheta2000_prof
);
FLAG
(
obj2
.
poserrthetaw_prof
)
|=
FLAG
(
obj2
.
poserrthetas_prof
);
FLAG
(
obj2
.
poserrmx2w_prof
)
|=
FLAG
(
obj2
.
poserrmy2w_prof
)
|
FLAG
(
obj2
.
poserrmxyw_prof
)
|
FLAG
(
obj2
.
poserrthetaw_prof
)
|
FLAG
(
obj2
.
poserraw_prof
)
|
FLAG
(
obj2
.
poserrcxxw_prof
);
FLAG
(
obj2
.
poserra_prof
)
|=
FLAG
(
obj2
.
poserrb_prof
)
|
FLAG
(
obj2
.
poserrtheta_prof
)
|
FLAG
(
obj2
.
poserraw_prof
);
FLAG
(
obj2
.
poserrcxx_prof
)
|=
FLAG
(
obj2
.
poserrcyy_prof
)
|
FLAG
(
obj2
.
poserrcxy_prof
);
FLAG
(
obj2
.
alpha1950_prof
)
|=
FLAG
(
obj2
.
delta1950_prof
)
|
FLAG
(
obj2
.
poserrtheta1950_prof
);
FLAG
(
obj2
.
alpha2000_prof
)
|=
FLAG
(
obj2
.
delta2000_prof
)
|
FLAG
(
obj2
.
alpha1950_prof
)
|
FLAG
(
obj2
.
poserrtheta2000_prof
);
FLAG
(
obj2
.
alphas_prof
)
|=
FLAG
(
obj2
.
deltas_prof
)
|
FLAG
(
obj2
.
alpha2000_prof
);
FLAG
(
obj2
.
xw_prof
)
|=
FLAG
(
obj2
.
yw_prof
)
|
FLAG
(
obj2
.
alphas_prof
);
FLAG
(
obj2
.
x_prof
)
|=
FLAG
(
obj2
.
y_prof
)
|
FLAG
(
obj2
.
xw_prof
)
|
FLAG
(
obj2
.
poserra_prof
)
|
FLAG
(
obj2
.
poserrcxx_prof
);
FLAG
(
obj2
.
mag_prof
)
|=
FLAG
(
obj2
.
magerr_prof
);
FLAG
(
obj2
.
flux_prof
)
|=
FLAG
(
obj2
.
mag_prof
)
|
FLAG
(
obj2
.
fluxerr_prof
);
FLAG
(
obj2
.
prof_spheroid_mag
)
|=
FLAG
(
obj2
.
prof_spheroid_magerr
);
FLAG
(
obj2
.
prof_spheroid_reff
)
|=
FLAG
(
obj2
.
prof_spheroid_refferr
);
FLAG
(
obj2
.
prof_spheroid_aspect
)
|=
FLAG
(
obj2
.
prof_spheroid_aspecterr
);
FLAG
(
obj2
.
prof_spheroid_theta
)
|=
FLAG
(
obj2
.
prof_spheroid_thetaerr
);
FLAG
(
obj2
.
prof_spheroid_sersicn
)
|=
FLAG
(
obj2
.
prof_spheroid_sersicnerr
);
FLAG
(
obj2
.
prof_disk_mag
)
|=
FLAG
(
obj2
.
prof_disk_magerr
);
FLAG
(
obj2
.
prof_disk_scale
)
|=
FLAG
(
obj2
.
prof_disk_scaleerr
);
FLAG
(
obj2
.
prof_disk_aspect
)
|=
FLAG
(
obj2
.
prof_disk_aspecterr
);
FLAG
(
obj2
.
prof_disk_inclination
)
|=
FLAG
(
obj2
.
prof_disk_inclinationerr
);
FLAG
(
obj2
.
prof_disk_theta
)
|=
FLAG
(
obj2
.
prof_disk_thetaerr
);
FLAG
(
obj2
.
prof_bar_mag
)
|=
FLAG
(
obj2
.
prof_bar_magerr
);
FLAG
(
obj2
.
prof_bar_length
)
|=
FLAG
(
obj2
.
prof_bar_lengtherr
);
FLAG
(
obj2
.
prof_bar_aspect
)
|=
FLAG
(
obj2
.
prof_bar_aspecterr
);
FLAG
(
obj2
.
prof_bar_theta
)
|=
FLAG
(
obj2
.
prof_bar_thetaerr
);
FLAG
(
obj2
.
prof_arms_mag
)
|=
FLAG
(
obj2
.
prof_arms_magerr
);
FLAG
(
obj2
.
dtheta1950
)
|=
FLAG
(
obj2
.
prof_spheroid_theta1950
)
|
FLAG
(
obj2
.
prof_disk_theta1950
)
// | FLAG(obj2.prof_arms_theta1950)
|
FLAG
(
obj2
.
prof_bar_theta1950
)
|
FLAG
(
obj2
.
poserrtheta1950_psf
)
|
FLAG
(
obj2
.
win_theta1950
)
|
FLAG
(
obj2
.
winposerr_theta1950
)
|
FLAG
(
obj2
.
poserr_theta1950
)
|
FLAG
(
obj2
.
theta1950
)
|
FLAG
(
obj2
.
poserrtheta1950_prof
);
FLAG
(
obj2
.
dtheta2000
)
|=
FLAG
(
obj2
.
prof_spheroid_theta2000
)
|
FLAG
(
obj2
.
prof_disk_theta2000
)
// | FLAG(obj2.prof_arms_theta2000)
|
FLAG
(
obj2
.
prof_bar_theta2000
)
|
FLAG
(
obj2
.
poserrtheta2000_psf
)
|
FLAG
(
obj2
.
win_theta2000
)
|
FLAG
(
obj2
.
winposerr_theta2000
)
|
FLAG
(
obj2
.
poserr_theta2000
)
|
FLAG
(
obj2
.
theta2000
)
|
FLAG
(
obj2
.
poserrtheta2000_prof
);
FLAG
(
obj2
.
prof_spheroid_thetas
)
|=
FLAG
(
obj2
.
prof_spheroid_theta2000
)
|
FLAG
(
obj2
.
prof_spheroid_theta1950
);
FLAG
(
obj2
.
prof_spheroid_thetaw
)
|=
FLAG
(
obj2
.
prof_spheroid_thetas
);
FLAG
(
obj2
.
prof_disk_thetas
)
|=
FLAG
(
obj2
.
prof_disk_theta2000
)
|
FLAG
(
obj2
.
prof_disk_theta1950
);
FLAG
(
obj2
.
prof_disk_thetaw
)
|=
FLAG
(
obj2
.
prof_disk_thetas
);
FLAG
(
obj2
.
prof_bar_thetas
)
|=
FLAG
(
obj2
.
prof_bar_theta2000
)
|
FLAG
(
obj2
.
prof_bar_theta1950
);
FLAG
(
obj2
.
prof_bar_thetaw
)
|=
FLAG
(
obj2
.
prof_bar_thetas
);
/*
FLAG(obj2.prof_arms_thetaw) |= FLAG(obj2.prof_arms_thetas)
| FLAG(obj2.prof_arms_theta2000)
| FLAG(obj2.prof_arms_theta1950);
*/
FLAG
(
obj2
.
prof_arms_scalew
)
|=
FLAG
(
obj2
.
prof_arms_startw
)
|
FLAG
(
obj2
.
prof_arms_scaleerrw
)
|
FLAG
(
obj2
.
prof_arms_starterrw
);
FLAG
(
obj2
.
prof_bar_lengthw
)
|=
FLAG
(
obj2
.
prof_bar_aspectw
)
|
FLAG
(
obj2
.
prof_bar_thetaw
)
|
FLAG
(
obj2
.
prof_bar_lengtherrw
)
|
FLAG
(
obj2
.
prof_bar_aspecterrw
)
|
FLAG
(
obj2
.
prof_bar_thetaerrw
);
FLAG
(
obj2
.
prof_disk_scalew
)
|=
FLAG
(
obj2
.
prof_disk_aspectw
)
|
FLAG
(
obj2
.
prof_disk_thetaw
)
|
FLAG
(
obj2
.
prof_disk_scaleerrw
)
|
FLAG
(
obj2
.
prof_disk_aspecterrw
)
|
FLAG
(
obj2
.
prof_disk_thetaerrw
)
|
FLAG
(
obj2
.
prof_arms_scalew
);
FLAG
(
obj2
.
prof_spheroid_reffw
)
|=
FLAG
(
obj2
.
prof_spheroid_aspectw
)
|
FLAG
(
obj2
.
prof_spheroid_thetaw
)
|
FLAG
(
obj2
.
prof_spheroid_refferrw
)
|
FLAG
(
obj2
.
prof_spheroid_aspecterrw
)
|
FLAG
(
obj2
.
prof_spheroid_thetaerrw
);
FLAG
(
obj2
.
prof_flagw
)
|=
FLAG
(
obj2
.
prof_spheroid_reffw
)
|
FLAG
(
obj2
.
prof_disk_scalew
)
|
FLAG
(
obj2
.
prof_bar_lengthw
)
|
FLAG
(
obj2
.
prof_arms_scalew
);
FLAG
(
obj2
.
prof_mx2
)
|=
FLAG
(
obj2
.
prof_my2
)
|
FLAG
(
obj2
.
prof_mxy
)
|
FLAG
(
obj2
.
prof_e1
)
|
FLAG
(
obj2
.
prof_e2
)
|
FLAG
(
obj2
.
prof_eps1
)
|
FLAG
(
obj2
.
prof_eps2
);
FLAG
(
obj2
.
prof_arms_flux
)
|=
FLAG
(
obj2
.
prof_arms_fluxerr
)
|
FLAG
(
obj2
.
prof_arms_mag
)
|
FLAG
(
obj2
.
prof_arms_scalew
)
|
FLAG
(
obj2
.
prof_arms_scale
)
|
FLAG
(
obj2
.
prof_arms_posang
)
|
FLAG
(
obj2
.
prof_arms_pitch
)
|
FLAG
(
obj2
.
prof_arms_start
)
|
FLAG
(
obj2
.
prof_arms_quadfrac
);
FLAG
(
obj2
.
prof_bar_theta
)
|=
FLAG
(
obj2
.
prof_bar_lengthw
);
FLAG
(
obj2
.
prof_bar_flux
)
|=
FLAG
(
obj2
.
prof_bar_fluxerr
)
|
FLAG
(
obj2
.
prof_bar_mag
)
|
FLAG
(
obj2
.
prof_bar_lengthw
)
|
FLAG
(
obj2
.
prof_bar_length
)
|
FLAG
(
obj2
.
prof_bar_aspect
)
|
FLAG
(
obj2
.
prof_bar_posang
)
|
FLAG
(
obj2
.
prof_bar_theta
)
|
FLAG
(
obj2
.
prof_arms_flux
);
FLAG
(
obj2
.
prof_disk_flux
)
|=
FLAG
(
obj2
.
prof_disk_fluxerr
)
|
FLAG
(
obj2
.
prof_disk_mag
)
|
FLAG
(
obj2
.
prof_disk_scalew
)
|
FLAG
(
obj2
.
prof_disk_scale
)
|
FLAG
(
obj2
.
prof_disk_aspect
)
|
FLAG
(
obj2
.
prof_disk_inclination
)
|
FLAG
(
obj2
.
prof_disk_theta
)
|
FLAG
(
obj2
.
prof_bar_flux
);
FLAG
(
obj2
.
prof_spheroid_flux
)
|=
FLAG
(
obj2
.
prof_spheroid_fluxerr
)
|
FLAG
(
obj2
.
prof_spheroid_mag
)
|
FLAG
(
obj2
.
prof_spheroid_reffw
)
|
FLAG
(
obj2
.
prof_spheroid_reff
)
|
FLAG
(
obj2
.
prof_spheroid_aspect
)
|
FLAG
(
obj2
.
prof_spheroid_theta
)
|
FLAG
(
obj2
.
prof_spheroid_sersicn
);
prefs
.
prof_flag
|=
FLAG
(
obj2
.
prof_chi2
)
|
FLAG
(
obj2
.
prof_niter
)
|
FLAG
(
obj2
.
prof_vector
)
|
FLAG
(
obj2
.
prof_errvector
)
|
FLAG
(
obj2
.
x_prof
)
|
FLAG
(
obj2
.
y_prof
)
|
FLAG
(
obj2
.
prof_mx2
)
|
FLAG
(
obj2
.
prof_disk_flux
)
|
FLAG
(
obj2
.
prof_spheroid_flux
);
/* If only global parameters are requested, fit a Sersic model */
if
(
prefs
.
prof_flag
&&
!
(
FLAG
(
obj2
.
prof_spheroid_flux
)
|
FLAG
(
obj2
.
prof_disk_flux
)))
{
FLAG
(
obj2
.
prof_spheroid_flux
)
|=
prefs
.
prof_flag
;
FLAG
(
obj2
.
prof_spheroid_sersicn
)
|=
prefs
.
prof_flag
;
}
/*------------------------------ Astrometry ---------------------------------*/
FLAG
(
obj2
.
win_aw
)
|=
FLAG
(
obj2
.
win_bw
)
|
FLAG
(
obj2
.
win_polarw
);
FLAG
(
obj2
.
win_cxxw
)
|=
FLAG
(
obj2
.
win_cyyw
)
|
FLAG
(
obj2
.
win_cxyw
);
...
...
@@ -202,12 +411,12 @@ void updateparamflags()
FLAG
(
obj2
.
peakalpha1950
)
|=
FLAG
(
obj2
.
peakdelta1950
);
FLAG
(
obj2
.
alpha1950
)
|=
FLAG
(
obj2
.
delta1950
)
|
FLAG
(
obj2
.
theta1950
)
|
FLAG
(
obj2
.
poserr_theta1950
);
|
FLAG
(
obj2
.
poserr_theta1950
)
|
FLAG
(
obj2
.
dtheta1950
);
;
FLAG
(
obj2
.
peakalpha2000
)
|=
FLAG
(
obj2
.
peakdelta2000
)
|
FLAG
(
obj2
.
peakalpha1950
);
FLAG
(
obj2
.
alpha2000
)
|=
FLAG
(
obj2
.
delta2000
)
|
FLAG
(
obj2
.
alpha1950
)
|
FLAG
(
obj2
.
theta2000
)
|
FLAG
(
obj2
.
poserr_theta2000
);
|
FLAG
(
obj2
.
dtheta2000
);
FLAG
(
obj2
.
peakalphas
)
|=
FLAG
(
obj2
.
peakdeltas
)
|
FLAG
(
obj2
.
peakalpha2000
);
FLAG
(
obj2
.
alphas
)
|=
FLAG
(
obj2
.
deltas
)
|
FLAG
(
obj2
.
alpha2000
);
FLAG
(
obj2
.
thetas
)
|=
FLAG
(
obj2
.
theta1950
)
|
FLAG
(
obj2
.
theta2000
);
...
...
@@ -239,7 +448,7 @@ void updateparamflags()
FLAG
(
obj2
.
flux_best
)
|=
FLAG
(
obj2
.
mag_best
)
|
FLAG
(
obj2
.
fluxerr_best
);
FLAG
(
obj2
.
hl_radius
)
|=
FLAG
(
obj2
.
winpos_x
);
FLAG
(
obj2
.
hl_radius
)
|=
FLAG
(
obj2
.
winpos_x
)
|
prefs
.
prof_flag
;
FLAG
(
obj2
.
flux_auto
)
|=
FLAG
(
obj2
.
mag_auto
)
|
FLAG
(
obj2
.
magerr_auto
)
|
FLAG
(
obj2
.
fluxerr_auto
)
...
...
@@ -260,9 +469,6 @@ void updateparamflags()
FLAG
(
obj2
.
flux_aper
)
|=
FLAG
(
obj2
.
mag_aper
)
|
FLAG
(
obj2
.
magerr_aper
)
|
FLAG
(
obj2
.
fluxerr_aper
);
FLAG
(
obj
.
flux_prof
)
|=
FLAG
(
obj2
.
mag_prof
)
|
FLAG
(
obj2
.
magerr_prof
)
|
FLAG
(
obj2
.
flux_prof
)
|
FLAG
(
obj2
.
fluxerr_prof
);
FLAG
(
obj2
.
flux_galfit
)
|=
FLAG
(
obj2
.
mag_galfit
)
|
FLAG
(
obj2
.
magerr_galfit
)
|
FLAG
(
obj2
.
fluxerr_galfit
);
...
...
@@ -330,6 +536,26 @@ void updateparamflags()
}
/********************************** dumpparams *******************************/
/*
Initialize the catalog header
*/
void
dumpparams
(
void
)
{
int
i
;
for
(
i
=
0
;
*
objkey
[
i
].
name
;
i
++
)
if
(
*
objkey
[
i
].
unit
)
printf
(
"#%-22.22s %-58.58s [%s]
\n
"
,
objkey
[
i
].
name
,
objkey
[
i
].
comment
,
objkey
[
i
].
unit
);
else
printf
(
"#%-22.22s %-58.58s
\n
"
,
objkey
[
i
].
name
,
objkey
[
i
].
comment
);
return
;
}
/********************************** initcat **********************************/
/*
Initialize the catalog header
...
...
@@ -355,10 +581,10 @@ void initcat(void)
for
(
i
=
0
,
n
=
1
;
i
++<
objtab
->
nkey
;
key
=
key
->
nextkey
)
{
if
(
*
key
->
unit
)
fprintf
(
ascfile
,
"# %3d %-
15.15s %-47.47
s [%s]
\n
"
,
fprintf
(
ascfile
,
"# %3d %-
22.22s %-58.58
s [%s]
\n
"
,
n
,
key
->
name
,
key
->
comment
,
key
->
unit
);
else
fprintf
(
ascfile
,
"# %3d %-
15.15s %.47
s
\n
"
,
fprintf
(
ascfile
,
"# %3d %-
22.22s %-58.58
s
\n
"
,
n
,
key
->
name
,
key
->
comment
);
n
+=
key
->
nbytes
/
t_size
[
key
->
ttype
];
}
...
...
@@ -494,9 +720,9 @@ void reinitcat(picstruct *field)
case
FITS_LDAC
:
/*------ We create a dummy table (only used through its header) */
QCALLOC
(
asctab
,
tabstruct
,
1
);
asctab
->
headnblock
=
field
->
fitsheadsize
/
FBSIZE
;
QM
ALLOC
(
asc
tab
->
headbuf
,
char
,
asctab
->
head
nblock
*
FBSIZE
);
memcpy
(
asctab
->
headbuf
,
field
->
fitshead
,
asctab
->
headnblock
*
FBSIZE
);
asctab
->
headnblock
=
field
->
tab
->
headnblock
;
QM
EMCPY
(
field
->
tab
->
headbuf
,
asctab
->
head
buf
,
char
,
asctab
->
headnblock
*
FBSIZE
);
key
=
headkey
;
while
(
*
key
->
name
)
addkeyto_head
(
asctab
,
key
++
);
...
...
@@ -522,9 +748,9 @@ void reinitcat(picstruct *field)
case
FITS_TPX
:
/*------ We create a dummy table (only used through its header) */
QCALLOC
(
asctab
,
tabstruct
,
1
);
asctab
->
headnblock
=
field
->
fitsheadsize
/
FBSIZE
;
QM
ALLOC
(
asc
tab
->
headbuf
,
char
,
asctab
->
head
nblock
*
FBSIZE
);
memcpy
(
asctab
->
headbuf
,
field
->
fitshead
,
asctab
->
headnblock
*
FBSIZE
);
asctab
->
headnblock
=
field
->
tab
->
headnblock
;
QM
EMCPY
(
field
->
tab
->
headbuf
,
asctab
->
head
buf
,
char
,
asctab
->
headnblock
*
FBSIZE
);
key
=
headkey
;
while
(
*
key
->
name
)
addkeyto_head
(
asctab
,
key
++
);
...
...
@@ -703,8 +929,8 @@ void reendcat()
head
=
key
->
ptr
;
fitswrite
(
head
,
"SEXNDET "
,
&
thecat
.
ndetect
,
H_INT
,
T_LONG
);
fitswrite
(
head
,
"SEXNFIN "
,
&
thecat
.
ntotal
,
H_INT
,
T_LONG
);
fitswrite
(
head
,
"SEXDATE "
,
thecat
.
ext_date
,
H_STRING
,
0
);
fitswrite
(
head
,
"SEXTIME "
,
thecat
.
ext_time
,
H_STRING
,
0
);
fitswrite
(
head
,
"SEXDATE "
,
thecat
.
ext_date
,
H_STRING
,
T_STRING
);
fitswrite
(
head
,
"SEXTIME "
,
thecat
.
ext_time
,
H_STRING
,
T_STRING
);
fitswrite
(
head
,
"SEXELAPS"
,
&
thecat
.
ext_elapsed
,
H_FLOAT
,
T_DOUBLE
);
QFTELL
(
fitscat
->
file
,
pos
,
fitscat
->
filename
);
QFSEEK
(
fitscat
->
file
,
tab
->
headpos
,
SEEK_SET
,
fitscat
->
filename
);
...
...
src/check.c
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: handling of "check-images".
*
* Last modify: 1
5
/0
6
/200
4
* Last modify: 1
7
/0
9
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -26,7 +26,7 @@
#include
"define.h"
#include
"globals.h"
#include
"fits/fitscat.h"
#include
"
astrom
.h"
#include
"
fitswcs
.h"
#include
"check.h"
/********************************* addcheck **********************************/
...
...
@@ -61,8 +61,8 @@ void addcheck(checkstruct *check, float *psf,
}
if
(
xmin
<
0
)
{
psf
+
=
-
xmin
;
w2
-
=
-
xmin
;
psf
-
=
xmin
;
w2
+
=
xmin
;
xmin
=
0
;
}
...
...
@@ -181,7 +181,7 @@ initialize check-image (for subsequent writing).
void
reinitcheck
(
picstruct
*
field
,
checkstruct
*
check
)
{
astrom
struct
*
a
s
;
wcs
struct
*
wc
s
;
char
*
buf
;
int
i
,
ival
;
size_t
padsize
;
...
...
@@ -190,15 +190,14 @@ void reinitcheck(picstruct *field, checkstruct *check)
PIXTYPE
*
ptrf
;
/* Inherit the field FITS header */
check
->
fitsheadsize
=
field
->
fitsheadsize
;
QMALLOC
(
check
->
fitshead
,
char
,
check
->
fitsheadsize
);
memcpy
(
check
->
fitshead
,
field
->
fitshead
,
check
->
fitsheadsize
);
check
->
fitsheadsize
=
field
->
tab
->
headnblock
*
FBSIZE
;
QMEMCPY
(
field
->
tab
->
headbuf
,
check
->
fitshead
,
char
,
check
->
fitsheadsize
);
check
->
y
=
0
;
/* Neutralize possible scaling factors */
dval
=
1
.
0
;
fitswrite
(
check
->
fitshead
,
"BSCALE "
,
&
dval
,
H_FLOAT
,
T_DOUBLE
);
dval
=
0
.
0
;
fitswrite
(
check
->
fitshead
,
"BZERO "
,
&
dval
,
H_FLOAT
,
T_DOUBLE
);
ival
=
1
;
fitswrite
(
check
->
fitshead
,
"BITSGN "
,
&
ival
,
H_INT
,
T_LONG
);
if
(
field
->
compress_type
!=
I
COMPRESS_NONE
)
if
(
field
->
tab
->
compress_type
!=
COMPRESS_NONE
)
fitswrite
(
check
->
fitshead
,
"IMAGECOD"
,
"NONE"
,
H_STRING
,
T_STRING
);
fitswrite
(
check
->
fitshead
,
"ORIGIN "
,
BANNER
,
H_STRING
,
T_STRING
);
...
...
@@ -242,6 +241,9 @@ void reinitcheck(picstruct *field, checkstruct *check)
case
CHECK_SUBPCPROTOS
:
case
CHECK_PCPROTOS
:
case
CHECK_PCOPROTOS
:
case
CHECK_SUBPROFILES
:
case
CHECK_PROFILES
:
case
CHECK_PATTERNS
:
ival
=
-
32
;
fitswrite
(
check
->
fitshead
,
"BITPIX "
,
&
ival
,
H_INT
,
T_LONG
);
check
->
width
=
field
->
width
;
...
...
@@ -289,24 +291,24 @@ void reinitcheck(picstruct *field, checkstruct *check)
check
->
height
=
field
->
nbacky
;
fitswrite
(
check
->
fitshead
,
"NAXIS2 "
,
&
check
->
height
,
H_INT
,
T_LONG
);
/*---- Scale the WCS information if present */
if
((
a
s
=
field
->
astrom
))
if
((
wc
s
=
field
->
wcs
))
{
dval
=
a
s
->
cdelt
[
0
]
*
field
->
backw
;
dval
=
wc
s
->
cdelt
[
0
]
*
field
->
backw
;
fitswrite
(
check
->
fitshead
,
"CDELT1 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
a
s
->
cdelt
[
1
]
*
field
->
backh
;
dval
=
wc
s
->
cdelt
[
1
]
*
field
->
backh
;
fitswrite
(
check
->
fitshead
,
"CDELT2 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
(
a
s
->
crpix
[
0
]
-
0
.
5
)
/
field
->
backw
+
0
.
5
;
dval
=
(
wc
s
->
crpix
[
0
]
-
0
.
5
)
/
field
->
backw
+
0
.
5
;
fitswrite
(
check
->
fitshead
,
"CRPIX1 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
(
a
s
->
crpix
[
1
]
-
0
.
5
)
/
field
->
backh
+
0
.
5
;
dval
=
(
wc
s
->
crpix
[
1
]
-
0
.
5
)
/
field
->
backh
+
0
.
5
;
fitswrite
(
check
->
fitshead
,
"CRPIX2 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
as
->
pc
[
0
]
*
a
s
->
cd
elt
[
0
]
*
field
->
backw
;
dval
=
wc
s
->
cd
[
0
]
*
field
->
backw
;
fitswrite
(
check
->
fitshead
,
"CD1_1 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
as
->
pc
[
1
]
*
a
s
->
cd
elt
[
1
]
*
field
->
backh
;
dval
=
wc
s
->
cd
[
1
]
*
field
->
backh
;
fitswrite
(
check
->
fitshead
,
"CD1_2 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
a
s
->
pc
[
2
]
*
as
->
cdelt
[
0
]
*
field
->
backw
;
dval
=
wc
s
->
cd
[
wcs
->
naxis
]
*
field
->
backw
;
fitswrite
(
check
->
fitshead
,
"CD2_1 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
dval
=
a
s
->
pc
[
3
]
*
as
->
cdelt
[
1
]
*
field
->
backh
;
dval
=
wc
s
->
cd
[
wcs
->
naxis
+
1
]
*
field
->
backh
;
fitswrite
(
check
->
fitshead
,
"CD2_2 "
,
&
dval
,
H_EXPO
,
T_DOUBLE
);
}
check
->
npix
=
check
->
width
*
check
->
height
;
...
...
@@ -348,7 +350,7 @@ void reinitcheck(picstruct *field, checkstruct *check)
break
;
default:
error
(
EXIT_FAILURE
,
"*Internal Error* in "
,
"initcheck()!"
);
error
(
EXIT_FAILURE
,
"*Internal Error* in "
,
"
re
initcheck()!"
);
}
return
;
...
...
@@ -363,7 +365,8 @@ void writecheck(checkstruct *check, PIXTYPE *data, int w)
{
if
(
check
->
type
==
CHECK_APERTURES
||
check
->
type
==
CHECK_SUBPSFPROTOS
||
check
->
type
==
CHECK_SUBPCPROTOS
||
check
->
type
==
CHECK_PCOPROTOS
)
||
check
->
type
==
CHECK_SUBPCPROTOS
||
check
->
type
==
CHECK_PCOPROTOS
||
check
->
type
==
CHECK_SUBPROFILES
)
{
memcpy
((
PIXTYPE
*
)
check
->
pix
+
w
*
(
check
->
y
++
),
data
,
w
*
sizeof
(
PIXTYPE
));
return
;
...
...
@@ -424,7 +427,10 @@ void reendcheck(picstruct *field, checkstruct *check)
case
CHECK_SUBPCPROTOS
:
case
CHECK_PCPROTOS
:
case
CHECK_PCOPROTOS
:
case
CHECK_SUBPROFILES
:
case
CHECK_PROFILES
:
case
CHECK_ASSOC
:
case
CHECK_PATTERNS
:
if
(
bswapflag
)
swapbytes
(
check
->
pix
,
sizeof
(
PIXTYPE
),
(
int
)
check
->
npix
);
QFWRITE
(
check
->
pix
,
check
->
npix
*
sizeof
(
PIXTYPE
),
...
...
src/check.h
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: handling of "check-images".
*
* Last modify: 1
5/12
/200
2
* Last modify: 1
8/09
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -23,7 +23,7 @@ typedef struct structcheck
char
*
fitshead
;
/* ptr to check-image FITS header */
int
fitsheadsize
;
/* size of check-image FITS header */
void
*
pix
;
/* ptr to check-image pixmap */
int
width
,
height
;
/* size of check-image */
int
width
,
height
,
depth
;
/* size of check-image */
size_t
npix
;
/* number of pixels in check-image */
int
y
;
/* current line in check-image */
PIXTYPE
overlay
;
/* intensity of the overlayed plots */
...
...
src/clean.c
View file @
ece261cd
...
...
@@ -10,7 +10,7 @@
* Contents: functions that remove spurious detections from the
* catalog
*
* Last modify:
15
/0
2
/200
5
* Last modify:
20
/0
6
/200
7
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -250,15 +250,6 @@ void mergeobject(objstruct *objslave,objstruct *objmaster)
*
pix
=
colormaster
;
}
if
(
FLAG
(
obj
.
flux_prof
))
{
objmaster
->
flux_prof
=
(
objmaster
->
flux_prof
*
objmaster
->
fdflux
+
objslave
->
flux_prof
*
objslave
->
fdflux
)
/
(
objmaster
->
fdflux
+
objslave
->
fdflux
);
objmaster
->
fluxerr_prof
=
(
objmaster
->
fluxerr_prof
*
objmaster
->
fdflux
+
objslave
->
fluxerr_prof
*
objslave
->
fdflux
)
/
(
objmaster
->
fdflux
+
objslave
->
fdflux
);
}
objmaster
->
fdnpix
+=
objslave
->
fdnpix
;
objmaster
->
dnpix
+=
objslave
->
dnpix
;
objmaster
->
fdflux
+=
objslave
->
fdflux
;
...
...
src/define.h
View file @
ece261cd
...
...
@@ -9,7 +9,7 @@
*
* Contents: global definitions.
*
* Last modify: 1
2/07
/200
6
* Last modify: 1
4/11
/200
8
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
...
...
@@ -24,12 +24,14 @@
/*------------------------ what, who, when and where ------------------------*/
#define BANNER "SExtractor"
#define EXECUTABLE "sex"
//#ifdef USE_THREADS
//#define MYVERSION VERSION "-MP"
//#else
#define MYVERSION VERSION
#define COPYRIGHT "Emmanuel BERTIN (bertin@iap.fr)"
//#endif
#define EXECUTABLE "sex"
#define COPYRIGHT "Emmanuel BERTIN <bertin@iap.fr>"
#define WEBSITE "http://terapix.iap.fr/soft/sextractor"
#define MAILINGLIST "sextractor@iap.fr"
#define MAILINGLISTREQ "sextractor-request@iap.fr"
#define INSTITUTE "TERAPIX team at IAP http://terapix.iap.fr"
/*--------------------------- Internal constants ----------------------------*/
...
...
@@ -40,7 +42,6 @@
#define MARGIN_SCALE 2.0
/* Margin / object height */
#define MAXCHAR 512
/* max. number of characters */
#define MAXCHARL 16384
/* max.nb of chars in strlist*/
#define MAXCHECK 32
/* max. # of CHECKimages */
#define MAXDEBAREA 3
/* max. area for deblending */
#define MAXFLAG 4
/* max. # of FLAG-images */
#define MAXIMAGE 2
/* max. # of input images */
...
...
@@ -48,9 +49,10 @@
#define MAXNASSOC 32
/* max. number of assoc. */
#define MAXPICSIZE 1048576
/* max. image size */
#define NISO 8
/* number of isophotes */
#define OUTPUT std
out
/* where all msgs are sent */
#define OUTPUT std
err
/* where all msgs are sent */
#define PSF_NPSFMAX 9
/* Max number of fitted PSFs */
#define DEG (PI/180.0)
/* 1 deg in radians */
#ifndef PI
#define PI 3.1415926535898
/* never met before? */
#endif
...
...
src/fft.c
0 → 100644
View file @
ece261cd
/*
fft.c
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*
* Part of: A program that uses FFTs
*
* Author: E.BERTIN (IAP)
*
* Contents: Routines dealing with double precision FFT.
*
* Last modify: 26/03/2007
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<math.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<fftw3.h>
#include
"define.h"
#include
"globals.h"
#include
"fft.h"
#include
"prefs.h"
#ifdef USE_THREADS
#include
"threads.h"
#endif
int
firsttimeflag
;
#ifdef USE_THREADS
pthread_mutex_t
fftmutex
;
#endif
#define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
/****** fft_init ************************************************************
PROTO void fft_init(void)
PURPOSE Initialize the FFT routines
INPUT -.
OUTPUT -.
NOTES Global preferences are used for multhreading.
AUTHOR E. Bertin (IAP)
VERSION 29/11/2006
***/
void
fft_init
(
void
)
{
if
(
!
firsttimeflag
)
{
#ifdef USE_THREADS
if
(
!
fftw_init_threads
())
error
(
EXIT_FAILURE
,
"*Error*: thread initialization failed in "
,
"FFTW"
);
fftw_plan_with_nthreads
(
prefs
.
nthreads
);
QPTHREAD_MUTEX_INIT
(
&
fftmutex
,
NULL
);
#endif
firsttimeflag
=
1
;
}
return
;
}
/****** fft_end ************************************************************
PROTO void fft_init(void)
PURPOSE Clear up stuff set by FFT routines
INPUT -.
OUTPUT -.
NOTES -.
AUTHOR E. Bertin (IAP)
VERSION 29/11/2006
***/
void
fft_end
(
void
)
{
if
(
firsttimeflag
)
{
firsttimeflag
=
0
;
#ifdef USE_THREADS
fftw_cleanup_threads
();
QPTHREAD_MUTEX_DESTROY
(
&
fftmutex
);
#endif
fftw_cleanup
();
}
return
;
}
/****** fft_conv ************************************************************
PROTO void fft_conv(double *data1, double *fdata2, int *size)
PURPOSE Optimized 2-dimensional FFT convolution using the FFTW library.
INPUT ptr to the first image,
ptr to the Fourier transform of the second image,
image size vector.
OUTPUT -.
NOTES For data1 and fdata2, memory must be allocated for
size[0]* ... * 2*(size[naxis-1]/2+1) doubles (padding required).
AUTHOR E. Bertin (IAP)
VERSION 26/03/2007
***/
void
fft_conv
(
double
*
data1
,
double
*
fdata2
,
int
*
size
)
{
fftw_plan
plan
;
double
*
fdata1
,
*
fdata1p
,
*
fdata2p
,
real
,
imag
,
fac
;
int
i
,
npix
,
npix2
;
/* Convert axis indexing to that of FFTW */
npix
=
size
[
0
]
*
size
[
1
];
npix2
=
(((
size
[
0
]
/
2
)
+
1
)
*
2
)
*
size
[
1
];
/* Forward FFT "in place" for data1 */
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK
(
&
fftmutex
);
#endif
QFFTWMALLOC
(
fdata1
,
double
,
npix2
);
plan
=
fftw_plan_dft_r2c_2d
(
size
[
1
],
size
[
0
],
data1
,
(
fftw_complex
*
)
fdata1
,
FFTW_ESTIMATE
|
FFTW_DESTROY_INPUT
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK
(
&
fftmutex
);
#endif
fftw_execute
(
plan
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK
(
&
fftmutex
);
#endif
fftw_destroy_plan
(
plan
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK
(
&
fftmutex
);
#endif
/* Actual convolution (Fourier product) */
fac
=
1
.
0
/
npix
;
fdata1p
=
fdata1
;
fdata2p
=
fdata2
;
for
(
i
=
npix2
/
2
;
i
--
;
fdata2p
+=
2
)
{
real
=
*
fdata1p
**
fdata2p
-
*
(
fdata1p
+
1
)
**
(
fdata2p
+
1
);
imag
=
*
(
fdata1p
+
1
)
**
fdata2p
+
*
fdata1p
**
(
fdata2p
+
1
);
*
(
fdata1p
++
)
=
fac
*
real
;
*
(
fdata1p
++
)
=
fac
*
imag
;
}
/* Reverse FFT */
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK
(
&
fftmutex
);
#endif
plan
=
fftw_plan_dft_c2r_2d
(
size
[
1
],
size
[
0
],
(
fftw_complex
*
)
fdata1
,
data1
,
FFTW_ESTIMATE
|
FFTW_DESTROY_INPUT
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK
(
&
fftmutex
);
#endif
fftw_execute
(
plan
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK
(
&
fftmutex
);
#endif
fftw_destroy_plan
(
plan
);
/* Free the fdata1 scratch array */
QFFTWFREE
(
fdata1
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK
(
&
fftmutex
);
#endif
return
;
}
/****** fft_rtf ************************************************************
PROTO double *fft_rtf(double *data, int *size)
PURPOSE Optimized 2-dimensional FFT "in place" using the FFTW library.
INPUT ptr to the image,
ptr to image size vector.
OUTPUT Pointer to the compressed, memory-allocated Fourier transform.
NOTES Input data may end up corrupted.
AUTHOR E. Bertin (IAP)
VERSION 26/03/2007
***/
double
*
fft_rtf
(
double
*
data
,
int
*
size
)
{
fftw_plan
plan
;
fftw_complex
*
fdata
;
int
npix2
;
/* Convert axis indexing to that of FFTW */
npix2
=
((
size
[
0
]
/
2
)
+
1
)
*
size
[
1
];
/* Forward FFT "in place" for data1 */
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK
(
&
fftmutex
);
#endif
QFFTWMALLOC
(
fdata
,
fftw_complex
,
npix2
);
plan
=
fftw_plan_dft_r2c_2d
(
size
[
1
],
size
[
0
],
data
,
fdata
,
FFTW_ESTIMATE
|
FFTW_DESTROY_INPUT
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK
(
&
fftmutex
);
#endif
fftw_execute
(
plan
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_LOCK
(
&
fftmutex
);
#endif
fftw_destroy_plan
(
plan
);
#ifdef USE_THREADS
QPTHREAD_MUTEX_UNLOCK
(
&
fftmutex
);
#endif
return
(
double
*
)
fdata
;
}
Prev
1
2
3
4
5
6
7
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment