[cpl-plugin-fors] 01/03: Remove sextractor subdir to easy copyright and make src smaller
Ole Streicher
olebole-guest at moszumanska.debian.org
Wed Dec 4 08:03:00 UTC 2013
This is an automated email from the git hooks/post-receive script.
olebole-guest pushed a commit to branch debian
in repository cpl-plugin-fors.
commit edb8b8d4c1938610ec552f3b3d5fe31bd66d45ad
Author: Ole Streicher <debian at liska.ath.cx>
Date: Wed Dec 4 08:53:39 2013 +0100
Remove sextractor subdir to easy copyright and make src smaller
---
sextractor/AUTHORS | 1 -
sextractor/BUGS | 7 -
sextractor/COPYING | 358 --
sextractor/ChangeLog | 568 ---
sextractor/HISTORY | 113 -
sextractor/INSTALL | 59 -
sextractor/Makefile.am | 27 -
sextractor/Makefile.in | 757 ----
sextractor/README | 32 -
sextractor/THANKS | 21 -
sextractor/aclocal.m4 | 973 -----
sextractor/acx_prog_cc_optim.m4 | 87 -
sextractor/autoconf/depcomp | 707 ----
sextractor/autoconf/install-sh | 527 ---
sextractor/autoconf/missing | 330 --
sextractor/config.h.in | 165 -
sextractor/config/README | 29 -
sextractor/config/block_3x3.conv | 5 -
sextractor/config/default.conv | 5 -
sextractor/config/default.nnw | 28 -
sextractor/config/default.param | 124 -
sextractor/config/default.sex | 75 -
sextractor/config/gauss_1.5_3x3.conv | 5 -
sextractor/config/gauss_2.0_3x3.conv | 6 -
sextractor/config/gauss_2.0_5x5.conv | 7 -
sextractor/config/gauss_2.5_5x5.conv | 7 -
sextractor/config/gauss_3.0_5x5.conv | 7 -
sextractor/config/gauss_3.0_7x7.conv | 9 -
sextractor/config/gauss_4.0_7x7.conv | 9 -
sextractor/config/gauss_5.0_9x9.conv | 11 -
sextractor/config/mexhat_1.5_5x5.conv | 7 -
sextractor/config/mexhat_2.0_7x7.conv | 9 -
sextractor/config/mexhat_2.5_7x7.conv | 9 -
sextractor/config/mexhat_3.0_9x9.conv | 11 -
sextractor/config/mexhat_4.0_9x9.conv | 11 -
sextractor/config/mexhat_5.0_11x11.conv | 13 -
sextractor/config/tophat_1.5_3x3.conv | 5 -
sextractor/config/tophat_2.0_3x3.conv | 5 -
sextractor/config/tophat_2.5_3x3.conv | 5 -
sextractor/config/tophat_3.0_3x3.conv | 5 -
sextractor/config/tophat_4.0_5x5.conv | 7 -
sextractor/config/tophat_5.0_5x5.conv | 7 -
sextractor/configure | 6636 -------------------------------
sextractor/configure.ac | 146 -
sextractor/doc/README.DOC | 10 -
sextractor/doc/SE_Handbook.4.pdf | Bin 914489 -> 0 bytes
sextractor/doc/sextractor.pdf | Bin 432561 -> 0 bytes
sextractor/man/Makefile.am | 3 -
sextractor/man/Makefile.in | 353 --
sextractor/man/sex.1.in | 47 -
sextractor/sextractor-tpx.spec.in | 56 -
sextractor/sextractor.spec.in | 60 -
sextractor/src/Makefile.am | 19 -
sextractor/src/Makefile.in | 690 ----
sextractor/src/analyse.c | 733 ----
sextractor/src/assoc.c | 372 --
sextractor/src/assoc.h | 41 -
sextractor/src/astrom.c | 955 -----
sextractor/src/astrom.h | 72 -
sextractor/src/back.c | 1302 ------
sextractor/src/back.h | 59 -
sextractor/src/bpro.c | 138 -
sextractor/src/bpro.h | 45 -
sextractor/src/catout.c | 735 ----
sextractor/src/check.c | 491 ---
sextractor/src/check.h | 43 -
sextractor/src/clean.c | 322 --
sextractor/src/clean.h | 36 -
sextractor/src/define.h | 196 -
sextractor/src/extract.c | 354 --
sextractor/src/extract.h | 50 -
sextractor/src/field.c | 213 -
sextractor/src/field.h | 27 -
sextractor/src/filter.c | 399 --
sextractor/src/filter.h | 47 -
sextractor/src/fits/Makefile.am | 7 -
sextractor/src/fits/Makefile.in | 483 ---
sextractor/src/fits/fitsbody.c | 655 ---
sextractor/src/fits/fitscat.c | 403 --
sextractor/src/fits/fitscat.h | 312 --
sextractor/src/fits/fitscat_defs.h | 144 -
sextractor/src/fits/fitscheck.c | 324 --
sextractor/src/fits/fitscleanup.c | 205 -
sextractor/src/fits/fitsconv.c | 192 -
sextractor/src/fits/fitshead.c | 832 ----
sextractor/src/fits/fitskey.c | 952 -----
sextractor/src/fits/fitsmisc.c | 236 --
sextractor/src/fits/fitsread.c | 251 --
sextractor/src/fits/fitstab.c | 728 ----
sextractor/src/fits/fitsutil.c | 578 ---
sextractor/src/fits/fitswrite.c | 535 ---
sextractor/src/flag.c | 228 --
sextractor/src/flag.h | 25 -
sextractor/src/globals.h | 86 -
sextractor/src/graph.c | 158 -
sextractor/src/growth.c | 359 --
sextractor/src/growth.h | 36 -
sextractor/src/image.c | 643 ---
sextractor/src/image.h | 42 -
sextractor/src/interpolate.c | 125 -
sextractor/src/interpolate.h | 24 -
sextractor/src/key.h | 42 -
sextractor/src/main.c | 128 -
sextractor/src/makeit.c | 502 ---
sextractor/src/manobjlist.c | 113 -
sextractor/src/misc.c | 72 -
sextractor/src/neurro.c | 188 -
sextractor/src/neurro.h | 40 -
sextractor/src/param.h | 873 ----
sextractor/src/pc.c | 478 ---
sextractor/src/photom.c | 913 -----
sextractor/src/photom.h | 42 -
sextractor/src/plist.c | 216 -
sextractor/src/plist.h | 49 -
sextractor/src/poly.c | 350 --
sextractor/src/poly.h | 47 -
sextractor/src/preflist.h | 286 --
sextractor/src/prefs.c | 600 ---
sextractor/src/prefs.h | 217 -
sextractor/src/psf.c | 1594 --------
sextractor/src/psf.h | 130 -
sextractor/src/readimage.c | 872 ----
sextractor/src/refine.c | 340 --
sextractor/src/retina.c | 119 -
sextractor/src/retina.h | 35 -
sextractor/src/scan.c | 954 -----
sextractor/src/sexhead.h | 119 -
sextractor/src/sexhead1.h | 137 -
sextractor/src/sexheadsc.h | 27 -
sextractor/src/som.c | 692 ----
sextractor/src/som.h | 79 -
sextractor/src/types.h | 413 --
sextractor/src/wcs/Makefile.am | 7 -
sextractor/src/wcs/Makefile.in | 477 ---
sextractor/src/wcs/cel.c | 589 ---
sextractor/src/wcs/cel.h | 90 -
sextractor/src/wcs/lin.c | 424 --
sextractor/src/wcs/lin.h | 76 -
sextractor/src/wcs/poly.c | 914 -----
sextractor/src/wcs/poly.h | 58 -
sextractor/src/wcs/proj.c | 3808 ------------------
sextractor/src/wcs/proj.h | 171 -
sextractor/src/wcs/sph.c | 230 --
sextractor/src/wcs/sph.h | 54 -
sextractor/src/wcs/tnx.c | 291 --
sextractor/src/wcs/tnx.h | 61 -
sextractor/src/wcs/wcs.c | 1271 ------
sextractor/src/wcs/wcs.h | 111 -
sextractor/src/wcs/wcsmath.h | 61 -
sextractor/src/wcs/wcstrig.c | 198 -
sextractor/src/wcs/wcstrig.h | 79 -
sextractor/src/weight.c | 126 -
sextractor/src/weight.h | 24 -
sextractor/src/winpos.c | 388 --
sextractor/src/winpos.h | 33 -
sextractor/src/xml.c | 799 ----
sextractor/src/xml.h | 65 -
157 files changed, 49438 deletions(-)
diff --git a/sextractor/AUTHORS b/sextractor/AUTHORS
deleted file mode 100644
index 69b269a..0000000
--- a/sextractor/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Emmanuel Bertin <bertin at iap.fr> : SExtractor code and FITS library
diff --git a/sextractor/BUGS b/sextractor/BUGS
deleted file mode 100644
index f8e2746..0000000
--- a/sextractor/BUGS
+++ /dev/null
@@ -1,7 +0,0 @@
-V2.5 (2006-07-14)
-COOSYS epoch and system are not set to the proper values in ASCII_VOTABLE
-catalogs.
-V2.3 (2002-12-17)
-ASSOC options do not work properly with MEF images (this is not really a bug).
-
- Emmanuel Bertin <bertin at iap.fr>
diff --git a/sextractor/COPYING b/sextractor/COPYING
deleted file mode 100644
index 03afa73..0000000
--- a/sextractor/COPYING
+++ /dev/null
@@ -1,358 +0,0 @@
-GNU GENERAL PUBLIC LICENSE
-**************************
-
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-Preamble
-========
-
-The licenses for most software are designed to take away your freedom
-to share and change it. By contrast, the GNU General Public License is
-intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.
-Our General Public Licenses are designed to make sure that you have
-the freedom to distribute copies of free software (and charge for this
-service if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs; and that you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone
-to deny you these rights or to ask you to surrender the rights. These
-restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis
-or for a fee, you must give the recipients all the rights that you
-have. You must make sure that they, too, receive or can get the source
-code. And you must show them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-Finally, any free program is threatened constantly by software patents.
-We wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program
-proprietary. To prevent this, we have made it clear that any patent
-must be licensed for everyone's free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
-
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains a
- notice placed by the copyright holder saying it may be distributed
- under the terms of this General Public License. The "Program",
- below, refers to any such program or work, and a "work based on
- the Program" means either the Program or any derivative work under
- copyright law: that is to say, a work containing the Program or a
- portion of it, either verbatim or with modifications and/or
- translated into another language. (Hereinafter, translation is
- included without limitation in the term "modification".) Each
- licensee is addressed as "you".
-
- Activities other than copying, distribution and modification are
- not covered by this License; they are outside its scope. The act
- of running the Program is not restricted, and the output from the
- Program is covered only if its contents constitute a work based on
- the Program (independent of having been made by running the
- Program). Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
- source code as you receive it, in any medium, provided that you
- conspicuously and appropriately publish on each copy an appropriate
- copyright notice and disclaimer of warranty; keep intact all the
- notices that refer to this License and to the absence of any
- warranty; and give any other recipients of the Program a copy of
- this License along with the Program.
-
- You may charge a fee for the physical act of transferring a copy,
- and you may at your option offer warranty protection in exchange
- for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
- of it, thus forming a work based on the Program, and copy and
- distribute such modifications or work under the terms of Section 1
- above, provided that you also meet all of these conditions:
-
- a. You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b. You must cause any work that you distribute or publish, that
- in whole or in part contains or is derived from the Program
- or any part thereof, to be licensed as a whole at no charge
- to all third parties under the terms of this License.
-
- c. If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display
- an announcement including an appropriate copyright notice and
- a notice that there is no warranty (or else, saying that you
- provide a warranty) and that users may redistribute the
- program under these conditions, and telling the user how to
- view a copy of this License. (Exception: if the Program
- itself is interactive but does not normally print such an
- announcement, your work based on the Program is not required
- to print an announcement.)
-
- These requirements apply to the modified work as a whole. If
- identifiable sections of that work are not derived from the
- Program, and can be reasonably considered independent and separate
- works in themselves, then this License, and its terms, do not
- apply to those sections when you distribute them as separate
- works. But when you distribute the same sections as part of a
- whole which is a work based on the Program, the distribution of
- the whole must be on the terms of this License, whose permissions
- for other licensees extend to the entire whole, and thus to each
- and every part regardless of who wrote it.
-
- Thus, it is not the intent of this section to claim rights or
- contest your rights to work written entirely by you; rather, the
- intent is to exercise the right to control the distribution of
- derivative or collective works based on the Program.
-
- In addition, mere aggregation of another work not based on the
- Program with the Program (or with a work based on the Program) on
- a volume of a storage or distribution medium does not bring the
- other work under the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
- under Section 2) in object code or executable form under the terms
- of Sections 1 and 2 above provided that you also do one of the
- following:
-
- a. Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of
- Sections 1 and 2 above on a medium customarily used for
- software interchange; or,
-
- b. Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a
- medium customarily used for software interchange; or,
-
- c. Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with
- such an offer, in accord with Subsection b above.)
-
- The source code for a work means the preferred form of the work for
- making modifications to it. For an executable work, complete
- source code means all the source code for all modules it contains,
- plus any associated interface definition files, plus the scripts
- used to control compilation and installation of the executable.
- However, as a special exception, the source code distributed need
- not include anything that is normally distributed (in either
- source or binary form) with the major components (compiler,
- kernel, and so on) of the operating system on which the executable
- runs, unless that component itself accompanies the executable.
-
- If distribution of executable or object code is made by offering
- access to copy from a designated place, then offering equivalent
- access to copy the source code from the same place counts as
- distribution of the source code, even though third parties are not
- compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
- except as expressly provided under this License. Any attempt
- otherwise to copy, modify, sublicense or distribute the Program is
- void, and will automatically terminate your rights under this
- License. However, parties who have received copies, or rights,
- from you under this License will not have their licenses
- terminated so long as such parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
- signed it. However, nothing else grants you permission to modify
- or distribute the Program or its derivative works. These actions
- are prohibited by law if you do not accept this License.
- Therefore, by modifying or distributing the Program (or any work
- based on the Program), you indicate your acceptance of this
- License to do so, and all its terms and conditions for copying,
- distributing or modifying the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
- Program), the recipient automatically receives a license from the
- original licensor to copy, distribute or modify the Program
- subject to these terms and conditions. You may not impose any
- further restrictions on the recipients' exercise of the rights
- granted herein. You are not responsible for enforcing compliance
- by third parties to this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
- infringement or for any other reason (not limited to patent
- issues), conditions are imposed on you (whether by court order,
- agreement or otherwise) that contradict the conditions of this
- License, they do not excuse you from the conditions of this
- License. If you cannot distribute so as to satisfy simultaneously
- your obligations under this License and any other pertinent
- obligations, then as a consequence you may not distribute the
- Program at all. For example, if a patent license would not permit
- royalty-free redistribution of the Program by all those who
- receive copies directly or indirectly through you, then the only
- way you could satisfy both it and this License would be to refrain
- entirely from distribution of the Program.
-
- If any portion of this section is held invalid or unenforceable
- under any particular circumstance, the balance of the section is
- intended to apply and the section as a whole is intended to apply
- in other circumstances.
-
- It is not the purpose of this section to induce you to infringe any
- patents or other property right claims or to contest validity of
- any such claims; this section has the sole purpose of protecting
- the integrity of the free software distribution system, which is
- implemented by public license practices. Many people have made
- generous contributions to the wide range of software distributed
- through that system in reliance on consistent application of that
- system; it is up to the author/donor to decide if he or she is
- willing to distribute software through any other system and a
- licensee cannot impose that choice.
-
- This section is intended to make thoroughly clear what is believed
- to be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
- certain countries either by patents or by copyrighted interfaces,
- the original copyright holder who places the Program under this
- License may add an explicit geographical distribution limitation
- excluding those countries, so that distribution is permitted only
- in or among countries not thus excluded. In such case, this
- License incorporates the limitation as if written in the body of
- this License.
-
- 9. The Free Software Foundation may publish revised and/or new
- versions of the General Public License from time to time. Such
- new versions will be similar in spirit to the present version, but
- may differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
- Program specifies a version number of this License which applies
- to it and "any later version", you have the option of following
- the terms and conditions either of that version or of any later
- version published by the Free Software Foundation. If the Program
- does not specify a version number of this License, you may choose
- any version ever published by the Free Software Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
- programs whose distribution conditions are different, write to the
- author to ask for permission. For software which is copyrighted
- by the Free Software Foundation, write to the Free Software
- Foundation; we sometimes make exceptions for this. Our decision
- will be guided by the two goals of preserving the free status of
- all derivatives of our free software and of promoting the sharing
- and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
- WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
- LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
- WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
- NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
- QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
- SERVICING, REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
- WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
- MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
- LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
- INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
- OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
- OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-=============================================
-
-If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
-To do so, attach the following notices to the program. It is safest to
-attach them to the start of each source file to most effectively convey
-the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
- Copyright (C) YYYY NAME OF AUTHOR
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the
-appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than `show w' and `show
-c'; they could even be mouse-clicks or menu items--whatever suits your
-program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- SIGNATURE OF TY COON, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library,
-you may consider it more useful to permit linking proprietary
-applications with the library. If this is what you want to do, use the
-GNU Library General Public License instead of this License.
-
diff --git a/sextractor/ChangeLog b/sextractor/ChangeLog
deleted file mode 100644
index 257ce04..0000000
--- a/sextractor/ChangeLog
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- ChangeLog
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E. BERTIN (IAP)
-*
-* Contents: log of changes made to the SExtractor source
-*
-* Last modify: 14/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-------------------------------------------------------------------------
-r288 | bertin | 2006-07-14 20:13:39 +0200 (Fri, 14 Jul 2006) | 8 lines
-
-Yet another rewriting of the XML part. Meta-data, error messages and catalog
-info are now consistant between the catalog and the XML metadata file. Still
-some pb with the COOSYS epoch and system in the VOTable version of the catalog
-(but correct in the XML metadata file).
-CATALOG_TYPE ASCII_VO changed to ASCII_VOTABLE.
-Added a check in error catching to prevent recursive loops.
-Added reinit of the warning counter to allow multiple uses of the warning
-history.
-Cleaned up configure.ac and added a default path for the (still missing) XSL
-file.
-Updated config/default.sex, BUGS HISTORY and README files.
-Ready for release of V2.5.
-
-------------------------------------------------------------------------
-r286 | bertin | 2006-07-13 22:06:48 +0200 (Thu, 13 Jul 2006) | 5 lines
-
-XML VOTable approach changed again: support for error messaging in VO catalog
-(not only metadata) and FITS serialization of LDAC files in XML output.
-COOSYS tag added with relevant information.
-Removed MAMA_CORFLEX advanced config parameter (replaced with define).
-Version number pushed to 2.5.
-
-------------------------------------------------------------------------
-r285 | bertin | 2006-07-12 20:34:06 +0200 (Wed, 12 Jul 2006) | 4 lines
-
-Improved XML VOTable (still waiting for F.Ochsenbein comments, though).
-Added meta-data to VOTable catalog output.
-Fixed potential bug with long command lines.
-
-------------------------------------------------------------------------
-r283 | bertin | 2006-07-11 23:04:18 +0200 (Tue, 11 Jul 2006) | 2 lines
-
-Completed the conversion of XML output to the VOTable format.
-
-------------------------------------------------------------------------
-r280 | bertin | 2006-07-10 21:49:59 +0200 (Mon, 10 Jul 2006) | 6 lines
-
-Added support for ICRS in header WCS.
-Changed the way header WCS info is interpreted when EQUINOX is missing.
-Added dump of command line in XML meta-data.
-Pushed max number of recorded warnings to 100.
-Changed XML meta-data output format to VOTable (not complete yet).
-
-------------------------------------------------------------------------
-r278 | bertin | 2006-07-09 19:57:00 +0200 (Sun, 09 Jul 2006) | 4 lines
-
-Added support for warning history in the fits library.
-Added duration to XML error output.
-Added ten most recent warnings to XML output.
-
-------------------------------------------------------------------------
-r277 | bertin | 2006-07-07 20:30:30 +0200 (Fri, 07 Jul 2006) | 4 lines
-
-Added catching of error messages and forwarding to XML.
-Added ASCII_VO output catalog format (inspired by G.Tissier's VOTable patch)
-Fixed issue with conflicting CDi_j/CDELTi parameters (report by J.F. Bonnarel).
-
-------------------------------------------------------------------------
-r276 | bertin | 2006-07-05 20:11:29 +0200 (Wed, 05 Jul 2006) | 2 lines
-
-Added more configuration parameters to XML output.
-
-------------------------------------------------------------------------
-r273 | bertin | 2006-07-04 17:39:58 +0200 (Tue, 04 Jul 2006) | 3 lines
-
-Fixed a bug with the reentrant version of strtok in TNX.
-Added more XML info.
-
-------------------------------------------------------------------------
-r271 | bertin | 2006-07-03 21:31:15 +0200 (Mon, 03 Jul 2006) | 5 lines
-
-Updated display to the leatest "Bertin standards".
-Added comments to uncommonly used config parameters in default .sex.
-Changed default output channel for info about extraction to stdout.
-Added XML output.
-
-------------------------------------------------------------------------
-r269 | bertin | 2006-07-02 21:15:05 +0200 (Sun, 02 Jul 2006) | 5 lines
-
-Updated WCS lib to the latest SCAMP version.
-Added support for TNX distortions.
-Added support for WCS with more than 2D (NAXIS=3 right now).
-Added -g compilation flag for gcc.
-
-------------------------------------------------------------------------
-r268 | bertin | 2006-06-29 22:38:02 +0200 (Thu, 29 Jun 2006) | 7 lines
-
-Self Organizing Map code revived!
-The FITS body writing routine now complies with strict aliasing constraints,
-but:
-Strict-aliasing optimization option dropped in acx_prog_cc_optim.m4 because of
-too many problems with gcc 4.1 (missing X_IMAGE output, etc.): too much "fun"
-with pointers in the SExtractor code.
-Local background estimates work again after many years of oblivion, thanks to
-an increased top margin in the buffering mechanism (bug found by P.Astier).
-Overwriting of displayed infos fixed.
-
-------------------------------------------------------------------------
-r115 | bertin | 2006-01-12 20:12:04 +0100 (Thu, 12 Jan 2006) | 2 lines
-
-Preliminary merging with P.Delorme branch (improved PSF-fitting).
-
-------------------------------------------------------------------------
-r54 | bertin | 2005-11-30 07:29:34 +0100 (Wed, 30 Nov 2005) | 3 lines
-
-Added preliminary support for FLAGS_WEIGHT. Null weights above detections are
-still missed.
-
-
--------------------------------- old ChangeLog --------------------------------
-Who When Where(mostly) What
-
-EB 03/07/97 clean.c Make removal of LSB sources optional.
- scanimage() Idem.
- clean.h
- types.h Move prototypes from types.h to clean.h
-
-EB 23/07/97 - Blanking of detections. Major update.
- outobj2 components are now handled
- through the obj2 pointer.
-
-EB 31/07/97 photom.c MAGERR_APER bug introduced during the
- add of blanking fixed.
-
-EB 01/08/97 LDACTools Upgraded from the EIS version.
-
-EB 04/08/97 - Added handling of external FLAG-maps.
- read_prefs() Upgraded from the WeightWatcher code.
- newfield() Changed slightly the frame description
- display.
-EB 13/08/97 filterback() Fixed bug with even BACK_FILTERSIZE
- localback() Fixed bug with LOCAL backgrounds for
- BLANKed detections.
-
-EB 27/08/97 - Added handling of external WEIGHT-maps.
-
-EB 02/09/97 makeback() Added display of currently processed
- line.
- sexheadsc.h
- catout.c New ASCII_SKYCAT catalog format.
-
-EB 05/09/97 - Fixed -PROTOTYPES check-image bug.
-
-EB 13/09/97 filter.c Added FILTER_THRESH option.
- scan.c Fixed WEIGHT-map detection bug.
-
-EB 10/10/97 examine_iso()
- clean() Improve CLEANing and take into account
- variable S/N.
- plist.[c,h] New memory-friendly propagation of
- information through deblending.
-
-EB 16/10/97 main() New syntax for dual-image mode.
-
-EB 18/10/97 analyse.c
- photom.c Exact computation of photometric errors
- in the context of variable S/N.
-
-EB 20/10/97 prefs.h new MAMA_CORFLEX preferences parameter,
- astrom.c
- param.h new X_MAMA and Y_MAMA output parameters
-
-EB 21/10/97 createblank() Bug in single-image mode fixed.
- sortit() Bug in dual-image + BLANKing mode.
-
-EB 24/10/97 astrom.c X_MAMA and Y_MAMA computed differently
- addcleanobj() Bug in the automag flagging fixed by
- modifying the margin computations
-
-EB 26/10/97 analyse() ASSOC selection added.
- photom.c MASKing with photometric CORRECTion
- added.
-
-EB 04/11/97 readprefs() Added support for ENV variables within
- .sex config file.
-
-EB 06/11/97 photom.c Bug in FLUXERR_ISOCOR fixed.
-
-EB 13/11/97 end_readobj()
- end_writeobj() "Potential bug" fixed.
-
-EB 18/11/97 flag.[c,h] New module for computing flags from
- flag-map.
-
-EB 21/11/97 newfield() PIXEL_SCALE pb with non-WCS images
- fixed.
-
-EB 24/11/97 prefs.h CROSS_ID keyval changed to MATCHED.
- initcheck() WCS rescaling for MINIBACKGROUND and
- MINIBACKRMS added.
-
-EB 28/11/97 initcheck() Bug fixed in WCS coordinates of MINIs.
-
-EB 29/11/97 initcheck() Another bug added in MINIs fixed.
- sexhead.h Corrected SEXTHLD value.
-
-EB 19/12/97 readprefs() Test length of command-line arguments
-
-EB 21/12/97 endobject() Replace prefs pixel-scale by field
- pixel-scale for S/G separation.
-
-EB 06/01/98 readimagehead() Load basic WCS infos even if no astrom
- parameter is requested (for MINIBACKs).
- Added handling of CDxx_xx (thanks to
- D. Mink)
-
-EB 29/01/98 - Added crude interpolation scheme in
- presence of image weighting: new
- interpolate.c module.
-
-EB 30/01/98 preanalyse()
- examineiso() Changed the rules concerning the
- handling of "infinitely thin"
- detections (B_IMAGE=0).
-
-EB 31/01/98 parcelout() Fixed a big (but intermittent) bug
- preventing proper deblending in
- weighted images.
-
-EB 07/02/98 photom.c
- scan.c
- makeit.c Revisited completely the handling of
- bad pixels for the photometry.
-
-EB 10/02/98 endobject() (De)blanking strategy slightly changed.
-
-EB 16/02/98 - New parameters XPEAK_ and YPEAK_ added.
-
-EB 13/03/98 - Finalization of the handling of weights
- (Background RMS, weight threshold).
- endobject() SEGMENTATION check-image bug fixed.
-
-EB 16/03/98 readprefs() Management of the conflicts between
- weight-types seriously updated.
-
-EB 20/03/98 photom.c MAGERR bug in presence of weighting
- fixed.
-
-EB 23/03/98 clean() Wrong handling of abcor factor
- corrected.
-
-EB 25/03/98 clean() realloc() bug in CLEANing with Linux
- scan.c fixed.
-
-EB 26/03/98 readimagehead() Typo in OBS-DATE FITS keyword reading.
-
-EB 27/03/98 sortit() Bug that prevented some faint
- detections to be CLEANed fixed.
- - Add a new EXTRA_WARNINGS prefs option.
-
-EB 11/04/98 - Added FITS_UNSIGNED option.
- filterback() Bug with empty images fixed.
- main() New banner.
-
-EB 15/04/98 getflag() Potential bug for big objects with
- FLAGTYPE MOST fixed.
- examineiso() Wrong detection threshold for CLEANing
- in multi-image mode replaced with
- correct one.
-EB 29/04/98 - Allow multiple FLAG-MAPs (up to 4
- currently): IMAFLAG_ISO and
- NIMAFLAG_ISO have become vectors.
- getflags() Bug with FLAG_TYPEs MIN and MAX fixed.
-
-EB 30/04/98 copyastrom() Fixed a bug with INTERP_TYPE VAR_ONLY.
- - Simplified access init_interpolate.
-
-EB 02/05/98 define.h
- fitsread() Improve stability with incorrect FITS
- headers.
-
-EB 03/05/98 filterback() RMS determination more tolerant towards
- constant weight-maps.
- BACK_FILTERing anisotropy bug fixed.
- makeit() Bad closing of CHECKIMAGEs fixed.
- - New CATALOG_TYPE NONE option.
- - APER measurements functional again
- (recently introduced bug).
-
-EB 06/05/98 readimagehead() Pb with FITS astrometric strings fixed.
-
-EB 07/05/98 getconv() Uninitialized variable pb fixed.
-
-EB 12/05/98 loadstrip() Bug in the production of BACKGROUND
- CHECK-image fixed.
-
-EB 28/05/98 define.h new VECFLAG() macro for flagging
- arrays.
- prefs.h Remove "&" before ptrs to static
- arrays.
-
-EB 13/06/98 initastrom() Wrong mapping of PC components fixed.
- readimagehead() Wrong mapping of CD components fixed.
-
-EB 29/06/98 makeit() Handling of weight-maps+interpolation
- simplified.
- scanimage() Missing reference field in the reading
- of dwscan added.
- useprefs() Bad default threshold in VAR_ONLY
- interpolation mode fixed.
-
-EB 30/06/98 backguess() Missing scaling of "sig" in the
- computation of "*mean" added, but
- threshold changed from 0.2 to 0.0,
- awaiting for more tests.
-
-EB 08/07/98 readimagehead() CDx_x FITS WCS parameters are now
- given priority before PCxxxx.
-
-EB 09/07/98 filterback() Filtering bug at image borders fixed.
-
-EB 21/07/98 photom.c Division by zero for unphotometrable
- objects fixed.
-
-EB 23/07/98 fitswrite() Pb with very long strings fixed.
- readcatparams() Reading of .param files more robust.
- Comments starting with '#' now allowed.
-
-EB 27/07/98 readimagehead()
- initcheck() Changed the handling of CDELTx params
- when CDx_x are used. Now works with
- MINIBACKGROUND check-images.
-
-EB 11/08/98 photom.c Purify warning fixed in
- computeautoflux()
- scan.c Purify warning fixed in scanimage().
- BLANKing procedure of CLEANed pixels
- fixed. Memory leaks fixed.
-
-EB 18/11/98 - New BACK_TYPE, BACK_VALUE, and
- THRESH_TYPE config parameters.
- flag.c Fixed initialization bug in FLAG_TYPE
- MAX mode (thanks to T.Erben).
-
-EB 20/11/98 back.c New BACK_FILTTHRESH parameter.
-
-EB 23/11/98 prefs.c
- weight.c Quick fix of MAP_RMS measurement mode.
-
-EB 26/11/98 - New key->alloc flag to distinguish
- between constant and dynamic pointers.
-
-EB 28/11/98 - lint warnings fixed.
-
-EB 29/11/98 assoc.c New ASSOC_TYPE NEAREST option.
-
-EB 28/12/98 catout.c Added dependency between flux_auto and
- flux_radius
-
-EB 13/01/99 endobject() Fixed numbering problem in SEGMENTATION
- maps when CLEAN is N.
-
-EB 27/01/99 load_assoc() Stupid bug in 2 ASSOC_PARAMS mode
- fixed.
-
-EB 19/02/99 examineiso() Variable thresholding is now taken into
- account for S/G classification and
- FWHMs.
-
-EB 25/02/99 types.h Wrong data-type for BACK_VALUE fixed.
-
-EB 02/03/99 examineiso() XPEAK and YPEAK offset bug fixed.
-
-EB 06/04/99 - Unused variables removed.
- clean.c
- scan.c New handling of CLEANed blanked
- detections.
-
-EB 08/04/99 - Various memory leaks fixed
- readimage() BACKGROUND_RMS check-images now
- operational in single-image mode.
-
-EB 15/04/99 param.h Remove the 0's from the formatting
- of flags.
-
-EB 21/04/99 - New _PROFILE photometric parameters.
-
-EB 06/05/99 examineiso() Potential bug in the threshs[i] fixed.
- readimage() Bug in BACKGROUND_RMS mode fixed.
-
-EB 11/05/99 - Major change: handling of weight-maps
- during the background processing.
- New WEIGHT_GAIN parameter.
-
-EB 19/05/99 scanimage() Important "bug" fix: slight differences
- between single- and double-image modes
- supressed.
-
-EB 24/05/99 makeback() Memory leak in double-weight/single-
- image mode fixed.
- makeit() New info display.
- inheritfield() Interpolation flag is no longer
- inherited (fixes a bug in some weird
- double-weight-maps configs).
-
-EB 12/08/99 endfield() Fixed segmentation fault at the end
- of processing when ASSOC is used.
- psf_load() Remove malloc() of null-size data
- with constant PSFs.
-
-EB 10/09/99 makeit() Background pb in WEIGHT_TYPE NONE,...
- fixed.
-
-EB 14/09/99 back() Replacement value for bad variance map
- background meshes changed to 1.0
- scanimage() Bug with THRESH_TYPE ABSOLUTE in
- WEIGHTing mode fixed.
-
-EB 30/09/99 fitsread() The quote (') symbol is now properly
- handled in FITS headers.
-
-EB 07/10/99 scanimage() Removed debug information inadvertently
- left in the previous release.
-
-EB 24/01/2000 computeautoflux()
- Small inaccuracy in crowding-flag
- positioning fixed.
-
-EB 01/02/2000 localback() Fixed division by zero in local
- background estimates of some heavily
- deblended detections in MASK_TYPE
- CORRECT mode.
-EB 03/02/2000 makeback() Risk of segmentation fault with huge
- weight maps fixed.
-
-EB 11/02/2000 computeautoflux()
- Wrong version of photom.c in release
- V2.1.5 fixed.
-
-EB 14/10/2000 newfield() RMS_FIELD now properly taken into
- account.
- prefs.h BACK_FILTERSIZE upper limit pushed to
- 11.
-
-EB 04/02/2001 backhisto()
- backstat() Fixed two huge bugs in the MAP_WEIGHT
- calibration.
-
-EB 08/02/2001 makeback() Fixed a small bug in large-image mode.
- clean() Fixed CLEANing bug for hollow objects.
-
-EB 23/09/2001 neurfilter() Fixed a bug that would make the result
- of neural filtering compiler-dependent.
- makeback() Corrected typos in text displayed on
- screen.
-
-EB 24/09/2001 endobject() Add 1 to xmin,xmax,ymin and ymax object
- parameters to be compatible with the
- FITS convention for pixel coordinates.
-
-EB 17/06/2002 - Added Large File Support
-
-EB 13/12/2002 - Moved to autoconf'ed distribution.
- - FITS and WCS library updated.
- main() New banner.
-EB 15/12/2002 - Added Support for MEF files.
-
-EB 24/01/2003 initastrom()
- astrom.h Increased PV array to 2000 to comply
- with the newly added version of the WCS
- library.
- preflist.h Increased default MEMORY_PIXSTACK to
- 200,000.
- acx_prog_cc_optim.m4
- Added "-g" to default CFLAGS when
- compiling with gcc.
-EB 05/02/2003 readimage.c Added <math.h> include statement.
-
-EB 06/02/2003 backguess() Fixed potential bug with unitialized
- value.
-
-EB 07/02/2003 back.c
- fitscat.h
- define.h
- configure.in Improved LFS support (with glibc2.2).
-
-EB 05/03/2003 - Put back config/ dir and add Benne
- Holwerda's manual.
-
-EB 02/04/2003 makeback() Fixed a memory leak on weight histo.
- refine.c Modify parcelout() array allocation.
- pc.c
- psf.c
- som.c Added dummy return to please insure++.
-
-EB 03/04/2003 endastrom() 2 arrays were freed twice sometimes.
-
-EB 28/11/2003 - Fixed gcc -Wall warnings
- - Updated the fitscat and wcs libraries
- to the latest versions.
-
-EB 03/12/2003 add_tab() Removed confusing seg section, fixing
- the SEXNDET header bug with MEFs.
- save_head() Add saving of headpos file position.
-
-EB 15/06/2004 analyse.c
- check.c
- clean.c Mv SEGMENTATION map from 16 to 32 bits.
-
-EB 13/12/2004 computepetroflux()
- Added Petrosian "total" magnitudes
- winpos.c Added *WIN_* position measurements.
-
-EB 14/12/2004 key.h Keyword max length changed to 31 chars
-
-EB 15/12/2004 - New RPM build system
- - Updated the fits and wcs libraries
- to the latest versions.
-
-EB 15/02/2005 compute_winpos()
- Added 1.0 to computed coordinates and
- fixed error singularities. New
- iterative procedure (more accurate).
-
-EB 17/07/2005 compute_winpos()
- Added computation of "windowed moments".
- astrom.c Added support for WORLD "windowed
- parameters".
-
-EB 18/07/2005 dumpprefs() Added support for "deep dump".
- Makefile.am added the -g option to gcc CFLAGS.
- param.h Fixed non-FORTRAN compliant format
- in TDISP output.
-
-EB 22/08/2005 compute_winpos()
- Fixed issues for sources with flux<0.
-
-EB 23/08/2005 param.h Removed duplicated lines.
-
-EB 24/08/2005 compute_winpos()
- Added Kaiser's POLARizations (POLAR and
- POLARWIN) and FLAGS_WIN.
-
-EB 25/08/2005 compute_winpos()
- Added NITER_WIN giving the number of
- WIN iterations.
-
-EB 22/09/2005 compute_winpos()
- Fixed a trigger bug with ERR*WIN_IMAGE.
-
-EB 23/09/2005 define.h Corrected SExtractor URL.
-
-EB 27/09/2005 examineiso() Fixed NaN in computing ISO thresholds.
-
-EB 19/10/2005 updateparamflags()
- Fixed a trigger bug with ERR*WIN_IMAGE.
- astrom_winshapeparam()
- Fixed null *WIN_WORLDs.
- preflist.h Improved display of advanced parameters.
diff --git a/sextractor/HISTORY b/sextractor/HISTORY
deleted file mode 100644
index 065cf30..0000000
--- a/sextractor/HISTORY
+++ /dev/null
@@ -1,113 +0,0 @@
-Jul 06: 2.5
- - Support for VOTable catalogs and metadata in output.
-
-Aug 05: 2.4
- - New windowed measurement parameters
- - Better FITS compliancy of output files
-
-May 03: 2.3
- - Autoconf'ed package.
- - Dumpable internal config file
- - Large File Support
- - Support for MEF files
-
-Feb 01: 2.2
- - Mostly bug fixes and experimental stuff added
-
-May 99: 2.1
- - Mostly bug fixes and experimental stuff added
-
-April 98: 2.0
- - New documentation
-
-January 97 - March 98:1.2
- - Rewriting of an important part of the software, in order to
- prepare the future... Further optimization of many functions:
- V1.2 is 30 to 500% faster than V1.0.
- - (natural) bicubic spline interpolation added to the background-map
- processing.
- - Possibility to use another FITS frame for detecting objects,
- allowing pixel-to-pixel colour measurements.
- - New MAG_AUTO magnitudes, more robust towards contamination by
- neighbouring sources (MASKing option).
- - New .sex format.
- - New CHECKIMAGE_TYPEs: MINIBACKGROUND (produces small background maps),
- BACKGROUND_RMS (produces noise maps)
- MINIBACK_RMS (produces small noise maps)
- IDENTICAL (useful for converting data types)
- -OBJECTS (background and detections removed).
- - Multiple CHECKIMAGE output.
- - New astrometric parameters using the WCS library.
- - Handling of external flag-maps.
- - Handling of images with variable S/N and external noise- or weight-
- maps, with interpolation.
- - Real-time cross-identification with an ASCII catalog.
-
-May 96: 1.1 "DeNIS" version (not distributed officially)
- - Corrects 2 fatal bugs which sometimes appeared with DEC-Alphas
- - Incorporates a new extended FITS output format.
- - Added possibility to measure within multiple apertures.
-
-May 95: Passed 1.0a version: -> FIRST OFFICIAL RELEASE!!! <-
- - Now the NNW filename is correct in FITS catalog headers.
- - Corrected a convolution bug with large masks at the bottom of
- the frame. Added a better-than-nothing normalization of
- zero-sum masks.
- - Display of the FITS ID limited to 20 characters.
- - New default.nnw enhanced and with a larger seeing range.
- - FWHM parameters slightly tuned for undersampled profiles.
- - The ``sexcopy'' SExTool put in the previous archive wasn't the
- right one! Replaced.
- - 2 new SExtools released: sexreduce and sexin.
-
-Apr 95: FIRST 1.0 version:
- - Neural-network based star/galaxy classifier implemented. NNW-file
- for Moffat-like PSFs in the optical, generated from simulations.
- - User's manual updated.
- - FWHM_IMAGE, FWHM_IMAGE and ELONGATION parameters added.
- - many more typical convolution files included in the archive.
- - Comments (beginning with a `#') are now allowed within all the
- configuration files.
- - 2 SExTools released: sexcat and sexcopy.
- - Alpha VMS version added (thanks to R. Johnstone).
-
-Feb 95: 1.0 beta 5e version:
- - 2 bugs major corrected: background interpolation when very special
- convolution masks are used, and (fixed) aperture magnitude (improved
- to sub-pixel integration).
- - Possibility to change preference keywords from the command line.
-
-Dec 94: 1.0 beta 5 version:
- - Major update! Too many changes to mention.
- - Code optimized and much more stable now.
- - New executables for IBM RS6000 and AMIGA added.
- - "II" dropped: call me simply "SExtractor" now.
-
-Sep 94: 1.0 beta 4 version:
- - "clean" distribution with source and makefiles for DEC Alpha,
- HP/UX, and SUN workstations.
- - SATUR_LEVEL keyword added.
- - FLAGS parameter now reliable and written in decimal in ASCII cat.
- - KRON_RADIUS parameter now reliable.
- - MAG_ISO_ERR and MAG_APER_ERR now give trusty estimates.
- - BACKGROUND parameter now in "raw" units.
- - catalog index numbering starts now from 1.
- - 2 huge fatal bugs corrected in deblending and background estimation
- procedures.
-
-
-Jun 94: 1.0 beta 3 version: many bugs corrected thanks to enthousiastic
- testers! First public release.
-
-May 94: 1.0 beta 2 version: reads now all kinds of FITS data. C code
- completely rewritten in ANSI; image bitmaps are now stored in
- floating-point. Now controlled through configuration files.
- User's manual written.
-
-Feb 94: 1.0 beta 1 version of "Sextractor II", still limited to 16 bits FITS
- frames, but pipelined processing allows now frames with size up to
- 65534x65534 to be processable on most machines.
-
-Mar 93: final version of "Sextractor I": limited to 16 bits 2048x2048 max. FITS
- frames, specifically oriented toward Schmidt plate data processing.
- Has reduced more than 1.2e10 pixels within 10 months...
diff --git a/sextractor/INSTALL b/sextractor/INSTALL
deleted file mode 100644
index 1ef7109..0000000
--- a/sextractor/INSTALL
+++ /dev/null
@@ -1,59 +0,0 @@
-Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
-Foundation, Inc.
-
- This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
- 2. Type `make' to compile the package.
- 3. Type `make install' to install the programs and any data files and
- documentation.
-
-Optional Features
-=================
-The executable is dynamically linked by default. If you have the necessary
-static libraries installed, you might want to turn on static linking by typing
-
- ./configure --enable-static
-
-A statically-linked executable takes more disk and memory space; however it
-runs generally faster and it will work on any similar system independently of
-the libraries available.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. Run `./configure --help'
-for details on some of the pertinent environment variables.
-
- You can give `configure' initial values for variables by setting
-them in the environment. You can do that on the command line like this:
-
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
diff --git a/sextractor/Makefile.am b/sextractor/Makefile.am
deleted file mode 100644
index 740f802..0000000
--- a/sextractor/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Main Makefile for SExtractor
-# Copyright (C) 2002-2005 Emmanuel Bertin.
-AUTOMAKE_OPTIONS = foreign no-dependencies
-SUBDIRS = man src
-EXTRA_DIST = config doc AUTHORS BUGS ChangeLog COPYING HISTORY \
- INSTALL README THANKS \
- acx_prog_cc_optim.m4
-RPM_ROOTDIR = /usr/src/RPM
-RPM_SRCDIR = $(RPM_ROOTDIR)/SOURCES
-rpm: dist
- cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
- rpmbuild -ba --clean $(PACKAGE_NAME).spec $(PACKAGE_NAME)-mp.spec
-
-rpm-opteron: dist
- cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
- GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \
- -march=opteron" rpmbuild -ba --target=x86_64 \
- --clean $(PACKAGE_NAME).spec
-
-rpm-athlon: dist
- cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
- GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall -m32 \
- -march=i686 -msse -mfpmath=sse -mtune=athlon" rpmbuild \
- -ba --target=i686 --clean $(PACKAGE_NAME).spec
-
-debug:
- $(MAKE) CFLAGS="-O3 -funroll-loops -fomit-frame-pointer -Wall -m32 -g"
diff --git a/sextractor/Makefile.in b/sextractor/Makefile.in
deleted file mode 100644
index 8555e9a..0000000
--- a/sextractor/Makefile.in
+++ /dev/null
@@ -1,757 +0,0 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2012 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(srcdir)/sextractor-tpx.spec.in $(srcdir)/sextractor.spec.in \
- $(top_srcdir)/autoconf/install-sh \
- $(top_srcdir)/autoconf/missing $(top_srcdir)/configure AUTHORS \
- COPYING ChangeLog INSTALL THANKS autoconf/install-sh \
- autoconf/missing
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = sextractor.spec sextractor-tpx.spec
-CONFIG_CLEAN_VPATH_FILES =
-depcomp =
-am__depfiles_maybe =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-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
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- cscope distdir dist dist-all distcheck
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-DIST_TARGETS = dist-gzip
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE2 = @DATE2@
-DATE3 = @DATE3@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGER = @PACKAGER@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-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@
-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_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-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_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# Main Makefile for SExtractor
-# Copyright (C) 2002-2005 Emmanuel Bertin.
-AUTOMAKE_OPTIONS = foreign no-dependencies
-SUBDIRS = man src
-EXTRA_DIST = config doc AUTHORS BUGS ChangeLog COPYING HISTORY \
- INSTALL README THANKS \
- acx_prog_cc_optim.m4
-
-RPM_ROOTDIR = /usr/src/RPM
-RPM_SRCDIR = $(RPM_ROOTDIR)/SOURCES
-all: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-config.h: stamp-h1
- @if test ! -f $@; then rm -f stamp-h1; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f config.h stamp-h1
-sextractor.spec: $(top_builddir)/config.status $(srcdir)/sextractor.spec.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-sextractor-tpx.spec: $(top_builddir)/config.status $(srcdir)/sextractor-tpx.spec.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-cscopelist-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-cscope: cscope.files
- test ! -s cscope.files \
- || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-
-clean-cscope:
- -rm -f cscope.files
-
-cscope.files: clean-cscope cscopelist-recursive cscopelist
-
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
- -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @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; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__post_remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__post_remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__post_remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__post_remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__post_remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__post_remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__post_remove_distdir)
-
-dist dist-all:
- $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
- $(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir); chmod u+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
- chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__post_remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile config.h
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
- cscopelist-recursive ctags-recursive install-am install-strip \
- tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am am--refresh check check-am clean clean-cscope \
- clean-generic cscope cscopelist cscopelist-recursive ctags \
- ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \
- dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
- distclean-generic distclean-hdr distclean-tags distcleancheck \
- distdir distuninstallcheck 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-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
-
-rpm: dist
- cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
- rpmbuild -ba --clean $(PACKAGE_NAME).spec $(PACKAGE_NAME)-mp.spec
-
-rpm-opteron: dist
- cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
- GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall \
- -march=opteron" rpmbuild -ba --target=x86_64 \
- --clean $(PACKAGE_NAME).spec
-
-rpm-athlon: dist
- cp -f $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz $(RPM_SRCDIR)
- GCCFLAGS="-O -g -funroll-loops -fomit-frame-pointer -Wall -m32 \
- -march=i686 -msse -mfpmath=sse -mtune=athlon" rpmbuild \
- -ba --target=i686 --clean $(PACKAGE_NAME).spec
-
-debug:
- $(MAKE) CFLAGS="-O3 -funroll-loops -fomit-frame-pointer -Wall -m32 -g"
-
-# 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.
-.NOEXPORT:
diff --git a/sextractor/README b/sextractor/README
deleted file mode 100644
index 749f37d..0000000
--- a/sextractor/README
+++ /dev/null
@@ -1,32 +0,0 @@
-SExtractor stands for ``Source Extractor'': a software for making
-catalog of sources from astronomical images.
-Multi-Extension FITS is now supported. Binary output catalogs are also MEFs.
-ASCII output catalogs contain detections from all extensions merged together.
-Use the "EXT_NUMBER" catalog parameter to identify the extension on which a
-given source was detected. Check-images will also be written as MEFs if the
-input image is a MEF.
-- The (main) default config file can be dumped by typing "sex -d". Secondary
-configuration files like default.param are still needed, though.
-
-In case of problems, questions or suggestions related to the software,
-please don't hesitate to send a mail (preferably in english) to the
-official mailing list:
-sextractor at iap.fr
-These questions and answers to them are posted on the Web at:
-http://terapix.iap.fr/soft/sextractor/
-In any case you can still reach me at bertin at iap.fr. I cannot garantee
-that I will reply immediately, but I will try for sure to provide
-an answer.
------------
-Notes:
-- A version "sextractor-2.3.1_lanl" of SExtractor is available on
-SourceForge thanks to Mark Galassi and Dan Starr:
-http://sourceforge.net/projects/sextractor/
-It is a reconditioned version of SExtractor 2.2.2. The LanL and the TERAPIX
-(present one) versions follow two different development branches.
-- Benne Holwerda <holwerda at stsci.edu> has written a SExtractor handbook and a
-GUI which can be found in the doc/ subdirectory or at
-http://www-int.stsci.edu/~holwerda/OldHomepage/se.html
-
-
- Emmanuel Bertin.
diff --git a/sextractor/THANKS b/sextractor/THANKS
deleted file mode 100644
index d8c10f0..0000000
--- a/sextractor/THANKS
+++ /dev/null
@@ -1,21 +0,0 @@
-Stephane Arnouts <Stephane.Arnouts at oamp.fr>
- Suggestions and extensive testing
-Mark Calabretta <mcalabre at atnf.csiro.au>
- SExtractor makes use of his nice WCS library
-Gerard Tissier <tissier at iap.fr>
- Preliminary implementation of the VOTable output
-Jean-Paul Kneib <kneib at omp.fr>
-Ian Smail <Ian.Smail at durham.ac.uk>
- Suggestions and spreading the software back in the early days!
-Pascal Fouque <pfouque at eso.org>
- Suggestions and testing
-Eric Aubourg <Eric.Aubourg at cea.fr>
- Hints about how to optimize a C code
-Ville Laurikari <vl at iki.fi>
- For his VL_PROG_CC_WARNINGS (modified to ACX_PROG_CC_OPTIM)
-Benne Holwerda <holwerda at stsci.edu>
- For making his cookbook available
-ESO
- Financial support
-Too many people to list
- Help in discovering bugs or bringing suggestions
diff --git a/sextractor/aclocal.m4 b/sextractor/aclocal.m4
deleted file mode 100644
index 4cefd89..0000000
--- a/sextractor/aclocal.m4
+++ /dev/null
@@ -1,973 +0,0 @@
-# generated automatically by aclocal 1.12.2 -*- Autoconf -*-
-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-
-# This file 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-
-# Copyright (C) 2002-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.12'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.12.2], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.12.2])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
-# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is '.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 10
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ([2.52])dnl
- m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 17
-
-# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
- [$1], [CXX], [depcc="$CXX" am_compiler_list=],
- [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
- [$1], [UPC], [depcc="$UPC" am_compiler_list=],
- [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE([dependency-tracking], [dnl
-AS_HELP_STRING(
- [--enable-dependency-tracking],
- [do not reject slow dependency extractors])
-AS_HELP_STRING(
- [--disable-dependency-tracking],
- [speeds up one-time build])])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 6
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 19
-
-# This macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[AC_DIAGNOSE([obsolete],
-[$0: two- and three-arguments forms are deprecated. For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
-m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
- [ok:ok],,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
- AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
-AM_MISSING_PROG([AUTOCONF], [autoconf])
-AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
-AM_MISSING_PROG([AUTOHEADER], [autoheader])
-AM_MISSING_PROG([MAKEINFO], [makeinfo])
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES([CC])],
- [m4_define([AC_PROG_CC],
- m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES([CXX])],
- [m4_define([AC_PROG_CXX],
- m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES([OBJC])],
- [m4_define([AC_PROG_OBJC],
- m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-dnl Support for Objective C++ was only introduced in Autoconf 2.65,
-dnl but we still cater to Autoconf 2.62.
-m4_ifdef([AC_PROG_OBJCXX],
-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
- [_AM_DEPENDENCIES([OBJCXX])],
- [m4_define([AC_PROG_OBJCXX],
- m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 8
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST([install_sh])])
-
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 5
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 7
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- AC_MSG_WARN(['missing' script is too old or missing])
-fi
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 6
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 9
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
- alias in your environment])
- fi
- if test "$[2]" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT([yes])
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-AC_CONFIG_COMMANDS_PRE(
- [AC_MSG_CHECKING([that generated files are newer than configure])
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- AC_MSG_RESULT([done])])
-rm -f conftest.file
-])
-
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 2
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor 'install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in "make install-strip", and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004-2012 Free Software Foundation, Inc.
-#
-# This file 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.
-
-# serial 3
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of 'v7', 'ustar', or 'pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
diff --git a/sextractor/acx_prog_cc_optim.m4 b/sextractor/acx_prog_cc_optim.m4
deleted file mode 100644
index 23b2d02..0000000
--- a/sextractor/acx_prog_cc_optim.m4
+++ /dev/null
@@ -1,87 +0,0 @@
-dnl @synopsis ACX_PROG_CC_OPTIM
-dnl
-dnl Enables a reasonable set of optimization flags for the C compiler.
-dnl
-dnl Currently this macro knows about GCC, Solaris C compiler,
-dnl Digital Unix C compiler, C for AIX Compiler, HP-UX C compiler,
-dnl IRIX C compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90
-dnl (Unicos 10.0.0.8) C compiler.
-dnl
-dnl This macro is a modification of Ville Laurikari's VL_PROG_CC_WARNINGS
-dnl @version 1.0 (2002-04-15)
-dnl @authors Emmanuel Bertin <bertin at iap.fr> Ville Laurikari <vl at iki.fi>
-dnl
-AC_DEFUN([ACX_PROG_CC_OPTIM], [
- msg="for C compiler optimization flags"
- AC_CACHE_CHECK($msg, prog_cc_optim_flags, [
- if test -n "$CC"; then
- cat > conftest.c <<EOF
-int main(int argc, char **argv) { return 0; }
-EOF
-
- dnl GCC
- if test "$GCC" = "yes"; then
- prog_cc_optim_flags="-O -funroll-loops -fomit-frame-pointer -Wall -g"
-
- dnl Most compilers print some kind of a version string with some command
- dnl line options (often "-V"). The version string should be checked
- dnl before doing a test compilation run with compiler-specific flags.
- dnl This is because some compilers (like the Cray compiler) only
- dnl produce a warning message for unknown flags instead of returning
- dnl an error, resulting in a false positive. Also, compilers may do
- dnl erratic things when invoked with flags meant for a different
- dnl compiler.
-
- dnl Solaris C compiler
- elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
- $CC -c -O conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O"
-
- dnl Digital Unix/Compaq C compiler
- elif ($CC -V 2>&1 | grep -i "Digital UNIX Compiler"> /dev/null 2>&1 ||
- $CC -V 2>&1 | grep -i "Compaq C"> /dev/null 2>&1) &&
- $CC -c -fast conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-fast -tune host"
-
- dnl C for AIX Compiler
- elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
- $CC -c -qinfo=all -O2 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O2"
-
- dnl IRIX C compiler
- elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
- $CC -c -fullwarn -O3 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O3"
-
- dnl HP-UX C compiler
- elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
- $CC -c -Aa +O3 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="+O3"
-
- dnl The NEC SX-5 (Super-UX 10) C compiler
- elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
- $CC -c -Xc -O conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O"
-
- dnl The Cray C compiler (Unicos)
- elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
- $CC -c -h conform -O3 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O3"
-
- fi
- rm -f conftest.*
- fi
- if test -n "$prog_cc_optim_flags"; then
- CFLAGS="$CFLAGS $prog_cc_optim_flags"
- else
- prog_cc_optim_flags="unknown"
- fi
- ])
-])dnl
diff --git a/sextractor/autoconf/depcomp b/sextractor/autoconf/depcomp
deleted file mode 100755
index debb6ff..0000000
--- a/sextractor/autoconf/depcomp
+++ /dev/null
@@ -1,707 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2012-03-27.16; # UTC
-
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by 'PROGRAMS ARGS'.
- object Object file output by 'PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputting dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake at gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the "deleted header file" problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' "$nl" < "$tmpdepfile" |
-## Some versions of gcc put a space before the ':'. On the theory
-## that the space means something, we add a space to the output as
-## well. hp depmode also adds that space, but also prefixes the VPATH
-## to the object. Take care to not repeat it in the output.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like '#:fec' to the end of the
- # dependency line.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr "$nl" ' ' >> "$depfile"
- echo >> "$depfile"
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-xlc)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts '$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
- "$@" -Wc,-M
- else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
- "$@" -M
- fi
- stat=$?
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # '$object: dependent.h' and one to simply 'dependent.h:'.
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
- # However on
- # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\':
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
- # tcc 0.9.26 (FIXME still under development at the moment of writing)
- # will emit a similar output, but also prepend the continuation lines
- # with horizontal tabulation characters.
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form 'foo.o: dependent.h',
- # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # '$object: dependent.h' and one to simply 'dependent.h:'.
- sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
- < "$tmpdepfile" > "$depfile"
- sed '
- s/[ '"$tab"'][ '"$tab"']*/ /g
- s/^ *//
- s/ *\\*$//
- s/^[^:]*: *//
- /^$/d
- /:$/d
- s/$/ :/
- ' < "$tmpdepfile" >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add 'dependent.h:' lines.
- sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-msvc7)
- if test "$libtool" = yes; then
- showIncludes=-Wc,-showIncludes
- else
- showIncludes=-showIncludes
- fi
- "$@" $showIncludes > "$tmpdepfile"
- stat=$?
- grep -v '^Note: including file: ' "$tmpdepfile"
- if test "$stat" = 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The first sed program below extracts the file names and escapes
- # backslashes for cygpath. The second sed program outputs the file
- # name when reading, but also accumulates all include files in the
- # hold buffer in order to output them again at the end. This only
- # works with sed implementations that can handle large buffers.
- sed < "$tmpdepfile" -n '
-/^Note: including file: *\(.*\)/ {
- s//\1/
- s/\\/\\\\/g
- p
-}' | $cygpath_u | sort -u | sed -n '
-s/ /\\ /g
-s/\(.*\)/'"$tab"'\1 \\/p
-s/.\(.*\) \\/\1:/
-H
-$ {
- s/.*/'"$tab"'/
- G
- p
-}' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvc7msys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for ':'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
- "$@" $dashmflag |
- sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' "$nl" < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no eat=no
- for arg
- do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- if test $eat = yes; then
- eat=no
- continue
- fi
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -arch)
- eat=yes ;;
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix=`echo "$object" | sed 's/^.*\././'`
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- # makedepend may prepend the VPATH from the source file name to the object.
- # No need to regex-escape $object, excess matching of '.' is harmless.
- sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- IFS=" "
- for arg
- do
- case "$arg" in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E 2>/dev/null |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
- echo "$tab" >> "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvcmsys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/sextractor/autoconf/install-sh b/sextractor/autoconf/install-sh
deleted file mode 100755
index 377bb86..0000000
--- a/sextractor/autoconf/install-sh
+++ /dev/null
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-11-20.07; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) no_target_directory=true;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call 'install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names problematic for 'test' and other utilities.
- case $src in
- -* | [=\(\)!]) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
- dst=$dst_arg
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
- esac
-
- eval "$initialize_posix_glob"
-
- oIFS=$IFS
- IFS=/
- $posix_glob set -f
- set fnord $dstdir
- shift
- $posix_glob set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/sextractor/autoconf/missing b/sextractor/autoconf/missing
deleted file mode 100755
index 9a55648..0000000
--- a/sextractor/autoconf/missing
+++ /dev/null
@@ -1,330 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2012-01-06.18; # UTC
-
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
-fi
-
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, 'missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case $1 in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file 'aclocal.m4'
- autoconf touch file 'configure'
- autoheader touch file 'config.h.in'
- autom4te touch the output file, or create a stub one
- automake touch all 'Makefile.in' files
- bison create 'y.tab.[ch]', if possible, from existing .[ch]
- flex create 'lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create 'lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- yacc create 'y.tab.[ch]', if possible, from existing .[ch]
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake at gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown '$1' option"
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# normalize program name to check for.
-program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program). This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
- lex*|yacc*)
- # Not GNU programs, they don't have --version.
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running '$TOOL --version' or '$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
- aclocal*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified 'acinclude.m4' or '${configure_ac}'. You might want
- to install the Automake and Perl packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified '${configure_ac}'. You might want to install the
- Autoconf and GNU m4 packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified 'acconfig.h' or '${configure_ac}'. You might want
- to install the Autoconf and GNU m4 packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case $f in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
- You might want to install the Automake and Perl packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te*)
- echo 1>&2 "\
-WARNING: '$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get '$1' as part of Autoconf from any GNU
- archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison*|yacc*)
- echo 1>&2 "\
-WARNING: '$1' $msg. You should only need it if
- you modified a '.y' file. You may need the Bison package
- in order for those modifications to take effect. You can get
- Bison from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
- eval LASTARG=\${$#}
- case $LASTARG in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if test ! -f y.tab.h; then
- echo >y.tab.h
- fi
- if test ! -f y.tab.c; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex*|flex*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified a '.l' file. You may need the Flex package
- in order for those modifications to take effect. You can get
- Flex from any GNU archive site."
- rm -f lex.yy.c
- if test $# -ne 1; then
- eval LASTARG=\${$#}
- case $LASTARG in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if test ! -f lex.yy.c; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- Help2man package in order for those modifications to take
- effect. You can get Help2man from any GNU archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit $?
- fi
- ;;
-
- makeinfo*)
- echo 1>&2 "\
-WARNING: '$1' is $msg. You should only need it if
- you modified a '.texi' or '.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy 'make' (AIX,
- DU, IRIX). You might want to install the Texinfo package or
- the GNU make package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: '$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the 'README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing '$1' program."
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/sextractor/config.h.in b/sextractor/config.h.in
deleted file mode 100644
index a169377..0000000
--- a/sextractor/config.h.in
+++ /dev/null
@@ -1,165 +0,0 @@
-/* config.h.in. Generated from configure.ac by autoheader. */
-
-/* Archive creation date */
-#undef DATE
-
-/* Define to 1 if you have the `atexit' function. */
-#undef HAVE_ATEXIT
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
-#undef HAVE_FSEEKO
-
-/* Define to 1 if you have the `getenv' function. */
-#undef HAVE_GETENV
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the `m' library (-lm). */
-#undef HAVE_LIBM
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
- to 0 otherwise. */
-#undef HAVE_MALLOC
-
-/* Define to 1 if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define to 1 if you have the `mkdir' function. */
-#undef HAVE_MKDIR
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the `munmap' function. */
-#undef HAVE_MUNMAP
-
-/* Define to 1 if `stat' has the bug that it succeeds when given the
- zero-length file name argument. */
-#undef HAVE_STAT_EMPTY_STRING_BUG
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
- slash. */
-#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Maximum number of POSIX threads */
-#undef THREADS_NMAX
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
-/* Version number of package */
-#undef VERSION
-
-/* Enable large inode numbers on Mac OS X 10.5. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-#undef _LARGEFILE_SOURCE
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
-
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
-/* Define to `long int' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
diff --git a/sextractor/config/README b/sextractor/config/README
deleted file mode 100644
index 7a8c593..0000000
--- a/sextractor/config/README
+++ /dev/null
@@ -1,29 +0,0 @@
-This directory contains several ASCII files related to SExtractor
-configuration:
-
-default.sex: an example of SExtractor .sex configuration file.
-default.param: a .param file, containing all parameters known by SExtractor.
- To prevent some parameters to figure in the output catalog,
- just erase or comment their names (by adding a # at the
- beginning of the line).
-default.nnw: a "Neural-Network-Weights" file for star/galaxy separation on
- images with Moffat-like PSFs.
-*.conv: several "classical" convolution masks for optimal detection:
- - default.conv a small pyramidal function (fast),
- - gauss*.conv a set of gaussian functions, for
- seeing FWHMs between 1.5 and 5 pixels
- (best for faint object detection),
- - tophat*.conv a set of "top-hat" functions. Use them
- to detect extended, low-surface
- brightness objects, with a very low
- THRESHOLD.
- - mexhat*.conv "wavelets", producing a passband-
- filtering of the image, tuned to
- seeing FWHMs between 1.5 and 5 pixels.
- Useful in very crowded star fields,
- or in the vicinity of a nebula.
- WARNING: may need a high THRESHOLD!!
- - block_3x3.conv a small "block" function (for rebinned
- images like those of the DeNIS survey).
-
- All these convolution files are normalized by default.
diff --git a/sextractor/config/block_3x3.conv b/sextractor/config/block_3x3.conv
deleted file mode 100644
index 3884ce2..0000000
--- a/sextractor/config/block_3x3.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a block-function PSF (ex: DeNIS PSF).
-1 1 1
-1 1 1
-1 1 1
diff --git a/sextractor/config/default.conv b/sextractor/config/default.conv
deleted file mode 100644
index 2590b9c..0000000
--- a/sextractor/config/default.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 ``all-ground'' convolution mask with FWHM = 2 pixels.
-1 2 1
-2 4 2
-1 2 1
diff --git a/sextractor/config/default.nnw b/sextractor/config/default.nnw
deleted file mode 100644
index 4b521bd..0000000
--- a/sextractor/config/default.nnw
+++ /dev/null
@@ -1,28 +0,0 @@
-NNW
-# Neural Network Weights for the SExtractor star/galaxy classifier (V1.3)
-# inputs: 9 for profile parameters + 1 for seeing.
-# outputs: ``Stellarity index'' (0.0 to 1.0)
-# Seeing FWHM range: from 0.025 to 5.5'' (images must have 1.5 < FWHM < 5 pixels)
-# Optimized for Moffat profiles with 2<= beta <= 4.
-
- 3 10 10 1
-
--1.56604e+00 -2.48265e+00 -1.44564e+00 -1.24675e+00 -9.44913e-01 -5.22453e-01 4.61342e-02 8.31957e-01 2.15505e+00 2.64769e-01
- 3.03477e+00 2.69561e+00 3.16188e+00 3.34497e+00 3.51885e+00 3.65570e+00 3.74856e+00 3.84541e+00 4.22811e+00 3.27734e+00
-
--3.22480e-01 -2.12804e+00 6.50750e-01 -1.11242e+00 -1.40683e+00 -1.55944e+00 -1.84558e+00 -1.18946e-01 5.52395e-01 -4.36564e-01 -5.30052e+00
- 4.62594e-01 -3.29127e+00 1.10950e+00 -6.01857e-01 1.29492e-01 1.42290e+00 2.90741e+00 2.44058e+00 -9.19118e-01 8.42851e-01 -4.69824e+00
--2.57424e+00 8.96469e-01 8.34775e-01 2.18845e+00 2.46526e+00 8.60878e-02 -6.88080e-01 -1.33623e-02 9.30403e-02 1.64942e+00 -1.01231e+00
- 4.81041e+00 1.53747e+00 -1.12216e+00 -3.16008e+00 -1.67404e+00 -1.75767e+00 -1.29310e+00 5.59549e-01 8.08468e-01 -1.01592e-02 -7.54052e+00
- 1.01933e+01 -2.09484e+01 -1.07426e+00 9.87912e-01 6.05210e-01 -6.04535e-02 -5.87826e-01 -7.94117e-01 -4.89190e-01 -8.12710e-02 -2.07067e+01
--5.31793e+00 7.94240e+00 -4.64165e+00 -4.37436e+00 -1.55417e+00 7.54368e-01 1.09608e+00 1.45967e+00 1.62946e+00 -1.01301e+00 1.13514e-01
- 2.20336e-01 1.70056e+00 -5.20105e-01 -4.28330e-01 1.57258e-03 -3.36502e-01 -8.18568e-02 -7.16163e+00 8.23195e+00 -1.71561e-02 -1.13749e+01
- 3.75075e+00 7.25399e+00 -1.75325e+00 -2.68814e+00 -3.71128e+00 -4.62933e+00 -2.13747e+00 -1.89186e-01 1.29122e+00 -7.49380e-01 6.71712e-01
--8.41923e-01 4.64997e+00 5.65808e-01 -3.08277e-01 -1.01687e+00 1.73127e-01 -8.92130e-01 1.89044e+00 -2.75543e-01 -7.72828e-01 5.36745e-01
--3.65598e+00 7.56997e+00 -3.76373e+00 -1.74542e+00 -1.37540e-01 -5.55400e-01 -1.59195e-01 1.27910e-01 1.91906e+00 1.42119e+00 -4.35502e+00
-
--1.70059e+00 -3.65695e+00 1.22367e+00 -5.74367e-01 -3.29571e+00 2.46316e+00 5.22353e+00 2.42038e+00 1.22919e+00 -9.22250e-01 -2.32028e+00
-
-
- 0.00000e+00
- 1.00000e+00
diff --git a/sextractor/config/default.param b/sextractor/config/default.param
deleted file mode 100644
index 3dbb7f6..0000000
--- a/sextractor/config/default.param
+++ /dev/null
@@ -1,124 +0,0 @@
-NUMBER
-
-#FLUX_ISO
-FLUXERR_ISO
-#MAG_ISO
-#MAGERR_ISO
-
-#FLUX_ISOCOR
-#FLUXERR_ISOCOR
-#MAG_ISOCOR
-#MAGERR_ISOCOR
-
-#FLUX_APER(1)
-#FLUXERR_APER(1)
-#MAG_APER(1)
-#MAGERR_APER(1)
-
-FLUX_AUTO
-FLUXERR_AUTO
-#MAG_AUTO
-#MAGERR_AUTO
-
-#FLUX_BEST
-#FLUXERR_BEST
-#MAG_BEST
-#MAGERR_BEST
-
-#KRON_RADIUS
-#BACKGROUND
-
-#THRESHOLD
-#MU_THRESHOLD
-#FLUX_MAX
-#MU_MAX
-#ISOAREA_IMAGE
-#ISOAREA_WORLD
-
-#XMIN_IMAGE
-#YMIN_IMAGE
-#XMAX_IMAGE
-#YMAX_IMAGE
-
-X_IMAGE
-Y_IMAGE
-#X_WORLD
-#Y_WORLD
-#ALPHA_SKY
-#DELTA_SKY
-#ALPHA_J2000
-#DELTA_J2000
-#ALPHA_B1950
-#DELTA_B1950
-
-#X2_IMAGE
-#Y2_IMAGE
-#XY_IMAGE
-#X2_WORLD
-#Y2_WORLD
-#XY_WORLD
-
-#CXX_IMAGE
-#CYY_IMAGE
-#CXY_IMAGE
-#CXX_WORLD
-#CYY_WORLD
-#CXY_WORLD
-
-#A_IMAGE
-#B_IMAGE
-#A_WORLD
-#B_WORLD
-
-#THETA_IMAGE
-#THETA_WORLD
-#THETA_SKY
-#THETA_J2000
-#THETA_B1950
-
-#ELONGATION
-#ELLIPTICITY
-
-#ERRX2_IMAGE
-#ERRY2_IMAGE
-#ERRXY_IMAGE
-#ERRX2_WORLD
-#ERRY2_WORLD
-#ERRXY_WORLD
-
-#ERRCXX_IMAGE
-#ERRCYY_IMAGE
-#ERRCXY_IMAGE
-#ERRCXX_WORLD
-#ERRCYY_WORLD
-#ERRCXY_WORLD
-
-#ERRA_IMAGE
-#ERRB_IMAGE
-#ERRA_WORLD
-#ERRB_WORLD
-
-#ERRTHETA_IMAGE
-#ERRTHETA_WORLD
-#ERRTHETA_SKY
-#ERRTHETA_J2000
-#ERRTHETA_B1950
-
-#FWHM_IMAGE
-#FWHM_WORLD
-
-#ISO0
-#ISO1
-#ISO2
-#ISO3
-#ISO4
-#ISO5
-#ISO6
-#ISO7
-
-FLAGS
-#IMAFLAGS_ISO(1)
-#NIMAFLAGS_ISO(1)
-
-#CLASS_STAR
-#VIGNET(5,5)
diff --git a/sextractor/config/default.sex b/sextractor/config/default.sex
deleted file mode 100644
index e88fe53..0000000
--- a/sextractor/config/default.sex
+++ /dev/null
@@ -1,75 +0,0 @@
-# Default configuration file for SExtractor 2.5.0
-# EB 2006-07-14
-#
-
-#-------------------------------- Catalog ------------------------------------
-
-CATALOG_NAME test.cat # name of the output catalog
-CATALOG_TYPE ASCII_HEAD # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT,
- # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC
-PARAMETERS_NAME default.param # name of the file containing catalog contents
-
-#------------------------------- Extraction ----------------------------------
-
-DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction)
-DETECT_MINAREA 5 # minimum number of pixels above threshold
-DETECT_THRESH 1.5 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2
-ANALYSIS_THRESH 1.5 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2
-
-FILTER Y # apply filter for detection (Y or N)?
-FILTER_NAME default.conv # name of the file containing the filter
-
-DEBLEND_NTHRESH 32 # Number of deblending sub-thresholds
-DEBLEND_MINCONT 0.005 # Minimum contrast parameter for deblending
-
-CLEAN Y # Clean spurious detections? (Y or N)?
-CLEAN_PARAM 1.0 # Cleaning efficiency
-
-MASK_TYPE CORRECT # type of detection MASKing: can be one of
- # NONE, BLANK or CORRECT
-
-#------------------------------ Photometry -----------------------------------
-
-PHOT_APERTURES 5 # MAG_APER aperture diameter(s) in pixels
-PHOT_AUTOPARAMS 2.5, 3.5 # MAG_AUTO parameters: <Kron_fact>,<min_radius>
-PHOT_PETROPARAMS 2.0, 3.5 # MAG_PETRO parameters: <Petrosian_fact>,
- # <min_radius>
-
-SATUR_LEVEL 50000.0 # level (in ADUs) at which arises saturation
-
-MAG_ZEROPOINT 0.0 # magnitude zero-point
-MAG_GAMMA 4.0 # gamma of emulsion (for photographic scans)
-GAIN 0.0 # detector gain in e-/ADU
-PIXEL_SCALE 1.0 # size of pixel in arcsec (0=use FITS WCS info)
-
-#------------------------- Star/Galaxy Separation ----------------------------
-
-SEEING_FWHM 1.2 # stellar FWHM in arcsec
-STARNNW_NAME default.nnw # Neural-Network_Weight table filename
-
-#------------------------------ Background -----------------------------------
-
-BACK_SIZE 64 # Background mesh: <size> or <width>,<height>
-BACK_FILTERSIZE 3 # Background filter: <size> or <width>,<height>
-
-BACKPHOTO_TYPE GLOBAL # can be GLOBAL or LOCAL
-
-#------------------------------ Check Image ----------------------------------
-
-CHECKIMAGE_TYPE NONE # can be NONE, BACKGROUND, BACKGROUND_RMS,
- # MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND,
- # FILTERED, OBJECTS, -OBJECTS, SEGMENTATION,
- # or APERTURES
-CHECKIMAGE_NAME check.fits # Filename for the check-image
-
-#--------------------- Memory (change with caution!) -------------------------
-
-MEMORY_OBJSTACK 3000 # number of objects in stack
-MEMORY_PIXSTACK 300000 # number of pixels in stack
-MEMORY_BUFSIZE 1024 # number of lines in buffer
-
-#----------------------------- Miscellaneous ---------------------------------
-
-VERBOSE_TYPE NORMAL # can be QUIET, NORMAL or FULL
-WRITE_XML N # Write XML file (Y/N)?
-XML_NAME sex.xml # Filename for XML output
diff --git a/sextractor/config/gauss_1.5_3x3.conv b/sextractor/config/gauss_1.5_3x3.conv
deleted file mode 100644
index 629f20e..0000000
--- a/sextractor/config/gauss_1.5_3x3.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a gaussian PSF with FWHM = 1.5 pixels.
-0.109853 0.300700 0.109853
-0.300700 0.823102 0.300700
-0.109853 0.300700 0.109853
diff --git a/sextractor/config/gauss_2.0_3x3.conv b/sextractor/config/gauss_2.0_3x3.conv
deleted file mode 100644
index f9d0ba3..0000000
--- a/sextractor/config/gauss_2.0_3x3.conv
+++ /dev/null
@@ -1,6 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a gaussian PSF with FWHM = 2.0 pixels.
-0.260856 0.483068 0.260856
-0.483068 0.894573 0.483068
-0.260856 0.483068 0.260856
-
diff --git a/sextractor/config/gauss_2.0_5x5.conv b/sextractor/config/gauss_2.0_5x5.conv
deleted file mode 100644
index 09e2c68..0000000
--- a/sextractor/config/gauss_2.0_5x5.conv
+++ /dev/null
@@ -1,7 +0,0 @@
-CONV NORM
-# 5x5 convolution mask of a gaussian PSF with FWHM = 2.0 pixels.
-0.006319 0.040599 0.075183 0.040599 0.006319
-0.040599 0.260856 0.483068 0.260856 0.040599
-0.075183 0.483068 0.894573 0.483068 0.075183
-0.040599 0.260856 0.483068 0.260856 0.040599
-0.006319 0.040599 0.075183 0.040599 0.006319
diff --git a/sextractor/config/gauss_2.5_5x5.conv b/sextractor/config/gauss_2.5_5x5.conv
deleted file mode 100644
index 1e79313..0000000
--- a/sextractor/config/gauss_2.5_5x5.conv
+++ /dev/null
@@ -1,7 +0,0 @@
-CONV NORM
-# 5x5 convolution mask of a gaussian PSF with FWHM = 2.5 pixels.
-0.034673 0.119131 0.179633 0.119131 0.034673
-0.119131 0.409323 0.617200 0.409323 0.119131
-0.179633 0.617200 0.930649 0.617200 0.179633
-0.119131 0.409323 0.617200 0.409323 0.119131
-0.034673 0.119131 0.179633 0.119131 0.034673
diff --git a/sextractor/config/gauss_3.0_5x5.conv b/sextractor/config/gauss_3.0_5x5.conv
deleted file mode 100644
index b70e9a2..0000000
--- a/sextractor/config/gauss_3.0_5x5.conv
+++ /dev/null
@@ -1,7 +0,0 @@
-CONV NORM
-# 5x5 convolution mask of a gaussian PSF with FWHM = 3.0 pixels.
-0.092163 0.221178 0.296069 0.221178 0.092163
-0.221178 0.530797 0.710525 0.530797 0.221178
-0.296069 0.710525 0.951108 0.710525 0.296069
-0.221178 0.530797 0.710525 0.530797 0.221178
-0.092163 0.221178 0.296069 0.221178 0.092163
diff --git a/sextractor/config/gauss_3.0_7x7.conv b/sextractor/config/gauss_3.0_7x7.conv
deleted file mode 100644
index 527acbb..0000000
--- a/sextractor/config/gauss_3.0_7x7.conv
+++ /dev/null
@@ -1,9 +0,0 @@
-CONV NORM
-# 7x7 convolution mask of a gaussian PSF with FWHM = 3.0 pixels.
-0.004963 0.021388 0.051328 0.068707 0.051328 0.021388 0.004963
-0.021388 0.092163 0.221178 0.296069 0.221178 0.092163 0.021388
-0.051328 0.221178 0.530797 0.710525 0.530797 0.221178 0.051328
-0.068707 0.296069 0.710525 0.951108 0.710525 0.296069 0.068707
-0.051328 0.221178 0.530797 0.710525 0.530797 0.221178 0.051328
-0.021388 0.092163 0.221178 0.296069 0.221178 0.092163 0.021388
-0.004963 0.021388 0.051328 0.068707 0.051328 0.021388 0.004963
diff --git a/sextractor/config/gauss_4.0_7x7.conv b/sextractor/config/gauss_4.0_7x7.conv
deleted file mode 100644
index 001efd0..0000000
--- a/sextractor/config/gauss_4.0_7x7.conv
+++ /dev/null
@@ -1,9 +0,0 @@
-CONV NORM
-# 7x7 convolution mask of a gaussian PSF with FWHM = 4.0 pixels.
-0.047454 0.109799 0.181612 0.214776 0.181612 0.109799 0.047454
-0.109799 0.254053 0.420215 0.496950 0.420215 0.254053 0.109799
-0.181612 0.420215 0.695055 0.821978 0.695055 0.420215 0.181612
-0.214776 0.496950 0.821978 0.972079 0.821978 0.496950 0.214776
-0.181612 0.420215 0.695055 0.821978 0.695055 0.420215 0.181612
-0.109799 0.254053 0.420215 0.496950 0.420215 0.254053 0.109799
-0.047454 0.109799 0.181612 0.214776 0.181612 0.109799 0.047454
diff --git a/sextractor/config/gauss_5.0_9x9.conv b/sextractor/config/gauss_5.0_9x9.conv
deleted file mode 100644
index 332f982..0000000
--- a/sextractor/config/gauss_5.0_9x9.conv
+++ /dev/null
@@ -1,11 +0,0 @@
-CONV NORM
-# 9x9 convolution mask of a gaussian PSF with FWHM = 5.0 pixels.
-0.030531 0.065238 0.112208 0.155356 0.173152 0.155356 0.112208 0.065238 0.030531
-0.065238 0.139399 0.239763 0.331961 0.369987 0.331961 0.239763 0.139399 0.065238
-0.112208 0.239763 0.412386 0.570963 0.636368 0.570963 0.412386 0.239763 0.112208
-0.155356 0.331961 0.570963 0.790520 0.881075 0.790520 0.570963 0.331961 0.155356
-0.173152 0.369987 0.636368 0.881075 0.982004 0.881075 0.636368 0.369987 0.173152
-0.155356 0.331961 0.570963 0.790520 0.881075 0.790520 0.570963 0.331961 0.155356
-0.112208 0.239763 0.412386 0.570963 0.636368 0.570963 0.412386 0.239763 0.112208
-0.065238 0.139399 0.239763 0.331961 0.369987 0.331961 0.239763 0.139399 0.065238
-0.030531 0.065238 0.112208 0.155356 0.173152 0.155356 0.112208 0.065238 0.030531
diff --git a/sextractor/config/mexhat_1.5_5x5.conv b/sextractor/config/mexhat_1.5_5x5.conv
deleted file mode 100644
index 2ff2753..0000000
--- a/sextractor/config/mexhat_1.5_5x5.conv
+++ /dev/null
@@ -1,7 +0,0 @@
-CONV NORM
-# 5x5 convolution mask of a mexican-hat for images with FWHM~1.5 pixels.
--0.000109 -0.002374 -0.006302 -0.002374 -0.000109
--0.002374 -0.032222 -0.025569 -0.032222 -0.002374
--0.006302 -0.025569 0.276021 -0.025569 -0.006302
--0.002374 -0.032222 -0.025569 -0.032222 -0.002374
--0.000109 -0.002374 -0.006302 -0.002374 -0.000109
diff --git a/sextractor/config/mexhat_2.0_7x7.conv b/sextractor/config/mexhat_2.0_7x7.conv
deleted file mode 100644
index 7aad03c..0000000
--- a/sextractor/config/mexhat_2.0_7x7.conv
+++ /dev/null
@@ -1,9 +0,0 @@
-CONV NORM
-# 7x7 convolution mask of a mexican-hat for images with FWHM~2.0 pixels.
--0.000006 -0.000132 -0.000849 -0.001569 -0.000849 -0.000132 -0.000006
--0.000132 -0.002989 -0.017229 -0.028788 -0.017229 -0.002989 -0.000132
--0.000849 -0.017229 -0.042689 0.023455 -0.042689 -0.017229 -0.000849
--0.001569 -0.028788 0.023455 0.356183 0.023455 -0.028788 -0.001569
--0.000849 -0.017229 -0.042689 0.023455 -0.042689 -0.017229 -0.000849
--0.000132 -0.002989 -0.017229 -0.028788 -0.017229 -0.002989 -0.000132
--0.000006 -0.000132 -0.000849 -0.001569 -0.000849 -0.000132 -0.000006
diff --git a/sextractor/config/mexhat_2.5_7x7.conv b/sextractor/config/mexhat_2.5_7x7.conv
deleted file mode 100644
index a16d8ec..0000000
--- a/sextractor/config/mexhat_2.5_7x7.conv
+++ /dev/null
@@ -1,9 +0,0 @@
-CONV NORM
-# 7x7 convolution mask of a mexican-hat for images with FWHM~2.5 pixels.
--0.000284 -0.002194 -0.007273 -0.010722 -0.007273 -0.002194 -0.000284
--0.002194 -0.015640 -0.041259 -0.050277 -0.041259 -0.015640 -0.002194
--0.007273 -0.041259 -0.016356 0.095837 -0.016356 -0.041259 -0.007273
--0.010722 -0.050277 0.095837 0.402756 0.095837 -0.050277 -0.010722
--0.007273 -0.041259 -0.016356 0.095837 -0.016356 -0.041259 -0.007273
--0.002194 -0.015640 -0.041259 -0.050277 -0.041259 -0.015640 -0.002194
--0.000284 -0.002194 -0.007273 -0.010722 -0.007273 -0.002194 -0.000284
diff --git a/sextractor/config/mexhat_3.0_9x9.conv b/sextractor/config/mexhat_3.0_9x9.conv
deleted file mode 100644
index dfb8dcf..0000000
--- a/sextractor/config/mexhat_3.0_9x9.conv
+++ /dev/null
@@ -1,11 +0,0 @@
-CONV NORM
-# 9x9 convolution mask of a mexican-hat for images with FWHM~3.0 pixels.
--0.000041 -0.000316 -0.001357 -0.003226 -0.004294 -0.003226 -0.001357 -0.000316 -0.000041
--0.000316 -0.002428 -0.010013 -0.022204 -0.028374 -0.022204 -0.010013 -0.002428 -0.000316
--0.001357 -0.010013 -0.035450 -0.054426 -0.050313 -0.054426 -0.035450 -0.010013 -0.001357
--0.003226 -0.022204 -0.054426 0.033057 0.164532 0.033057 -0.054426 -0.022204 -0.003226
--0.004294 -0.028374 -0.050313 0.164532 0.429860 0.164532 -0.050313 -0.028374 -0.004294
--0.003226 -0.022204 -0.054426 0.033057 0.164532 0.033057 -0.054426 -0.022204 -0.003226
--0.001357 -0.010013 -0.035450 -0.054426 -0.050313 -0.054426 -0.035450 -0.010013 -0.001357
--0.000316 -0.002428 -0.010013 -0.022204 -0.028374 -0.022204 -0.010013 -0.002428 -0.000316
--0.000041 -0.000316 -0.001357 -0.003226 -0.004294 -0.003226 -0.001357 -0.000316 -0.000041
diff --git a/sextractor/config/mexhat_4.0_9x9.conv b/sextractor/config/mexhat_4.0_9x9.conv
deleted file mode 100644
index 8f8424a..0000000
--- a/sextractor/config/mexhat_4.0_9x9.conv
+++ /dev/null
@@ -1,11 +0,0 @@
-CONV NORM
-# 9x9 convolution mask of a mexican-hat for images with FWHM~4.0 pixels.
--0.002250 -0.007092 -0.015640 -0.024467 -0.028187 -0.024467 -0.015640 -0.007092 -0.002250
--0.007092 -0.021141 -0.041403 -0.054742 -0.057388 -0.054742 -0.041403 -0.021141 -0.007092
--0.015640 -0.041403 -0.057494 -0.024939 0.008058 -0.024939 -0.057494 -0.041403 -0.015640
--0.024467 -0.054742 -0.024939 0.145167 0.271470 0.145167 -0.024939 -0.054742 -0.024467
--0.028187 -0.057388 0.008058 0.271470 0.459236 0.271470 0.008058 -0.057388 -0.028187
--0.024467 -0.054742 -0.024939 0.145167 0.271470 0.145167 -0.024939 -0.054742 -0.024467
--0.015640 -0.041403 -0.057494 -0.024939 0.008058 -0.024939 -0.057494 -0.041403 -0.015640
--0.007092 -0.021141 -0.041403 -0.054742 -0.057388 -0.054742 -0.041403 -0.021141 -0.007092
--0.002250 -0.007092 -0.015640 -0.024467 -0.028187 -0.024467 -0.015640 -0.007092 -0.002250
diff --git a/sextractor/config/mexhat_5.0_11x11.conv b/sextractor/config/mexhat_5.0_11x11.conv
deleted file mode 100644
index e0f2fbf..0000000
--- a/sextractor/config/mexhat_5.0_11x11.conv
+++ /dev/null
@@ -1,13 +0,0 @@
-CONV NORM
-# 11x11 convolution mask of a mexican-hat for images with FWHM~5.0 pixels.
--0.002172 -0.005657 -0.011702 -0.019279 -0.025644 -0.028106 -0.025644 -0.019279 -0.011702 -0.005657 -0.002172
--0.005657 -0.014328 -0.028098 -0.042680 -0.052065 -0.054833 -0.052065 -0.042680 -0.028098 -0.014328 -0.005657
--0.011702 -0.028098 -0.049016 -0.059439 -0.051288 -0.043047 -0.051288 -0.059439 -0.049016 -0.028098 -0.011702
--0.019279 -0.042680 -0.059439 -0.030431 0.047481 0.093729 0.047481 -0.030431 -0.059439 -0.042680 -0.019279
--0.025644 -0.052065 -0.051288 0.047481 0.235153 0.339248 0.235153 0.047481 -0.051288 -0.052065 -0.025644
--0.028106 -0.054833 -0.043047 0.093729 0.339248 0.473518 0.339248 0.093729 -0.043047 -0.054833 -0.028106
--0.025644 -0.052065 -0.051288 0.047481 0.235153 0.339248 0.235153 0.047481 -0.051288 -0.052065 -0.025644
--0.019279 -0.042680 -0.059439 -0.030431 0.047481 0.093729 0.047481 -0.030431 -0.059439 -0.042680 -0.019279
--0.011702 -0.028098 -0.049016 -0.059439 -0.051288 -0.043047 -0.051288 -0.059439 -0.049016 -0.028098 -0.011702
--0.005657 -0.014328 -0.028098 -0.042680 -0.052065 -0.054833 -0.052065 -0.042680 -0.028098 -0.014328 -0.005657
--0.002172 -0.005657 -0.011702 -0.019279 -0.025644 -0.028106 -0.025644 -0.019279 -0.011702 -0.005657 -0.002172
diff --git a/sextractor/config/tophat_1.5_3x3.conv b/sextractor/config/tophat_1.5_3x3.conv
deleted file mode 100644
index 95e30c7..0000000
--- a/sextractor/config/tophat_1.5_3x3.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a top-hat PSF with diameter = 1.5 pixels.
-0.000000 0.180000 0.000000
-0.180000 1.000000 0.180000
-0.000000 0.180000 0.000000
diff --git a/sextractor/config/tophat_2.0_3x3.conv b/sextractor/config/tophat_2.0_3x3.conv
deleted file mode 100644
index 6cd5e1a..0000000
--- a/sextractor/config/tophat_2.0_3x3.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a top-hat PSF with diameter = 2.0 pixels.
-0.080000 0.460000 0.080000
-0.460000 1.000000 0.460000
-0.080000 0.460000 0.080000
diff --git a/sextractor/config/tophat_2.5_3x3.conv b/sextractor/config/tophat_2.5_3x3.conv
deleted file mode 100644
index 0a7cda3..0000000
--- a/sextractor/config/tophat_2.5_3x3.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a top-hat PSF with diameter = 2.5 pixels.
-0.260000 0.700000 0.260000
-0.700000 1.000000 0.700000
-0.260000 0.700000 0.260000
diff --git a/sextractor/config/tophat_3.0_3x3.conv b/sextractor/config/tophat_3.0_3x3.conv
deleted file mode 100644
index 5f5050c..0000000
--- a/sextractor/config/tophat_3.0_3x3.conv
+++ /dev/null
@@ -1,5 +0,0 @@
-CONV NORM
-# 3x3 convolution mask of a top-hat PSF with diameter = 3.0 pixels.
-0.560000 0.980000 0.560000
-0.980000 1.000000 0.980000
-0.560000 0.980000 0.560000
diff --git a/sextractor/config/tophat_4.0_5x5.conv b/sextractor/config/tophat_4.0_5x5.conv
deleted file mode 100644
index c6d5868..0000000
--- a/sextractor/config/tophat_4.0_5x5.conv
+++ /dev/null
@@ -1,7 +0,0 @@
-CONV NORM
-# 5x5 convolution mask of a top-hat PSF with diameter = 4.0 pixels.
-0.000000 0.220000 0.480000 0.220000 0.000000
-0.220000 0.990000 1.000000 0.990000 0.220000
-0.480000 1.000000 1.000000 1.000000 0.480000
-0.220000 0.990000 1.000000 0.990000 0.220000
-0.000000 0.220000 0.480000 0.220000 0.000000
diff --git a/sextractor/config/tophat_5.0_5x5.conv b/sextractor/config/tophat_5.0_5x5.conv
deleted file mode 100644
index c474b1c..0000000
--- a/sextractor/config/tophat_5.0_5x5.conv
+++ /dev/null
@@ -1,7 +0,0 @@
-CONV NORM
-# 5x5 convolution mask of a top-hat PSF with diameter = 5.0 pixels.
-0.150000 0.770000 1.000000 0.770000 0.150000
-0.770000 1.000000 1.000000 1.000000 0.770000
-1.000000 1.000000 1.000000 1.000000 1.000000
-0.770000 1.000000 1.000000 1.000000 0.770000
-0.150000 0.770000 1.000000 0.770000 0.150000
diff --git a/sextractor/configure b/sextractor/configure
deleted file mode 100755
index 732cf76..0000000
--- a/sextractor/configure
+++ /dev/null
@@ -1,6636 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sextractor 2.5.0.
-#
-# Report bugs to <bertin at iap.fr>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf at gnu.org and bertin at iap.fr
-$0: about your system, including any error possibly output
-$0: before this message. Then install a modern shell, or
-$0: manually run the script under such a shell if you do
-$0: have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='sextractor'
-PACKAGE_TARNAME='sextractor'
-PACKAGE_VERSION='2.5.0'
-PACKAGE_STRING='sextractor 2.5.0'
-PACKAGE_BUGREPORT='bertin at iap.fr'
-PACKAGE_URL=''
-
-ac_unique_file="src/makeit.c"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_header_list=
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-EGREP
-GREP
-CPP
-RANLIB
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-DATE3
-DATE2
-PACKAGER
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_icc
-enable_gprof
-enable_static
-enable_dependency_tracking
-enable_largefile
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures sextractor 2.5.0 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/sextractor]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of sextractor 2.5.0:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-icc Enable special mode for compilation with the Intel
- compiler (off by default)
- --enable-gprof Enable special mode for compilation with the gprof
- profiler (off by default)
- --enable-static Enable static linking (off by default)
- --enable-dependency-tracking
- do not reject slow dependency extractors
- --disable-dependency-tracking
- speeds up one-time build
- --disable-largefile omit support for large files
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <bertin at iap.fr>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-sextractor configure 2.5.0
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ---------------------------- ##
-## Report this to bertin at iap.fr ##
-## ---------------------------- ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by sextractor $as_me 2.5.0, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-
-as_fn_append ac_header_list " stdlib.h"
-as_fn_append ac_header_list " unistd.h"
-as_fn_append ac_header_list " sys/param.h"
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_aux_dir=
-for ac_dir in autoconf "$srcdir"/autoconf; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in autoconf \"$srcdir\"/autoconf" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-ac_config_headers="$ac_config_headers config.h"
-
-am__api_version='1.12'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
- alias in your environment" "$LINENO" 5
- fi
- if test "$2" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='sextractor'
- VERSION='2.5.0'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-date=`date +%Y-%m-%d`
-date2=`date +"%a %b %d %Y"`
-date3=`date +"%B %Y"`
-
-cat >>confdefs.h <<_ACEOF
-#define DATE "$date"
-_ACEOF
-
-PACKAGER="Emmanuel Bertin"
-
-DATE2="$date2"
-
-DATE3="$date3"
-
-
-# Include macros
-
-
-# Display pakage and version number
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: *********** Configuring: $PACKAGE $VERSION ($date) **********" >&5
-$as_echo "*********** Configuring: $PACKAGE $VERSION ($date) **********" >&6; }
-
-# Initialize the list of compilers to consider
-cclist="cc gcc"
-
-# Backup and reset the input CFLAGS and LDFLAGS
-mycflags="$CFLAGS"
-CFLAGS=""
-myldflags="$LDFLAGS"
-LDFLAGS=""
-
-# Provide special option for the Linux Intel C compiler
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux Intel C compiler mode" >&5
-$as_echo_n "checking for Linux Intel C compiler mode... " >&6; }
-# Check whether --enable-icc was given.
-if test "${enable_icc+set}" = set; then :
- enableval=$enable_icc; use_icc="yes"
- cclist="icc $cclist"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- use_icc="no"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Provide special option for gprof profiling
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gprof profiler mode" >&5
-$as_echo_n "checking for gprof profiler mode... " >&6; }
-# Check whether --enable-gprof was given.
-if test "${enable_gprof+set}" = set; then :
- enableval=$enable_gprof; use_gprof="yes"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- use_gprof="no"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Enable static linking
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking static linking" >&5
-$as_echo_n "checking static linking... " >&6; }
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; use_static="yes"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- use_static="no"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-# Checks for programs.
-# GCC is chosen last because it is likely to yield less optimized code
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in $cclist
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in $cclist
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-# C Compiler: Check that it is POSIX-compliant
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
-$as_echo_n "checking for library containing strerror... " >&6; }
-if ${ac_cv_search_strerror+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strerror ();
-int
-main ()
-{
-return strerror ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' cposix; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_strerror=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_strerror+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_strerror+:} false; then :
-
-else
- ac_cv_search_strerror=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
-$as_echo "$ac_cv_search_strerror" >&6; }
-ac_res=$ac_cv_search_strerror
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-
- msg="for C compiler optimization flags"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5
-$as_echo_n "checking $msg... " >&6; }
-if ${prog_cc_optim_flags+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- if test -n "$CC"; then
- cat > conftest.c <<EOF
-int main(int argc, char **argv) { return 0; }
-EOF
-
- if test "$GCC" = "yes"; then
- prog_cc_optim_flags="-O -funroll-loops -fomit-frame-pointer -Wall -g"
-
-
- elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
- $CC -c -O conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O"
-
- elif ($CC -V 2>&1 | grep -i "Digital UNIX Compiler"> /dev/null 2>&1 ||
- $CC -V 2>&1 | grep -i "Compaq C"> /dev/null 2>&1) &&
- $CC -c -fast conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-fast -tune host"
-
- elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
- $CC -c -qinfo=all -O2 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O2"
-
- elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
- $CC -c -fullwarn -O3 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O3"
-
- elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
- $CC -c -Aa +O3 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="+O3"
-
- elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
- $CC -c -Xc -O conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O"
-
- elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
- $CC -c -h conform -O3 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- prog_cc_optim_flags="-O3"
-
- fi
- rm -f conftest.*
- fi
- if test -n "$prog_cc_optim_flags"; then
- CFLAGS="$CFLAGS $prog_cc_optim_flags"
- else
- prog_cc_optim_flags="unknown"
- fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $prog_cc_optim_flags" >&5
-$as_echo "$prog_cc_optim_flags" >&6; }
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-
-
-# Checks for libraries.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
-$as_echo_n "checking for sin in -lm... " >&6; }
-if ${ac_cv_lib_m_sin+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char sin ();
-int
-main ()
-{
-return sin ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_sin=yes
-else
- ac_cv_lib_m_sin=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
-$as_echo "$ac_cv_lib_m_sin" >&6; }
-if test "x$ac_cv_lib_m_sin" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
- LIBS="-lm $LIBS"
-
-fi
-
-
-# Checks for header files.
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in fcntl.h limits.h malloc.h stdlib.h string.h sys/mman.h sys/types.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
- typedef int charset[2];
- const charset cs = { 0, 0 };
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
-else
- ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define off_t long int
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <time.h>
-
-int
-main ()
-{
-struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_struct_tm=time.h
-else
- ac_cv_struct_tm=sys/time.h
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5
-$as_echo "$ac_cv_struct_tm" >&6; }
-if test $ac_cv_struct_tm = sys/time.h; then
-
-$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
-$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if ${ac_cv_type_uid_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "uid_t" >/dev/null 2>&1; then :
- ac_cv_type_uid_t=yes
-else
- ac_cv_type_uid_t=no
-fi
-rm -f conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
-$as_echo "$ac_cv_type_uid_t" >&6; }
-if test $ac_cv_type_uid_t = no; then
-
-$as_echo "#define uid_t int" >>confdefs.h
-
-
-$as_echo "#define gid_t int" >>confdefs.h
-
-fi
-
-
-# Checks for library functions.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
-$as_echo_n "checking for error_at_line... " >&6; }
-if ${ac_cv_lib_error_at_line+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <error.h>
-int
-main ()
-{
-error_at_line (0, 0, "", 0, "an error occurred");
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_error_at_line=yes
-else
- ac_cv_lib_error_at_line=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
-$as_echo "$ac_cv_lib_error_at_line" >&6; }
-if test $ac_cv_lib_error_at_line = no; then
- case " $LIBOBJS " in
- *" error.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS error.$ac_objext"
- ;;
-esac
-
-fi
-
-for ac_header in stdlib.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
-_ACEOF
-
-fi
-
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if ${ac_cv_func_malloc_0_nonnull+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_malloc_0_nonnull=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
-
-int
-main ()
-{
-return ! malloc (0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_malloc_0_nonnull=yes
-else
- ac_cv_func_malloc_0_nonnull=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
-
-$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
-
-else
- $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
-
- case " $LIBOBJS " in
- *" malloc.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
- ;;
-esac
-
-
-$as_echo "#define malloc rpl_malloc" >>confdefs.h
-
-fi
-
-
-
-
-
- for ac_header in $ac_header_list
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-for ac_func in getpagesize
-do :
- ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
-fi
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
-$as_echo_n "checking for working mmap... " >&6; }
-if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_mmap_fixed_mapped=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the file system buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propagated back to all the places they're supposed to be.
-
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
- char *data, *data2, *data3;
- const char *cdata2;
- int i, pagesize;
- int fd, fd2;
-
- pagesize = getpagesize ();
-
- /* First, make a file with some known garbage in it. */
- data = (char *) malloc (pagesize);
- if (!data)
- return 1;
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand ();
- umask (0);
- fd = creat ("conftest.mmap", 0600);
- if (fd < 0)
- return 2;
- if (write (fd, data, pagesize) != pagesize)
- return 3;
- close (fd);
-
- /* Next, check that the tail of a page is zero-filled. File must have
- non-zero length, otherwise we risk SIGBUS for entire page. */
- fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
- if (fd2 < 0)
- return 4;
- cdata2 = "";
- if (write (fd2, cdata2, 1) != 1)
- return 5;
- data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
- if (data2 == MAP_FAILED)
- return 6;
- for (i = 0; i < pagesize; ++i)
- if (*(data2 + i))
- return 7;
- close (fd2);
- if (munmap (data2, pagesize))
- return 8;
-
- /* Next, try to mmap the file at a fixed address which already has
- something else allocated at it. If we can, also make sure that
- we see the same garbage. */
- fd = open ("conftest.mmap", O_RDWR);
- if (fd < 0)
- return 9;
- if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- return 10;
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- return 11;
-
- /* Finally, make sure that changes to the mapped area do not
- percolate back to the file as seen by read(). (This is a bug on
- some variants of i386 svr4.0.) */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = (char *) malloc (pagesize);
- if (!data3)
- return 12;
- if (read (fd, data3, pagesize) != pagesize)
- return 13;
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- return 14;
- close (fd);
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_mmap_fixed_mapped=yes
-else
- ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
-$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-$as_echo "#define HAVE_MMAP 1" >>confdefs.h
-
-fi
-rm -f conftest.mmap conftest.txt
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
-$as_echo_n "checking return type of signal handlers... " >&6; }
-if ${ac_cv_type_signal+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <signal.h>
-
-int
-main ()
-{
-return *(signal (0, 0)) (0) == 1;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_type_signal=int
-else
- ac_cv_type_signal=void
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
-$as_echo "$ac_cv_type_signal" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
-$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- rm -f conftest.sym conftest.file
-echo >conftest.file
-if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
- if test "$cross_compiling" = yes; then :
- ac_cv_func_lstat_dereferences_slashed_symlink=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-struct stat sbuf;
- /* Linux will dereference the symlink and fail, as required by POSIX.
- That is better in the sense that it means we will not
- have to compile and use the lstat wrapper. */
- return lstat ("conftest.sym/", &sbuf) == 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_lstat_dereferences_slashed_symlink=yes
-else
- ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-else
- # If the `ln -s' command failed, then we probably don't even
- # have an lstat function.
- ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -f conftest.sym conftest.file
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-
-test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
-
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
-
-
-if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
- case " $LIBOBJS " in
- *" lstat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
- ;;
-esac
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
-$as_echo_n "checking whether stat accepts an empty string... " >&6; }
-if ${ac_cv_func_stat_empty_string_bug+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_stat_empty_string_bug=yes
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-struct stat sbuf;
- return stat ("", &sbuf) == 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_stat_empty_string_bug=no
-else
- ac_cv_func_stat_empty_string_bug=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
-$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
-if test $ac_cv_func_stat_empty_string_bug = yes; then
- case " $LIBOBJS " in
- *" stat.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS stat.$ac_objext"
- ;;
-esac
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STAT_EMPTY_STRING_BUG 1
-_ACEOF
-
-fi
-
-for ac_func in strftime
-do :
- ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-else
- # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if ${ac_cv_lib_intl_strftime+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strftime ();
-int
-main ()
-{
-return strftime ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_intl_strftime=yes
-else
- ac_cv_lib_intl_strftime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = xyes; then :
- $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
-for ac_func in atexit getenv memcpy memmove memset mkdir munmap strstr
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-# Check support for large files
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
- enableval=$enable_largefile;
-fi
-
-if test "$enable_largefile" != no; then
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- break
-fi
-rm -f core conftest.err conftest.$ac_objext
- CC="$CC -n32"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_largefile_CC=' -n32'; break
-fi
-rm -f core conftest.err conftest.$ac_objext
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=64; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_file_offset_bits=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
- if test $ac_cv_sys_file_offset_bits = unknown; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_large_files=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
- fi
-
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_source+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h> /* for off_t */
- #include <stdio.h>
-int
-main ()
-{
-int (*fp) (FILE *, off_t, int) = fseeko;
- return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_sys_largefile_source=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _LARGEFILE_SOURCE 1
-#include <sys/types.h> /* for off_t */
- #include <stdio.h>
-int
-main ()
-{
-int (*fp) (FILE *, off_t, int) = fseeko;
- return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_sys_largefile_source=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_cv_sys_largefile_source=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
-$as_echo "$ac_cv_sys_largefile_source" >&6; }
-case $ac_cv_sys_largefile_source in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
-_ACEOF
-;;
-esac
-rm -rf conftest*
-
-# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
-# in glibc 2.1.3, but that breaks too many other things.
-# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-if test $ac_cv_sys_largefile_source != unknown; then
-
-$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
-
-fi
-
-
-########################### No multithreading yet! ###########################
-#AC_DEFINE(USE_THREADS, 1, [Triggers multhreading])
-
-cat >>confdefs.h <<_ACEOF
-#define THREADS_NMAX 1
-_ACEOF
-
-
-# href to the XSL style-sheet in preflist.h
-CFLAGS="$CFLAGS -DXSL_URL=\\\"file://$datadir/${PACKAGE_NAME}/${PACKAGE_NAME}.xsl\\\""
-
-# 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"
-fi
-
-# Link with gprof option
-if test "$use_gprof" = "yes"; then
- if test "$use_icc" = "yes"; then
- CFLAGS="$CFLAGS -pq"
- else
- CFLAGS="-O3 -pg"
- fi
- use_static="no"
-fi
-
-if test "$use_static" = "yes"; then
- LDFLAGS="$LDFLAGS -static"
-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
-
-# Display compiler and linker flags
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: I will compile using: $CC $CFLAGS" >&5
-$as_echo "I will compile using: $CC $CFLAGS" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: I will link using: $CC $LDFLAGS $LIBS" >&5
-$as_echo "I will link using: $CC $LDFLAGS $LIBS" >&6; }
-
-ac_config_files="$ac_config_files Makefile man/Makefile src/Makefile src/fits/Makefile src/wcs/Makefile sextractor.spec sextractor-tpx.spec man/sex.1"
-
-
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by sextractor $as_me 2.5.0, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <bertin at iap.fr>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-sextractor config.status 2.5.0
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "src/fits/Makefile") CONFIG_FILES="$CONFIG_FILES src/fits/Makefile" ;;
- "src/wcs/Makefile") CONFIG_FILES="$CONFIG_FILES src/wcs/Makefile" ;;
- "sextractor.spec") CONFIG_FILES="$CONFIG_FILES sextractor.spec" ;;
- "sextractor-tpx.spec") CONFIG_FILES="$CONFIG_FILES sextractor-tpx.spec" ;;
- "man/sex.1") CONFIG_FILES="$CONFIG_FILES man/sex.1" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/sextractor/configure.ac b/sextractor/configure.ac
deleted file mode 100644
index a5914ab..0000000
--- a/sextractor/configure.ac
+++ /dev/null
@@ -1,146 +0,0 @@
-# configure.in for SExtractor
-# (C) E.Bertin 2002-2006
-# 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 at iap.fr])
-AC_CONFIG_SRCDIR(src/makeit.c)
-AC_CONFIG_AUX_DIR(autoconf)
-AC_CONFIG_HEADERS(config.h)
-AM_INIT_AUTOMAKE
-date=`date +%Y-%m-%d`
-date2=`date +"%a %b %d %Y"`
-date3=`date +"%B %Y"`
-AC_DEFINE_UNQUOTED(DATE, "$date", [Archive creation date])
-AC_SUBST(PACKAGER, "Emmanuel Bertin")
-AC_SUBST(DATE2, "$date2")
-AC_SUBST(DATE3, "$date3")
-
-# Include macros
-sinclude(acx_prog_cc_optim.m4)
-
-# Display pakage and version number
-AC_MSG_RESULT([*********** Configuring: $PACKAGE $VERSION ($date) **********])
-
-# Initialize the list of compilers to consider
-cclist="cc gcc"
-
-# Backup and reset the input CFLAGS and LDFLAGS
-mycflags="$CFLAGS"
-CFLAGS=""
-myldflags="$LDFLAGS"
-LDFLAGS=""
-
-# Provide special option for the Linux Intel C compiler
-AC_MSG_CHECKING([for Linux Intel C compiler mode])
-AC_ARG_ENABLE(icc,
- [AC_HELP_STRING([--enable-icc],
- [Enable special mode for compilation with the Intel compiler \
-(off by default)])],
- use_icc="yes"
- cclist="icc $cclist"
- AC_MSG_RESULT([yes]),
- 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_PROG_CC([$cclist])
-# C Compiler: Check that it is POSIX-compliant
-AC_ISC_POSIX
-ACX_PROG_CC_OPTIM
-AC_PROG_RANLIB
-AC_PROG_INSTALL
-
-# Checks for libraries.
-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])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_OFF_T
-AC_TYPE_SIZE_T
-AC_STRUCT_TM
-AC_TYPE_UID_T
-
-# Checks for library functions.
-AC_FUNC_ERROR_AT_LINE
-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])
-
-# 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])
-
-# href to the XSL style-sheet in preflist.h
-CFLAGS="$CFLAGS -DXSL_URL=\\\"file://$datadir/${PACKAGE_NAME}/${PACKAGE_NAME}.xsl\\\""
-
-# 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"
-fi
-
-# Link with gprof option
-if test "$use_gprof" = "yes"; then
- if test "$use_icc" = "yes"; then
- CFLAGS="$CFLAGS -pq"
- else
- CFLAGS="-O3 -pg"
- fi
- use_static="no"
-fi
-
-if test "$use_static" = "yes"; then
- LDFLAGS="$LDFLAGS -static"
-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
-
-# 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_OUTPUT
diff --git a/sextractor/doc/README.DOC b/sextractor/doc/README.DOC
deleted file mode 100644
index a267b12..0000000
--- a/sextractor/doc/README.DOC
+++ /dev/null
@@ -1,10 +0,0 @@
-The present documentation of SExtractor2 is still very incomplete: this
-is rather a ``proto-documentation''. Chapters are missing. The english
-is so-so. At least I tried to remove any obsolete information from V1.0.
-I will progressively upgrade the documentation during the coming months.
-In the meanwhile, you may still retrieve some basic information from the
-old documentation included in V1.0 archive:
-ftp://ftp/pub/from_users/bertin/sextractor/sex_1.0a.tar.gz
-The SExtractor handbook from Benne Holwerda is also included for convenience.
-
- Emmanuel Bertin.
diff --git a/sextractor/doc/SE_Handbook.4.pdf b/sextractor/doc/SE_Handbook.4.pdf
deleted file mode 100644
index a6f55ad..0000000
Binary files a/sextractor/doc/SE_Handbook.4.pdf and /dev/null differ
diff --git a/sextractor/doc/sextractor.pdf b/sextractor/doc/sextractor.pdf
deleted file mode 100644
index 3528d66..0000000
Binary files a/sextractor/doc/sextractor.pdf and /dev/null differ
diff --git a/sextractor/man/Makefile.am b/sextractor/man/Makefile.am
deleted file mode 100644
index 17acd7b..0000000
--- a/sextractor/man/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-# Manpage Makefile for SExtractor
-# Copyright (C) 2002 Emmanuel Bertin.
-#dist_man_MANS = sex.1 sex.x
diff --git a/sextractor/man/Makefile.in b/sextractor/man/Makefile.in
deleted file mode 100644
index 052e46d..0000000
--- a/sextractor/man/Makefile.in
+++ /dev/null
@@ -1,353 +0,0 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2012 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-subdir = man
-DIST_COMMON = $(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 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = sex.1
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE2 = @DATE2@
-DATE3 = @DATE3@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGER = @PACKAGER@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-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@
-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_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-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_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu man/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-sex.1: $(top_builddir)/config.status $(srcdir)/sex.1.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
- @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; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.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-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 \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am
-
-
-# Manpage Makefile for SExtractor
-# Copyright (C) 2002 Emmanuel Bertin.
-#dist_man_MANS = sex.1 sex.x
-
-# 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.
-.NOEXPORT:
diff --git a/sextractor/man/sex.1.in b/sextractor/man/sex.1.in
deleted file mode 100644
index 06325dc..0000000
--- a/sextractor/man/sex.1.in
+++ /dev/null
@@ -1,47 +0,0 @@
-.TH SEXTRACTOR "1" "@DATE3@" "SWarp @PACKAGE_VERSION@" "User Commands"
-.SH NAME
-sex \- extract a source catalog from an astronomical FITS image
-.SH SYNOPSIS
-.B sex \fIimage\fR [\fI-c configuration-file\fR]
-.RS
-[\fI-parameter1 value1 -parameter2 value2 ...\fR]
-.RE
-.TP
-.B sex \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
-.RS
-[\fI-parameter1 value1 -parameter2 value2 ...\fR]
-.RE
-.TP
-.B sex \fI-d\fR
-.SH DESCRIPTION
-SExtractor is a program that builds a catalogue of objects from an astronomical
-image. Although it is particularly oriented towards reduction of large scale
-galaxy-survey data, it performs rather well on moderately crowded star fields.
-.RE
-See http://terapix.iap.fr/soft/sextractor for more details.
-.SS "Operation modes:"
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-print this help, then exit
-.TP
-\fB\-V\fR, \fB\-\-version\fR
-print version number, then exit
-.TP
-\fB\-d\fR, \fB\-\-dump\fR
-dump a default configuration file
-.SH AUTHOR
-Written by Emmanuel Bertin (Institut d'Astrophysique de Paris and Observatoire de Paris).
-.PP
-Copyright 1994-2005 Emmanuel Bertin
-.RE
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-.SH "REPORTING BUGS"
-Report bugs to <sextractor at iap.fr>.
-.SH "SEE ALSO"
-.BR swarp (1)
-.PP
-The full documentation for
-.B SExtractor
-is maintained as a Postscript manual available at
-.B http://terapix.iap.fr/soft/sextractor
diff --git a/sextractor/sextractor-tpx.spec.in b/sextractor/sextractor-tpx.spec.in
deleted file mode 100644
index 6ff2514..0000000
--- a/sextractor/sextractor-tpx.spec.in
+++ /dev/null
@@ -1,56 +0,0 @@
-%define name @PACKAGE_NAME@
-%define version @PACKAGE_VERSION@
-%define release 1tpx
-
-Summary: Extract catalogs of sources from astronomical images
-Name: %{name}
-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: LGPL
-Group: Sciences/Astronomy
-BuildRoot: %{_tmppath}/%{name}-buildroot
-Prefix: %{_prefix}
-
-%description
-SExtractor stands for ``Source Extractor'': a software for making catalog of sources from astronomical images.
-
-%prep
-%setup -q
-
-%build
-./configure --prefix=$RPM_BUILD_ROOT/usr/local/ --mandir=$RPM_BUILD_ROOT/usr/local/man/ --enable-static
-
-make
-
-%install
-make install
-
-%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.ps
-
-%changelog
-* @DATE2@ @PACKAGER@ <@PACKAGE_BUGREPORT@>
-- Automatic RPM rebuild
-* Tue May 13 2003 Emmanuel Bertin <bertin at iap.fr>
-- RPM build for V2.3
-* Fri Apr 04 2003 Emmanuel Bertin <bertin at iap.fr>
-- RPM build for V2.3b4
-* Wed Mar 05 2003 Emmanuel Bertin <bertin at iap.fr>
-- RPM build for V2.3b3
-* Fri Feb 07 2003 Emmanuel Bertin <bertin at iap.fr>
-- Second RPM build
-* Fri Jan 24 2003 Emmanuel Bertin <bertin at iap.fr>
-- Second RPM build
-* Sun Dec 15 2002 Emmanuel Bertin <bertin at iap.fr>
-- First RPM build
-
-# end of file
diff --git a/sextractor/sextractor.spec.in b/sextractor/sextractor.spec.in
deleted file mode 100644
index d505b2c..0000000
--- a/sextractor/sextractor.spec.in
+++ /dev/null
@@ -1,60 +0,0 @@
-%define name @PACKAGE_NAME@
-%define version @PACKAGE_VERSION@
-%define release 1
-
-Summary: Extract catalogs of sources from astronomical images
-Name: %{name}
-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: LGPL
-Group: Sciences/Astronomy
-BuildRoot: %{_tmppath}/%{name}-buildroot
-Prefix: %{_prefix}
-
-%description
-SExtractor stands for ``Source Extractor'': a software for making catalog of sources from astronomical images.
-
-%prep
-%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"
-else
-./configure --prefix=$RPM_BUILD_ROOT/usr/local/ --mandir=$RPM_BUILD_ROOT/usr/local/man/
-make
-fi
-
-%install
-make install
-
-%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
-
-%changelog
-* @DATE2@ @PACKAGER@ <@PACKAGE_BUGREPORT@>
-- Automatic RPM rebuild
-* Tue May 13 2003 Emmanuel Bertin <bertin at iap.fr>
-- RPM build for V2.3
-* Fri Apr 04 2003 Emmanuel Bertin <bertin at iap.fr>
-- RPM build for V2.3b4
-* Wed Mar 05 2003 Emmanuel Bertin <bertin at iap.fr>
-- RPM build for V2.3b3
-* Fri Feb 07 2003 Emmanuel Bertin <bertin at iap.fr>
-- Second RPM build
-* Fri Jan 24 2003 Emmanuel Bertin <bertin at iap.fr>
-- Second RPM build
-* Sun Dec 15 2002 Emmanuel Bertin <bertin at iap.fr>
-- First RPM build
-
-# end of file
diff --git a/sextractor/src/Makefile.am b/sextractor/src/Makefile.am
deleted file mode 100644
index 3af5647..0000000
--- a/sextractor/src/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-# Program Makefile for SEx
-# Copyright (C) 2004-2006 Emmanuel Bertin.
-SUBDIRS = fits wcs
-bin_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 poly.c prefs.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
-DATE=`date +"%Y-%m-%d"`
diff --git a/sextractor/src/Makefile.in b/sextractor/src/Makefile.in
deleted file mode 100644
index a8988bd..0000000
--- a/sextractor/src/Makefile.in
+++ /dev/null
@@ -1,690 +0,0 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2012 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-bin_PROGRAMS = sex$(EXEEXT)
-subdir = src
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/autoconf/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
-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)
-sex_OBJECTS = $(am_sex_OBJECTS)
-sex_DEPENDENCIES = $(top_builddir)/src/fits/libfits.a \
- $(top_builddir)/src/wcs/libwcs_c.a
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-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)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
- html-recursive info-recursive install-data-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
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
- distdir
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE2 = @DATE2@
-DATE3 = @DATE3@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGER = @PACKAGER@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-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@
-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_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-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_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# Program Makefile for SEx
-# Copyright (C) 2004-2006 Emmanuel Bertin.
-SUBDIRS = fits 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 poly.c prefs.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
-DATE = `date +"%Y-%m-%d"`
-all: all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p; \
- then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-sex$(EXEEXT): $(sex_OBJECTS) $(sex_DEPENDENCIES) $(EXTRA_sex_DEPENDENCIES)
- @rm -f sex$(EXEEXT)
- $(LINK) $(sex_OBJECTS) $(sex_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/analyse.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/assoc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/astrom.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/back.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bpro.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/catout.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/check.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/clean.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/extract.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/field.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/filter.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flag.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/graph.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/growth.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/image.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/interpolate.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/makeit.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/manobjlist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/misc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/neurro.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/photom.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/plist.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/poly.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/prefs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/psf.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/readimage.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/refine.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/retina.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/scan.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/som.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/weight.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/winpos.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/xml.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
- @fail= failcom='exit 1'; \
- for f in x $$MAKEFLAGS; do \
- case $$f in \
- *=* | --[!k]*);; \
- *k*) failcom='fail=yes';; \
- esac; \
- done; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-cscopelist-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
- done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-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)'; \
- 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; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(PROGRAMS)
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(bindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \
- cscopelist-recursive ctags-recursive install-am install-strip \
- tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am check check-am clean clean-binPROGRAMS \
- clean-generic cscopelist cscopelist-recursive ctags \
- ctags-recursive distclean distclean-compile distclean-generic \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-binPROGRAMS 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 mostlyclean mostlyclean-compile \
- mostlyclean-generic 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.
-.NOEXPORT:
diff --git a/sextractor/src/analyse.c b/sextractor/src/analyse.c
deleted file mode 100644
index 18e724a..0000000
--- a/sextractor/src/analyse.c
+++ /dev/null
@@ -1,733 +0,0 @@
- /*
- analyse.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: analyse(), endobject()...: measurements on detections.
-*
-* Last modify: 12/01/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "back.h"
-#include "check.h"
-#include "assoc.h"
-#include "astrom.h"
-#include "plist.h"
-#include "flag.h"
-#include "growth.h"
-#include "image.h"
-#include "photom.h"
-#include "psf.h"
-#include "retina.h"
-#include "som.h"
-#include "winpos.h"
-
-static obj2struct *obj2 = &outobj2;
-
-/********************************* analyse ***********************************/
-void analyse(picstruct *field, picstruct *dfield, int objnb,
- objliststruct *objlist)
-
- {
- objstruct *obj = objlist->obj+objnb;
-
-/* Do photometry on the detection image if no other image available */
- obj->number = ++thecat.ndetect;
- obj->bkg = (float)back(field, (int)(obj->mx+0.5), (int)(obj->my+0.5));
- obj->dbkg = 0.0;
- if (prefs.pback_type == LOCAL)
- localback(field, obj);
- else
- obj->sigbkg = field->backsig;
-
- examineiso(field, dfield, obj, objlist->plist);
-
-
-/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
-/* Put here your calls to custom functions related to isophotal measurements.
-Ex:
-
-compute_myparams(obj);
-
-*/
-
-/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
-
-
- return;
- }
-
-
-/***************************** examineiso ********************************/
-/*
-compute some isophotal parameters IN THE MEASUREMENT image.
-*/
-void examineiso(picstruct *field, picstruct *dfield, objstruct *obj,
- pliststruct *pixel)
-
- {
- checkstruct *check;
- pliststruct *pixt;
- int i,j,k,h, photoflag,area,errflag, cleanflag,
- pospeakflag, profflag, minarea, gainflag;
- double tv,sigtv, ngamma,
- esum, emx2,emy2,emxy, err,gain,backnoise2,dbacknoise2,
- xm,ym, x,y,var,var2, profflux,proffluxvar;
- float *heap,*heapt,*heapj,*heapk, swap;
- PIXTYPE pix, cdpix, tpix, peak,cdpeak, thresh,dthresh;
- static PIXTYPE threshs[NISO];
-
-
- if (!dfield)
- dfield = field;
-
-/* Prepare computation of positional error */
- esum = emx2 = emy2 = emxy = 0.0;
- if ((errflag=FLAG(obj.poserr_mx2)))
- {
- dbacknoise2 = dfield->backsig*dfield->backsig;
- xm = obj->mx;
- ym = obj->my;
- }
- else
- xm = ym = dbacknoise2 = 0.0; /* to avoid gcc -Wall warnings */
-
- pospeakflag = FLAG(obj.peakx);
- profflag = FLAG(obj.flux_prof);
- gain = prefs.gain;
- ngamma = field->ngamma;
- photoflag = (prefs.detect_type==PHOTO);
- gainflag = PLISTEXIST(var) && prefs.weightgain_flag;
-
- h = minarea = prefs.ext_minarea;
-
-/* Prepare selection of the heap selection for CLEANing */
- if ((cleanflag = prefs.clean_flag))
- {
- if (obj->fdnpix < minarea)
- {
- obj->mthresh = 0.0;
- cleanflag = 0;
- heapt = heap = NULL; /* to avoid gcc -Wall warnings */
- }
- else
- {
- QMALLOC(heap, float, minarea);
- heapt = heap;
- }
- }
- else
- {
- obj->mthresh = 0.0;
- heapt = heap = NULL; /* to avoid gcc -Wall warnings */
- }
-
-
-/* Measure essential isophotal parameters in the measurement image... */
- tv = sigtv = profflux = proffluxvar = 0.0;
- var = backnoise2 = field->backsig*field->backsig;
- peak = -BIG;
- cdpeak = -BIG;
- thresh = field->thresh;
- dthresh = dfield->dthresh;
- area = 0;
- for (pixt=pixel+obj->firstpix; pixt>=pixel; pixt=pixel+PLIST(pixt,nextpix))
- {
- pix = PLIST(pixt,value);
- if (pix>peak)
- peak = pix;
-
- cdpix=PLISTPIX(pixt,cdvalue);
- if (pospeakflag && cdpix>cdpeak)
- {
- cdpeak=cdpix;
- obj->peakx = PLIST(pixt,x) + 1;
- obj->peaky = PLIST(pixt,y) + 1;
- }
- if (PLISTEXIST(var))
- var = PLISTPIX(pixt, var);
- if (photoflag)
- {
- pix = exp(pix/ngamma);
- var2 = pix*pix*var;
- }
- else
- var2 = var;
-
- if (gainflag && pix>0.0 && gain>0.0)
- var2 += pix/gain*var/backnoise2;
-
- sigtv += var2;
-
- if (profflag && cdpix>0.0)
- {
- profflux += cdpix*pix;
- proffluxvar += cdpix*var2;
- }
-
- if (pix>thresh)
- area++;
- tv += pix;
- if (errflag)
- {
- err = dbacknoise2;
- if (gain>0.0 && cdpix>0.0)
- err += cdpix/gain;
- x = PLIST(pixt,x) - xm;
- y = PLIST(pixt,y) - ym;
- esum += err;
- emx2 += err*x*x;
- emy2 += err*y*y;
- emxy += err*x*y;
- }
-
-/*-- Find the minareath pixel in decreasing intensity for CLEANing */
- if (cleanflag)
- {
- tpix = PLISTPIX(pixt, cdvalue) - (PLISTEXIST(dthresh)?
- PLISTPIX(pixt, dthresh):dthresh);
- if (h>0)
- *(heapt++) = (float)tpix;
- else if (h)
- {
- if ((float)tpix>*heap)
- {
- *heap = (float)tpix;
- for (j=0; (k=(j+1)<<1)<=minarea; j=k)
- {
- heapk = heap+k;
- heapj = heap+j;
- if (k != minarea && *(heapk-1) > *heapk)
- {
- heapk++;
- k++;
- }
- if (*heapj <= *(--heapk))
- break;
- swap = *heapk;
- *heapk = *heapj;
- *heapj = swap;
- }
- }
- }
- else
- hmedian(heap, minarea);
- h--;
- }
- }
-
-/* Flagging from the flag-map */
- if (PLISTEXIST(flag))
- getflags(obj, pixel);
-
- if (cleanflag)
- {
- obj->mthresh = *heap;
- 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;
-
- flux2 = obj->fdflux*obj->fdflux;
-/*-- Estimation of the error ellipse moments: we re-use previous variables */
- emx2 /= flux2; /* variance of xm */
- emy2 /= flux2; /* variance of ym */
- emxy /= flux2; /* covariance */
-
-/*-- Handle fully correlated profiles (which cause a singularity...) */
- esum *= 0.08333/flux2;
- if (obj->singuflag && (emx2*emy2-emxy*emxy) < esum*esum)
- {
- emx2 += esum;
- emy2 += esum;
- }
-
- obj->poserr_mx2 = emx2;
- obj->poserr_my2 = emy2;
- obj->poserr_mxy = emxy;
- }
-
- if (photoflag)
- {
- tv = ngamma*(tv-obj->fdnpix*exp(obj->dbkg/ngamma));
- sigtv /= ngamma*ngamma;
- }
- else
- {
- tv -= obj->fdnpix*obj->dbkg;
- if (!gainflag && gain > 0.0 && tv>0.0)
- sigtv += tv/gain;
- }
-
- obj->npix = area;
- obj->flux = tv;
- obj->fluxerr = sigtv;
- obj->peak = peak;
-
- obj->thresh -= obj->dbkg;
- obj->peak -= obj->dbkg;
-
-/* Initialize isophotal thresholds so as to sample optimally the full profile*/
-
- if (FLAG(obj.iso[0]))
- {
- int *iso;
- PIXTYPE *thresht;
-
- memset(obj->iso, 0, NISO*sizeof(int));
- if (prefs.detect_type == PHOTO)
- for (i=0; i<NISO; i++)
- threshs[i] = obj->thresh + (obj->peak-obj->thresh)*i/NISO;
- else
- {
- if (obj->peak>0.0 && obj->thresh>0.0)
- for (i=0; i<NISO; i++)
- threshs[i] = obj->thresh*pow(obj->peak/obj->thresh, (double)i/NISO);
- else
- for (i=0; i<NISO; i++)
- threshs[i] = 0.0;
- }
- for (pixt=pixel+obj->firstpix; pixt>=pixel; pixt=pixel+PLIST(pixt,nextpix))
- for (i=NISO,iso=obj->iso,thresht=threshs;
- i-- && PLIST(pixt,value)>*(thresht++);)
- (*(iso++))++;
- }
-
-/* Put objects in "segmentation check-image" */
-
- if ((check = prefs.check[CHECK_SEGMENTATION]))
- for (pixt=pixel+obj->firstpix; pixt>=pixel; pixt=pixel+PLIST(pixt,nextpix))
- ((ULONG *)check->pix)[check->width*PLIST(pixt,y)+PLIST(pixt,x)]
- = (ULONG)obj->number;
-
- if ((check = prefs.check[CHECK_OBJECTS]))
- for (pixt=pixel+obj->firstpix; pixt>=pixel; pixt=pixel+PLIST(pixt,nextpix))
- ((PIXTYPE *)check->pix)[check->width*PLIST(pixt,y)+PLIST(pixt,x)]
- = PLIST(pixt,value);
-
-/* Compute the FWHM of the object */
- if (FLAG(obj.fwhm))
- {
- PIXTYPE thresh0;
-
- thresh0 = obj->peak/5.0;
- if (thresh0<obj->thresh)
- thresh0 = obj->thresh;
- if (thresh0>0.0)
- {
- double mx,my, s,sx,sy,sxx,sxy, dx,dy,d2, lpix,pix, b, inverr2, sat,
- dbkg, d, bmax;
-
- mx = obj->mx;
- my = obj->my;
- dbkg = obj->dbkg;
- sat = (double)(prefs.satur_level - obj->bkg);
- s = sx = sy = sxx = sxy = 0.0;
- for (pixt=pixel+obj->firstpix;pixt>=pixel;pixt=pixel+PLIST(pixt,nextpix))
- {
- pix = PLIST(pixt,value)-dbkg;
- if (pix>thresh0 && pix<sat)
- {
- dx = PLIST(pixt,x) - mx;
- dy = PLIST(pixt,y) - my;
- lpix = log(pix);
- inverr2 = pix*pix;
- s += inverr2;
- d2 = dx*dx+dy*dy;
- sx += d2*inverr2;
- sxx += d2*d2*inverr2;
- sy += lpix*inverr2;
- sxy += lpix*d2*inverr2;
- }
- }
- d = s*sxx-sx*sx;
- if (fabs(d)>0.0)
- {
- b = -(s*sxy-sx*sy)/d;
- if (b<(bmax = 1/(13*obj->a*obj->b))) /* to have FWHM # 6 sigma */
- b = bmax;
- obj->fwhm = (float)(1.6651/sqrt(b));
-/*----- correction for undersampling effects (established from simulations) */
- if (obj->fwhm>0.0)
- obj->fwhm -= 1/(4*obj->fwhm);
- }
- else
- obj->fwhm = 0.0;
- }
- else
- obj->fwhm = 0.0;
- }
-
- return;
- }
-
-
-/******************************* endobject **********************************/
-/*
-Final processing of object data, just before saving it to the catalog.
-*/
-void endobject(picstruct *field, picstruct *dfield, picstruct *wfield,
- picstruct *dwfield, int n, objliststruct *objlist)
- {
- checkstruct *check;
- int i,j, ix,iy,selecflag, newnumber,nsub;
- objstruct *obj;
-
- obj = &objlist->obj[n];
-
-/* Current FITS extension */
- obj2->ext_number = thecat.currext;
-
-/* Source position */
- obj2->sposx = (float)(obj2->posx = obj->mx+1.0); /* That's standard FITS */
- obj2->sposy = (float)(obj2->posy = obj->my+1.0);
-
-/* Integer coordinates */
- ix=(int)(obj->mx+0.49999);
- iy=(int)(obj->my+0.49999);
-
-/* Association */
- if (prefs.assoc_flag)
- obj2->assoc_number = do_assoc(field, obj2->sposx, obj2->sposy);
-
- if (prefs.assoc_flag && prefs.assocselec_type!=ASSOCSELEC_ALL)
- selecflag = (prefs.assocselec_type==ASSOCSELEC_MATCHED)?
- obj2->assoc_number:!obj2->assoc_number;
- else
- selecflag = 1;
-
- if (selecflag)
- {
-/*-- Paste back to the image the object's pixels if BLANKing is on */
- if (prefs.blank_flag)
- {
- pasteimage(field, obj->blank, obj->subw, obj->subh,
- obj->subx, obj->suby);
- if (obj->dblank)
- pasteimage(dfield, obj->dblank, obj->subw, obj->subh,
- obj->subx, obj->suby);
- }
-
-/*------------------------- Error ellipse parameters ------------------------*/
- if (FLAG(obj2.poserr_a))
- {
- double pmx2,pmy2,temp,theta;
-
- if (fabs(temp=obj->poserr_mx2-obj->poserr_my2) > 0.0)
- theta = atan2(2.0 * obj->poserr_mxy,temp) / 2.0;
- else
- theta = PI/4.0;
-
- temp = sqrt(0.25*temp*temp+obj->poserr_mxy*obj->poserr_mxy);
- pmy2 = pmx2 = 0.5*(obj->poserr_mx2+obj->poserr_my2);
- pmx2+=temp;
- pmy2-=temp;
-
- obj2->poserr_a = (float)sqrt(pmx2);
- obj2->poserr_b = (float)sqrt(pmy2);
- obj2->poserr_theta = theta*180.0/PI;
- }
-
- if (FLAG(obj2.poserr_cxx))
- {
- double xm2,ym2, xym, temp;
-
- xm2 = obj->poserr_mx2;
- ym2 = obj->poserr_my2;
- xym = obj->poserr_mxy;
- obj2->poserr_cxx = (float)(ym2/(temp=xm2*ym2-xym*xym));
- obj2->poserr_cyy = (float)(xm2/temp);
- obj2->poserr_cxy = (float)(-2*xym/temp);
- }
-
-/* ---- Aspect ratio */
-
- if (FLAG(obj2.elong))
- obj2->elong = obj->a/obj->b;
-
- if (FLAG(obj2.ellip))
- obj2->ellip = 1-obj->b/obj->a;
-
- if (FLAG(obj2.polar))
- obj2->polar = (obj->a*obj->a - obj->b*obj->b)
- / (obj->a*obj->a + obj->b*obj->b);
-
-/*------------------------------- Photometry -------------------------------*/
-
-/*-- 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);
-
- if (FLAG(obj2.flux_aper))
- for (i=0; i<prefs.naper; i++)
- computeaperflux(field, wfield, obj, i);
-
- if (FLAG(obj2.flux_auto))
- computeautoflux(field, dfield, wfield, dwfield, obj);
-
- if (FLAG(obj2.flux_petro))
- computepetroflux(field, dfield, wfield, dwfield, obj);
-
-/*-- Growth curve */
- if (prefs.growth_flag)
- makeavergrowth(field, wfield, obj);
-
-/*--------------------------- Windowed barycenter --------------------------*/
- if (FLAG(obj2.winpos_x))
- compute_winpos(field, wfield, obj);
-
-/*-- What about the peak of the profile? */
- if (obj->peak+obj->bkg >= prefs.satur_level)
- obj->flag |= OBJ_SATUR;
-
-/*-- Check-image CHECK_APERTURES option */
-
- if ((check = prefs.check[CHECK_APERTURES]))
- {
- if (FLAG(obj2.flux_aper))
- for (i=0; i<prefs.naper; i++)
- sexcircle(check->pix, check->width, check->height,
- obj->mx, obj->my, prefs.apert[i]/2.0, check->overlay);
-
- if (FLAG(obj2.flux_auto))
- sexellips(check->pix, check->width, check->height,
- obj->mx, obj->my, obj->a*obj2->kronfactor,
- obj->b*obj2->kronfactor, obj->theta,
- check->overlay, obj->flag&OBJ_CROWDED);
-
- if (FLAG(obj2.flux_petro))
- sexellips(check->pix, check->width, check->height,
- obj->mx, obj->my, obj->a*obj2->petrofactor,
- obj->b*obj2->petrofactor, obj->theta,
- check->overlay, obj->flag&OBJ_CROWDED);
- }
-
-/* ---- Star/Galaxy classification */
-
- if (FLAG(obj2.sprob))
- {
- double fac2, input[10], output, fwhm;
-
- fwhm = prefs.seeing_fwhm;
-
- fac2 = fwhm/field->pixscale;
- fac2 *= fac2;
- input[j=0] = log10(obj->iso[0]? obj->iso[0]/fac2: 0.01);
- input[++j] = field->thresh>0.0?
- log10(obj->peak>0.0? obj->peak/field->thresh: 0.1)
- :-1.0;
- for (i=1; i<NISO; i++)
- input[++j] = log10(obj->iso[i]? obj->iso[i]/fac2: 0.01);
- input[++j] = log10(fwhm);
- neurresp(input, &output);
- obj2->sprob = (float)output;
- }
-
-/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
-/*-- Put here your calls to "BLIND" custom functions. Ex:
-
- compute_myotherparams(obj);
-
---*/
-
-/*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*/
-
- newnumber = ++thecat.ntotal;
-/*-- update segmentation map */
- if ((check=prefs.check[CHECK_SEGMENTATION]))
- {
- ULONG *pix;
- ULONG newsnumber = newnumber,
- 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 = newsnumber;
- }
- obj->number = newnumber;
-
-/*-- SOM fitting */
- if (prefs.somfit_flag)
- {
- float *input;
-
- input = thesom->input;
- copyimage(field,input,thesom->inputsize[0],thesom->inputsize[1],ix,iy);
-
- if (thesom->nextrainput)
- {
- input += thesom->ninput-thesom->nextrainput;
- *(input) = (obj->mx+1)/field->width;
- *(input+1) = (obj->my+1)/field->height;
- }
-
- som_phot(thesom, obj->bkg, field->backsig,
- (float)prefs.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;
- outobj2.fluxerr_somfit = thesom->sigamp;
- }
-
- if (FLAG(obj2.vignet))
- copyimage(field,outobj2.vignet,prefs.vignetsize[0],prefs.vignetsize[1],
- ix,iy);
-
- if (FLAG(obj2.vigshift))
- 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)
- {
- if (prefs.dpsf_flag)
- double_psf_fit(ppsf, field, wfield, obj, thepsf, dfield, dwfield);
- else
- psf_fit(thepsf, field, wfield, obj);
- obj2->npsf = thepsfit->npsf;
- if (prefs.psfdisplay_type == PSFDISPLAY_SPLIT)
- {
- nsub = thepsfit->npsf;
- if (nsub<1)
- nsub = 1;
- }
- else
- for (j=0; j<thepsfit->npsf; j++)
- {
- if (FLAG(obj2.x_psf) && j<prefs.psf_xsize)
- obj2->x_psf[j] = thepsfit->x[j];
- if (FLAG(obj2.y_psf) && j<prefs.psf_ysize)
- obj2->y_psf[j] = thepsfit->y[j];
- if (FLAG(obj2.flux_psf) && j<prefs.psf_fluxsize)
- obj2->flux_psf[j] = thepsfit->flux[j];
- if (FLAG(obj2.magerr_psf) && j<prefs.psf_magerrsize)
- obj2->magerr_psf[j] = obj2->fluxerr_psf[j]>0.0?
- 1.086*obj2->fluxerr_psf[j]/thepsfit->flux[j] : 99.0;
- if (FLAG(obj2.fluxerr_psf) && j<prefs.psf_fluxerrsize)
- obj2->fluxerr_psf[j] = obj2->fluxerr_psf[j];
- if (FLAG(obj2.mag_psf) && j<prefs.psf_magsize)
- obj2->mag_psf[j] = thepsfit->flux[j]>0.0?
- prefs.mag_zeropoint -2.5*log10(thepsfit->flux[j]) : 99.0;
- }
- }
-
-/*-------------------------------- Astrometry ------------------------------*/
- if (prefs.world_flag)
- computeastrom(field, obj);
-/*-- Edit min and max coordinates to follow the FITS conventions */
- obj->xmin += 1;
- obj->ymin += 1;
- obj->xmax += 1;
- obj->ymax += 1;
-
-/*-- Go through each newly identified component */
- for (j=0; j<nsub; j++)
- {
- if (prefs.psf_flag && prefs.psfdisplay_type == PSFDISPLAY_SPLIT)
- {
- if (FLAG(obj2.x_psf))
- obj2->x_psf[0] = thepsfit->x[j];
- if (FLAG(obj2.y_psf))
- obj2->y_psf[0] = thepsfit->y[j];
- if (FLAG(obj2.flux_psf))
- obj2->flux_psf[0] = thepsfit->flux[j]>0.0? thepsfit->flux[j]:0.0; /*?*/
- if (FLAG(obj2.mag_psf))
- obj2->mag_psf[0] = thepsfit->flux[j]>0.0?
- prefs.mag_zeropoint -2.5*log10(thepsfit->flux[j]) : 99.0;
- if (FLAG(obj2.magerr_psf))
- obj2->magerr_psf[0]=
- (thepsfit->flux[j]>0.0 && obj2->fluxerr_psf[j]>0.0) ? /*?*/
- 1.086*obj2->fluxerr_psf[j]/thepsfit->flux[j] : 99.0;
- if (FLAG(obj2.fluxerr_psf))
- obj2->fluxerr_psf[0]= obj2->fluxerr_psf[j];
- if (j)
- obj->number = ++thecat.ntotal;
- }
-
- FPRINTF(OUTPUT, "%8d %6.1f %6.1f %5.1f %5.1f %12g "
- "%c%c%c%c%c%c%c%c\n",
- obj->number, obj->mx+1.0, obj->my+1.0,
- obj->a, obj->b,
- obj->flux,
- obj->flag&OBJ_CROWDED?'C':'_',
- obj->flag&OBJ_MERGED?'M':'_',
- obj->flag&OBJ_SATUR?'S':'_',
- obj->flag&OBJ_TRUNC?'T':'_',
- obj->flag&OBJ_APERT_PB?'A':'_',
- obj->flag&OBJ_ISO_PB?'I':'_',
- obj->flag&OBJ_DOVERFLOW?'D':'_',
- obj->flag&OBJ_OVERFLOW?'O':'_');
- writecat(n, objlist);
- }
- }
-
-/* Remove again from the image the object's pixels if BLANKing is on ... */
-/*-- ... and free memory */
-
- if (prefs.blank_flag && obj->blank)
- {
- if (selecflag)
- {
- if (prefs.somfit_flag && (check=prefs.check[CHECK_MAPSOM]))
- blankcheck(check, obj->blank, obj->subw, obj->subh,
- obj->subx, obj->suby, (PIXTYPE)*(obj2->vector_somfit));
-
- }
- blankimage(field, obj->blank, obj->subw, obj->subh,
- obj->subx, obj->suby, -BIG);
- free(obj->blank);
- if (obj->dblank)
- {
- blankimage(dfield, obj->dblank, obj->subw, obj->subh,
- obj->subx, obj->suby, -BIG);
- free(obj->dblank);
- }
- }
-
- return;
- }
-
diff --git a/sextractor/src/assoc.c b/sextractor/src/assoc.c
deleted file mode 100644
index 488dc7d..0000000
--- a/sextractor/src/assoc.c
+++ /dev/null
@@ -1,372 +0,0 @@
- /*
- assoc.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Routines for catalog-associations.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "assoc.h"
-
-/********************************* comp_assoc ********************************/
-/*
-Comparison function for sort_assoc().
-*/
-int comp_assoc(const void *i1, const void *i2)
- {
- float *f1,*f2;
-
- f1 = (float *)i1 + 1;
- f2 = (float *)i2 + 1;
- if (*f1<*f2)
- return -1;
- else return (*f1==*f2)?0:1;
- }
-
-
-/********************************* sort_assoc ********************************/
-/*
-Make the presentation histogram, order the assoc-list and build the hash-table.
-*/
-void sort_assoc(picstruct *field, assocstruct *assoc)
-
- {
- int comp_assoc(const void *i1, const void *i2);
- float *list, rad;
- int i,j, step,nobj, *hash;
-
- step = assoc->ncol;
- nobj = assoc->nobj;
- list = assoc->list;
- qsort(assoc->list, assoc->nobj, step*sizeof(float), comp_assoc);
-/* Build the hash table that contains the first object in the sorted list */
-/* which may be in reach from the current scanline */
- QMALLOC(assoc->hash, int, field->height);
- list = assoc->list+1; /* This is where the 1st y coordinate is stored */
- hash = assoc->hash;
- rad = assoc->radius;
- for (i=0, j=0; i<field->height; i++)
- {
-/*-- For safety, we keep a 1-pixel margin */
- for (;j<nobj && (int)(*list+rad+1.5)<i; j++, list+=step);
-/*-- We use -1 as a code identifying lines with no objects */
- *(hash++) = (j==nobj || (int)(*list-rad-0.5)>i) ? -1 : j;
- }
-
- return;
- }
-
-
-/********************************* load_assoc ********************************/
-/*
-Read an assoc-list, and returns a pointer to the new assoc struct (or NULL if
-no list was found).
-*/
-assocstruct *load_assoc(char *filename)
-
- {
- assocstruct *assoc;
- FILE *file;
- float *list, val;
- char str[MAXCHAR], str2[MAXCHAR], *sstr;
- int *data,
- i,ispoon,j,k,l, ncol, ndata, nlist, size,spoonsize,
- xindex,yindex,mindex;
-
- if (!(file = fopen(filename, "r")))
- return NULL;
-
- assoc = NULL; /* To avoid gcc -Wall warnings */
- list = NULL; /* To avoid gcc -Wall warnings */
- data = NULL; /* To avoid gcc -Wall warnings */
- ispoon = ncol = ndata = nlist = size = spoonsize = xindex = yindex
- = mindex = 0;
- NFPRINTF(OUTPUT, "Reading ASSOC input-list...");
- for (i=0; fgets(str, MAXCHAR, file);)
- {
-/*-- Examine current input line (discard empty and comment lines) */
- if (!*str || strchr("#\t\n",*str))
- continue;
-
- if (!i)
- {
- strcpy(str2, str);
-/*---- Let's count the number of columns in the first line */
- for (ncol=0; strtok(ncol?NULL:str2, " \t\v\n\r\f"); ncol++);
- if (!ncol)
- error(EXIT_FAILURE, "*Error*: empty line in ", filename);
-/*---- Build a look-up table containing the ordering of column data */
- QCALLOC(data, int, ncol);
- k = 1;
- for (j=0; j<prefs.nassoc_data && k<=prefs.assoc_size; j++)
- if ((l=prefs.assoc_data[j]) && --l<ncol)
- data[l] = k++;
- ndata = k-1;
- if (!ndata)
- {
- ndata = ncol;
- if (prefs.assoc_size<ndata)
- ndata = prefs.assoc_size;
- for (j=0; j<ndata; j++)
- data[j] = j+1;
- }
- if (ndata<prefs.assoc_size)
- {
- sprintf(gstr, "no more than %d ASSOC parameters available: ", ncol);
- warning("VECTOR_ASSOC redimensioned: ", gstr);
- prefs.assoc_size = ndata;
- }
-
- if ((xindex = prefs.assoc_param[0]-1) >= ncol)
- error(EXIT_FAILURE, "*Error*: ASSOC_PARAMS #1 exceeds the number of ",
- "fields in the ASSOC file");
- if ((yindex = prefs.assoc_param[1]-1) >= ncol)
- error(EXIT_FAILURE, "*Error*: ASSOC_PARAMS #2 exceeds the number of ",
- "fields in the ASSOC file");
- if (prefs.nassoc_param>2)
- {
- if ((mindex = prefs.assoc_param[2]-1) >= ncol)
- error(EXIT_FAILURE,"*Error*: ASSOC_PARAMS #3 exceeds the number of ",
- "fields in the ASSOC file");
- }
- else
- {
- mindex = -1;
- prefs.assoc_type = ASSOC_FIRST;
- }
-
- nlist = ndata+3;
-
-/*---- Allocate memory for the ASSOC struct and the filtered list */
- QMALLOC(assoc, assocstruct, 1);
- ispoon = ASSOC_BUFINC/(nlist*sizeof(float));
- spoonsize = ispoon*nlist;
- QMALLOC(assoc->list, float, size = spoonsize);
- list = assoc->list;
- }
- else if (!(i%ispoon))
- {
- QREALLOC(assoc->list, float, size += spoonsize);
- list = assoc->list + i*nlist;
- }
-
- if (!(++i%1000))
- {
- sprintf(str2, "Reading input list... (%d objects)", i);
- NFPRINTF(OUTPUT, str2);
- }
-
-/*-- Read the data normally */
- *(list+2) = 0.0;
- for (sstr = str, j=0; j<ncol; j++)
- {
- val = (float)strtod(sstr, &sstr);
- if (j==xindex)
- *list = val;
- else if (j==yindex)
- *(list+1) = val;
- else if (j==mindex)
- *(list+2) = val;
- if ((k=data[j]))
- *(list+2+k) = val;
- }
- list += nlist;
- }
-
- fclose(file);
- free(data);
- QREALLOC(assoc->list, float, i*nlist);
- assoc->nobj = i;
- assoc->radius = prefs.assoc_radius;
- assoc->ndata = ndata;
- assoc->ncol = nlist;
-
- return assoc;
- }
-
-
-/********************************* init_assoc ********************************/
-/*
-Initialize the association procedure.
-*/
-void init_assoc(picstruct *field)
-
- {
- assocstruct *assoc;
-
-/* Load the assoc-list */
- if (!(assoc = field->assoc = load_assoc(prefs.assoc_name)))
- error(EXIT_FAILURE, "*Error*: Assoc-list file not found: ",
- prefs.assoc_name);
-
-/* Sort the assoc-list by y coordinates, and build the hash table */
- sort_assoc(field, assoc);
-
-/* Where data go for the current output pattern*/
- assoc->data = outobj2.assoc;
-
- return;
- }
-
-
-/********************************** end_assoc ********************************/
-/*
-Free memory related to the assoc operations.
-*/
-void end_assoc(picstruct *field)
-
- {
-/* Free the assoc-list */
- if (field->assoc)
- {
- free((field->assoc)->list);
- free((field->assoc)->hash);
- free(field->assoc);
- }
-
- return;
- }
-
-
-/********************************** do_assoc *********************************/
-/*
-Perform the association task for a source and return the number of IDs.
-*/
-int do_assoc(picstruct *field, float x, float y)
- {
- assocstruct *assoc;
- double aver;
- float dx,dy, dist, rad, rad2, comp, wparam,
- *list, *input, *data;
- int h, step, i, flag, iy, nobj;
-
- assoc = field->assoc;
-/* Need to initialize the array */
- memset(assoc->data, 0, prefs.assoc_size*sizeof(float));
- aver = 0.0;
-
- if (prefs.assoc_type == ASSOC_MIN || prefs.assoc_type == ASSOC_NEAREST)
- comp = BIG;
- else
- comp = -BIG;
-
- iy = (int)(y+0.499999);
- if (iy<0 || iy>=field->height)
- return 0;
-/* If there is already no candidate in hash table, no need to go further */
- if ((h=assoc->hash[iy])<0)
- return 0;
-/* Now loop over possible candidates */
- nobj = assoc->nobj;
- step = assoc->ncol;
- list = assoc->list + step*h;
- rad = assoc->radius;
- rad2 = rad*rad;
- for (flag = 0; (h++<nobj && *(list+1)-rad<y); list+=step)
- {
- dx = *list - x;
- dy = *(list+1) - y;
- if ((dist=dx*dx+dy*dy)<rad2)
- {
- flag++;
- input = list+3;
- if (prefs.assoc_type == ASSOC_FIRST)
- {
- memcpy(assoc->data, input, assoc->ndata*sizeof(float));
- return 1;
- }
- wparam = *(list+2);
- data = assoc->data;
- switch(prefs.assoc_type)
- {
- case ASSOC_NEAREST:
- if (dist<comp)
- {
- memcpy(data, input, assoc->ndata*sizeof(float));
- comp = dist;
- }
- break;
- case ASSOC_MEAN:
- aver += wparam;
- for (i=assoc->ndata; i--;)
- *(data++) += *(input++)*wparam;
- break;
- case ASSOC_MAGMEAN:
- wparam = fabs(wparam)<99.0?DEXP(-0.4*wparam): 0.0;
- aver += wparam;
- for (i=assoc->ndata; i--;)
- *(data++) += *(input++)*wparam;
- break;
- case ASSOC_SUM:
- for (i=assoc->ndata; i--;)
- *(data++) += *(input++);
- break;
- case ASSOC_MAGSUM:
- for (i=assoc->ndata; i--;)
- *(data++) += fabs(wparam=*(input++))<99.0? DEXP(-0.4*wparam):0.0;
- break;
- case ASSOC_MIN:
- if (wparam<comp)
- {
- memcpy(data, input, assoc->ndata*sizeof(float));
- comp = wparam;
- }
- break;
- case ASSOC_MAX:
- if (wparam>comp)
- {
- memcpy(data, input, assoc->ndata*sizeof(float));
- comp = wparam;
- }
- break;
- default:
- error(EXIT_FAILURE, "*Internal Error*: unknown ASSOC type in ",
- "pixlearn()");
- }
- }
- }
-
-/* No candidate found? exit! */
- if (!flag)
- return 0;
-
-/* Terminate the computation of the mean */
- if (prefs.assoc_type == ASSOC_MEAN || prefs.assoc_type == ASSOC_MAGMEAN)
- {
- if (aver<1e-30)
- return 0;
- data = assoc->data;
- for (i=assoc->ndata; i--;)
- *(data++) /= aver;
- }
-
- if (prefs.assoc_type == ASSOC_MAGSUM)
- {
- data = assoc->data;
- for (i=assoc->ndata; i--; data++)
- *data = *data>0.0? -2.5*log10(*data):99.0;
- }
-
- return flag;
- }
-
diff --git a/sextractor/src/assoc.h b/sextractor/src/assoc.h
deleted file mode 100644
index fc39b13..0000000
--- a/sextractor/src/assoc.h
+++ /dev/null
@@ -1,41 +0,0 @@
- /*
- assoc.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden observatory
-*
-* Contents: Include file for assoc.c.
-*
-* Last modify: 25/06/97
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-
-#define ASSOC_BUFINC 65536 /* Assoc buffer increment (bytes) */
-
-/*--------------------------------- typedefs --------------------------------*/
-
-typedef struct structassoc
- {
- float *list; /* Pointer to the list of data */
- int nobj; /* Number of data rows */
- int ncol; /* Total number of columns per row */
- int ndata; /* Number of retained cols per row */
- int *hash; /* Pointer to the hash table */
- float *data; /* Copy of current parameters */
- float radius; /* Radius of search for association */
- } assocstruct;
-
-/*------------------------------ Prototypes ---------------------------------*/
-
-assocstruct *load_assoc(char *filename);
-
-int do_assoc(picstruct *field, float x, float y);
-
-void init_assoc(picstruct *field),
- end_assoc(picstruct *field),
- sort_assoc(picstruct *field, assocstruct *assoc);
diff --git a/sextractor/src/astrom.c b/sextractor/src/astrom.c
deleted file mode 100644
index f946163..0000000
--- a/sextractor/src/astrom.c
+++ /dev/null
@@ -1,955 +0,0 @@
- /*
- astrom.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Astrometrical computations.
-*
-* Last modify: 13/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "wcs/wcs.h"
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "astrom.h"
-#include "wcs/tnx.h"
-
-static obj2struct *obj2 = &outobj2;
-
-/****************************** initastrom **********************************/
-/*
-Initialize astrometrical structures.
-*/
-void initastrom(picstruct *field)
-
- {
- astromstruct *as;
- double *lm;
- int l,n, lng,lat, naxis;
-
- as = field->astrom;
-
- naxis = as->naxis;
-
-/* Test if the WCS is in use */
- if (as->wcs_flag)
-/*-- ...Yes: launch the WCS stuff! */
- {
- 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))
- {
- if (fabs(as->equinox-2000.0)>0.003)
- precess(as->equinox, 0.0, 90.0, 2000.0, &as->ap2000, &as->dp2000);
- else
- {
- as->ap2000 = 0.0;
- as->dp2000 = 90.0;
- }
-
- if (FLAG(obj2.theta1950) || FLAG(obj2.poserr_theta1950))
- j2b(as->equinox, as->ap2000, as->dp2000, &as->ap1950, &as->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 */
- }
- else
- as->pixscale = (field->pixscale=prefs.pixel_scale)/3600.0;
-
- return;
- }
-
-
-/**************************** computeastrom *********************************/
-/*
-Compute real WORLD coordinates and dimensions according to FITS info.
-*/
-void computeastrom(picstruct *field, objstruct *obj)
-
- {
- astromstruct *as;
- double *lm, *wcspos;
-
- as = field->astrom;
- lm = as->linmat;
-
-/* If working with WCS, compute WORLD coordinates and local matrix */
- if (FLAG(obj2.mxw))
- {
- if (as->wcs_flag)
- {
- wcspos = compute_wcs(field, obj2->posx, obj2->posy);
- obj2->alphas = obj2->mxw = wcspos[0];
- obj2->deltas = obj2->myw = wcspos[1];
- if (FLAG(obj2.alpha2000))
- {
- if (fabs(as->equinox-2000.0)>0.003)
- precess(as->equinox, wcspos[0], wcspos[1],
- 2000.0, &obj2->alpha2000, &obj2->delta2000);
- else
- {
- obj2->alpha2000 = obj2->mxw;
- obj2->delta2000 = obj2->myw;
- }
- if (FLAG(obj2.alpha1950))
- j2b(as->equinox, obj2->alpha2000, obj2->delta2000,
- &obj2->alpha1950, &obj2->delta1950);
- }
- }
- 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)
- {
- wcspos = compute_wcs(field, (double)obj->peakx, (double)obj->peaky);
- obj2->peakalphas = obj2->peakxw = wcspos[0];
- obj2->peakdeltas = obj2->peakyw = wcspos[1];
- if (FLAG(obj2.peakalpha2000))
- {
- if (fabs(as->equinox-2000.0)>0.003)
- precess(as->equinox, wcspos[0], wcspos[1],
- 2000.0, &obj2->peakalpha2000, &obj2->peakdelta2000);
- else
- {
- obj2->peakalpha2000 = obj2->peakxw;
- obj2->peakdelta2000 = obj2->peakyw;
- }
- if (FLAG(obj2.peakalpha1950))
- j2b(as->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)
- {
- 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];
- if (FLAG(obj2.winpos_alpha2000))
- {
- if (fabs(as->equinox-2000.0)>0.003)
- precess(as->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;
- }
- if (FLAG(obj2.winpos_alpha1950))
- j2b(as->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! */
- }
- }
-
-/* Custom coordinate system for the MAMA machine */
- if (FLAG(obj2.mamaposx))
- {
- double dx,dy;
-
- 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! */
- }
-
-/* Express shape parameters in WORLD frame */
- if (FLAG(obj2.mx2w))
- astrom_shapeparam(field, obj);
- if (FLAG(obj2.win_mx2w))
- astrom_winshapeparam(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.npixw))
- obj2->npixw = obj->npix*as->pixscale*as->pixscale;
- if (FLAG(obj2.fdnpixw))
- obj2->fdnpixw = obj->fdnpix*as->pixscale*as->pixscale;
-
- if (FLAG(obj2.fwhmw))
- obj2->fwhmw = obj->fwhm*as->pixscale;
-
- 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;
- int 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;
- }
- lm0 = lm[lng+naxis*lng];
- lm1 = lm[lat+naxis*lng];
- lm2 = lm[lng+naxis*lat];
- lm3 = lm[lat+naxis*lat];
-
-
-/* All WORLD params based on 2nd order moments have to pass through here */
- dx2 = obj->mx2;
- dy2 = obj->my2;
- dxy = obj->mxy;
- obj2->mx2w = xm2 = lm0*lm0*dx2 + lm1*lm1*dy2 + lm0*lm1*dxy;
- obj2->my2w = ym2 = lm2*lm2*dx2 + lm3*lm3*dy2 + lm2*lm3*dxy;
- obj2->mxyw = xym = lm0*lm2*dx2 + lm1*lm3*dy2 + (lm0*lm3+lm1*lm2)*dxy;
- 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);
-
-/*-- Compute position angles in J2000 or B1950 reference frame */
- if (as->wcs_flag)
- {
- double da,dd;
-
- 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);
- }
-
- 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);
- }
- }
- }
-
- if (FLAG(obj2.aw))
- {
- temp = sqrt(0.25*temp*temp+xym*xym);
- pm2 = 0.5*(xm2+ym2);
- obj2->aw = (float)sqrt(pm2+temp);
- obj2->bw = (float)sqrt(pm2-temp);
- obj2->polarw = temp / pm2;
- }
-
- if (FLAG(obj2.cxxw))
- {
-/*-- Handle large, fully correlated profiles (can cause a singularity...) */
- if ((temp=xm2*ym2-xym*xym)<1e-6)
- {
- temp = 1e-6;
- xym *= 0.99999;
- }
- obj2->cxxw = (float)(ym2/temp);
- obj2->cyyw = (float)(xm2/temp);
- obj2->cxyw = (float)(-2*xym/temp);
- }
-
- return;
- }
-
-
-/**************************** astrom_winshapeparam ***************************/
-/*
-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;
- int 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;
- }
- lm0 = lm[lng+naxis*lng];
- lm1 = lm[lat+naxis*lng];
- lm2 = lm[lng+naxis*lat];
- lm3 = lm[lat+naxis*lat];
-
-/* All WORLD params based on 2nd order moments have to pass through here */
- dx2 = obj2->win_mx2;
- dy2 = obj2->win_my2;
- dxy = obj2->win_mxy;
- obj2->win_mx2w = xm2 = lm0*lm0*dx2 + lm1*lm1*dy2 + lm0*lm1*dxy;
- obj2->win_my2w = ym2 = lm2*lm2*dx2 + lm3*lm3*dy2 + lm2*lm3*dxy;
- obj2->win_mxyw = xym = lm0*lm2*dx2 + lm1*lm3*dy2 + (lm0*lm3+lm1*lm2)*dxy;
- 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);
-
-/*-- Compute position angles in J2000 or B1950 reference frame */
- if (as->wcs_flag)
- {
- double da,dd;
-
- 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);
- }
-
- 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);
- }
- }
- }
-
- if (FLAG(obj2.win_aw))
- {
- temp = sqrt(0.25*temp*temp+xym*xym);
- pm2 = 0.5*(xm2+ym2);
- obj2->win_aw = (float)sqrt(pm2+temp);
- obj2->win_bw = (float)sqrt(pm2-temp);
- obj2->win_polarw = temp / pm2;
- }
-
- if (FLAG(obj2.win_cxxw))
- {
-/*-- Handle large, fully correlated profiles (can cause a singularity...) */
- if ((temp=xm2*ym2-xym*xym)<1e-6)
- {
- temp = 1e-6;
- xym *= 0.99999;
- }
- obj2->win_cxxw = (float)(ym2/temp);
- obj2->win_cyyw = (float)(xm2/temp);
- obj2->win_cxyw = (float)(-2*xym/temp);
- }
-
- return;
- }
-
-
-/******************************* astrom_errparam *****************************/
-/*
-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;
- int 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;
- }
- lm0 = lm[lng+naxis*lng];
- lm1 = lm[lat+naxis*lng];
- lm2 = lm[lng+naxis*lat];
- lm3 = lm[lat+naxis*lat];
-
-/* All WORLD params based on 2nd order moments have to pass through here */
- dx2 = obj->poserr_mx2;
- dy2 = obj->poserr_my2;
- dxy = obj->poserr_mxy;
- obj2->poserr_mx2w = xm2 = lm0*lm0*dx2 + lm1*lm1*dy2 + lm0*lm1*dxy;
- obj2->poserr_my2w = ym2 = lm2*lm2*dx2 + lm3*lm3*dy2 + lm2*lm3*dxy;
- obj2->poserr_mxyw = xym = lm0*lm2*dx2 + lm1*lm3*dy2 + (lm0*lm3+lm1*lm2)*dxy;
- 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);
-
-/*-- Compute position angles in J2000 or B1950 reference frame */
- if (as->wcs_flag)
- {
- double da,dd;
-
- 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);
- }
-
- 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);
- }
- }
- }
-
- if (FLAG(obj2.poserr_aw))
- {
- temp = sqrt(0.25*temp*temp+xym*xym);
- pm2 = 0.5*(xm2+ym2);
- obj2->poserr_aw = (float)sqrt(pm2+temp);
- obj2->poserr_bw = (float)sqrt(pm2-temp);
- }
-
- if (FLAG(obj2.poserr_cxxw))
- {
-/*-- Handle large, fully correlated profiles (can cause a singularity...) */
- if ((temp=xm2*ym2-xym*xym)<1e-6)
- {
- temp = 1e-6;
- xym *= 0.99999;
- }
- obj2->poserr_cxxw = (float)(ym2/temp);
- obj2->poserr_cyyw = (float)(xm2/temp);
- obj2->poserr_cxyw = (float)(-2*xym/temp);
- }
-
- return;
- }
-
-
-/***************************** astrom_winerrparam ***************************/
-/*
-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;
- int 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;
- }
- lm0 = lm[lng+naxis*lng];
- lm1 = lm[lat+naxis*lng];
- lm2 = lm[lng+naxis*lat];
- lm3 = lm[lat+naxis*lat];
-
-/* All WORLD params based on 2nd order moments have to pass through here */
- dx2 = obj2->winposerr_mx2;
- dy2 = obj2->winposerr_my2;
- dxy = obj2->winposerr_mxy;
- obj2->winposerr_mx2w = xm2 = lm0*lm0*dx2 + lm1*lm1*dy2 + lm0*lm1*dxy;
- obj2->winposerr_my2w = ym2 = lm2*lm2*dx2 + lm3*lm3*dy2 + lm2*lm3*dxy;
- obj2->winposerr_mxyw = xym = lm0*lm2*dx2 + lm1*lm3*dy2 + (lm0*lm3+lm1*lm2)*dxy;
- 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);
-
-/*-- Compute position angles in J2000 or B1950 reference frame */
- if (as->wcs_flag)
- {
- double da,dd;
-
- 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);
- }
-
- 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);
- }
- }
- }
-
- if (FLAG(obj2.winposerr_aw))
- {
- temp = sqrt(0.25*temp*temp+xym*xym);
- pm2 = 0.5*(xm2+ym2);
- obj2->winposerr_aw = (float)sqrt(pm2+temp);
- obj2->winposerr_bw = (float)sqrt(pm2-temp);
- }
-
- if (FLAG(obj2.winposerr_cxxw))
- {
-/*-- Handle large, fully correlated profiles (can cause a singularity...) */
- if ((temp=xm2*ym2-xym*xym)<1e-6)
- {
- temp = 1e-6;
- xym *= 0.99999;
- }
- obj2->winposerr_cxxw = (float)(ym2/temp);
- obj2->winposerr_cyyw = (float)(xm2/temp);
- obj2->winposerr_cxyw = (float)(-2*xym/temp);
- }
-
- return;
- }
-
-
-/******************************* copyastrom *********************************/
-/*
-Copy astrometrical structures.
-*/
-void copyastrom(picstruct *infield, picstruct *outfield)
-
- {
- astromstruct *inas, *outas;
- int naxis;
-
- if (infield->astrom)
- {
- 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);
- }
- }
-
- return;
- }
-
-
-/******************************* endastrom ***********************************/
-/*
-Free astrometrical structures.
-*/
-void endastrom(picstruct *field)
-
- {
- astromstruct *as;
-
- as = field->astrom;
- if (as->wcs_flag)
- {
- 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);
- }
-
- free(as);
-
- return;
- }
-
-
-/********************************* precess ***********************************/
-/*
-precess equatorial coordinates according to the equinox (from Ephemerides du
-Bureau des Longitudes 1992). Epoch for coordinates should be J2000
-(FK5 system).
-*/
-void precess(double yearin, double alphain, double deltain,
- double yearout, double *alphaout, double *deltaout)
-
- {
- 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;
- }
-
-
-/*********************************** 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.01118148281196562, 0.004859003848996022,
- -2.423898417033081e-06,-2.710547600126671e-08,-1.177738063266745e-08},
- {-0.01118148272969232, 0.9999374849247641, -2.717708936468247e-05,
- 2.710547578707874e-08,-2.423927042585208e-06, 6.588254898401055e-11},
- {-0.00485900399622881, -2.715579322970546e-05, 0.999988194643078,
- 1.177738102358923e-08, 6.582788892816657e-11,-2.424049920613325e-06},
- {-0.0005508458576414713, 0.2384844384742432, -0.4356144527773499,
- 0.9999043171308133, 0.01118145410120206, 0.004858518651645554},
- {-0.2385354433560954, -0.002664266996872802, 0.01225282765749546,
- -0.01118145417187502, 0.9999161290795875, -2.717034576263522e-05},
- { 0.4357269351676567, -0.008536768476441086, 0.002113420799663768,
- -0.004858518477064975, -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]);
-
- for (i=0; i<3; i++)
- r1[i] = r2[i]+v1[i]*ARCSEC*t1;
-
- dotp = 0.0;
- for (i=0; i<3; i++)
- {
- a1[i] = a[i]+ap[i]*ARCSEC*t1;
- dotp += a1[i]*(r1[i]+a1[i]);
- }
- dotp = 2.0/(sqrt(1+4.0*dotp)+1.0);
- rmod = 0.0;
- for (i=0; i<3; i++)
- {
- ro[i] = dotp*(r1[i]+a1[i]);
- rmod += ro[i]*ro[i];
- }
- 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;
- }
-
diff --git a/sextractor/src/astrom.h b/sextractor/src/astrom.h
deleted file mode 100644
index fec0727..0000000
--- a/sextractor/src/astrom.h
+++ /dev/null
@@ -1,72 +0,0 @@
- /*
- astrom.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden observatory
-*
-* Contents: Astrometrical stuff.
-*
-* Last modify: 13/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define DEG (PI/180.0) /* 1 deg in radians */
-#define ARCSEC (DEG/3600.0) /* 1 arcsec in radians */
-#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_shapeparam(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 *);
-
-extern double *compute_wcs(picstruct *, double, double);
diff --git a/sextractor/src/back.c b/sextractor/src/back.c
deleted file mode 100644
index 967dc95..0000000
--- a/sextractor/src/back.c
+++ /dev/null
@@ -1,1302 +0,0 @@
- /*
- back.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions dealing with background computation.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "back.h"
-#include "field.h"
-#include "weight.h"
-
-/******************************** makeback ***********************************/
-/*
-Background maps are established from the images themselves; thus we need to
-make at least one first pass through the data.
-*/
-void makeback(picstruct *field, picstruct *wfield)
-
- {
- backstruct *backmesh,*wbackmesh, *bm,*wbm;
- PIXTYPE *buf,*wbuf, *buft,*wbuft;
- OFF_T fcurpos,wfcurpos, wfcurpos2,fcurpos2, bufshift, jumpsize;
- size_t bufsize, bufsize2,
- size,meshsize;
- int i,j,k,m,n, step, nlines,
- w,bw, bh, nx,ny,nb,
- lflag, nr;
- float *ratio,*ratiop, *weight, *sigma,
- sratio;
-
-/* If the weight-map is not an external one, no stats are needed for it */
- if (wfield && wfield->flags&(INTERP_FIELD|BACKRMS_FIELD))
- wfield= NULL;
-
- w = field->width;
- bw = field->backw;
- bh = field->backh;
- nx = field->nbackx;
- ny = field->nbacky;
- nb = field->nback;
-
- NFPRINTF(OUTPUT, "Setting up background maps");
-
-/* Decide if it is worth displaying progress each 16 lines */
-
- lflag = (field->width*field->backh >= (size_t)65536);
-
-/* Save current positions in files */
-
- wfcurpos = wfcurpos2 = 0; /* to avoid gcc -Wall warnings */
- QFTELL(field->file, fcurpos, field->filename);
- if (wfield)
- QFTELL(wfield->file, wfcurpos, wfield->filename);
-
-/* Allocate a correct amount of memory to store pixels */
-
- bufsize = (OFF_T)w*bh;
- meshsize = (size_t)bufsize;
- nlines = 0;
- if (bufsize > (size_t)BACK_BUFSIZE)
- {
- nlines = BACK_BUFSIZE/w;
- step = (field->backh-1)/nlines+1;
- bufsize = (size_t)(nlines = field->backh/step)*w;
- bufshift = (step/2)*(OFF_T)w;
- jumpsize = (step-1)*(OFF_T)w;
- }
- else
- bufshift = jumpsize = 0; /* to avoid gcc -Wall warnings */
-
-/* Allocate some memory */
- QMALLOC(backmesh, backstruct, nx); /* background information */
- QMALLOC(buf, PIXTYPE, bufsize); /* pixel buffer */
- free(field->back);
- QMALLOC(field->back, float, nb); /* background map */
- free(field->backline);
- QMALLOC(field->backline, PIXTYPE, w); /* current background line */
- free(field->sigma);
- QMALLOC(field->sigma, float, nb); /* sigma map */
- if (wfield)
- {
- QMALLOC(wbackmesh, backstruct, nx); /* background information */
- QMALLOC(wbuf, PIXTYPE, bufsize); /* pixel buffer */
- free(wfield->back);
- QMALLOC(wfield->back, float, nb); /* background map */
- free(wfield->backline);
- QMALLOC(wfield->backline, PIXTYPE, w); /* current background line */
- free(wfield->sigma);
- QMALLOC(wfield->sigma, float, nb); /* sigma map */
- wfield->sigfac = 1.0;
- }
- else
- {
- wbackmesh = NULL;
- wbuf = NULL;
- }
-
-/* Loop over the data packets */
-
- for (j=0; j<ny; j++)
- {
- if (lflag && j)
- NPRINTF(OUTPUT, "\33[1M> Setting up background map at line:%5d\n\33[1A",
- j*bh);
- if (!nlines)
- {
-/*---- The image is small enough so that we can make exhaustive stats */
- if (j == ny-1 && field->npix%bufsize)
- bufsize = field->npix%bufsize;
- readdata(field, buf, bufsize);
- if (wfield)
- {
- readdata(wfield, wbuf, bufsize);
- weight_to_var(wfield, wbuf, bufsize);
- }
-/*---- Build the histograms */
- backstat(backmesh, wbackmesh, buf, wbuf, bufsize,nx, w, bw,
- wfield?wfield->weight_thresh:0.0);
- bm = backmesh;
- for (m=nx; m--; bm++)
- if (bm->mean <= -BIG)
- bm->histo=NULL;
- else
- QCALLOC(bm->histo, LONG, bm->nlevels);
- if (wfield)
- {
- wbm = wbackmesh;
- for (m=nx; m--; wbm++)
- if (wbm->mean <= -BIG)
- wbm->histo=NULL;
- else
- QCALLOC(wbm->histo, LONG, wbm->nlevels);
- }
- backhisto(backmesh, wbackmesh, buf, wbuf, bufsize,nx, w, bw,
- wfield?wfield->weight_thresh:0.0);
- }
- else
- {
-/*---- Image size too big, we have to skip a few data !*/
- QFTELL(field->file, fcurpos2, field->filename);
- if (wfield)
- QFTELL(wfield->file, wfcurpos2, wfield->filename);
- if (j == ny-1 && (n=field->height%field->backh))
- {
- meshsize = n*(size_t)w;
- nlines = BACK_BUFSIZE/w;
- step = (n-1)/nlines+1;
- bufsize = (nlines = n/step)*(size_t)w;
- bufshift = (step/2)*(OFF_T)w;
- jumpsize = (step-1)*(OFF_T)w;
- free(buf);
- QMALLOC(buf, PIXTYPE, bufsize); /* pixel buffer */
- if (wfield)
- {
- free(wbuf);
- QMALLOC(wbuf, PIXTYPE, bufsize); /* pixel buffer */
- }
- }
-
-/*---- Read and skip, read and skip, etc... */
- QFSEEK(field->file, bufshift*(OFF_T)field->bytepix, SEEK_CUR,
- field->filename);
- buft = buf;
- for (i=nlines; i--; buft += w)
- {
- readdata(field, buft, w);
- if (i)
- QFSEEK(field->file, jumpsize*(OFF_T)field->bytepix, SEEK_CUR,
- field->filename);
- }
-
- if (wfield)
- {
-/*------ Read and skip, read and skip, etc... now on the weight-map */
- QFSEEK(wfield->file, bufshift*(OFF_T)wfield->bytepix, SEEK_CUR,
- wfield->filename);
- wbuft = wbuf;
- for (i=nlines; i--; wbuft += w)
- {
- readdata(wfield, wbuft, w);
- weight_to_var(wfield, wbuft, w);
- if (i)
- QFSEEK(wfield->file, jumpsize*(OFF_T)wfield->bytepix, SEEK_CUR,
- wfield->filename);
- }
- }
- backstat(backmesh, wbackmesh, buf, wbuf, bufsize, nx, w, bw,
- wfield?wfield->weight_thresh:0.0);
- QFSEEK(field->file, fcurpos2, SEEK_SET, field->filename);
- bm = backmesh;
- for (m=nx; m--; bm++)
- if (bm->mean <= -BIG)
- bm->histo=NULL;
- else
- QCALLOC(bm->histo, LONG, bm->nlevels);
- if (wfield)
- {
- QFSEEK(wfield->file, wfcurpos2, SEEK_SET, wfield->filename);
- wbm = wbackmesh;
- for (m=nx; m--; wbm++)
- if (wbm->mean <= -BIG)
- wbm->histo=NULL;
- else
- QCALLOC(wbm->histo, LONG, wbm->nlevels);
- }
-/*---- Build (progressively this time) the histograms */
- for(size=meshsize, bufsize2=bufsize; size>0; size -= bufsize2)
- {
- if (bufsize2>size)
- bufsize2 = size;
- readdata(field, buf, bufsize2);
- if (wfield)
- {
- readdata(wfield, wbuf, bufsize2);
- weight_to_var(wfield, wbuf, bufsize2);
- }
- backhisto(backmesh, wbackmesh, buf, wbuf, bufsize2, nx, w, bw,
- wfield?wfield->weight_thresh:0.0);
- }
- }
-
- /*-- Compute background statistics from the histograms */
- bm = backmesh;
- for (m=0; m<nx; m++, bm++)
- {
- k = m+nx*j;
- backguess(bm, field->back+k, field->sigma+k);
- free(bm->histo);
- }
- if (wfield)
- {
- wbm = wbackmesh;
- for (m=0; m<nx; m++, wbm++)
- {
- k = m+nx*j;
- backguess(wbm, wfield->back+k, wfield->sigma+k);
- free(wbm->histo);
- }
- }
- }
-
-/* Free memory */
- free(buf);
- free(backmesh);
- if (wfield)
- {
- free(wbackmesh);
- free(wbuf);
- }
-
-/* Go back to the original position */
- QFSEEK(field->file, fcurpos, SEEK_SET, field->filename);
- if (wfield)
- QFSEEK(wfield->file, wfcurpos, SEEK_SET, wfield->filename);
-
-/* Median-filter and check suitability of the background map */
- NFPRINTF(OUTPUT, "Filtering background map(s)");
- filterback(field);
- if (wfield)
- filterback(wfield);
-
-/* Compute normalization for variance- or weight-maps*/
- if (wfield && wfield->flags&(VAR_FIELD|WEIGHT_FIELD))
- {
- nr = 0;
- QMALLOC(ratio, float, wfield->nback);
- ratiop = ratio;
- weight = wfield->back;
- sigma = field->sigma;
- for (i=wfield->nback; i--; sigma++)
- if ((sratio=*(weight++)) > 0.0
- && (sratio = *sigma/sqrt(sratio)) > 0.0)
- {
- *(ratiop++) = sratio;
- nr++;
- }
- wfield->sigfac = hmedian(ratio, nr);
- for (i=0; i<nr && ratio[i]<=0.0; i++);
- if (i<nr)
- wfield->sigfac = hmedian(ratio+i, nr-i);
- else
- {
- warning("Null or negative global weighting factor:","defaulted to 1");
- wfield->sigfac = 1.0;
- }
- free(ratio);
- }
-
-/* Compute 2nd derivatives along the y-direction */
- NFPRINTF(OUTPUT, "Computing background d-map");
- free(field->dback);
- field->dback = makebackspline(field, field->back);
- NFPRINTF(OUTPUT, "Computing background-noise d-map");
- free(field->dsigma);
- field->dsigma = makebackspline(field, field->sigma);
-/* If asked for, force the backmean parameter to the supplied value */
- if (field->back_type == BACK_ABSOLUTE)
- field->backmean = (float)prefs.back_val[(field->flags&DETECT_FIELD)?0:1];
-
-/* Set detection/measurement threshold */
- if (prefs.ndthresh > 1)
- {
- double dval;
-
- if (fabs(dval=prefs.dthresh[0] - prefs.dthresh[1])> 70.0)
- error(EXIT_FAILURE,
- "*Error*: I cannot deal with such extreme thresholds!", "");
-
- field->dthresh = field->pixscale*field->pixscale*pow(10.0, -0.4*dval);
- }
- else if (prefs.thresh_type[0]==THRESH_ABSOLUTE)
- field->dthresh = prefs.dthresh[0];
- else
- field->dthresh = prefs.dthresh[0]*field->backsig;
- if (prefs.nthresh > 1)
- {
- double dval;
-
- if (fabs(dval=prefs.thresh[0] - prefs.thresh[1]) > 70.0)
- error(EXIT_FAILURE,
- "*Error*: I cannot deal with such extreme thresholds!", "");
-
- field->thresh = field->pixscale*field->pixscale*pow(10.0, -0.4*dval);
- }
- else if (prefs.thresh_type[1]==THRESH_ABSOLUTE)
- field->thresh = prefs.thresh[0];
- else
- field->thresh = prefs.thresh[0]*field->backsig;
-
-#ifdef QUALITY_CHECK
- printf("%-10g %-10g %-10g\n", field->backmean, field->backsig,
- (field->flags & DETECT_FIELD)? field->dthresh : field->thresh);
-#endif
- if (field->dthresh<=0.0 || field->thresh<=0.0)
- error(EXIT_FAILURE,
- "*Error*: I cannot deal with zero or negative thresholds!", "");
-
- if (prefs.detect_type == PHOTO
- && field->backmean+3*field->backsig > 50*field->ngamma)
- error(EXIT_FAILURE,
- "*Error*: The density range of this image is too large for ",
- "PHOTO mode");
-
- return;
- }
-
-
-/******************************** backstat **********************************/
-/*
-Compute robust statistical estimators in a row of meshes.
-*/
-void backstat(backstruct *backmesh, backstruct *wbackmesh,
- PIXTYPE *buf, PIXTYPE *wbuf, size_t bufsize,
- int n, int w, int bw, PIXTYPE wthresh)
-
- {
- backstruct *bm, *wbm;
- double pix,wpix, sig, mean,wmean, sigma,wsigma, step;
- PIXTYPE *buft,*wbuft,
- lcut,wlcut, hcut,whcut;
- int m,h,x,y, npix,wnpix, offset, lastbite, ngood;
-
- h = bufsize/w;
- bm = backmesh;
- wbm = wbackmesh;
- offset = w - bw;
- step = sqrt(2/PI)*QUANTIF_NSIGMA/QUANTIF_AMIN;
- wmean = wsigma = wlcut = whcut = 0.0; /* to avoid gcc -Wall warnings */
- for (m = n; m--; bm++,buf+=bw)
- {
- if (!m && (lastbite=w%bw))
- {
- bw = lastbite;
- offset = w-bw;
- }
- mean = sigma = 0.0;
- buft=buf;
-/*-- We separate the weighted case at this level to avoid penalty in CPU */
- ngood = 0;
- if (wbackmesh)
- {
- wmean = wsigma = 0.0;
- wbuft = wbuf;
- for (y=h; y--; buft+=offset,wbuft+=offset)
- for (x=bw; x--;)
- {
- pix = *(buft++);
- if ((wpix = *(wbuft++)) < wthresh)
- {
- wmean += wpix;
- wsigma += wpix*wpix;
- mean += pix;
- sigma += pix*pix;
- ngood++;
- }
- }
- }
- else
- for (y=h; y--; buft+=offset)
- for (x=bw; x--;)
- {
- mean += (pix = *(buft++));
- sigma += pix*pix;
- }
- npix = bw*h;
- if (wbackmesh)
- {
-/*---- If not enough valid pixels, discard this mesh */
- if ((float)ngood < (float)(npix*BACK_MINGOODFRAC))
- {
- bm->mean = bm->sigma = -BIG;
- if (wbackmesh)
- {
- wbm->mean = wbm->sigma = -BIG;
- wbm++;
- wbuf += bw;
- }
- continue;
- }
- else
- npix = ngood;
- wmean /= (double)npix;
- wsigma = (sig = wsigma/npix - wmean*wmean)>0.0? sqrt(sig):0.0;
- wlcut = wbm->lcut = (PIXTYPE)(wmean - 2.0*wsigma);
- whcut = wbm->hcut = (PIXTYPE)(wmean + 2.0*wsigma);
- }
- mean /= (double)npix;
- sigma = (sig = sigma/npix - mean*mean)>0.0? sqrt(sig):0.0;
- lcut = bm->lcut = (PIXTYPE)(mean - 2.0*sigma);
- hcut = bm->hcut = (PIXTYPE)(mean + 2.0*sigma);
- mean = sigma = 0.0;
- npix = wnpix = 0;
- buft = buf;
- if (wbackmesh)
- {
- wmean = wsigma = 0.0;
- wbuft=wbuf;
- for (y=h; y--; buft+=offset, wbuft+=offset)
- for (x=bw; x--;)
- {
- pix = *(buft++);
- if ((wpix = *(wbuft++))<wthresh && pix<=hcut && pix>=lcut)
- {
- mean += pix;
- sigma += pix*pix;
- npix++;
- if (wpix<=whcut && wpix>=wlcut)
- {
- wmean += wpix;
- wsigma += wpix*wpix;
- wnpix++;
- }
- }
- }
- }
- else
- for (y=h; y--; buft+=offset)
- for (x=bw; x--;)
- {
- pix = *(buft++);
- if (pix<=hcut && pix>=lcut)
- {
- mean += pix;
- sigma += pix*pix;
- npix++;
- }
- }
-
- bm->npix = npix;
- mean /= (double)npix;
- sig = sigma/npix - mean*mean;
- sigma = sig>0.0 ? sqrt(sig):0.0;
- bm->mean = mean;
- bm->sigma = sigma;
- if ((bm->nlevels = (int)(step*npix+1)) > QUANTIF_NMAXLEVELS)
- bm->nlevels = QUANTIF_NMAXLEVELS;
- bm->qscale = sigma>0.0? 2*QUANTIF_NSIGMA*sigma/bm->nlevels : 1.0;
- bm->qzero = mean - QUANTIF_NSIGMA*sigma;
- if (wbackmesh)
- {
- wbm->npix = wnpix;
- wmean /= (double)wnpix;
- sig = wsigma/wnpix - wmean*wmean;
- wsigma = sig>0.0 ? sqrt(sig):0.0;
- wbm->mean = wmean;
- wbm->sigma = wsigma;
- if ((wbm->nlevels = (int)(step*wnpix+1)) > QUANTIF_NMAXLEVELS)
- wbm->nlevels = QUANTIF_NMAXLEVELS;
- wbm->qscale = wsigma>0.0? 2*QUANTIF_NSIGMA*wsigma/wbm->nlevels : 1.0;
- wbm->qzero = wmean - QUANTIF_NSIGMA*wsigma;
- wbm++;
- wbuf += bw;
- }
- }
-
- return;
- }
-
-
-/******************************** backhisto *********************************/
-/*
-Compute robust statistical estimators in a row of meshes.
-*/
-void backhisto(backstruct *backmesh, backstruct *wbackmesh,
- PIXTYPE *buf, PIXTYPE *wbuf, size_t bufsize,
- int n, int w, int bw, PIXTYPE wthresh)
- {
- backstruct *bm,*wbm;
- PIXTYPE *buft,*wbuft;
- float qscale,wqscale, cste,wcste, wpix;
- LONG *histo,*whisto;
- int h,m,x,y, nlevels,wnlevels, lastbite, offset, bin;
-
- h = bufsize/w;
- bm = backmesh;
- wbm = wbackmesh;
- offset = w - bw;
- for (m=0; m++<n; bm++ , buf+=bw)
- {
- if (m==n && (lastbite=w%bw))
- {
- bw = lastbite;
- offset = w-bw;
- }
-/*-- Skip bad meshes */
- if (bm->mean <= -BIG)
- {
- if (wbackmesh)
- {
- wbm++;
- wbuf += bw;
- }
- continue;
- }
- nlevels = bm->nlevels;
- histo = bm->histo;
- qscale = bm->qscale;
- cste = 0.499999 - bm->qzero/qscale;
- buft = buf;
- if (wbackmesh)
- {
- wnlevels = wbm->nlevels;
- whisto = wbm->histo;
- wqscale = wbm->qscale;
- wcste = 0.499999 - wbm->qzero/wqscale;
- wbuft = wbuf;
- for (y=h; y--; buft+=offset, wbuft+=offset)
- for (x=bw; x--;)
- {
- bin = (int)(*(buft++)/qscale + cste);
- if ((wpix = *(wbuft++))<wthresh && bin<nlevels && bin>=0)
- {
- (*(histo+bin))++;
- bin = (int)(wpix/wqscale + wcste);
- if (bin>=0 && bin<wnlevels)
- (*(whisto+bin))++;
- }
- }
- wbm++;
- wbuf += bw;
- }
- else
- for (y=h; y--; buft += offset)
- for (x=bw; x--;)
- {
- bin = (int)(*(buft++)/qscale + cste);
- if (bin>=0 && bin<nlevels)
- (*(histo+bin))++;
- }
- }
-
- return;
- }
-
-/******************************* backguess **********************************/
-/*
-Estimate the background from a histogram;
-*/
-float backguess(backstruct *bkg, float *mean, float *sigma)
-
-#define EPS (1e-4) /* a small number */
-
- {
- LONG *histo, *hilow, *hihigh, *histot;
- unsigned long lowsum, highsum, sum;
- double ftemp, mea, sig, sig1, med, dpix;
- int i, n, lcut,hcut, nlevelsm1, pix;
-
-/* Leave here if the mesh is already classified as `bad' */
- if (bkg->mean<=-BIG)
- {
- *mean = *sigma = -BIG;
- return -BIG;
- }
-
- histo = bkg->histo;
- hcut = nlevelsm1 = bkg->nlevels-1;
- lcut = 0;
-
- sig = 10.0*nlevelsm1;
- sig1 = 1.0;
- mea = med = bkg->mean;
- for (n=100; n-- && (sig>=0.1) && (fabs(sig/sig1-1.0)>EPS);)
- {
- sig1 = sig;
- sum = mea = sig = 0.0;
- lowsum = highsum = 0;
- histot = hilow = histo+lcut;
- hihigh = histo+hcut;
- for (i=lcut; i<=hcut; i++)
- {
- if (lowsum<highsum)
- lowsum += *(hilow++);
- else
- highsum += *(hihigh--);
- sum += (pix = *(histot++));
- mea += (dpix = (double)pix*i);
- sig += dpix*i;
- }
-
- med = hihigh>=histo?
- ((hihigh-histo)+0.5+((double)highsum-lowsum)/(2.0*(*hilow>*hihigh?
- *hilow:*hihigh)))
- : 0.0;
- if (sum)
- {
- mea /= (double)sum;
- sig = sig/sum - mea*mea;
- }
- sig = sig>0.0?sqrt(sig):0.0;
- lcut = (ftemp=med-3.0*sig)>0.0 ?(int)(ftemp>0.0?ftemp+0.5:ftemp-0.5):0;
- hcut = (ftemp=med+3.0*sig)<nlevelsm1 ?(int)(ftemp>0.0?ftemp+0.5:ftemp-0.5)
- : nlevelsm1;
- }
- *mean = fabs(sig)>0.0? (fabs(bkg->sigma/(sig*bkg->qscale)-1) < 0.0 ?
- bkg->qzero+mea*bkg->qscale
- :(fabs((mea-med)/sig)< 0.3 ?
- bkg->qzero+(2.5*med-1.5*mea)*bkg->qscale
- :bkg->qzero+med*bkg->qscale))
- :bkg->qzero+mea*bkg->qscale;
-
- *sigma = sig*bkg->qscale;
-
- return *mean;
- }
-
-
-/******************************* filterback *********************************/
-/*
-Median filtering of the background map to remove the contribution from bright
-sources.
-*/
-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, npxm,npxp, npym,npyp, 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);
- QMALLOC(back2, float, np);
- QMALLOC(sigma2, float, np);
-
- back = field->back;
- sigma = field->sigma;
- val = sval = 0.0; /* to avoid gcc -Wall warnings */
-
-/* Look for `bad' meshes and interpolate them if necessary */
- for (i=0,py=0; py<ny; py++)
- for (px=0; px<nx; px++,i++)
- if ((back2[i]=back[i])<=-BIG)
- {
-/*------ Seek the closest valid mesh */
- d2min = BIG;
- nmin = 0.0;
- for (j=0,y=0; y<ny; y++)
- for (x=0; x<nx; x++,j++)
- if (back[j]>-BIG)
- {
- d2 = (float)(x-px)*(x-px)+(y-py)*(y-py);
- if (d2<d2min)
- {
- val = back[j];
- sval = sigma[j];
- nmin = 1;
- d2min = d2;
- }
- else if (d2==d2min)
- {
- val += back[j];
- sval += sigma[j];
- nmin++;
- }
- }
- back2[i] = nmin? val/nmin: 0.0;
- sigma[i] = nmin? sval/nmin: 1.0;
- }
- memcpy(back, back2, (size_t)np*sizeof(float));
-
-/* Do the actual filtering */
- for (py=0; py<np; py+=nx)
- for (px=0; px<nx; px++)
- {
- i=0;
- for (dpy = -npym; dpy< npyp; dpy+=nx)
- for (dpx = -npxm; dpx < npxp; 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];
- }
- }
- if (fabs((med=hmedian(bmask, i))-back[px+py])>=fthresh)
- {
- back2[px+py] = med;
- sigma2[px+py] = hmedian(smask, i);
- }
- else
- {
- back2[px+py] = back[px+py];
- sigma2[px+py] = sigma[px+py];
- }
- }
-
- free(bmask);
- free(smask);
- memcpy(back, back2, np*sizeof(float));
- field->backmean = hmedian(back2, np);
- free(back2);
- memcpy(sigma, sigma2, np*sizeof(float));
- field->backsig = hmedian(sigma2, np);
-
- if (field->backsig<=0.0)
- {
- sigmat = sigma2+np;
- for (i=np; i-- && *(--sigmat)>0.0;);
- if (i>=0 && i<(np-1))
- field->backsig = hmedian(sigmat+1, np-1-i);
- else
- {
- if (field->flags&(DETECT_FIELD|MEASURE_FIELD))
- warning("Image contains mainly constant data; ",
- "I'll try to cope with that...");
- field->backsig = 1.0;
- }
- }
-
- free(sigma2);
-
-
- return;
- }
-
-
-/******************************** localback *********************************/
-/*
-Compute Local background if possible.
-*/
-float localback(picstruct *field, objstruct *obj)
-
- {
- static backstruct backmesh;
- int bxmin,bxmax, bymin,bymax, ixmin,ixmax, iymin,iymax,
- bxnml,bynml, oxsize,oysize, npix,
- i, x,y, bin, w,sh, bmn, pbs;
- float bkg, bqs,cste;
- LONG *bmh;
- PIXTYPE *backpix, *bp, *strip, *st,
- pix;
-
- strip = field->strip;
- w = field->width;
- sh = field->stripheight;
- pbs = prefs.pback_size;
-
-/* Estimate background in a 'rectangular annulus' around the object */
- oxsize = obj->xmax - obj->xmin + 1;
- oysize = obj->ymax - obj->ymin + 1;
- bxnml = oxsize<w/2? oxsize/4 : (w-oxsize)/4;
- bynml = oysize<field->height/2? oysize/4 : (field->height-oysize)/4;
- bxmin = (ixmin = obj->xmin - bxnml) - pbs;
- bxmax = (ixmax = obj->xmax+1 + bxnml) + pbs;
- bymin = (iymin = obj->ymin - bynml) - pbs;
- bymax = (iymax = obj->ymax+1 + bynml) + pbs;
-
- if (bymin>=field->ymin && bymax<field->ymax
- && bxmin>=0 && bxmax<w)
- {
- npix = (bxmax-bxmin)*(bymax-bymin) - (ixmax-ixmin)*(iymax-iymin);
-
- QMALLOC(backpix, PIXTYPE, npix);
- bp = backpix;
-
-/*--store all the pixels*/
- npix = 0;
- for (y=bymin; y<bymax; y++)
- {
- st = strip + (y%sh)*w + bxmin;
- for (x=pbs; x--;)
- if ((pix=*(st++))>-BIG)
- {
- *(bp++) = pix;
- npix++;
- }
- st += ixmax-ixmin;
- for (x=pbs; x--;)
- if ((pix=*(st++))>-BIG)
- {
- *(bp++) = pix;
- npix++;
- }
- }
-
- for (y=bymin; y<iymin; y++)
- {
- st = strip + (y%sh)*w + ixmin;
- for (x=ixmax-ixmin; x--;)
- if ((pix=*(st++))>-BIG)
- {
- *(bp++) = pix;
- npix++;
- }
- }
- for (y=iymax; y<bymax; y++)
- {
- st = strip + (y%sh)*w + ixmin;
- for (x=ixmax-ixmin; x--;)
- if ((pix=*(st++))>-BIG)
- {
- *(bp++) = pix;
- npix++;
- }
- }
-
- if (npix)
- {
- backstat(&backmesh, NULL, backpix, NULL, npix, 1, 1, 1, 0.0);
- QCALLOC(backmesh.histo, LONG, backmesh.nlevels);
- bmh = backmesh.histo;
- bmn = backmesh.nlevels;
- cste = 0.499999 - backmesh.qzero/(bqs = backmesh.qscale);
- bp = backpix;
- for (i=npix; i--;)
- {
- bin = (int)(*(bp++)/bqs + cste);
- if (bin>=0 && bin<bmn)
- (*(bmh+bin))++;
- }
- backguess(&backmesh, &bkg, &obj->sigbkg);
- obj->bkg += (obj->dbkg = bkg);
- free(backmesh.histo);
- }
- else
- {
- obj->dbkg = 0.0;
- obj->sigbkg = field->backsig;
- }
- free(backpix);
- }
- else
- {
- obj->dbkg = bkg = 0.0;
- obj->sigbkg = field->backsig;
- }
-
- return bkg;
- }
-
-
-/************************************ back ***********************************/
-/*
-return background at position x,y (linear interpolation between background
-map vertices).
-*/
-PIXTYPE back(picstruct *field, int x, int y)
-
- {
- int nx,ny, xl,yl, pos;
- double dx,dy, cdx;
- float *b, b0,b1,b2,b3;
-
- b = field->back;
- nx = field->nbackx;
- ny = field->nbacky;
-
- dx = (double)x/field->backw - 0.5;
- dy = (double)y/field->backh - 0.5;
- dx -= (xl = (int)dx);
- dy -= (yl = (int)dy);
-
- if (xl<0)
- {
- xl = 0;
- dx -= 1.0;
- }
- else if (xl>=nx-1)
- {
- xl = nx<2 ? 0 : nx-2;
- dx += 1.0;
- }
-
- if (yl<0)
- {
- yl = 0;
- dy -= 1.0;
- }
- else if (yl>=ny-1)
- {
- yl = ny<2 ? 0 : ny-2;
- dy += 1.0;
- }
-
- pos = yl*nx + xl;
- cdx = 1 - dx;
-
- b0 = *(b+=pos); /* consider when nbackx or nbacky = 1 */
- b1 = nx<2? b0:*(++b);
- b2 = ny<2? *b:*(b+=nx);
- b3 = nx<2? *b:*(--b);
-
- return (PIXTYPE)((1-dy)*(cdx*b0 + dx*b1) + dy*(dx*b2 + cdx*b3));
- }
-
-
-/******************************* makebackspline ******************************/
-/*
-Pre-compute 2nd derivatives along the y direction at background nodes.
-*/
-float *makebackspline(picstruct *field, float *map)
-
- {
- int x,y, nbx,nby,nbym1;
- float *dmap,*dmapt,*mapt, *u, temp;
-
- nbx = field->nbackx;
- nby = field->nbacky;
- nbym1 = nby - 1;
- QMALLOC(dmap, float, field->nback);
- for (x=0; x<nbx; x++)
- {
- mapt = map+x;
- dmapt = dmap+x;
- if (nby>1)
- {
- QMALLOC(u, float, nbym1); /* temporary array */
- *dmapt = *u = 0.0; /* "natural" lower boundary condition */
- mapt += nbx;
- for (y=1; y<nbym1; y++, mapt+=nbx)
- {
- temp = -1/(*dmapt+4);
- *(dmapt += nbx) = temp;
- temp *= *(u++) - 6*(*(mapt+nbx)+*(mapt-nbx)-2**mapt);
- *u = temp;
- }
- *(dmapt+=nbx) = 0.0; /* "natural" upper boundary condition */
- for (y=nby-2; y--;)
- {
- temp = *dmapt;
- dmapt -= nbx;
- *dmapt = (*dmapt*temp+*(u--))/6.0;
- }
- free(u);
- }
- else
- *dmapt = 0.0;
- }
-
- return dmap;
- }
-
-
-/******************************* subbackline *********************************/
-/*
-Interpolate background at line y (bicubic spline interpolation between
-background map vertices) and subtract it from the current line.
-*/
-void subbackline(picstruct *field, int y, PIXTYPE *line)
-
- {
- int i,j,x,yl, nbx,nbxm1,nby, nx,width, ystep, changepoint;
- float dx,dx0,dy,dy3, cdx,cdy,cdy3, temp, xstep,
- *node,*nodep,*dnode, *blo,*bhi,*dblo,*dbhi, *u;
- PIXTYPE *backline, bval;
-
- width = field->width;
- backline = field->backline;
-
- if (field->back_type==BACK_ABSOLUTE)
- {
-/*-- In absolute background mode, just subtract a cste */
- bval = field->backmean;
- for (i=width; i--;)
- *(line++) -= ((*backline++)=bval);
- return;
- }
-
- nbx = field->nbackx;
- nbxm1 = nbx - 1;
- nby = field->nbacky;
- if (nby > 1)
- {
- dy = (float)y/field->backh - 0.5;
- dy -= (yl = (int)dy);
- if (yl<0)
- {
- yl = 0;
- dy -= 1.0;
- }
- else if (yl>=nby-1)
- {
- yl = nby<2 ? 0 : nby-2;
- dy += 1.0;
- }
-/*-- Interpolation along y for each node */
- cdy = 1 - dy;
- dy3 = (dy*dy*dy-dy);
- cdy3 = (cdy*cdy*cdy-cdy);
- ystep = nbx*yl;
- blo = field->back + ystep;
- bhi = blo + nbx;
- dblo = field->dback + ystep;
- dbhi = dblo + nbx;
- QMALLOC(node, float, nbx); /* Interpolated background */
- nodep = node;
- for (x=nbx; x--;)
- *(nodep++) = cdy**(blo++) + dy**(bhi++) + cdy3**(dblo++) + dy3**(dbhi++);
-
-/*-- Computation of 2nd derivatives along x */
- QMALLOC(dnode, float, nbx); /* 2nd derivative along x */
- if (nbx>1)
- {
- QMALLOC(u, float, nbxm1); /* temporary array */
- *dnode = *u = 0.0; /* "natural" lower boundary condition */
- nodep = node+1;
- for (x=nbxm1; --x; nodep++)
- {
- temp = -1/(*(dnode++)+4);
- *dnode = temp;
- temp *= *(u++) - 6*(*(nodep+1)+*(nodep-1)-2**nodep);
- *u = temp;
- }
- *(++dnode) = 0.0; /* "natural" upper boundary condition */
- for (x=nbx-2; x--;)
- {
- temp = *(dnode--);
- *dnode = (*dnode*temp+*(u--))/6.0;
- }
- free(u);
- dnode--;
- }
- }
- else
- {
-/*-- No interpolation and no new 2nd derivatives needed along y */
- node = field->back;
- dnode = field->dback;
- }
-
-/*-- Interpolation along x */
- if (nbx>1)
- {
- nx = field->backw;
- xstep = 1.0/nx;
- changepoint = nx/2;
- dx = (xstep - 1)/2; /* dx of the first pixel in the row */
- dx0 = ((nx+1)%2)*xstep/2; /* dx of the 1st pixel right to a bkgnd node */
- blo = node;
- bhi = node + 1;
- dblo = dnode;
- dbhi = dnode + 1;
- for (x=i=0,j=width; j--; i++, dx += xstep)
- {
- if (i==changepoint && x>0 && x<nbxm1)
- {
- blo++;
- bhi++;
- dblo++;
- dbhi++;
- dx = dx0;
- }
- cdx = 1 - dx;
- *(line++) -= (*(backline++) = (PIXTYPE)(cdx*(*blo+(cdx*cdx-1)**dblo)
- + dx*(*bhi+(dx*dx-1)**dbhi)));
- if (i==nx)
- {
- x++;
- i = 0;
- }
- }
- }
- else
- for (j=width; j--;)
- *(line++) -= (*(backline++) = (PIXTYPE)*node);
-
- if (nby>1)
- {
- free(node);
- free(dnode);
- }
-
- return;
- }
-
-
-/******************************* backrmsline ********************************
-PROTO void backrmsline(picstruct *field, int y, PIXTYPE *line)
-PURPOSE Bicubic-spline interpolation of the background noise along the current
- scanline (y).
-INPUT Measurement or detection field pointer,
- Current line position.
- Where to put the data.
-OUTPUT -.
-NOTES Most of the code is a copy of subbackline(), for optimization reasons.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 02/02/98
- ***/
-void backrmsline(picstruct *field, int y, PIXTYPE *line)
-
- {
- int i,j,x,yl, nbx,nbxm1,nby, nx,width, ystep, changepoint;
- float dx,dx0,dy,dy3, cdx,cdy,cdy3, temp, xstep,
- *node,*nodep,*dnode, *blo,*bhi,*dblo,*dbhi, *u;
-
- nbx = field->nbackx;
- nbxm1 = nbx - 1;
- nby = field->nbacky;
- if (nby > 1)
- {
- dy = (float)y/field->backh - 0.5;
- dy -= (yl = (int)dy);
- if (yl<0)
- {
- yl = 0;
- dy -= 1.0;
- }
- else if (yl>=nby-1)
- {
- yl = nby<2 ? 0 : nby-2;
- dy += 1.0;
- }
-/*-- Interpolation along y for each node */
- cdy = 1 - dy;
- dy3 = (dy*dy*dy-dy);
- cdy3 = (cdy*cdy*cdy-cdy);
- ystep = nbx*yl;
- blo = field->sigma + ystep;
- bhi = blo + nbx;
- dblo = field->dsigma + ystep;
- dbhi = dblo + nbx;
- QMALLOC(node, float, nbx); /* Interpolated background */
- nodep = node;
- for (x=nbx; x--;)
- *(nodep++) = cdy**(blo++) + dy**(bhi++) + cdy3**(dblo++) + dy3**(dbhi++);
-
-/*-- Computation of 2nd derivatives along x */
- QMALLOC(dnode, float, nbx); /* 2nd derivative along x */
- if (nbx>1)
- {
- QMALLOC(u, float, nbxm1); /* temporary array */
- *dnode = *u = 0.0; /* "natural" lower boundary condition */
- nodep = node+1;
- for (x=nbxm1; --x; nodep++)
- {
- temp = -1/(*(dnode++)+4);
- *dnode = temp;
- temp *= *(u++) - 6*(*(nodep+1)+*(nodep-1)-2**nodep);
- *u = temp;
- }
- *(++dnode) = 0.0; /* "natural" upper boundary condition */
- for (x=nbx-2; x--;)
- {
- temp = *(dnode--);
- *dnode = (*dnode*temp+*(u--))/6.0;
- }
- free(u);
- dnode--;
- }
- }
- else
- {
-/*-- No interpolation and no new 2nd derivatives needed along y */
- node = field->sigma;
- dnode = field->dsigma;
- }
-
-/*-- Interpolation along x */
- width = field->width;
- if (nbx>1)
- {
- nx = field->backw;
- xstep = 1.0/nx;
- changepoint = nx/2;
- dx = (xstep - 1)/2; /* dx of the first pixel in the row */
- dx0 = ((nx+1)%2)*xstep/2; /* dx of the 1st pixel right to a bkgnd node */
- blo = node;
- bhi = node + 1;
- dblo = dnode;
- dbhi = dnode + 1;
- for (x=i=0,j=width; j--; i++, dx += xstep)
- {
- if (i==changepoint && x>0 && x<nbxm1)
- {
- blo++;
- bhi++;
- dblo++;
- dbhi++;
- dx = dx0;
- }
- cdx = 1 - dx;
- *(line++) = (PIXTYPE)(cdx*(*blo+(cdx*cdx-1)**dblo)
- + dx*(*bhi+(dx*dx-1)**dbhi));
- if (i==nx)
- {
- x++;
- i = 0;
- }
- }
- }
- else
- for (j=width; j--;)
- *(line++) = (PIXTYPE)*node;
-
- if (nby>1)
- {
- free(node);
- free(dnode);
- }
-
- return;
- }
-
-
-/********************************* copyback **********************************/
-/*
-Copy sub-structures related to background procedures (mainly freeing memory).
-*/
-void copyback(picstruct *infield, picstruct *outfield)
-
- {
- QMEMCPY(infield->back, outfield->back, float, infield->nback);
- QMEMCPY(infield->dback, outfield->dback, float, infield->nback);
- QMEMCPY(infield->sigma, outfield->sigma, float, infield->nback);
- QMEMCPY(infield->dsigma, outfield->dsigma, float, infield->nback);
- QMEMCPY(infield->backline, outfield->backline, PIXTYPE, infield->width);
-
- return;
- }
-
-
-/********************************* endback ***********************************/
-/*
-Terminate background procedures (mainly freeing memory).
-*/
-void endback(picstruct *field)
-
- {
- free(field->back);
- free(field->dback);
- free(field->sigma);
- free(field->dsigma);
- free(field->backline);
-
- return;
- }
-
diff --git a/sextractor/src/back.h b/sextractor/src/back.h
deleted file mode 100644
index 5b58036..0000000
--- a/sextractor/src/back.h
+++ /dev/null
@@ -1,59 +0,0 @@
- /*
- back.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions dealing with background computation.
-*
-* Last modify: 02/05/99
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-#define BACK_BUFSIZE 1048576 /* bkgnd buffer */
-#define BACK_MINGOODFRAC 0.5 /* min frac with good weights*/
-#define QUANTIF_NSIGMA 5 /* histogram limits */
-#define QUANTIF_NMAXLEVELS 4096 /* max nb of quantif. levels */
-#define QUANTIF_AMIN 4 /* min nb of "mode pixels" */
-
-/* NOTES:
-One must have: BACK_BUFSIZE >= MAXPICSIZE
- 0 < QUANTIF_NSIGMA <= 10
- QUANTIF_AMIN > 0
-*/
-
-/*------------------------------- structures --------------------------------*/
-/* Background info */
-typedef struct structback
- {
- float mode, mean, sigma; /* Background mode, mean and sigma */
- LONG *histo; /* Pointer to a histogram */
- int nlevels; /* Nb of histogram bins */
- float qzero, qscale; /* Position of histogram */
- float lcut, hcut; /* Histogram cuts */
- int npix; /* Number of pixels involved */
- } backstruct;
-
-
-/*------------------------------- functions ---------------------------------*/
-void backhisto(backstruct *, backstruct *, PIXTYPE *, PIXTYPE *,
- size_t, int, int, int, PIXTYPE),
- backstat(backstruct *, backstruct *, PIXTYPE *, PIXTYPE *,
- size_t, int, int, int, PIXTYPE),
- backrmsline(picstruct *, int, PIXTYPE *),
- copyback(picstruct *infield, picstruct *outfield),
- endback(picstruct *),
- filterback(picstruct *),
- makeback(picstruct *, picstruct *),
- subbackline(picstruct *, int, PIXTYPE *);
-
-float backguess(backstruct *, float *, float *),
- localback(picstruct *, objstruct *),
- *makebackspline(picstruct *, float *);
-
-extern PIXTYPE back(picstruct *, int, int);
diff --git a/sextractor/src/bpro.c b/sextractor/src/bpro.c
deleted file mode 100644
index 0323e0d..0000000
--- a/sextractor/src/bpro.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- bpro.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: Any back-propagation-ANN-oriented software
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Routines for BP-neural network management ("read-only"
-* mode).
-*
-* Requirements: The LDACTools.
-*
-* Last modify: 13/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "fits/fitscat.h"
-#include "bpro.h"
-
-/******************************** play_bpann *********************************/
-/*
-Single forward pass through the ANN.
-*/
-void play_bpann(bpannstruct *bpann, NFLOAT *invec, NFLOAT *outvec)
- {
- NFLOAT u, *neuroni,*neuronj, *weight;
- int i,j,l,lp,ll, lflag;
-
- ll = bpann->nlayers-1;
- memcpy(bpann->neuron[0], invec, bpann->nn[0]*sizeof(float));
- lflag = bpann->linearoutflag;
- for (lp=0,l=1; lp<ll; l++, lp++)
- {
- neuronj = bpann->neuron[l];
- weight = bpann->weight[lp];
- for (j=bpann->nn[l]; j--; neuronj++)
- { /* note we don't touch the "bias" neuron (=-1) */
- neuroni = bpann->neuron[lp];
- u = *(weight++)**(neuroni++);
- for (i=bpann->nn[lp]; i--;) /* The last one is the bias */
- u += *(weight++)**(neuroni++);
- if (l == ll)
- *(outvec++)= lflag?u:SIGMOID(u);
- else
- *neuronj = SIGMOID(u);
- }
- }
-
- return;
- }
-
-
-/******************************* loadtab_bpann *******************************/
-/*
-Load the relevant ANN structure (using the LDACTools).
-*/
-bpannstruct *loadtab_bpann(tabstruct *tab, char *filename)
- {
- bpannstruct *bpann;
- keystruct *key;
- char *head, str[80];
- int l;
-
-/* OK, we now allocate memory for the ANN structure itself */
- QCALLOC(bpann, bpannstruct, 1);
-/* Load important scalars (which are stored as FITS keywords) */
- head = tab->headbuf;
- if (fitsread(head, "BPNLAYER", &bpann->nlayers, H_INT, T_LONG) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: incorrect BP-ANN header in ", filename);
- if (fitsread(head, "BPLINEAR",&bpann->linearoutflag, H_INT,T_LONG)!=RETURN_OK)
- bpann->linearoutflag = 0;
-/* Load all vectors!! */
- read_keys(tab, NULL, NULL, 0, NULL);
-/* Now interpret the result */
- if (!(key = name_to_key(tab, "NNEUR_PER_LAYER")))
- error(EXIT_FAILURE, "*Error*: incorrect BP-ANN header in ", filename);
- bpann->nn = key->ptr; key->ptr = 0;
- QMALLOC(bpann->neuron, NFLOAT *, bpann->nlayers);
- QMALLOC(bpann->weight, NFLOAT *, bpann->nlayers-1);
- for (l=0; l<bpann->nlayers-1; l++)
- {
- QMALLOC(bpann->neuron[l], NFLOAT, bpann->nn[l]+1);
- bpann->neuron[l][bpann->nn[l]] = -1.0;
- sprintf(str, "WEIGHT_LAYER%d", l+1);
- if (!(key = name_to_key(tab, str)))
- error(EXIT_FAILURE, "*Error*: incorrect BP-ANN header in ", filename);
- bpann->weight[l] = key->ptr; key->ptr = 0;
- }
-
- QMALLOC(bpann->neuron[l], NFLOAT, bpann->nn[l]); /* no bias in this layer */
-
- return bpann;
- }
-
-
-/******************************** free_bpann *********************************/
-/*
-Free all memory modules allocated for a Back-Propagation ANN structure.*/
-void free_bpann(bpannstruct *bpann)
-
- {
- int i;
-
-/* Loop over the "true" layers */
- for (i=0; i<bpann->nlayers-1; i++)
- {
- free(bpann->neuron[i]);
- free(bpann->weight[i]);
- }
-
- free(bpann->neuron[i]); /* Because of the input layer */
-
-/* Then free pointers of pointers */
- free(bpann->neuron);
- free(bpann->weight);
- free(bpann->nn);
-
-/* And finally free the ANN structure itself */
- free(bpann);
-
- return;
- }
-
-
diff --git a/sextractor/src/bpro.h b/sextractor/src/bpro.h
deleted file mode 100644
index 685fc74..0000000
--- a/sextractor/src/bpro.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- bpro.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: Any back-propagation-ANN-oriented software
-*
-* Author: E.BERTIN, IAP/LDAC
-*
-* Contents: Routines for BP-neural network management ("read-only"
-* mode).
-*
-* Requirements: The LDACTools.
-*
-* Last modify: 08/10/96
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*------------------------------- definitions -------------------------------*/
-#define SIGMOID(u) ((u)<15.0?((u)>-15.0?1/(1+exp(-(u))):0.0):1.0)
- /* In-line activation function */
-
-/*---------------------------------- types ----------------------------------*/
-typedef float NFLOAT; /* Floating point units for neural data */
-
-/*------------------------------- structures --------------------------------*/
-typedef struct structbpann
- {
- int nlayers; /* Number of "active" layers */
- int *nn; /* Nb of neurons per "active" layer */
-/*------ The ANN itself */
- NFLOAT **neuron; /* Neuron array (layer,pos in layer) */
- NFLOAT **weight; /* Weight array (layer,pos in layer) */
- int linearoutflag; /* Flag: 0 if outputs are non-linear */
- } bpannstruct;
-
-
-/*------------------------------ Prototypes ---------------------------------*/
-
-bpannstruct *loadtab_bpann(tabstruct *tab, char *filename);
-
-void free_bpann(bpannstruct *bpann),
- play_bpann(bpannstruct *bpann, NFLOAT *invec, NFLOAT *outvec);
-
diff --git a/sextractor/src/catout.c b/sextractor/src/catout.c
deleted file mode 100644
index 1217706..0000000
--- a/sextractor/src/catout.c
+++ /dev/null
@@ -1,735 +0,0 @@
-/*
- catout.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions for output of catalog data.
-*
-* Last modify: 13/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "param.h"
-#include "sexhead.h"
-#include "sexhead1.h"
-#include "sexheadsc.h"
-#include "xml.h"
-
-catstruct *fitscat;
-tabstruct *objtab = NULL;
-FILE *ascfile;
-char *buf;
-int catopen_flag = 0;
-
-/******************************* readcatparams *******************************/
-/*
-Read the catalog config file
-*/
-void readcatparams(char *filename)
- {
- keystruct *key;
- FILE *infile;
- char str[MAXCHAR], *keyword, *sstr;
- int i, size;
-
-/* Prepare the OBJECTS tables*/
- objtab = new_tab("OBJECTS");
-
- if ((infile = fopen(filename,"r")) == NULL)
- error(EXIT_FAILURE, "*ERROR*: can't read ", filename);
-
-/* Scan the catalog config file*/
- thecat.nparam = 0;
- while (fgets(str, MAXCHAR, infile))
- {
- sstr = str + strspn(str," \t");
- if (*sstr!=(char)'#' && *sstr!=(char)'\n')
- {
- keyword = strtok(sstr, " \t{[(\n\r");
- if (keyword &&
- (i = findkey(keyword,(char *)objkey,sizeof(keystruct)))!=RETURN_ERROR)
- {
- key = objkey+i;
- add_key(key, objtab, 0);
- *((char *)key->ptr) = (char)'\1';
- thecat.nparam++;
- if (key->naxis)
- {
- for (i=0; i<key->naxis; i++)
- key->naxisn[i] = 1;
- size=t_size[key->ttype];
- for (i=0; (sstr = strtok(NULL, " \t,;.)]}\r")) && *sstr!=(char)'#'
- && *sstr!=(char)'\n'; i++)
- {
- if (i>=key->naxis)
- error(EXIT_FAILURE, "*Error*: too many dimensions for keyword ",
- keyword);
- if (!(size*=(key->naxisn[i]=atoi(sstr))))
- error(EXIT_FAILURE, "*Error*: wrong array syntax for keyword ",
- keyword);
- }
- key->nbytes = size;
- }
- }
- else
- warning(keyword, " catalog parameter unknown");
- }
- }
-
- fclose(infile);
-
-/* Now we copy the flags to the proper structures */
-
- flagobj = outobj;
- flagobj2 = outobj2;
-/* Differentiate between outobj and outobj2 vectors */
- memset(&outobj2, 0, sizeof(outobj2));
- updateparamflags();
-
-/* Go back to multi-dimensional arrays for memory allocation */
- if (thecat.nparam)
- for (i=objtab->nkey, key=objtab->key; i--; key = key->nextkey)
- if (key->naxis)
- {
-/*------ Only outobj2 vectors are dynamic */
- if (!*((char **)key->ptr))
- {
- QMALLOC(*((char **)key->ptr), char, key->nbytes);
- key->ptr = *((char **)key->ptr);
- key->allocflag = 1;
- }
- }
-
- return;
- }
-
-
-/***************************** updateparamflags ******************************/
-/*
-Update parameter flags according to their mutual dependencies.
-*/
-void updateparamflags()
-
- {
- int i;
-
-/*------------------------------ 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);
- FLAG(obj2.win_thetas) |= FLAG(obj2.win_theta1950)
- | FLAG(obj2.win_theta2000);
- FLAG(obj2.win_thetaw) |= FLAG(obj2.win_thetas);
-
- FLAG(obj2.win_mx2w) |= FLAG(obj2.win_my2w)
- | FLAG(obj2.win_mxyw)
- | FLAG(obj2.win_thetaw) | FLAG(obj2.win_aw)
- | FLAG(obj2.win_cxxw);
-
- FLAG(obj2.win_a) |= FLAG(obj2.win_b) | FLAG(obj2.win_theta)
- | FLAG(obj2.win_polar) | FLAG(obj2.win_aw);
- FLAG(obj2.win_cxx) |= FLAG(obj2.win_cyy)
- | FLAG(obj2.win_cxy) | FLAG(obj2.win_cxxw);
- FLAG(obj2.win_mx2) |= FLAG(obj2.win_my2)
- | FLAG(obj2.win_mxy)
- | FLAG(obj2.win_a) | FLAG(obj2.win_cxx)
- | FLAG(obj2.win_mx2w);
-
- FLAG(obj2.winposerr_aw) |= FLAG(obj2.winposerr_bw);
- FLAG(obj2.winposerr_cxxw) |= FLAG(obj2.winposerr_cyyw)
- | FLAG(obj2.winposerr_cxyw);
- FLAG(obj2.winposerr_thetas) |= FLAG(obj2.winposerr_theta1950)
- | FLAG(obj2.winposerr_theta2000);
- FLAG(obj2.winposerr_thetaw) |= FLAG(obj2.winposerr_thetas);
-
- FLAG(obj2.winposerr_mx2w) |= FLAG(obj2.winposerr_my2w)
- | FLAG(obj2.winposerr_mxyw)
- | FLAG(obj2.winposerr_thetaw) | FLAG(obj2.winposerr_aw)
- | FLAG(obj2.winposerr_cxxw);
-
- FLAG(obj2.winposerr_a) |= FLAG(obj2.winposerr_b) | FLAG(obj2.winposerr_theta);
- FLAG(obj2.winposerr_cxx) |= FLAG(obj2.winposerr_cyy)
- | FLAG(obj2.winposerr_cxy);
- FLAG(obj2.winposerr_mx2) |= FLAG(obj2.winposerr_my2)
- | FLAG(obj2.winposerr_mxy)
- | FLAG(obj2.winposerr_a) | FLAG(obj2.winposerr_cxx)
- | FLAG(obj2.winposerr_mx2w);
-
- FLAG(obj2.winpos_alpha1950) |= FLAG(obj2.winpos_delta1950)
- | FLAG(obj2.win_theta1950)
- | FLAG(obj2.winposerr_theta1950);
- FLAG(obj2.winpos_alpha2000) |= FLAG(obj2.winpos_delta2000)
- | FLAG(obj2.winpos_alpha1950)
- | FLAG(obj2.win_theta2000)
- | FLAG(obj2.winposerr_theta2000);
- FLAG(obj2.winpos_alphas) |= FLAG(obj2.winpos_deltas)
- | FLAG(obj2.winpos_alpha2000);
- FLAG(obj2.winpos_xw) |= FLAG(obj2.winpos_yw)
- | FLAG(obj2.winpos_alphas);
-
- FLAG(obj2.poserr_aw) |= FLAG(obj2.poserr_bw);
- FLAG(obj2.poserr_cxxw) |= FLAG(obj2.poserr_cyyw) | FLAG(obj2.poserr_cxyw);
- FLAG(obj2.poserr_thetas) |= FLAG(obj2.poserr_theta1950)
- | FLAG(obj2.poserr_theta2000);
- FLAG(obj2.poserr_thetaw) |= FLAG(obj2.poserr_thetas);
-
- FLAG(obj2.poserr_mx2w) |= FLAG(obj2.poserr_my2w) | FLAG(obj2.poserr_mxyw)
- | FLAG(obj2.poserr_thetaw) | FLAG(obj2.poserr_aw)
- | FLAG(obj2.poserr_cxxw);
-
- FLAG(obj2.poserr_a) |= FLAG(obj2.poserr_b) | FLAG(obj2.poserr_theta)
- | FLAG(obj2.winposerr_a);
- FLAG(obj2.poserr_cxx) |= FLAG(obj2.poserr_cyy) | FLAG(obj2.poserr_cxy);
- FLAG(obj.poserr_mx2) |= FLAG(obj.poserr_my2) | FLAG(obj.poserr_mxy)
- | FLAG(obj2.poserr_a) | FLAG(obj2.poserr_cxx)
- | FLAG(obj2.poserr_mx2w) | FLAG(obj2.winposerr_mx2);
-
- FLAG(obj2.peakalpha1950) |= FLAG(obj2.peakdelta1950);
- FLAG(obj2.alpha1950) |= FLAG(obj2.delta1950) | FLAG(obj2.theta1950)
- | FLAG(obj2.poserr_theta1950);
- 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.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);
- FLAG(obj2.thetaw) |= FLAG(obj2.thetas);
- FLAG(obj2.aw) |= FLAG(obj2.bw) | FLAG(obj2.polarw);
- FLAG(obj2.cxxw) |= FLAG(obj2.cyyw) | FLAG(obj2.cxyw);
-
- FLAG(obj2.mx2w) |= FLAG(obj2.my2w) | FLAG(obj2.mxyw)
- | FLAG(obj2.thetaw) | FLAG(obj2.aw) | FLAG(obj2.cxxw)
- | FLAG(obj2.npixw) | FLAG(obj2.fdnpixw)
- | FLAG(obj2.fwhmw);
-
- FLAG(obj2.peakxw) |= FLAG(obj2.peakyw) | FLAG(obj2.peakalphas);
- FLAG(obj.peakx) |= FLAG(obj.peaky) | FLAG(obj2.peakxw);
-
- FLAG(obj2.mxw) |= FLAG(obj2.myw) | FLAG(obj2.mx2w) | FLAG(obj2.alphas)
- | FLAG(obj2.poserr_mx2w);
- FLAG(obj2.mamaposx) |= FLAG(obj2.mamaposy);
- FLAG(obj2.flux_win) |= FLAG(obj2.mag_win)|FLAG(obj2.magerr_win)
- | FLAG(obj2.flux_win) | FLAG(obj2.fluxerr_win);
- FLAG(obj2.winpos_x) |= FLAG(obj2.winpos_y)
- | FLAG(obj2.winposerr_mx2) | FLAG(obj2.win_mx2)
- | FLAG(obj2.winpos_xw) | FLAG(obj2.win_flag)
- | FLAG(obj2.flux_win) |FLAG(obj2.winpos_niter);
-
-/*------------------------------ Photometry ---------------------------------*/
-
- FLAG(obj2.fluxerr_best) |= FLAG(obj2.magerr_best);
-
- FLAG(obj2.flux_best) |= FLAG(obj2.mag_best) | FLAG(obj2.fluxerr_best);
-
- FLAG(obj2.hl_radius) |= FLAG(obj2.winpos_x);
-
- FLAG(obj2.flux_auto) |= FLAG(obj2.mag_auto) | FLAG(obj2.magerr_auto)
- | FLAG(obj2.fluxerr_auto)
- | FLAG(obj2.kronfactor)
- | FLAG(obj2.flux_best)
- | FLAG(obj2.flux_radius)
- | FLAG(obj2.hl_radius);
- FLAG(obj2.flux_petro) |= FLAG(obj2.mag_petro) | FLAG(obj2.magerr_petro)
- | FLAG(obj2.fluxerr_petro)
- | FLAG(obj2.petrofactor);
-
- FLAG(obj2.fluxerr_isocor) |= FLAG(obj2.magerr_isocor)
- | FLAG(obj2.fluxerr_best);
-
- FLAG(obj2.flux_isocor) |= FLAG(obj2.mag_isocor) | FLAG(obj2.fluxerr_isocor)
- | FLAG(obj2.flux_best);
-
- 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);
-
-/*---------------------------- External flags -------------------------------*/
- VECFLAG(obj.imaflag) |= VECFLAG(obj.imanflag);
-
-/*------------------------------ PSF-fitting --------------------------------*/
- FLAG(obj2.poserraw_psf) |= FLAG(obj2.poserrbw_psf);
- FLAG(obj2.poserrcxxw_psf) |= FLAG(obj2.poserrcyyw_psf)
- | FLAG(obj2.poserrcxyw_psf);
- FLAG(obj2.poserrthetas_psf) |= FLAG(obj2.poserrtheta1950_psf)
- | FLAG(obj2.poserrtheta2000_psf);
- FLAG(obj2.poserrthetaw_psf) |= FLAG(obj2.poserrthetas_psf);
-
- FLAG(obj2.poserrmx2w_psf) |= FLAG(obj2.poserrmy2w_psf)
- | FLAG(obj2.poserrmxyw_psf)
- | FLAG(obj2.poserrthetaw_psf) | FLAG(obj2.poserraw_psf)
- | FLAG(obj2.poserrcxxw_psf);
-
- FLAG(obj2.poserra_psf) |= FLAG(obj2.poserrb_psf)
- | FLAG(obj2.poserrtheta_psf);
- FLAG(obj2.poserrcxx_psf) |= FLAG(obj2.poserrcyy_psf)
- | FLAG(obj2.poserrcxy_psf);
- FLAG(obj2.poserrmx2_psf) |= FLAG(obj2.poserrmy2_psf)
- | FLAG(obj2.poserrmxy_psf)
- | FLAG(obj2.poserra_psf) | FLAG(obj2.poserrcxx_psf)
- | FLAG(obj2.poserrmx2w_psf);
-
- FLAG(obj2.alpha1950_psf) |= FLAG(obj2.delta1950_psf)
- | FLAG(obj2.poserrtheta1950_psf);
- FLAG(obj2.alpha2000_psf) |= FLAG(obj2.delta2000_psf)
- | FLAG(obj2.alpha1950_psf)
- | FLAG(obj2.poserrtheta2000_psf);
- FLAG(obj2.alphas_psf) |= FLAG(obj2.deltas_psf) | FLAG(obj2.alpha2000_psf);
-
- FLAG(obj2.xw_psf) |= FLAG(obj2.yw_psf) | FLAG(obj2.poserrmx2w_psf)
- | FLAG(obj2.alphas_psf);
-
- FLAG(obj2.fluxerr_psf) |= FLAG(obj2.poserrmx2_psf) | FLAG(obj2.magerr_psf);
-
- FLAG(obj2.mx2_pc) |= FLAG(obj2.my2_pc) | FLAG(obj2.mxy_pc)
- | FLAG(obj2.a_pc) | FLAG(obj2.b_pc)
- | FLAG(obj2.theta_pc) | FLAG(obj2.vector_pc)
- | FLAG(obj2.gdposang) | FLAG(obj2.gdscale)
- | FLAG(obj2.gdaspect) | FLAG(obj2.flux_galfit)
- | FLAG(obj2.gde1) | FLAG(obj2.gde2)
- | FLAG(obj2.gbposang) | FLAG(obj2.gbscale)
- | FLAG(obj2.gbaspect) | FLAG(obj2.gbratio);
-
- FLAG(obj2.flux_psf) |= FLAG(obj2.mag_psf) | FLAG(obj2.x_psf)
- | FLAG(obj2.y_psf) | FLAG(obj2.xw_psf)
- | FLAG(obj2.fluxerr_psf)
- | FLAG(obj2.niter_psf)
- | FLAG(obj2.chi2_psf)
- | FLAG(obj2.mx2_pc);
-
-/*-------------------------------- Others -----------------------------------*/
- FLAG(obj.fwhm) |= FLAG(obj2.fwhmw);
-
- FLAG(obj.iso[0]) |= FLAG(obj2.sprob);
- for (i=0; i<NISO; i++)
- FLAG(obj.iso[0]) |= FLAG(obj.iso[i]);
-
- return;
- }
-
-
-/********************************** initcat **********************************/
-/*
-Initialize the catalog header
-*/
-void initcat(void)
- {
- keystruct *key;
- int i, n;
-
- if (prefs.cat_type == CAT_NONE)
- return;
-
- update_tab(objtab);
- if (prefs.cat_type == ASCII_HEAD || prefs.cat_type == ASCII ||
- prefs.cat_type == ASCII_SKYCAT || prefs.cat_type == ASCII_VO)
- {
- if (prefs.pipe_flag)
- ascfile = stdout;
- else
- if (!(ascfile = fopen(prefs.cat_name, "w+")))
- error(EXIT_FAILURE,"*Error*: cannot open ", prefs.cat_name);
- if (prefs.cat_type == ASCII_HEAD && (key = objtab->key))
- for (i=0,n=1; i++<objtab->nkey; key=key->nextkey)
- {
- if (*key->unit)
- fprintf(ascfile, "# %3d %-15.15s %-47.47s [%s]\n",
- n, key->name,key->comment, key->unit);
- else
- fprintf(ascfile, "# %3d %-15.15s %.47s\n",
- n, key->name,key->comment);
- n += key->nbytes/t_size[key->ttype];
- }
- else if (prefs.cat_type == ASCII_SKYCAT && (key = objtab->key))
- {
- if (objtab->nkey<3)
- error(EXIT_FAILURE,"The SkyCat format requires at least 4 parameters:",
- " Id Ra Dec Mag");
-/*--- We add a tab between rows, as required by Skycat */
- fprintf(ascfile, skycathead, 8.0);
- for (i=1,key=key->nextkey; i++<objtab->nkey; key=key->nextkey)
- {
- if (i>4)
- fprintf(ascfile, "\t%s", key->name);
- sprintf(gstr, "\t%s", key->printf);
- strcpy(key->printf, gstr);
- }
- fprintf(ascfile, "\n------------------\n");
- }
- else if (prefs.cat_type == ASCII_VO && objtab->key)
- {
- write_xml_header(ascfile);
- write_vo_fields(ascfile);
- fprintf(ascfile, " <DATA><TABLEDATA>\n");
- }
- }
- else
- {
- fitscat = new_cat(1);
- init_cat(fitscat);
- strcpy(fitscat->filename, prefs.cat_name);
- if (open_cat(fitscat, WRITE_ONLY) != RETURN_OK)
- error(EXIT_FAILURE,"*Error*: cannot open for writing ",prefs.cat_name);
- switch(prefs.cat_type)
- {
- case FITS_LDAC:
- case FITS_TPX:
-/*------ Save a "pure" primary HDU */
- save_tab(fitscat, fitscat->tab);
- break;
-
- case FITS_10:
-/*------ Add to the primary HDU extraction parameters */
- key = headkey1;
- while (*key->name)
- addkeyto_head(fitscat->tab, key++);
- save_tab(fitscat, fitscat->tab);
- break;
- default:
- error (EXIT_FAILURE, "*Internal Error*: Unknown FITS type in ",
- "initcat()");
- }
- }
-
- catopen_flag = 1;
-
- return;
- }
-
-
-/****** write_vo_fields *******************************************************
-PROTO int write_vo_fields(FILE *file)
-PURPOSE Write the list of columns to an XML-VOTable file or stream
-INPUT Pointer to the output file (or stream).
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 14/07/2006
- ***/
-void write_vo_fields(FILE *file)
- {
- keystruct *key;
- char datatype[40], arraysize[40], str[40];
- int i, d;
-
- if (!objtab || !objtab->key)
- return;
- key=objtab->key;
- for (i=0; i++<objtab->nkey; key=key->nextkey)
- {
-/*--- indicate datatype, arraysize, width and precision attributes */
-/*--- Handle multidimensional arrays */
- arraysize[0] = '\0';
- if (key->naxis>1)
- {
- for (d=0; d<key->naxis; d++)
- {
- sprintf(str, "%s%d", d?"x":" arraysize=\"", key->naxisn[d]);
- strcat(arraysize, str);
- }
- strcat(arraysize, "\"");
- }
- switch(key->ttype)
- {
- case T_BYTE: strcpy(datatype, "unsignedByte"); break;
- case T_SHORT: strcpy(datatype, "short"); break;
- case T_LONG: strcpy(datatype, "int"); break;
- case T_FLOAT: strcpy(datatype, "float"); break;
- case T_DOUBLE: strcpy(datatype, "double"); break;
- default: error(EXIT_FAILURE,
- "*Internal Error*: Unknown datatype in ",
- "initcat()");
- }
- fprintf(file,
- " <FIELD name=\"%s\" ucd=\"%s\" datatype=\"%s\" unit=\"%s\"%s>\n",
- key->name, key->voucd, datatype,key->vounit, arraysize);
- fprintf(file, " <DESCRIPTION>%s</DESCRIPTION>\n", key->comment);
- fprintf(file, " </FIELD>\n");
- }
-
- return;
- }
-
-
-/********************************* reinitcat *********************************/
-/*
-Initialize the catalog header
-*/
-void reinitcat(picstruct *field)
- {
- tabstruct *tab, *asctab;
- keystruct *key;
-
- if (prefs.cat_type == CAT_NONE)
- return;
-
- if (prefs.cat_type != ASCII_HEAD && prefs.cat_type != ASCII &&
- prefs.cat_type != ASCII_SKYCAT && prefs.cat_type != ASCII_VO)
- {
- update_tab(objtab);
- switch(prefs.cat_type)
- {
- case FITS_LDAC:
-/*------ We create a dummy table (only used through its header) */
- QCALLOC(asctab, tabstruct, 1);
- asctab->headnblock = field->fitsheadsize/FBSIZE;
- QMALLOC(asctab->headbuf, char, asctab->headnblock*FBSIZE);
- memcpy(asctab->headbuf, field->fitshead, asctab->headnblock*FBSIZE);
- key = headkey;
- while (*key->name)
- addkeyto_head(asctab, key++);
- tab = new_tab("LDAC_IMHEAD");
- add_tab(tab, fitscat, 0);
- key = new_key("Field Header Card");
- key->ptr = asctab->headbuf;
- asctab->headbuf = NULL;
- free_tab(asctab);
- key->htype = H_STRING;
- key->ttype = T_STRING;
- key->nobj = 1;
- key->nbytes = 80*(fitsfind(key->ptr, "END ")+1);
- key->naxis = 2;
- QMALLOC(key->naxisn, int, key->naxis);
- key->naxisn[0] = 80;
- key->naxisn[1] = key->nbytes/80;
- add_key(key, tab, 0);
- save_tab(fitscat, tab);
- strcpy(objtab->extname, "LDAC_OBJECTS");
- break;
-
- case FITS_TPX:
-/*------ We create a dummy table (only used through its header) */
- QCALLOC(asctab, tabstruct, 1);
- asctab->headnblock = field->fitsheadsize/FBSIZE;
- QMALLOC(asctab->headbuf, char, asctab->headnblock*FBSIZE);
- memcpy(asctab->headbuf, field->fitshead, asctab->headnblock*FBSIZE);
- key = headkey;
- while (*key->name)
- addkeyto_head(asctab, key++);
- tab = new_tab("TPX_IMHEAD");
- add_tab(tab, fitscat, 0);
- key = new_key("Field Header Card");
- key->ptr = asctab->headbuf;
- asctab->headbuf = NULL;
- free_tab(asctab);
- key->htype = H_STRING;
- key->ttype = T_STRING;
- key->nobj = fitsfind(key->ptr, "END ")+1;
- key->nbytes = 80;
- key->naxis = 1;
- QMALLOC(key->naxisn, int, key->naxis);
- key->naxisn[0] = 80;
- add_key(key, tab, 0);
- save_tab(fitscat, tab);
- strcpy(objtab->extname, "TPX_OBJECTS");
- break;
-
- case FITS_10:
-/*------ Add to the primary HDU extraction parameters */
-/*
- key = headkey1;
- while (*key->name)
- addkeyto_head(fitscat->tab, key++);
- save_tab(fitscat, fitscat->tab);
-*/
- break;
-
- default:
- error (EXIT_FAILURE, "*Internal Error*: Unknown FITS type in ",
- "reinitcat()");
- }
-
- objtab->cat = fitscat;
- init_writeobj(fitscat, objtab, &buf);
- }
-
- return;
- }
-
-
-/********************************* writecat **********************************/
-/*
-Write out in the catalog each one object.
-*/
-void writecat(int n, objliststruct *objlist)
- {
- outobj = objlist->obj[n];
-
- switch(prefs.cat_type)
- {
- case FITS_10:
- case FITS_LDAC:
- case FITS_TPX:
- write_obj(objtab, buf);
- break;
-
- case ASCII:
- case ASCII_HEAD:
- case ASCII_SKYCAT:
- print_obj(ascfile, objtab);
- break;
- case ASCII_VO:
- voprint_obj(ascfile, objtab);
- break;
-
- case CAT_NONE:
- break;
-
- default:
- error (EXIT_FAILURE, "*Internal Error*: Unknown catalog type", "");
- }
-
- return;
- }
-
-
-/********************************** endcat ***********************************/
-/*
-Terminate the catalog output.
-*/
-void endcat(char *error)
- {
- keystruct *key;
- int i;
-
- if (!catopen_flag)
- {
- if (prefs.cat_type == ASCII_VO)
- write_xmlerror(prefs.cat_name, error);
- return;
- }
- switch(prefs.cat_type)
- {
- case ASCII:
- case ASCII_HEAD:
- if (!prefs.pipe_flag)
- fclose(ascfile);
- break;
-
- case ASCII_SKYCAT:
- fprintf(ascfile, skycattail);
- if (!prefs.pipe_flag)
- fclose(ascfile);
- break;
-
- case ASCII_VO:
- fprintf(ascfile, " </TABLEDATA></DATA>\n");
- fprintf(ascfile, " </TABLE>\n");
-/*---- Add configuration file meta-data */
- write_xml_meta(ascfile, error);
- fprintf(ascfile, "</RESOURCE>\n");
- fprintf(ascfile, "</VOTABLE>\n");
-
- if (!prefs.pipe_flag)
- fclose(ascfile);
- break;
-
- case FITS_LDAC:
- case FITS_TPX:
- case FITS_10:
- free_cat(&fitscat,1);
- break;
-
- case CAT_NONE:
- break;
-
- default:
- break;
- }
-
-/* Free allocated memory for arrays */
- key = objtab->key;
- for (i=objtab->nkey; i--; key=key->nextkey)
- if (key->naxis && key->allocflag)
- free(key->ptr);
-
- objtab->key = NULL;
- objtab->nkey = 0;
- free_tab(objtab);
- objtab = NULL;
-
- return;
- }
-
-
-/******************************** reendcat ***********************************/
-/*
-Terminate the catalog output.
-*/
-void reendcat()
- {
- keystruct *key;
- tabstruct *tab;
- OFF_T pos;
- char *head;
-
- switch(prefs.cat_type)
- {
- case ASCII:
- case ASCII_HEAD:
- case ASCII_SKYCAT:
- case ASCII_VO:
- break;
-
- case FITS_LDAC:
- case FITS_TPX:
- end_writeobj(fitscat, objtab, buf);
- key = NULL;
- if (!(tab=fitscat->tab->prevtab)
- || !(key=name_to_key(tab, "Field Header Card")))
- error(EXIT_FAILURE,"*Error*: cannot update table ", "ASCFIELD");
- 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, "SEXELAPS", &thecat.ext_elapsed, H_FLOAT, T_DOUBLE);
- QFTELL(fitscat->file, pos, fitscat->filename);
- QFSEEK(fitscat->file, tab->headpos, SEEK_SET, fitscat->filename);
- save_tab(fitscat, tab);
- QFSEEK(fitscat->file, pos, SEEK_SET, fitscat->filename);
- break;
-
- case FITS_10:
- end_writeobj(fitscat, objtab, buf);
- fitswrite(fitscat->tab->headbuf,"SEXNDET ",&thecat.ndetect,H_INT,T_LONG);
- fitswrite(fitscat->tab->headbuf,"SEXNFIN ",&thecat.ntotal, H_INT,T_LONG);
- QFTELL(fitscat->file, pos, fitscat->filename);
- QFSEEK(fitscat->file, fitscat->tab->headpos, SEEK_SET,fitscat->filename);
- save_tab(fitscat, fitscat->tab);
- QFSEEK(fitscat->file, pos, SEEK_SET, fitscat->filename);
- break;
-
- case CAT_NONE:
- break;
-
- default:
- break;
- }
-
- return;
- }
-
-
diff --git a/sextractor/src/check.c b/sextractor/src/check.c
deleted file mode 100644
index 7290862..0000000
--- a/sextractor/src/check.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- check.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: handling of "check-images".
-*
-* Last modify: 15/06/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "fits/fitscat.h"
-#include "astrom.h"
-#include "check.h"
-
-/********************************* addcheck **********************************/
-/*
-Add a PSF to a CHECK-image (with a multiplicative factor).
-Outside boundaries are taken into account.
-*/
-void addcheck(checkstruct *check, float *psf,
- int w,int h, int ix,int iy, float amplitude)
- {
- PIXTYPE *pix;
- int x,y, xmin,xmax,ymin,ymax,w2, dwpsf;
-
-/* Set the image boundaries */
- w2 = w;
- ymin = iy-h/2;
- ymax = ymin + h;
- if (ymin<0)
- {
- psf -= ymin*w;
- ymin = 0;
- }
- if (ymax>check->height)
- ymax = check->height;
-
- xmin = ix-w/2;
- xmax = xmin + w;
- if (xmax>check->width)
- {
- w2 -= xmax-check->width;
- xmax = check->width;
- }
- if (xmin<0)
- {
- psf += -xmin;
- w2 -= -xmin;
- xmin = 0;
- }
-
- dwpsf = w-w2;
-/* Subtract the right pixels to the destination */
- for (y=ymin; y<ymax; y++, psf += dwpsf)
- {
- pix = (float *)check->pix+y*check->width+xmin;
- for (x=w2; x--;)
- *(pix++) += amplitude**(psf++);
- }
-
- return;
- }
-
-
-/********************************* blankcheck *******************************/
-/*
-Blank a part of the CHECK-image according to a mask.
-*/
-void blankcheck(checkstruct *check, PIXTYPE *mask, int w,int h,
- int xmin,int ymin, PIXTYPE val)
- {
- PIXTYPE *pixt;
- int x,y, xmax,ymax,w2,wc;
-
-/* Don't go further if out of frame!! */
- if (xmin+w<0 || xmin>=check->width
- || ymin+h<0 || ymin>=check->height)
- return;
-
-/* Set the image boundaries */
- w2 = w;
- ymax = ymin + h;
- if (ymin<0)
- {
- mask -= ymin*w;
- ymin = 0;
- }
- if (ymax>check->height)
- ymax = check->height;
-
- xmax = xmin + w;
- if (xmax>check->width)
- {
- w2 -= xmax - check->width;
- xmax = check->width;
- }
- if (xmin<0)
- {
- mask += -xmin;
- w2 -= -xmin;
- xmin = 0;
- }
-
- w -= w2;
- wc = check->width;
- ymin = ymin*wc+xmin;
- ymax = ymax*wc+xmin;
-
-/* Blank the right pixels in the image */
- for (y=ymin; y<ymax; y+=wc, mask += w)
- {
- pixt = (float *)check->pix + y;
- for (x=w2; x--; pixt++)
- if (*(mask++) > -BIG)
- *pixt = val;
- }
-
- return;
- }
-
-
-/******************************** initcheck **********************************/
-/*
-initialize check-image.
-*/
-checkstruct *initcheck(char *filename, checkenum check_type, int next)
-
- {
- catstruct *fitscat;
- checkstruct *check;
-
- QCALLOC(check, checkstruct, 1);
-
- strcpy(check->filename, filename);
- check->type = check_type;
-
- if (next>1)
-/*-- Create a "pure" primary HDU */
- {
- fitscat = new_cat(1);
- init_cat(fitscat);
- strcpy(fitscat->filename, filename);
- fitsadd(fitscat->tab->headbuf, "NEXTEND ", "Number of extensions");
- fitswrite(fitscat->tab->headbuf, "NEXTEND ", &next, H_INT, T_LONG);
- if (open_cat(fitscat, WRITE_ONLY) != RETURN_OK)
- error(EXIT_FAILURE,"*Error*: cannot open for writing ", filename);
- save_tab(fitscat, fitscat->tab);
- check->file = fitscat->file;
- fitscat->file = NULL;
- free_cat(&fitscat, 1);
- }
- else
- if (!(check->file = fopen(check->filename, "wb")))
- error(EXIT_FAILURE, "*Error*: Cannot open for output ", check->filename);
-
- return check;
- }
-
-
-/******************************** reinitcheck ********************************/
-/*
-initialize check-image (for subsequent writing).
-*/
-void reinitcheck(picstruct *field, checkstruct *check)
-
- {
- astromstruct *as;
- char *buf;
- int i, ival;
- size_t padsize;
- double dval;
- ULONG *ptri;
- 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->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 != ICOMPRESS_NONE)
- fitswrite(check->fitshead, "IMAGECOD", "NONE", H_STRING, T_STRING);
- fitswrite(check->fitshead, "ORIGIN ", BANNER, H_STRING, T_STRING);
-
- switch(check->type)
- {
- case CHECK_IDENTICAL:
- case CHECK_BACKGROUND:
- case CHECK_FILTERED:
- case CHECK_SUBTRACTED:
- ival = -32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->width;
- check->height = field->height;
- check->npix = field->npix;
- QMALLOC(ptrf, PIXTYPE, check->width);
- check->pix = (void *)ptrf;
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
- break;
-
- case CHECK_BACKRMS:
- case CHECK_SUBOBJECTS:
- ival = -32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->width;
- check->height = field->height;
- check->npix = field->npix;
- QMALLOC(ptrf, PIXTYPE, check->width);
- check->pix = (void *)ptrf;
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
-/*---- Allocate memory for replacing the blanked pixels by 0 */
- if (!check->line)
- QMALLOC(check->line, PIXTYPE, field->width);
- break;
-
- case CHECK_OBJECTS:
- case CHECK_APERTURES:
- case CHECK_SUBPSFPROTOS:
- case CHECK_PSFPROTOS:
- case CHECK_SUBPCPROTOS:
- case CHECK_PCPROTOS:
- case CHECK_PCOPROTOS:
- ival = -32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->width;
- check->height = field->height;
- check->npix = field->npix;
- check->overlay = 30*field->backsig;
- QCALLOC(ptrf, PIXTYPE, check->npix);
- check->pix = (void *)ptrf;
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
- break;
-
- case CHECK_SEGMENTATION:
- ival = 32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->width;
- check->height = field->height;
- check->npix = field->npix;
- QCALLOC(ptri, ULONG, check->npix);
- check->pix = (void *)ptri;
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
- break;
-
- case CHECK_ASSOC:
- ival = -32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->width;
- check->height = field->height;
- check->npix = field->npix;
- QMALLOC(ptrf, PIXTYPE, check->npix);
- check->pix = (void *)ptrf;
-/*---- Initialize the pixmap to IEEE NaN */
- memset(ptrf, 0xFF, check->npix*sizeof(LONG));
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
- break;
-
- case CHECK_MINIBACKGROUND:
- case CHECK_MINIBACKRMS:
- ival = -32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->nbackx;
- fitswrite(check->fitshead, "NAXIS1 ", &check->width, H_INT, T_LONG);
- check->height = field->nbacky;
- fitswrite(check->fitshead, "NAXIS2 ", &check->height, H_INT, T_LONG);
-/*---- Scale the WCS information if present */
- if ((as=field->astrom))
- {
- dval = as->cdelt[0]*field->backw;
- fitswrite(check->fitshead, "CDELT1 ", &dval, H_EXPO, T_DOUBLE);
- dval = as->cdelt[1]*field->backh;
- fitswrite(check->fitshead, "CDELT2 ", &dval, H_EXPO, T_DOUBLE);
- dval = (as->crpix[0]-0.5)/field->backw + 0.5;
- fitswrite(check->fitshead, "CRPIX1 ", &dval, H_EXPO, T_DOUBLE);
- dval = (as->crpix[1]-0.5)/field->backh + 0.5;
- fitswrite(check->fitshead, "CRPIX2 ", &dval, H_EXPO, T_DOUBLE);
-
- dval = as->pc[0]*as->cdelt[0]*field->backw;
- fitswrite(check->fitshead, "CD1_1 ", &dval, H_EXPO, T_DOUBLE);
- dval = as->pc[1]*as->cdelt[1]*field->backh;
- fitswrite(check->fitshead, "CD1_2 ", &dval, H_EXPO, T_DOUBLE);
- dval = as->pc[2]*as->cdelt[0]*field->backw;
- fitswrite(check->fitshead, "CD2_1 ", &dval, H_EXPO, T_DOUBLE);
- dval = as->pc[3]*as->cdelt[1]*field->backh;
- fitswrite(check->fitshead, "CD2_2 ", &dval, H_EXPO, T_DOUBLE);
- }
- check->npix = check->width*check->height;
- QMALLOC(ptrf, PIXTYPE, check->npix);
- check->pix = (void *)ptrf;
- if (check->type==CHECK_MINIBACKRMS)
- memcpy(check->pix, field->sigma, check->npix*sizeof(float));
- else
- memcpy(check->pix, field->back, check->npix*sizeof(float));
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
- if (bswapflag)
- swapbytes(check->pix, sizeof(float), (int)check->npix);
- QFWRITE(check->pix,check->npix*sizeof(float),check->file,
- check->filename);
-/*---- Put the buffer back to its original state */
- if (bswapflag)
- swapbytes(check->pix, sizeof(float), (int)check->npix);
- free(check->pix);
- QCALLOC(buf, char, FBSIZE);
- padsize = (FBSIZE -((check->npix*sizeof(PIXTYPE))%FBSIZE))% FBSIZE;
- if (padsize)
- QFWRITE (buf, padsize, check->file, check->filename);
- free(buf);
- break;
-
- case CHECK_MAPSOM:
- ival = -32;
- fitswrite(check->fitshead, "BITPIX ", &ival, H_INT, T_LONG);
- check->width = field->width;
- check->height = field->height;
- check->npix = field->npix;
- QMALLOC(ptrf, PIXTYPE, check->npix);
- check->pix = (void *)ptrf;
- for (i=check->npix; i--;)
- *(ptrf++) = -10.0;
- QFWRITE(check->fitshead,check->fitsheadsize,check->file,check->filename);
- free(check->fitshead);
- break;
-
- default:
- error(EXIT_FAILURE, "*Internal Error* in ", "initcheck()!");
- }
-
- return;
- }
-
-
-/******************************** writecheck *********************************/
-/*
-Write ONE line of npix pixels of a check-image.
-*/
-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)
- {
- memcpy((PIXTYPE *)check->pix + w*(check->y++), data, w*sizeof(PIXTYPE));
- return;
- }
- else if (check->type == CHECK_SUBOBJECTS)
- {
- int i;
- PIXTYPE *pixt;
-
- pixt = check->line;
- for (i=w; i--; data++)
- *(pixt++) = (*data>-BIG)? *data:0.0;
- data = check->line;
- }
-
- if (bswapflag)
- swapbytes(data, sizeof(PIXTYPE), w);
- QFWRITE(data, w*sizeof(PIXTYPE), check->file, check->filename);
- if (bswapflag)
-/*-- Put the buffer back to its original state */
- swapbytes(data, sizeof(PIXTYPE), w);
-
- return;
- }
-
-
-/********************************* reendcheck ********************************/
-/*
-Finish current check-image.
-*/
-void reendcheck(picstruct *field, checkstruct *check)
- {
- char *buf;
- size_t padsize;
-
- padsize = 0; /* To avoid gcc -Wall warnings */
- switch(check->type)
- {
- case CHECK_MINIBACKGROUND:
- case CHECK_MINIBACKRMS:
- return;
-
- case CHECK_IDENTICAL:
- case CHECK_BACKGROUND:
- case CHECK_BACKRMS:
- case CHECK_FILTERED:
- case CHECK_SUBTRACTED:
- free(check->pix);
- free(check->line);
- check->line = NULL;
- padsize = (FBSIZE -((check->npix*sizeof(PIXTYPE))%FBSIZE)) % FBSIZE;
- break;
-
- case CHECK_OBJECTS:
- case CHECK_APERTURES:
- case CHECK_SUBPSFPROTOS:
- case CHECK_PSFPROTOS:
- case CHECK_SUBPCPROTOS:
- case CHECK_PCPROTOS:
- case CHECK_PCOPROTOS:
- case CHECK_ASSOC:
- if (bswapflag)
- swapbytes(check->pix, sizeof(PIXTYPE), (int)check->npix);
- QFWRITE(check->pix,check->npix*sizeof(PIXTYPE),
- check->file,check->filename);
- free(check->pix);
- padsize = (FBSIZE-((check->npix*sizeof(PIXTYPE))%FBSIZE)) % FBSIZE;
- break;
-
- case CHECK_SEGMENTATION:
- if (bswapflag)
- swapbytes(check->pix, sizeof(ULONG), (int)check->npix);
- QFWRITE(check->pix,check->npix*sizeof(ULONG),
- check->file,check->filename);
- free(check->pix);
- padsize = (FBSIZE -((check->npix*sizeof(ULONG))%FBSIZE)) % FBSIZE;
- break;
-
- case CHECK_SUBOBJECTS:
- {
- int y;
-
- for (y=field->ymin; y<field->ymax; y++)
- writecheck(check, &PIX(field, 0, y), field->width);
- free(check->pix);
- free(check->line);
- check->line = NULL;
- padsize = (FBSIZE -((check->npix*sizeof(PIXTYPE))%FBSIZE)) % FBSIZE;
- break;
- }
-
- case CHECK_MAPSOM:
- if (bswapflag)
- swapbytes(check->pix, sizeof(PIXTYPE), (int)check->npix);
- QFWRITE(check->pix,check->npix*sizeof(PIXTYPE),
- check->file,check->filename);
- free(check->pix);
- padsize = (FBSIZE -((check->npix*sizeof(USHORT))%FBSIZE)) % FBSIZE;
- break;
-
- default:
- error(EXIT_FAILURE, "*Internal Error* in ", "endcheck()!");
- }
-
- QCALLOC(buf, char, FBSIZE);
- if (padsize)
- QFWRITE (buf, padsize, check->file, check->filename);
- free(buf);
-
- return;
- }
-
-/********************************* endcheck **********************************/
-/*
-close check-image.
-*/
-void endcheck(checkstruct *check)
- {
-
- fclose(check->file);
- free(check);
-
- return;
- }
-
diff --git a/sextractor/src/check.h b/sextractor/src/check.h
deleted file mode 100644
index 3915d62..0000000
--- a/sextractor/src/check.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- check.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP/Leiden
-*
-* Contents: handling of "check-images".
-*
-* Last modify: 15/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*--------------------------------- structures ------------------------------*/
-/* Check-image parameters */
-typedef struct structcheck
- {
- char filename[MAXCHAR]; /* ptr to check-image filename */
- FILE *file; /* ptr to check-image file structure */
- 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 */
- size_t npix; /* number of pixels in check-image */
- int y; /* current line in check-image */
- PIXTYPE overlay; /* intensity of the overlayed plots */
- PIXTYPE *line; /* buffered image line */
- checkenum type; /* CHECKIMAGE_TYPE */
- } checkstruct;
-
-/*------------------------------- functions ---------------------------------*/
-
-checkstruct *initcheck(char *, checkenum, int next);
-
-void addcheck(checkstruct *, float *, int,int, int,int, float),
- blankcheck(checkstruct *, PIXTYPE *, int,int,int,int,PIXTYPE),
- endcheck(checkstruct *),
- reendcheck(picstruct *field, checkstruct *),
- reinitcheck(picstruct *, checkstruct *),
- writecheck(checkstruct *, PIXTYPE *, int);
diff --git a/sextractor/src/clean.c b/sextractor/src/clean.c
deleted file mode 100644
index ca1a98b..0000000
--- a/sextractor/src/clean.c
+++ /dev/null
@@ -1,322 +0,0 @@
- /*
- clean.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions that remove spurious detections from the
-* catalog
-*
-* Last modify: 15/02/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "check.h"
-#include "clean.h"
-#include "flag.h"
-#include "image.h"
-
-/*------------------------------- variables ---------------------------------*/
-
-static LONG *cleanvictim;
-
-
-/******************************* initclean **********************************
-PROTO void initclean(void)
-PURPOSE Initialize things for CLEANing.
-INPUT -.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 03/07/97
- ***/
-void initclean(void)
- {
- if (prefs.clean_flag)
- QMALLOC(cleanvictim, LONG, prefs.clean_stacksize);
- QMALLOC(cleanobjlist, objliststruct, 1);
- cleanobjlist->obj = NULL;
- cleanobjlist->plist = NULL;
- cleanobjlist->nobj = cleanobjlist->npix = 0;
-
- return;
- }
-
-
-/******************************** endclean **********************************
-PROTO void endclean(void)
-PURPOSE End things related to CLEANing.
-INPUT -.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 03/07/97
- ***/
-void endclean(void)
- {
- if (prefs.clean_flag)
- free(cleanvictim);
- free(cleanobjlist);
- return;
- }
-
-
-/********************************** clean ***********************************
-PROTO int clean(int objnb, objliststruct *objlistin)
-PURPOSE Remove object from frame -buffer and put it in the "CLEANlist".
-INPUT Object number,
- Object list (source).
-OUTPUT 0 if the object was CLEANed, 1 otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP, Leiden & ESO)
-VERSION 08/02/2001
- ***/
-int clean(picstruct *field, picstruct *dfield, int objnb,
- objliststruct *objlistin)
- {
- objstruct *objin, *obj;
- int i,j,k;
- double amp,ampin,alpha,alphain, unitarea,unitareain,beta,val;
- float dx,dy,rlim;
-
- objin = objlistin->obj+objnb;
- beta = prefs.clean_param;
- unitareain = PI*objin->a*objin->b;
- ampin = objin->fdflux/(2*unitareain*objin->abcor);
- alphain = (pow(ampin/objin->dthresh, 1.0/beta)-1)*unitareain/objin->fdnpix;
- j=0;
- obj = cleanobjlist->obj;
- for (i=0; i<cleanobjlist->nobj; i++, obj++)
- {
- dx = objin->mx - obj->mx;
- dy = objin->my - obj->my;
- rlim = objin->a+obj->a;
- rlim *= rlim;
- if (dx*dx+dy*dy<rlim*CLEAN_ZONE*CLEAN_ZONE)
- {
- if (obj->fdflux < objin->fdflux)
- {
- val = 1+alphain*(objin->cxx*dx*dx+objin->cyy*dy*dy+objin->cxy*dx*dy);
- if (val>1.0
- && ((float)(val<1e10?ampin*pow(val,-beta) : 0.0) > obj->mthresh))
-/*------- the newcomer puts that object in its menu! */
- cleanvictim[j++] = i;
- }
- else
- {
- unitarea = PI*obj->a*obj->b;
- amp = obj->fdflux/(2*unitarea*obj->abcor);
- alpha = (pow(amp/obj->dthresh, 1.0/beta) - 1)*unitarea/obj->fdnpix;
- val = 1+alpha*(obj->cxx*dx*dx+obj->cyy*dy*dy+obj->cxy*dx*dy);
- if (val>1.0
- && ((float)(val<1e10?amp*pow(val,-beta) : 0.0) > objin->mthresh))
- {
-/*------- the newcomer is eaten!! */
- mergeobject(objin, obj);
- if (prefs.blank_flag)
- {
-/*---------- Paste back ``CLEANed'' object pixels before forgetting them */
- if (objin->blank)
- {
- pasteimage(field, objin->blank, objin->subw, objin->subh,
- objin->subx, objin->suby);
- free(objin->blank);
- }
- if (objin->dblank)
- {
- pasteimage(dfield, objin->dblank, objin->subw, objin->subh,
- objin->subx, objin->suby);
- free(objin->dblank);
- }
- }
-
- return 0;
- }
- }
- }
- }
-
-/* the newcomer eats the content of the menu */
- for (i=j; i--;)
- {
- k = cleanvictim[i];
- obj = cleanobjlist->obj + k;
- mergeobject(obj, objin);
- if (prefs.blank_flag)
- {
-/*---- Paste back ``CLEANed'' object pixels before forgetting them */
- if (obj->blank)
- {
- pasteimage(field, obj->blank, obj->subw, obj->subh,
- obj->subx, obj->suby);
- free(obj->blank);
- }
- if (obj->dblank)
- {
- pasteimage(dfield, obj->dblank, obj->subw, obj->subh,
- obj->subx, obj->suby);
- free(obj->dblank);
- }
- }
- subcleanobj(k);
- }
-
- return 1;
- }
-
-
-/******************************* addcleanobj ********************************/
-/*
-Add an object to the "cleanobjlist".
-*/
-void addcleanobj(objstruct *objin)
-
- {
- int margin, y;
- float hh1,hh2;
-
-/*Update the object list */
- if (cleanobjlist->nobj)
- {
- if (!(cleanobjlist->obj = (objstruct *)realloc(cleanobjlist->obj,
- (++cleanobjlist->nobj) * sizeof(objstruct))))
- error(EXIT_FAILURE, "Not enough memory for ", "CLEANing");
- }
- else
- {
- if (!(cleanobjlist->obj = (objstruct *)malloc((++cleanobjlist->nobj)
- * sizeof(objstruct))))
- error(EXIT_FAILURE, "Not enough memory for ", "CLEANing");
- }
-
-/* Compute the max. vertical extent of the object: */
-/* First from 2nd order moments, compute y-limit of the 3-sigma ellips... */
- hh1 = objin->cyy - objin->cxy*objin->cxy/(4.0*objin->cxx);
- hh1 = hh1 > 0.0 ? 1/sqrt(3*hh1) : 0.0;
-/* ... then from the isophotal limit, which should not be TOO different... */
- hh2 = (objin->ymax-objin->ymin+1.0);
- margin = (int)((hh1>hh2?hh1:hh2)*MARGIN_SCALE+1.49999);
- objin->ycmax = objin->ymax+margin;
-/* ... and finally compare with the predefined margin */
- if ((y=(int)(objin->my+0.49999)+prefs.cleanmargin)>objin->ycmax)
- objin->ycmax = y;
- objin->ycmin = objin->ymin-margin;
- if ((y=(int)(objin->my+0.49999)-prefs.cleanmargin)<objin->ycmin)
- objin->ycmin = y;
-
- cleanobjlist->obj[cleanobjlist->nobj-1] = *objin;
-
- return;
- }
-
-
-/******************************** mergeobject *******************************/
-/*
-Merge twos objects from "objlist".
-*/
-void mergeobject(objstruct *objslave,objstruct *objmaster)
-
- {
- checkstruct *check;
-
- if ((check = prefs.check[CHECK_SEGMENTATION]))
- {
- ULONG *pix;
- ULONG colorslave = objslave->number,
- colormaster = objmaster->number;
- int dx,dx0,dy,dpix;
-
- pix = (ULONG *)check->pix+check->width*objslave->ymin + objslave->xmin;
- dx0 = objslave->xmax-objslave->xmin+1;
- dpix = check->width-dx0;
- for (dy=objslave->ymax-objslave->ymin+1; dy--; pix += dpix)
- for (dx=dx0; dx--; pix++)
- if (*pix==colorslave)
- *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;
- objmaster->dflux += objslave->dflux;
- objmaster->flux += objslave->flux;
- objmaster->fluxerr += objslave->fluxerr;
-
- if (objslave->fdpeak>objmaster->fdpeak)
- {
- objmaster->fdpeak = objslave->fdpeak;
- objmaster->peakx = objslave->peakx;
- objmaster->peaky = objslave->peaky;
- }
- if (objslave->dpeak>objmaster->dpeak)
- objmaster->dpeak = objslave->dpeak;
- if (objslave->peak>objmaster->peak)
- objmaster->peak = objslave->peak;
-
- if (objslave->xmin<objmaster->xmin)
- objmaster->xmin = objslave->xmin;
- if (objslave->xmax>objmaster->xmax)
- objmaster->xmax = objslave->xmax;
-
- if (objslave->ymin<objmaster->ymin)
- objmaster->ymin = objslave->ymin;
- if (objslave->ymax>objmaster->ymax)
- objmaster->ymax = objslave->ymax;
-
- objmaster->flag |= (objslave->flag & (~(OBJ_MERGED|OBJ_CROWDED)));
- mergeflags(objmaster, objslave);
-
- return;
- }
-
-
-/******************************* subcleanobj ********************************/
-/*
-remove an object from a "cleanobjlist".
-*/
-void subcleanobj(int objnb)
-
- {
-/* Update the object list */
- if (objnb>=cleanobjlist->nobj)
- error(EXIT_FAILURE, "*Internal Error*: no CLEAN object to remove ",
- "in subcleanobj()");
-
- if (--cleanobjlist->nobj)
- {
- if (cleanobjlist->nobj != objnb)
- cleanobjlist->obj[objnb] = cleanobjlist->obj[cleanobjlist->nobj];
- if (!(cleanobjlist->obj = (objstruct *)realloc(cleanobjlist->obj,
- cleanobjlist->nobj * sizeof(objstruct))))
- error(EXIT_FAILURE, "Not enough memory for ", "CLEANing");
- }
- else
- free(cleanobjlist->obj);
-
- return;
- }
-
diff --git a/sextractor/src/clean.h b/sextractor/src/clean.h
deleted file mode 100644
index 2a234c6..0000000
--- a/sextractor/src/clean.h
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
- clean.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden observatory & ESO
-*
-* Contents: functions that remove spurious detections from the
-* catalog
-*
-* Last modify: 06/04/99
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*------------------------------ definitions --------------------------------*/
-
-#define CLEAN_ZONE 10.0 /* zone (in sigma) to */
- /* consider for processing */
-
-/*------------------------------- variables ---------------------------------*/
-
-objliststruct *cleanobjlist; /* laconic, isn't it? */
-
-/*------------------------------- functions ---------------------------------*/
-
-extern void addcleanobj(objstruct *),
- endclean(void),
- initclean(void),
- subcleanobj(int);
-
-extern int clean(picstruct *field, picstruct *dfield,
- int, objliststruct *);
-
diff --git a/sextractor/src/define.h b/sextractor/src/define.h
deleted file mode 100644
index 02bc8df..0000000
--- a/sextractor/src/define.h
+++ /dev/null
@@ -1,196 +0,0 @@
- /*
- define.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: global definitions.
-*
-* Last modify: 12/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/* Check if we are using a configure script here */
-#ifndef HAVE_CONFIG_H
-#define VERSION "2.x"
-#define DATE "2006-01-12"
-#define THREADS_NMAX 16 /* max. number of threads */
-#endif
-
-/*------------------------ what, who, when and where ------------------------*/
-
-#define BANNER "SExtractor"
-#define EXECUTABLE "sex"
-#define MYVERSION VERSION
-#define COPYRIGHT "Emmanuel BERTIN (bertin at iap.fr)"
-#define WEBSITE "http://terapix.iap.fr/soft/sextractor"
-#define MAILINGLIST "sextractor at iap.fr"
-#define MAILINGLISTREQ "sextractor-request at iap.fr"
-#define INSTITUTE "TERAPIX team at IAP http://terapix.iap.fr"
-
-/*--------------------------- Internal constants ----------------------------*/
-
-#define BIG 1e+30 /* a huge number */
-#define LESSBIG 1e+25 /* a somewhat smaller number */
-#define DATA_BUFSIZE 262144 /* data buffer size */
-#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 */
-#define MAXNAPER 32 /* max. number of apertures */
-#define MAXNASSOC 32 /* max. number of assoc. */
-#define MAXPICSIZE 1048576 /* max. image size */
-#define NISO 8 /* number of isophotes */
-#define OUTPUT stdout /* where all msgs are sent */
-#define PSF_NPSFMAX 9 /* Max number of fitted PSFs */
-
-#ifndef PI
-#define PI 3.1415926535898 /* never met before? */
-#endif
-
-/* NOTES:
- *
- *One must have: BIG < the biggest element a float can store
- * DATA_BUFSIZE >= 2880 with DATA_BUFSIZE%8 = 0
- * MAXCHAR >= 16
- * 1 <= MAXCHECK <= MAXLIST (see prefs.h)
- * 1 <= MAXDEBAREA (see prefs.c & extract.c)
- * 1 <= MAXFLAG <= MAXLIST (see prefs.h)
- * 1 <= MAXIMAGE <= MAXLIST (see prefs.h)
- * 1 <= MAXNAPER <= MAXLIST (see prefs.h)
- * 1 <= MAXNASSOC <= MAXLIST (see prefs.h)
- * MAXPICSIZE > size of any image!!
- * NISO = 8 (otherwise need to change prefs.h)
- * 1 <= PSF_NPSFMAX
-*/
-
-/*---- Set defines according to machine's specificities and customizing -----*/
-
-#if _LARGEFILE_SOURCE
-#define FSEEKO fseeko
-#define FTELLO ftello
-#else
-#define FSEEKO fseek
-#define FTELLO ftell
-#endif
-/*--------------------- in case of missing constants ------------------------*/
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE -1
-#endif
-
-/*---------------------------- return messages ------------------------------*/
-
-#define RETURN_OK 0
-#define RETURN_ERROR (-1)
-#define RETURN_FATAL_ERROR (-2)
-
-/*------------------- a few definitions to read FITS parameters ------------*/
-
-#define FBSIZE 2880L /* size (in bytes) of one FITS block */
-
-#define FITSTOF(k, def) \
- (st[0]=0,((point = fitsnfind(buf, k, n))? \
- fixexponent(point), \
- atof(strncat(st, &point[10], 70)) \
- :(def)))
-
-#define FITSTOI(k, def) \
- (st[0]=0,(point = fitsnfind(buf, k, n))? \
- atoi(strncat(st, &point[10], 70)) \
- :(def))
-
-#define FITSTOS(k, str, def) \
- { if (fitsread(buf,k,str,H_STRING,T_STRING)!= RETURN_OK) \
- strcpy(str, (def)); \
- }
-
-/*------------------------------- Other Macros -----------------------------*/
-
-#define DEXP(x) exp(2.30258509299*(x)) /* 10^x */
-
-#define QFREAD(ptr, size, afile, fname) \
- if (fread(ptr, (size_t)(size), (size_t)1, afile)!=1) \
- error(EXIT_FAILURE, "*Error* while reading ", fname)
-
-#define QFWRITE(ptr, size, afile, fname) \
- if (fwrite(ptr, (size_t)(size), (size_t)1, afile)!=1) \
- error(EXIT_FAILURE, "*Error* while writing ", fname)
-
-#define QFSEEK(afile, offset, pos, fname) \
- if (FSEEKO(afile, (offset), pos)) \
- error(EXIT_FAILURE,"*Error*: file positioning failed in ", \
- fname)
-
-#define QFTELL(afile, pos, fname) \
- if ((pos=FTELLO(afile))==-1) \
- error(EXIT_FAILURE,"*Error*: file position unknown in ", \
- fname)
-
-#define QCALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define QMALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define QFREE(ptr) \
- {free(ptr); \
- ptr = NULL;}
-
-#define QREALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)realloc(ptr, (size_t)(nel)*sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define QMEMCPY(ptrin, ptrout, typ, nel) \
- {if (ptrin) \
- {if (!(ptrout = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptrout " (" #nel " elements) !"); \
- memcpy(ptrout, ptrin, (size_t)(nel)*sizeof(typ));};}
-
-#define RINT(x) (int)(floor(x+0.5))
-
-#define PIX(pic, x, y) pic->strip[(((int)y)%pic->stripheight) \
- *pic->width +(int)x]
-
-#define NPRINTF if (prefs.verbose_type == NORM \
- || prefs.verbose_type==WARN) fprintf
-
-#define NFPRINTF(w,x) {if (prefs.verbose_type==NORM \
- || prefs.verbose_type==WARN) \
- fprintf(w, "\33[1M> %s\n\33[1A",x); \
- else if (prefs.verbose_type == FULL) \
- fprintf(w, "%s.\n", x);}
-
-#define QPRINTF if (prefs.verbose_type != QUIET) fprintf
-
-#define FPRINTF if (prefs.verbose_type == FULL) fprintf
-
-#define QWARNING if (prefs.verbose_type==WARN \
- || prefs.verbose_type==FULL) warning
-
-#define FLAG(x) (*((char *)&flag##x))
-
-#define VECFLAG(x) (*((char *)flag##x))
diff --git a/sextractor/src/extract.c b/sextractor/src/extract.c
deleted file mode 100644
index c3e2f4a..0000000
--- a/sextractor/src/extract.c
+++ /dev/null
@@ -1,354 +0,0 @@
- /*
- extract.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions for extraction of connected pixels from
-* a bitmap.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "extract.h"
-#include "plist.h"
-
-/*------------------------- Static buffers for lutz() -----------------------*/
-
-static infostruct *info, *store;
-static char *marker;
-static status *psstack;
-static int *start, *end, *discan, xmin,ymin,xmax,ymax;
-
-
-/******************************* lutzalloc ***********************************/
-/*
-Allocate once for all memory space for buffers used by lutz().
-*/
-void lutzalloc(int width, int height)
- {
- int *discant,
- stacksize, i;
-
- stacksize = width+1;
- xmin = ymin = 0;
- xmax = width-1;
- ymax = height-1;
- QMALLOC(info, infostruct, stacksize);
- QMALLOC(store, infostruct, stacksize);
- QMALLOC(marker, char, stacksize);
- QMALLOC(psstack, status, stacksize);
- QMALLOC(start, int, stacksize);
- QMALLOC(end, int, stacksize);
- QMALLOC(discan, int, stacksize);
- discant = discan;
- for (i=stacksize; i--;)
- *(discant++) = -1;
-
- return;
- }
-
-
-/******************************* lutzfree ************************************/
-/*
-Free once for all memory space for buffers used by lutz().
-*/
-void lutzfree()
- {
- free(discan);
- free(info);
- free(store);
- free(marker);
- free(psstack);
- free(start);
- free(end);
-
- return;
- }
-
-
-/********************************** lutz *************************************/
-/*
-C implementation of R.K LUTZ' algorithm for the extraction of 8-connected pi-
-xels in an image
-*/
-int lutz(objliststruct *objlistroot, int nroot, objstruct *objparent,
- objliststruct *objlist)
-
- {
- static infostruct curpixinfo,initinfo;
- objstruct *obj, *objroot;
- pliststruct *plist,*pixel, *plistin, *plistint;
-
- char newmarker;
- int cn, co, luflag, objnb, pstop, xl,xl2,yl,
- out, minarea, stx,sty,enx,eny, step,
- nobjm = NOBJ,
- inewsymbol, *iscan;
- short trunflag;
- PIXTYPE thresh;
- status cs, ps;
-
- out = RETURN_OK;
-
- minarea = prefs.deb_maxarea;
- plistint = plistin = objlistroot->plist;
- objroot = &objlistroot->obj[nroot];
- stx = objparent->xmin;
- sty = objparent->ymin;
- enx = objparent->xmax;
- eny = objparent->ymax;
- thresh = objlist->dthresh;
- initinfo.pixnb = 0;
- initinfo.flag = 0;
- initinfo.firstpix = initinfo.lastpix = -1;
- cn = 0;
- iscan = objroot->submap + (sty-objroot->suby)*objroot->subw
- + (stx-objroot->subx);
-/* As we only analyse a fraction of the map, a step occurs between lines */
- step = objroot->subw - (++enx-stx);
- eny++;
-
-/*------Allocate memory to store object data */
-
- free(objlist->obj);
- if (!(obj=objlist->obj=(objstruct *)malloc(nobjm*sizeof(objstruct))))
- {
- out = RETURN_FATAL_ERROR;
- plist = NULL; /* To avoid gcc -Wall warnings */
- goto exit_lutz;
- }
-
-/*------Allocate memory for the pixel list */
-
- free(objlist->plist);
- if (!(objlist->plist
- = (pliststruct *)malloc((eny-sty)*(enx-stx)*plistsize)))
- {
- out = RETURN_FATAL_ERROR;
- plist = NULL; /* To avoid gcc -Wall warnings */
- goto exit_lutz;
- }
-
- pixel = plist = objlist->plist;
-
-/*----------------------------------------*/
-
- for (xl=stx; xl<=enx; xl++)
- marker[xl] = 0 ;
-
- objnb = objlist->nobj = 0;
- co = pstop = 0;
- curpixinfo.pixnb = 1;
-
- for (yl=sty; yl<=eny; yl++, iscan += step)
- {
- ps = COMPLETE;
- cs = NONOBJECT;
- trunflag = (yl==0 || yl==ymax) ? OBJ_TRUNC : 0;
- if (yl==eny)
- iscan = discan;
-
- for (xl=stx; xl<=enx; xl++)
- {
- newmarker = marker[xl];
- marker[xl] = 0;
- if ((inewsymbol = (xl!=enx)?*(iscan++):-1) < 0)
- luflag = 0;
- else
- {
- curpixinfo.flag = trunflag;
- plistint = plistin+inewsymbol;
- luflag = (PLISTPIX(plistint, cdvalue) > thresh?1:0);
- }
- if (luflag)
- {
- if (xl==0 || xl==xmax)
- curpixinfo.flag |= OBJ_TRUNC;
- memcpy(pixel, plistint, (size_t)plistsize);
- PLIST(pixel, nextpix) = -1;
- curpixinfo.lastpix = curpixinfo.firstpix = cn;
- cn += plistsize;
- pixel += plistsize;
- if (cs != OBJECT)
-/*------------------------------- Start Segment -----------------------------*/
- {
- cs = OBJECT;
- if (ps == OBJECT)
- {
- if (start[co] == UNKNOWN)
- {
- marker[xl] = 'S';
- start[co] = xl;
- }
- else marker[xl] = 's';
- }
- else
- {
- psstack[pstop++] = ps;
- marker[xl] = 'S';
- start[++co] = xl;
- ps = COMPLETE;
- info[co] = initinfo;
- }
- }
- }
-/*---------------------------------------------------------------------------*/
- if (newmarker)
-/*---------------------------- Process New Marker ---------------------------*/
-
- {
- if (newmarker == 'S')
- {
- psstack[pstop++] = ps;
- if (cs == NONOBJECT)
- {
- psstack[pstop++] = COMPLETE;
- info[++co] = store[xl];
- start[co] = UNKNOWN;
- }
- else
- update (&info[co],&store[xl], plist);
- ps = OBJECT;
- }
- else if (newmarker == 's')
- {
- if ((cs == OBJECT) && (ps == COMPLETE))
- {
- pstop--;
- xl2 = start[co];
- update (&info[co-1],&info[co], plist);
- if (start[--co] == UNKNOWN)
- start[co] = xl2;
- else
- marker[xl2] = 's';
- }
- ps = OBJECT;
- }
- else if (newmarker == 'f')
- ps = INCOMPLETE;
- else if (newmarker == 'F')
- {
- ps = psstack[--pstop];
- if ((cs == NONOBJECT) && (ps == COMPLETE))
- {
- if (start[co] == UNKNOWN)
- {
- if ((int)info[co].pixnb >= minarea)
- {
- if (objlist->nobj>=nobjm)
- if (!(obj = objlist->obj = (objstruct *)
- realloc(obj, (nobjm+=nobjm/2)* sizeof(objstruct))))
- {
- out = RETURN_FATAL_ERROR;
- goto exit_lutz;
- }
- lutzsort(&info[co], objlist);
- }
- }
- else
- {
- marker[end[co]] = 'F';
- store[start[co]] = info[co];
- }
- co--;
- ps = psstack[--pstop];
- }
- }
- }
-
-/*---------------------------------------------------------------------------*/
-
- if (luflag)
- update (&info[co],&curpixinfo, plist);
- else
- {
- if (cs == OBJECT)
-/*-------------------------------- End Segment ------------------------------*/
- {
- cs = NONOBJECT;
- if (ps != COMPLETE)
- {
- marker[xl] = 'f';
- end[co] = xl;
- }
- else
- {
- ps = psstack[--pstop];
- marker[xl] = 'F';
- store[start[co]] = info[co];
- co--;
- }
- }
- }
-/*---------------------------------------------------------------------------*/
- }
- }
-
-exit_lutz:
-
- if (objlist->nobj && out == RETURN_OK)
- {
- if (!(objlist->obj=(objstruct *)realloc(obj,
- objlist->nobj*sizeof(objstruct))))
- error(EXIT_FAILURE,"problem with mem. realloc. in lutz()","");
- }
- else
- {
- free(obj);
- objlist->obj = NULL;
- }
-
- if (cn && out == RETURN_OK)
- {
- if (!(objlist->plist=(pliststruct *)realloc(plist,cn)))
- error(EXIT_FAILURE,"problem with mem. realloc. in lutz()","");
- }
- else
- {
- free(objlist->plist);
- objlist->plist = NULL;
- }
-
- return out;
- }
-
-
-/********************************* lutzsort ***********************************/
-/*
-Build the object structure.
-*/
-void lutzsort(infostruct *info, objliststruct *objlist)
-
- {
- objstruct *obj = objlist->obj+objlist->nobj;
-
- memset(obj, 0, (size_t)sizeof(objstruct));
- obj->firstpix = info->firstpix;
- obj->lastpix = info->lastpix;
- obj->flag = info->flag;
- objlist->npix += info->pixnb;
-
- preanalyse(objlist->nobj, objlist, ANALYSE_FAST);
-
- objlist->nobj++;
-
- return;
- }
-
diff --git a/sextractor/src/extract.h b/sextractor/src/extract.h
deleted file mode 100644
index a167e60..0000000
--- a/sextractor/src/extract.h
+++ /dev/null
@@ -1,50 +0,0 @@
- /*
- extract.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP, Leiden observatory & ESO)
-*
-* Contents: functions for extraction of connected pixels from
-* a bitmap.
-*
-* Last modify: 29/11/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*------------------------------ definitions --------------------------------*/
-
-#define NOBJ 256 /* starting number of obj. */
-#define UNKNOWN -1 /* flag for LUTZ */
-
-/*--------------------------------- typedefs --------------------------------*/
-
-typedef enum {COMPLETE, INCOMPLETE, NONOBJECT, OBJECT}
- status; /* Extraction status */
-
-/*--------------------------------- variables -------------------------------*/
-PIXTYPE *dumscan;
-
-/*------------------------------- structures --------------------------------*/
-/* Temporary object parameters during extraction */
-typedef struct structinfo
- {
- LONG pixnb; /* Number of pixels included */
- LONG firstpix; /* Pointer to first pixel of pixlist */
- LONG lastpix; /* Pointer to last pixel of pixlist */
- short flag; /* Extraction flag */
- } infostruct;
-
-
-/*------------------------------- functions ---------------------------------*/
-void lutzalloc(int, int),
- lutzfree(void),
- lutzsort(infostruct *, objliststruct *),
- sortit(picstruct *, picstruct *, picstruct *, picstruct *,
- infostruct *, objliststruct *, PIXTYPE *, PIXTYPE *),
- update(infostruct *, infostruct *, pliststruct *);
-
-int lutz(objliststruct *, int, objstruct *, objliststruct *);
diff --git a/sextractor/src/field.c b/sextractor/src/field.c
deleted file mode 100644
index be5f34b..0000000
--- a/sextractor/src/field.c
+++ /dev/null
@@ -1,213 +0,0 @@
- /*
- field.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Handling of field structures.
-*
-* Last modify: 29/06/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "assoc.h"
-#include "astrom.h"
-#include "back.h"
-#include "field.h"
-#include "filter.h"
-#include "interpolate.h"
-
-/********************************* newfield **********************************/
-/*
-Returns a pointer to a new field, ready to go!
-*/
-picstruct *newfield(char *filename, int flags, int nok)
-
- {
- picstruct *field;
- catstruct *cat;
- tabstruct *tab;
- OFF_T mefpos = 0; /* To avoid gcc -Wall warnings */
- int nok2, ntab, margin;
-
-/* Move to nok'th valid FITS image extension */
- if (!(cat = read_cat(filename)))
- error(EXIT_FAILURE, "*Error*: cannot open ", filename);
- close_cat(cat);
- tab = cat->tab;
- nok++; /* At least one pass through the loop */
- nok2 = nok;
- for (ntab=cat->ntab; nok && ntab--; tab=tab->nexttab)
- {
- if ((tab->naxis < 2)
- || !strncmp(tab->xtension, "BINTABLE", 8)
- || !strncmp(tab->xtension, "ASCTABLE", 8))
- continue;
- mefpos = tab->headpos;
- nok--;
- }
- if (ntab<0)
- error(EXIT_FAILURE, "Not enough valid FITS image extensions in ",filename);
-
-/* First allocate memory for the new field (and nullify pointers) */
- QCALLOC(field, picstruct, 1);
- field->mefpos = mefpos;
- field->flags = flags;
- strcpy (field->filename, filename);
-/* A short, "relative" version of the filename */
- if (!(field->rfilename = strrchr(field->filename, '/')))
- field->rfilename = field->filename;
- else
- field->rfilename++;
-
- sprintf(gstr, "Looking for %s", field->rfilename);
- NFPRINTF(OUTPUT, gstr);
-/* Check the image exists and read important info (image size, etc...) */
- readimagehead(field);
- if (cat->ntab>1)
- sprintf(gstr, "[%d/%d]", nok2, cat->ntab-1);
- QPRINTF(OUTPUT, "%s \"%.20s\" %s / %d x %d / %d bits %s data\n",
- flags&FLAG_FIELD? "Flagging from:" :
- (flags&(RMS_FIELD|VAR_FIELD|WEIGHT_FIELD)?
- "Weighting from:" :
- (flags&MEASURE_FIELD? "Measuring from:" :
- "Detecting from:")),
- field->ident,
- cat->ntab>1? gstr : "",
- field->width, field->height, field->bytepix*8,
- field->bitpix>0?
- (field->compress_type!=ICOMPRESS_NONE?"COMPRESSED":"INTEGER")
- :"FLOATING POINT");
-
-/* Provide a buffer for compressed data */
- if (field->compress_type != ICOMPRESS_NONE)
- QMALLOC(field->compress_buf, char, FBSIZE);
-
-/* Check the astrometric system and do the setup of the astrometric stuff */
- if (prefs.world_flag && (flags & (MEASURE_FIELD|DETECT_FIELD)))
- initastrom(field);
- else
- field->pixscale=prefs.pixel_scale;
-
-/* Background */
- if (flags & (DETECT_FIELD|MEASURE_FIELD|WEIGHT_FIELD|VAR_FIELD|RMS_FIELD))
- {
- field->ngamma = prefs.mag_gamma/log(10.0);
-
- field->backw = prefs.backsize[0]<field->width ? prefs.backsize[0]
- : field->width;
- field->backh = prefs.backsize[1]<field->height ? prefs.backsize[1]
- : field->height;
- field->nbackp = field->backw * field->backh;
- if ((field->nbackx = (field->width-1)/field->backw + 1) < 1)
- field->nbackx = 1;
- if ((field->nbacky = (field->height-1)/field->backh + 1) < 1)
- field->nbacky = 1;
- field->nback = field->nbackx * field->nbacky;
- field->nbackfx = field->nbackx>1 ? prefs.backfsize[0] : 1;
- field->nbackfy = field->nbacky>1 ? prefs.backfsize[1] : 1;
-/*-- Set the back_type flag if absolute background is selected */
- if (((flags & DETECT_FIELD) && prefs.back_type[0]==BACK_ABSOLUTE)
- || ((flags & MEASURE_FIELD) && prefs.back_type[1]==BACK_ABSOLUTE))
- field->back_type = BACK_ABSOLUTE;
- }
-
-/* Add a comfortable margin for local background estimates */
- margin = (prefs.pback_type == LOCAL)? prefs.pback_size + prefs.mem_bufsize/4
- : 0;
-
- field->stripheight = prefs.mem_bufsize + margin;
- if (field->stripheight>field->height)
- field->stripheight = field->height;
-/* Compute the image buffer size */
-/* Basically, only one margin line is sufficient... */
- field->stripmargin = 1 + margin;
-/* ...but : */
- if (prefs.filter_flag)
- {
-/*-- If filtering is on, one should consider the height of the conv. mask */
- int margin;
-
- if (field->stripheight < thefilter->convh)
- field->stripheight = thefilter->convh;
- if (field->stripmargin < (margin = (thefilter->convh-1)/2))
- field->stripmargin = margin;
- }
-
- free_cat(&cat, 1);
-
- return field;
- }
-
-
-/******************************* inheritfield *******************************/
-/*
-Make a copy of a field structure, e.g. for interpolation purposes.
-*/
-picstruct *inheritfield(picstruct *infield, int flags)
-
- {
- picstruct *field;
-
-/* First allocate memory for the new field (and nullify pointers) */
- QCALLOC(field, picstruct, 1);
-
-/* Copy what is important and reset the remaining */
- *field = *infield;
- field->flags = flags;
- copyastrom(infield, field);
- QMEMCPY(infield->fitshead, field->fitshead, char, infield->fitsheadsize);
- field->interp_flag = 0;
- field->assoc = NULL;
- field->strip = NULL;
- field->fstrip = NULL;
- field->reffield = infield;
- field->compress_buf = NULL;
- field->compress_type = ICOMPRESS_NONE;
- field->file = NULL;
-
- return field;
- }
-
-
-/********************************* endfield **********************************/
-/*
-Free and close everything related to a field structure.
-*/
-void endfield(picstruct *field)
-
- {
- if (field->file)
- fclose(field->file);
-
- free(field->fitshead);
- free(field->strip);
- free(field->fstrip);
- free(field->compress_buf);
- if (field->astrom)
- endastrom(field);
- if (field->interp_flag)
- end_interpolate(field);
- endback(field);
- free(field);
-
- return;
- }
-
diff --git a/sextractor/src/field.h b/sextractor/src/field.h
deleted file mode 100644
index c396514..0000000
--- a/sextractor/src/field.h
+++ /dev/null
@@ -1,27 +0,0 @@
- /*
- field.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP, Leiden observatory & ESO)
-*
-* Contents: Handling of field structures.
-*
-* Last modify: 22/03/98
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*------------------------------ field flags -------------------------------*/
-#define DETECT_FIELD 0x01 /* Detection */
-#define MEASURE_FIELD 0x02 /* Measurement */
-#define FLAG_FIELD 0x04 /* Flagging */
-#define RMS_FIELD 0x08 /* Weighting with std deviations */
-#define VAR_FIELD 0x10 /* Weighting with variances */
-#define WEIGHT_FIELD 0x20 /* Weighting with weights */
-#define BACKRMS_FIELD 0x40 /* Weighting from a backrms matrix */
-#define INTERP_FIELD 0x80 /* Purely interpolated data */
-
-
diff --git a/sextractor/src/filter.c b/sextractor/src/filter.c
deleted file mode 100644
index 6ed4152..0000000
--- a/sextractor/src/filter.c
+++ /dev/null
@@ -1,399 +0,0 @@
- /*
- filter.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions dealing with on-line filtering of the image
-* (for detection).
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "bpro.h"
-#include "filter.h"
-#include "image.h"
-
-/******************************** convolve ***********************************/
-/*
-Convolve a scan line with an array.
-*/
-void convolve(picstruct *field, PIXTYPE *mscan)
-
- {
- int mw,mw2,m0,me,m,mx,dmx, y0,dy, sw,sh;
- float *mask;
- PIXTYPE *mscane, *s,*s0, *d,*de, mval;
-
- sw = field->width;
- sh = field->stripheight;
- mw = thefilter->convw;
- mw2 = mw/2;
- mscane = mscan+sw;
- y0 = field->y - (thefilter->convh/2);
- if ((dy = field->ymin-y0) > 0)
- {
- m0 = mw*dy;
- y0 = field->ymin;
- }
- else
- m0 = 0;
-
- if ((dy = field->ymax - y0) < thefilter->convh)
- me = mw*dy;
- else
- me = mw*thefilter->convh;
-
- memset(mscan, 0, sw*sizeof(PIXTYPE));
- s0 = NULL; /* To avoid gcc -Wall warnings */
- mask = thefilter->conv+m0;
- for (m = m0, mx = 0; m<me; m++, mx++)
- {
- if (mx==mw)
- mx = 0;
- if (!mx)
- s0 = field->strip+sw*((y0++)%sh);
-
- if ((dmx = mx-mw2)>=0)
- {
- s = s0 + dmx;
- d = mscan;
- de = mscane - dmx;
- }
- else
- {
- s = s0;
- d = mscan - dmx;
- de = mscane;
- }
-
- mval = *(mask++);
- while (d<de)
- *(d++) += mval**(s++);
- }
-
- return;
- }
-
-
-/********************************* getconv **********************************/
-/*
-Read the convolution mask from a file.
-*/
-int getconv(char *filename)
-
- {
- FILE *file;
- char str[MAXCHAR], *sstr, *null = NULL;
- double sum, var, pix;
- int i,j, n, normflag;
-
-
-/* Open the file which may contain a convolution mask */
-
- if (!(file = fopen(filename, "r")))
- error(EXIT_FAILURE, "*Error*: cannot open ", filename);
-
-/* Check it is a convolution mask. Otherwise, exit */
- fgets(str,MAXCHAR,file);
- if (strncmp(str,"CONV",4))
- {
- fclose(file);
- return RETURN_ERROR;
- }
-
- if (strstr(str,"NORM"))
- normflag = strstr(str,"NONORM")?0:1;
- else
- {
- warning("No normalization info found in convolution file (old format?)\n",
- "> => I will assume you want the mask to be normalized...");
- normflag = 1;
- }
-/* Allocate memory for storing mask elements */
- QMALLOC(thefilter->conv, float, MAXMASK);
-
- for (i=0, n=0; fgets(str,MAXCHAR,file);)
- {
- j=0;
- sstr = strtok(str, " \t\n");
- if (sstr && sstr[0]!=(char)'#')
- do
- {
- j++;
- thefilter->conv[i++] = (float)atof(sstr);
- if (i>MAXMASK)
- error(EXIT_FAILURE, "*Error*: Convolution mask too large in ",
- filename);
- } while ((sstr = strtok(null, " \t\n")));
- if (j>n)
- n = j;
- }
-
- fclose(file);
-
- if ((thefilter->convw = n)<1)
- error(EXIT_FAILURE, "*Error*: unappropriate convolution mask width in ",
- filename);
- if (i%n)
- error(EXIT_FAILURE, "*Error*: unappropriate convolution mask line in ",
- filename);
-
- QREALLOC(thefilter->conv, float, i);
-
- thefilter->convh = i/n;
- var = 0.0;
- for (j=0, sum=0.0; j<i; j++)
- {
- sum += fabs(pix = thefilter->conv[j]);
- var += pix*pix;
- }
-
- thefilter->varnorm = (float)(var=sqrt(var));
-
- if (normflag)
- {
- if (sum == 0.0)
- {
- warning("Zero-sum filter: ", "Normalization switched to variance-mode");
- sum = var;
- }
- for (j=0; j<i; j++)
- thefilter->conv[j] /= sum;
- }
-
- thefilter->nconv = thefilter->convw*thefilter->convh;
-
- return RETURN_OK;
- }
-
-
-/********************************* getfilter *********************************/
-/*
-Read either a convolution mask or an ANN file.
-*/
-void getfilter(char *filename)
-
- {
- QCALLOC(thefilter, filterstruct, 1);
- if (getconv(filename) != RETURN_OK && getneurfilter(filename) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: not a suitable filter in ", filename);
-
- return;
- }
-
-
-/******************************** getneurfilter ******************************/
-/*
-Read an ANN RETINA-filter file.
-*/
-int getneurfilter(char *filename)
-
- {
-#define FILTEST(x) \
- if (x != RETURN_OK) \
- error(EXIT_FAILURE, "*Error*: incorrect filter header in ", filename)
-
- catstruct *fcat;
- tabstruct *ftab;
- int ival;
-
-/* We first map the catalog */
- if (!(fcat = read_cat(filename)))
- return RETURN_ERROR;
-/* Test if the requested table is present */
- if (!(ftab = name_to_tab(fcat, "BP-ANN", 0)))
- error(EXIT_FAILURE, "*Error*: no BP-ANN info found in ", filename);
- FILTEST(fitsread(ftab->headbuf, "BPTYPE ", gstr,H_STRING,T_STRING));
- if (strcmp(gstr, "RETINA"))
- error(EXIT_FAILURE, "*Error*: not a retina-filter in ", filename);
- FILTEST(fitsread(ftab->headbuf, "RENAXIS ", &ival ,H_INT, T_LONG));
- if (ival != 2)
- error(EXIT_FAILURE, "*Error*: not a 2D retina in ", filename);
- FILTEST(fitsread(ftab->headbuf, "RENAXIS1", &thefilter->convw ,H_INT,T_LONG));
- FILTEST(fitsread(ftab->headbuf, "RENAXIS2", &thefilter->convh ,H_INT,T_LONG));
- thefilter->nconv = thefilter->convw*thefilter->convh;
- QMALLOC(thefilter->conv, float, thefilter->nconv);
- thefilter->bpann = loadtab_bpann(ftab, filename);
-
- close_cat(fcat);
- free_cat(&fcat,1);
-
- return RETURN_OK;
- }
-
-
-/********************************* endfilter *********************************/
-/*
-Terminate filtering procedures.
-*/
-void endfilter()
-
- {
- QFREE(thefilter->conv);
- if (thefilter->bpann)
- {
- free_bpann(thefilter->bpann);
- thefilter->bpann = NULL;
- }
-
- QFREE(thefilter);
-
- return;
- }
-
-
-/********************************** filter ***********************************/
-/*
-Switch to the appropriate filtering routine.
-*/
-void filter(picstruct *field, PIXTYPE *mscan)
-
- {
- if (thefilter->bpann)
- neurfilter(field, mscan);
- else
- convolve(field, mscan);
-
- return;
- }
-
-
-/******************************** neurfilter *********************************/
-/*
-Filter a scan line using an artificial retina.
-*/
-void neurfilter(picstruct *field, PIXTYPE *mscan)
-
- {
- PIXTYPE cval;
- float *pix, resp, sig, threshlow, threshhigh;
- int i,x, tflag;
-
- sig = field->backsig;
- if ((tflag = (prefs.nfilter_thresh>0)))
- {
- threshlow = prefs.filter_thresh[0]*field->backsig;
- threshhigh = (prefs.nfilter_thresh<2)?
- BIG : prefs.filter_thresh[1]*field->backsig;
- }
- else
- threshlow = threshhigh = 0.0; /* To avoid gcc -Wall warnings */
-
- for (x=0;x<field->width;x++)
- {
- if (tflag)
- {
- cval = PIX(field, x, field->y);
- if (cval<threshlow || cval>threshhigh)
- {
- *(mscan++) = cval;
- continue;
- }
- }
-/*-- Copy the surrounding image area to the retina */
- copyimage(field, thefilter->conv, thefilter->convw, thefilter->convh,
- x, field->y);
- pix = thefilter->conv;
-/*-- Apply a transform of the intensity scale */
- for (i=thefilter->nconv; i--; pix++)
- *pix = *pix>0.0?log(1+*pix/sig):-log(1-*pix/sig);
- play_bpann(thefilter->bpann, thefilter->conv, &resp);
- if (resp>70.0)
- resp = 70.0;
- else if (resp<-70.0)
- resp = -70.0;
-/*-- Recover the linear intensity scale */
- *(mscan++) = resp>0.0?sig*(exp(resp)-1):sig*(exp(-resp)-1);
- }
-
- return;
- }
-
-
-/******************************* convolve_image ******************************/
-/*
-Convolve a vignet with an array.
-*/
-void convolve_image(picstruct *field, double *vig1,
- double *vig2, int width, int height)
-
- {
- int mw,mw2,m0,me,m,mx,dmx, y, y0,dy;
- float *mask;
- double *mscane, *s,*s0, *vig3, *d,*de, mval, val;
-
-/* If no filtering, just return a copy of the input data */
- if (!thefilter || thefilter->bpann)
- {
- memcpy(vig2, vig1, width*height*sizeof(double));
- return;
- }
- s0 = NULL; /* To avoid gcc -Wall warnings */
- mw = thefilter->convw;
- mw2 = mw/2;
- memset(vig2, 0, width*height*sizeof(double));
- vig3 = vig2;
- for (y=0; y<height; y++, vig3+=width)
- {
- mscane = vig3+width;
- y0 = y - (thefilter->convh/2);
- if (y0 < 0)
- {
- m0 = -mw*y0;
- y0 = 0;
- }
- else
- m0 = 0;
- if ((dy = height - y0) < thefilter->convh)
- me = mw*dy;
- else
- me = mw*thefilter->convh;
- mask = thefilter->conv+m0;
- for (m = m0, mx = 0; m<me; m++, mx++)
- {
- if (mx==mw)
- mx = 0;
- if (!mx)
- s0 = vig1+width*(y0++);
- if ((dmx = mx-mw2)>=0)
- {
- s = s0 + dmx;
- d = vig3;
- de = mscane - dmx;
- }
- else
- {
- s = s0;
- d = vig3 - dmx;
- de = mscane;
- }
-
- mval = *(mask++);
- while (d<de)
- *(d++) += ((val = *(s++))>-BIG? mval*val:0.0);
- }
- }
-
- return;
- }
-
-
diff --git a/sextractor/src/filter.h b/sextractor/src/filter.h
deleted file mode 100644
index 1b7b6aa..0000000
--- a/sextractor/src/filter.h
+++ /dev/null
@@ -1,47 +0,0 @@
- /*
- filter.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP/Leiden
-*
-* Contents: functions dealing with on-line filtering of the image
-* (for detection).
-*
-* Last modify: 09/11/99
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*------------------------------- definitions -------------------------------*/
-
-#define MAXMASK 1024 /* Maximum number of mask elements (=32x32) */
-
-/*------------------------------- structures --------------------------------*/
-
-typedef struct structfilter
- {
-/*---- convolution */
- float *conv; /* pointer to the convolution mask */
- int nconv; /* total number of elements */
- int convw, convh; /* x,y size of the mask */
- float varnorm;
-/*---- neural filtering */
- struct structbpann *bpann;
- } filterstruct;
-
-filterstruct *thefilter;
-
-/*------------------------------- functions ---------------------------------*/
-void convolve(picstruct *, PIXTYPE *),
- convolve_image(picstruct *field, double *vig1,
- double *vig2, int width, int height),
- filter(picstruct *, PIXTYPE *),
- neurfilter(picstruct *, PIXTYPE *),
- endfilter(void),
- getfilter(char *filename);
-
-int getconv(char *filename),
- getneurfilter(char *filename);
diff --git a/sextractor/src/fits/Makefile.am b/sextractor/src/fits/Makefile.am
deleted file mode 100644
index ff9ef26..0000000
--- a/sextractor/src/fits/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-# Program Makefile for the FITScat library
-# Copyright (C) 2002 Emmanuel Bertin.
-noinst_LIBRARIES = libfits.a
-libfits_a_SOURCES = fitsbody.c fitscat.c fitscheck.c fitscleanup.c \
- fitsconv.c fitshead.c fitskey.c fitsmisc.c \
- fitsread.c fitstab.c fitsutil.c fitswrite.c \
- fitscat_defs.h fitscat.h
diff --git a/sextractor/src/fits/Makefile.in b/sextractor/src/fits/Makefile.in
deleted file mode 100644
index 46a6c83..0000000
--- a/sextractor/src/fits/Makefile.in
+++ /dev/null
@@ -1,483 +0,0 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2012 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-subdir = src/fits
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/autoconf/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-libfits_a_AR = $(AR) $(ARFLAGS)
-libfits_a_LIBADD =
-am_libfits_a_OBJECTS = fitsbody.$(OBJEXT) fitscat.$(OBJEXT) \
- fitscheck.$(OBJEXT) fitscleanup.$(OBJEXT) fitsconv.$(OBJEXT) \
- fitshead.$(OBJEXT) fitskey.$(OBJEXT) fitsmisc.$(OBJEXT) \
- fitsread.$(OBJEXT) fitstab.$(OBJEXT) fitsutil.$(OBJEXT) \
- fitswrite.$(OBJEXT)
-libfits_a_OBJECTS = $(am_libfits_a_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libfits_a_SOURCES)
-DIST_SOURCES = $(libfits_a_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE2 = @DATE2@
-DATE3 = @DATE3@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGER = @PACKAGER@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-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@
-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_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-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_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# Program Makefile for the FITScat library
-# Copyright (C) 2002 Emmanuel Bertin.
-noinst_LIBRARIES = libfits.a
-libfits_a_SOURCES = fitsbody.c fitscat.c fitscheck.c fitscleanup.c \
- fitsconv.c fitshead.c fitskey.c fitsmisc.c \
- fitsread.c fitstab.c fitsutil.c fitswrite.c \
- fitscat_defs.h fitscat.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/fits/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/fits/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libfits.a: $(libfits_a_OBJECTS) $(libfits_a_DEPENDENCIES) $(EXTRA_libfits_a_DEPENDENCIES)
- -rm -f libfits.a
- $(libfits_a_AR) libfits.a $(libfits_a_OBJECTS) $(libfits_a_LIBADD)
- $(RANLIB) libfits.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitsbody.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitscat.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitscheck.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitscleanup.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitsconv.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitshead.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitskey.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitsmisc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitsread.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitstab.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitsutil.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fitswrite.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-cscopelist: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-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)'; \
- 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; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-noinstLIBRARIES cscopelist ctags distclean \
- distclean-compile distclean-generic distclean-tags 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-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am
-
-
-# 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.
-.NOEXPORT:
diff --git a/sextractor/src/fits/fitsbody.c b/sextractor/src/fits/fitsbody.c
deleted file mode 100644
index 227c1b8..0000000
--- a/sextractor/src/fits/fitsbody.c
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
- fitsbody.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Handle memory allocation for FITS bodies.
-*
-* Last modify: 29/06/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-size_t body_maxram = BODY_DEFRAM,
- body_maxvram = BODY_DEFVRAM,
- body_ramleft, body_vramleft, body_ramflag;
-
-int body_vmnumber;
-
-double bufdata0[DATA_BUFSIZE/sizeof(double)];
-char body_swapdirname[MAXCHARS] = BODY_DEFSWAPDIR;
-
-/******* alloc_body ***********************************************************
-PROTO PIXTYPE *alloc_body(tabstruct *tab,
- void (*func)(PIXTYPE *ptr, int npix))
-PURPOSE Allocate memory for and read a FITS data body (read-only). If not
- enough RAM is available, a swap file is created.
-INPUT Table (tab) structure.
-OUTPUT Pointer to the mapped data if OK, or NULL otherwise.
-NOTES The file pointer must be positioned at the beginning of the data.
-AUTHOR E. Bertin (IAP)
-VERSION 05/05/2001
- ***/
-PIXTYPE *alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
- {
- FILE *file;
- PIXTYPE *buffer;
- size_t npix, size, sizeleft, spoonful;
-
- if (!body_ramflag)
- {
- body_ramleft = body_maxram;
- body_vramleft = body_maxvram;
- body_ramflag = 1;
- }
-
-/* Return a NULL pointer if size is zero */
- if (!tab->tabsize)
- return (PIXTYPE *)NULL;
-
-/* Check that there is a cat parent structure and that the file is open */
- if (tab->cat && !tab->cat->file)
- error(EXIT_FAILURE, "*Internal Error*: Cannot access table: ",
- tab->extname);
-
-/* Decide if the data will go in physical memory or on swap-space */
- npix = tab->tabsize/tab->bytepix;
- size = npix*sizeof(PIXTYPE);
- if (size < body_ramleft)
- {
-/*-- There should be enough RAM left: try to do a malloc() */
- if ((tab->bodybuf = malloc(size)))
- {
- QFSEEK(tab->cat->file, tab->bodypos, SEEK_SET, tab->cat->filename);
- read_body(tab, (PIXTYPE *)tab->bodybuf, npix);
-/*---- Apply pixel processing */
- if (func)
- (*func)((PIXTYPE *)tab->bodybuf, npix);
- body_ramleft -= size;
-
- return (PIXTYPE *)tab->bodybuf;
- }
- else
- tab->bodybuf = NULL;
- }
-
- if (size < body_vramleft)
- {
-/*-- Convert and copy the data to a swap file, and mmap() it */
- if (!(buffer = malloc(DATA_BUFSIZE)))
- return NULL;
- sprintf(tab->swapname, "%s/vm%05ld_%05x.tmp",
- body_swapdirname, (long)getpid(),
- (unsigned int)++body_vmnumber) ;
- if (!(file=fopen(tab->swapname, "wb+")))
- error(EXIT_FAILURE, "*Error*: cannot create swap-file ", tab->swapname);
- add_cleanupfilename(tab->swapname);
- spoonful = (size%DATA_BUFSIZE);
- if (!spoonful)
- spoonful = DATA_BUFSIZE;
- QFSEEK(tab->cat->file, tab->bodypos, SEEK_SET, tab->cat->filename);
- read_body(tab, buffer, spoonful/sizeof(PIXTYPE));
-/*-- Apply pixel processing */
- if (func)
- (*func)(buffer, spoonful/sizeof(PIXTYPE));
- QFWRITE(buffer, spoonful, file, tab->swapname);
- for (sizeleft = size; sizeleft -= spoonful;)
- {
- read_body(tab, buffer, (spoonful=DATA_BUFSIZE)/sizeof(PIXTYPE));
-/*--- Apply pixel processing */
- if (func)
- (*func)(buffer, spoonful/sizeof(PIXTYPE));
- QFWRITE(buffer, spoonful, file, tab->swapname);
- }
- free(buffer);
- tab->bodybuf = mmap(NULL,size,PROT_READ,MAP_SHARED,fileno(file),(off_t)0);
- fclose(file);
- tab->swapflag = 1;
- body_vramleft -= size;
-
-/*-- Memory mapping problem */
- if (tab->bodybuf == (void *)-1)
- return NULL;
- return (PIXTYPE *)tab->bodybuf;
- }
-
-/* If no memory left at all: forget it! */
- return NULL;
- }
-
-
-/******* free_body ************************************************************
-PROTO void free_body(tabstruct *tab)
-PURPOSE Free FITS body data.
-INPUT Tab structure.
-OUTPUT -.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 04/03/2000
- ***/
-void free_body(tabstruct *tab)
-
- {
- size_t size;
-
-/* Free the body! (if allocated) */
- if (tab->bodybuf)
- {
- size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
- if (tab->swapflag)
- {
- if (munmap(tab->bodybuf, size))
- warning("Can't unmap ", tab->cat->filename);
- tab->swapflag = 0;
- tab->bodybuf = NULL;
- body_vramleft += size;
- if (unlink(tab->swapname))
- warning("Can't delete ", tab->swapname);
- remove_cleanupfilename(tab->swapname);
- *tab->swapname = '\0';
- }
- else
- {
- QFREE(tab->bodybuf);
- body_ramleft += size;
- }
- }
-
-/* Free the decompression buffer if allocated */
- if (tab->compress_buf)
- QFREE(tab->compress_buf);
-
- return;
- }
-
-
-/******* read_body ************************************************************
-PROTO read_body(tabstruct *tab, PIXTYPE *ptr, long size)
-PURPOSE Read values from the body of a FITS table.
-INPUT A pointer to the tab structure,
- a pointer to the array in memory,
- the number of elements to be read.
-OUTPUT -.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 06/11/2003
- ***/
-void read_body(tabstruct *tab, PIXTYPE *ptr, size_t size)
- {
- catstruct *cat;
- unsigned char cuval, cublank;
- char *bufdata,
- cval, cblank;
- unsigned short suval, sublank;
- short val16, sval, sblank;
- unsigned int iuval, iublank;
- int curval, dval, blankflag, ival, iblank;
-
- size_t i, bowl, spoonful, npix;
- PIXTYPE bs,bz;
-
-/* a NULL cat structure indicates that no data can be read */
- if (!(cat = tab->cat))
- return;
-
- bs = (PIXTYPE)tab->bscale;
- bz = (PIXTYPE)tab->bzero;
- blankflag = tab->blankflag;
-
- switch(tab->compress_type)
- {
-/*-- Uncompressed image */
- case COMPRESS_NONE:
- bowl = DATA_BUFSIZE/tab->bytepix;
- spoonful = size<bowl?size:bowl;
- for(; size>0; size -= spoonful)
- {
- if (spoonful>size)
- spoonful = size;
- bufdata = (char *)bufdata0;
- QFREAD(bufdata, spoonful*tab->bytepix, cat->file, cat->filename);
- switch(tab->bitpix)
- {
- case BP_BYTE:
- if (blankflag)
- {
- if (tab->bitsgn)
- {
- cblank = (char)tab->blank;
- for (i=spoonful; i--;)
- *(ptr++) = ((cval = *(bufdata++)) == cblank)?
- -BIG : cval*bs + bz;
- }
- else
- {
- cublank = (unsigned char)tab->blank;
- for (i=spoonful; i--;)
- *(ptr++) = ((cuval=*((unsigned char *)bufdata++))==cublank)?
- -BIG : cuval*bs + bz;
- }
- }
- else
- {
- if (tab->bitsgn)
- for (i=spoonful; i--;)
- *(ptr++) = *(bufdata++)*bs + bz;
- else
- for (i=spoonful; i--;)
- *(ptr++) = *((unsigned char *)bufdata++)*bs + bz;
- }
- break;
-
- case BP_SHORT:
- if (bswapflag)
- swapbytes(bufdata, 2, spoonful);
- if (blankflag)
- {
- if (tab->bitsgn)
- {
- sblank = (short)tab->blank;
- for (i=spoonful; i--; bufdata += sizeof(short))
- *(ptr++) = ((sval = *((short *)bufdata)) == sblank)?
- -BIG : sval*bs + bz;
- }
- else
- {
- sublank = (unsigned short)tab->blank;
- for (i=spoonful; i--; bufdata += sizeof(unsigned short))
- *(ptr++) = ((suval=*((unsigned short *)bufdata)) == sublank)?
- -BIG : suval*bs + bz;
- }
- }
- else
- {
- if (tab->bitsgn)
- for (i=spoonful; i--; bufdata += sizeof(short))
- *(ptr++) = *((short *)bufdata)*bs + bz;
- else
- for (i=spoonful; i--; bufdata += sizeof(unsigned short))
- *(ptr++) = *((unsigned short *)bufdata)*bs + bz;
- }
- break;
-
- case BP_LONG:
- if (bswapflag)
- swapbytes(bufdata, 4, spoonful);
- if (blankflag)
- {
- if (tab->bitsgn)
- {
- iblank = (int)tab->blank;
- for (i=spoonful; i--; bufdata += sizeof(int))
- *(ptr++) = ((ival = *((int *)bufdata)) == iblank)?
- -BIG : ival*bs + bz;
- }
- else
- {
- iublank = (unsigned int)tab->blank;
- for (i=spoonful; i--; bufdata += sizeof(unsigned int))
- *(ptr++) = ((iuval = *((unsigned int *)bufdata)) == iublank)?
- -BIG : iuval*bs + bz;
- }
- }
- else
- {
- if (tab->bitsgn)
- for (i=spoonful; i--; bufdata += sizeof(int))
- *(ptr++) = *((int *)bufdata)*bs + bz;
- else
- for (i=spoonful; i--; bufdata += sizeof(unsigned int))
- *(ptr++) = *((unsigned int *)bufdata)*bs + bz;
- }
- break;
-
- case BP_FLOAT:
- if (bswapflag)
- swapbytes(bufdata, 4, spoonful);
- for (i=spoonful; i--; bufdata += sizeof(float))
- *(ptr++) = ((0x7f800000&*(unsigned int *)bufdata) == 0x7f800000)?
- -BIG : *((float *)bufdata)*bs + bz;
- break;
-
- case BP_DOUBLE:
- if (bswapflag)
- {
- swapbytes(bufdata, 8, spoonful);
- for (i=spoonful; i--; bufdata += sizeof(double))
- *(ptr++) = ((0x7ff00000 & *(unsigned int *)(bufdata+4))
- == 0x7ff00000)?
- -BIG : *((double *)bufdata)*bs + bz;
- }
- else
- {
- for (i=spoonful; i--; bufdata += sizeof(double))
- *(ptr++) = ((0x7ff00000 & *(unsigned int *)bufdata)
- == 0x7ff00000)?
- -BIG : *((double *)bufdata)*bs + bz;
- }
- break;
-
- default:
- error(EXIT_FAILURE,"*FATAL ERROR*: unknown BITPIX type in ",
- "read_body()");
- break;
- }
- }
- break;
-
-/*-- Compressed image */
- case COMPRESS_BASEBYTE:
- if (!tab->compress_buf)
- QMALLOC(tab->compress_buf, char, FBSIZE);
- bufdata = tab->compress_bufptr;
- curval = tab->compress_curval;
- npix = tab->compress_npix;
- while (size--)
- {
- if (!(npix--))
- {
- if (curval != tab->compress_checkval)
- error(EXIT_FAILURE, "*Error*: invalid BASEBYTE checksum in ",
- cat->filename);
- bufdata = tab->compress_buf;
- QFREAD(bufdata, FBSIZE, cat->file, cat->filename);
- curval = 0;
- if (bswapflag)
- swapbytes(bufdata, 4, 1);
- tab->compress_checkval = *((int *)bufdata);
- bufdata += 4;
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- npix = (int)(*((short *)bufdata))-1;
- bufdata+=2;
- }
- if ((dval=(int)*(bufdata++))==-128)
- {
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- memcpy(&val16, bufdata, 2);
- dval = (int)val16;
- if (dval==-32768)
- {
- bufdata += 2;
- if (bswapflag)
- swapbytes(bufdata, 4, 1);
- memcpy(&dval,bufdata,4);
- bufdata += 4;
- }
- else
- bufdata += 2;
- }
- *(ptr++) = dval*bs + bz;
- curval += dval;
- }
- tab->compress_curval = curval;
- tab->compress_bufptr = bufdata;
- tab->compress_npix = npix;
- break;
-
- case COMPRESS_PREVPIX:
- if (!tab->compress_buf)
- QMALLOC(tab->compress_buf, char, FBSIZE);
- bufdata = tab->compress_bufptr;
- curval = tab->compress_curval;
- npix = tab->compress_npix;
- while (size--)
- {
- if (!(npix--))
- {
- if (curval != tab->compress_checkval)
- error(EXIT_FAILURE, "*Error*: invalid PREV_PIX checksum in ",
- tab->cat->filename);
- bufdata = tab->compress_buf;
- QFREAD(bufdata, FBSIZE, cat->file, cat->filename);
- if (bswapflag)
- swapbytes(bufdata, 2, 3);
- curval = (int)*(short *)bufdata;
- npix = (int)*(short *)(bufdata+=2)-1;
- tab->compress_checkval = (int)(*(short *)(bufdata+=2));
- bufdata+=4;
- }
- if ((dval=(int)*(bufdata++))==-128)
- {
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- memcpy(&val16, bufdata, 2);
- curval = (int)val16;
- bufdata += 2;
- }
- else
- curval += dval;
- *(ptr++) = curval*bs + bz;
- }
- tab->compress_curval = curval;
- tab->compress_bufptr = bufdata;
- tab->compress_npix = npix;
- break;
-
- default:
- error(EXIT_FAILURE,"*Internal Error*: unknown compression mode in ",
- "read_body()");
- }
-
- return;
- }
-
-
-/******* write_body ***********************************************************
-PROTO write_body(tabstruct *tab, PIXTYPE *ptr, long size)
-PURPOSE Write values to a FITS body.
-INPUT A pointer to the tab structure,
- a pointer to the array in memory,
- the number of elements to be written.
-OUTPUT -.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 29/06/2006
- ***/
-void write_body(tabstruct *tab, PIXTYPE *ptr, size_t size)
- {
- catstruct *cat;
- char *cbufdata0;
- size_t i, bowl, spoonful;
- PIXTYPE bs,bz;
-
- bs = (PIXTYPE)tab->bscale;
- bz = (PIXTYPE)tab->bzero;
- cat = tab->cat;
- if (!cat)
- error(EXIT_FAILURE, "*Internal Error*: no parent cat structure for table ",
- tab->extname);
-
- cbufdata0 = (char *)bufdata0; /* A trick to remove gcc aliasing warnings */
-
- switch(tab->compress_type)
- {
-/*-- Uncompressed image */
- case COMPRESS_NONE:
- bowl = DATA_BUFSIZE/tab->bytepix;
- spoonful = size<bowl?size:bowl;
- for(; size>0; size -= spoonful)
- {
- if (spoonful>size)
- spoonful = size;
- switch(tab->bitpix)
- {
- case BP_BYTE:
- if (tab->bitsgn)
- {
- char *bufdata = (char *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (char)((*(ptr++)-bz)/bs+0.49999);
- }
- else
- {
- unsigned char *bufdata = (unsigned char *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (unsigned char)((*(ptr++)-bz)/bs+0.49999);;
- }
- break;
-
- case BP_SHORT:
- if (tab->bitsgn)
- {
- short *bufdata = (short *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (short)((*(ptr++)-bz)/bs+0.49999);
- }
- else
- {
- unsigned short *bufdata = (unsigned short *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (unsigned short)((*(ptr++)-bz)/bs+0.49999);
- }
- if (bswapflag)
- swapbytes(cbufdata0, 2, spoonful);
- break;
-
- case BP_LONG:
- if (tab->bitsgn)
- {
- int *bufdata = (int *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (int)((*(ptr++)-bz)/bs+0.49999);
- }
- else
- {
- unsigned int *bufdata = (unsigned int *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (unsigned int)((*(ptr++)-bz)/bs+0.49999);
- }
- if (bswapflag)
- swapbytes(cbufdata0, 4, spoonful);
- break;
-
- case BP_FLOAT:
- {
- float *bufdata = (float *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (*(ptr++)-bz)/bs;
- if (bswapflag)
- swapbytes(cbufdata0, 4, spoonful);
- }
- break;
-
- case BP_DOUBLE:
- {
- double *bufdata = (double *)cbufdata0;
- for (i=spoonful; i--;)
- *(bufdata++) = (double)(*(ptr++)-bz)/bs;
- if (bswapflag)
- swapbytes(cbufdata0, 8, spoonful);
- }
- break;
-
- default:
- error(EXIT_FAILURE,"*FATAL ERROR*: unknown BITPIX type in ",
- "read_body()");
- break;
- }
- QFWRITE(cbufdata0, spoonful*tab->bytepix, cat->file, cat->filename);
- }
- break;
-
-/*-- Compressed image */
- case COMPRESS_BASEBYTE:
- break;
-
- case COMPRESS_PREVPIX:
- break;
-
- default:
- error(EXIT_FAILURE,"*Internal Error*: unknown compression mode in ",
- "read_body()");
- }
-
- return;
- }
-
-
-/******* set_maxram ***********************************************************
-PROTO int set_maxram(size_t maxram)
-PURPOSE Set the maximum amount of silicon memory that can be allocated for
- storing FITS body data.
-INPUT The maximum amount of RAM (in bytes).
-OUTPUT RETURN_OK if within limits, RETURN_ERROR otherwise.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 19/12/99
- ***/
-int set_maxram(size_t maxram)
- {
-
- if (maxram<1)
- return RETURN_ERROR;
-
- body_maxram = maxram;
-
- return RETURN_OK;
- }
-
-
-/******* set_maxvram **********************************************************
-PROTO int set_maxvram(size_t maxram)
-PURPOSE Set the maximum amount of total virtual memory that can be used for
- storing FITS body data.
-INPUT The maximum amount of VRAM (in bytes).
-OUTPUT RETURN_OK if within limits, RETURN_ERROR otherwise.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 08/02/2000
- ***/
-int set_maxvram(size_t maxvram)
- {
-
- if (maxvram<1)
- return RETURN_ERROR;
-
- body_maxvram = maxvram;
-
- return RETURN_OK;
- }
-
-
-/******* set_swapdir **********************************************************
-PROTO int set_swapdir(char *dirname)
-PURPOSE Set the path name of the directory that will be used for storing
- memory swap files.
-INPUT The pointer to the path string.
-OUTPUT RETURN_OK if path appropriate, RETURN_ERROR otherwise.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 19/12/99
- ***/
-int set_swapdir(char *dirname)
- {
-
- if (!dirname)
- return RETURN_ERROR;
-
- strcpy(body_swapdirname, dirname);
-
- return RETURN_OK;
- }
-
-
diff --git a/sextractor/src/fits/fitscat.c b/sextractor/src/fits/fitscat.c
deleted file mode 100644
index a619349..0000000
--- a/sextractor/src/fits/fitscat.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- fitscat.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: low-level functions for handling LDAC FITS catalogs.
-*
-* Last modify: 25/09/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <time.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-/****** about_cat **************************************************************
-PROTO int about_cat(catstruct *cat, FILE *stream)
-PURPOSE Print some info about a catalog.
-INPUT Catalog structure,
- output stream.
-OUTPUT RETURN_OK if everything went as expected, RETURN_ERROR otherwise.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 19/03/2002
- ***/
-int about_cat(catstruct *cat, FILE *stream)
-
- {
- tabstruct *tab;
- int i;
-
- fprintf(stream,"\n");
-
-/*General info about the catalog itself*/
- fprintf(stream,
- "------------------Catalog information----------------\n");
- fprintf(stream,
- "Filename:..............%s\n", cat->filename);
- fprintf(stream,
- "Number of segments:....%d\n", cat->ntab);
- fprintf(stream,"\n");
-
-/*Now for each table*/
- tab = cat->tab;
- for (i=0; i<cat->ntab; i++)
- {
- fprintf(stream,
- "****** Table #%d\n", i+1);
- fprintf(stream,
- " Extension type:.........%s\n",
- tab->xtension[0]? tab->xtension: "(Primary HDU)");
- fprintf(stream,
- " Extension name:.........%s\n", tab->extname);
- if (tab->naxis)
- {
- fprintf(stream,
- " Number of dimensions:...%d\n", tab->naxis);
- fprintf(stream,
- " Number of elements:.....%d\n", tab->naxisn[1]);
- if (tab->tfields)
- fprintf(stream,
- " Number of data fields...%d\n", tab->tfields);
- fprintf(stream,
- " Body size:..............%ld bytes\n",
- (unsigned long)tab->tabsize);
- }
- fprintf(stream,"\n");
- while (!(tab=tab->nexttab)->nseg);
- }
-
- fprintf(stream,"\n");
-
- return RETURN_OK;
- }
-
-
-/****** addhistoryto_cat *******************************************************
-PROTO int addhistoryto_cat(catstruct *cat, char *str)
-PURPOSE Add a HISTORY line to a FITS catalog.
-INPUT A pointer to catalog structure, and the character string to insert.
-OUTPUT RETURN_OK if everything went as expected, RETURN_ERROR otherwise.
-NOTES The pointer to the primary header might be reallocated if necessary.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/09/2004
- ***/
-int addhistoryto_cat(catstruct *cat, char *str)
-
- {
- time_t thetime;
- char str2[82];
- tabstruct *tab;
- int n, headpos;
-
- tab = cat->tab;
- n = tab->headnblock;
- headpos = fitsfind(tab->headbuf, "END ");
- if (headpos >= n*(FBSIZE/80) - 1)
- {
- QREALLOC(tab->headbuf, char, (n+1)*FBSIZE);
- memset(&tab->headbuf[n*FBSIZE], ' ', FBSIZE);
- tab->headnblock++;
- }
-
- if (time(&thetime)==-1)
- warning("No time available for history","");
-
- if (!strftime(str2, 16, "%d/%m/%Y %H:%M", localtime(&thetime)))
- error(EXIT_FAILURE, "*Internal Error*: Time/date string too long in ",
- "addhistoryto_cat()");
- sprintf(str2, "%s %.65s", str2, str);
- fitsadd(tab->headbuf, "HISTORY ", str2);
-
- return RETURN_OK;
- }
-
-
-/****** close_cat **************************************************************
-PROTO int close_cat(catstruct *cat)
-PURPOSE Close a FITS catalog.
-INPUT catalog structure.
-OUTPUT RETURN_OK if everything went as expected, RETURN_ERROR otherwise.
-NOTES the file structure member is set to NULL;
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 22/06/2001
- ***/
-int close_cat(catstruct *cat)
-
- {
- if (cat->file && fclose(cat->file))
- {
- cat->file = NULL;
- return RETURN_ERROR;
- }
-
- cat->file = NULL;
-
- return RETURN_OK;
- }
-
-
-/****** free_cat ***************************************************************
-PROTO void free_cat(catstruct **cat, int ncat)
-PURPOSE Free all structures allocated for one or several FITS catalog.
-INPUT Pointer to a catalog structure,
- Number of catalogs.
-OUTPUT -.
-NOTES Unallocated pointers should have been put to NULL.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 05/06/2001
- ***/
-void free_cat(catstruct **cat, int ncat)
-
- {
- catstruct **thecat;
- int i;
-
-/*--free memory allocated within each catalog */
- thecat = cat;
- for (i=ncat; i--;)
- {
- if ((*thecat)->file)
- close_cat(*thecat);
- remove_tabs(*(thecat++));
- }
-
- free(*cat);
-
- return;
- }
-
-
-/****** inherit_cat ************************************************************
-PROTO int inherit_cat(catstruct *catin, catstruct *catout)
-PURPOSE Copy the primary table, and all other informations from one catalog
- to another, except those related to the associated file itself
- (filename, etc...),
-INPUT A pointer to both catalog structures.
-OUTPUT RETURN_OK if at least one table was copied, RETURN_ERROR otherwise.
-NOTES The output catalog should be ``cleaned'' before call.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 13/06/2002
- ***/
-int inherit_cat(catstruct *catin, catstruct *catout)
-
- {
- tabstruct *tabin, *tabout, *prevtabout;
- int j;
-
- catout->ntab = 1;
- tabin = catin->tab;
-
-/*copy only one table: well it could be simpler, but let's stay general!*/
- prevtabout = NULL;
- for (j=tabin->nseg; j--;)
- {
- QCALLOC(tabout, tabstruct, 1);
- *tabout = *tabin;
- if (tabin->naxis)
- QMEMCPY(tabin->naxisn, tabout->naxisn, int, (size_t)tabin->naxis);
- if (tabin->headbuf)
- QMEMCPY(tabin->headbuf, tabout->headbuf, char,
- tabin->headnblock*FBSIZE);
- if (tabin->bodybuf)
- QMEMCPY(tabin->bodybuf, tabout->bodybuf, char, (size_t)tabin->tabsize);
- if (prevtabout)
- {
- tabout->prevtab = prevtabout;
- prevtabout->nexttab = tabout;
- }
- else
- {
- catout->tab = tabout;
- }
- prevtabout = tabout;
- tabin = tabin->nexttab;
- }
-
- if (prevtabout)
- {
- prevtabout->nexttab = catout->tab;
- catout->tab->prevtab = prevtabout;
- }
- else
- return RETURN_ERROR;
-
- return RETURN_OK;
- }
-
-/****** init_cat ***************************************************************
-PROTO int init_cat(catstruct *cat)
-PURPOSE Initialize a catalog, "cleaning" any content if present
- and adding the primary header "table".
-INPUT A pointer to the catalog structure.
-OUTPUT RETURN_OK if everything went as expected, RETURN_ERROR otherwise.
-NOTES The output catalog should be ``cleaned'' before call.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 28/05/2001
- ***/
-int init_cat(catstruct *cat)
-
- {
- static char bintabtemplate[][80] = {
-"SIMPLE = T / This is a FITS file",
-"BITPIX = 8 / ",
-"NAXIS = 0 / ",
-"EXTEND = T / This file may contain FITS extensions",
-"END "};
- tabstruct *tab;
- char *buf;
- int i;
-
-/* Initialize the primary header itself */
- QCALLOC(tab, tabstruct, 1);
- tab->naxis = 0;
- tab->bitpix = 8;
- tab->bytepix = 1;
- tab->pcount = 0;
- tab->gcount = 1;
- tab->seg = 1;
- tab->nseg = 1;
-/* Provide a new header*/
- QCALLOC(tab->headbuf, char, FBSIZE);
- memcpy(tab->headbuf, bintabtemplate, sizeof(bintabtemplate));
- for (buf = tab->headbuf, i=0; i<FBSIZE; i++, buf++)
- if (!*buf)
- *buf = ' ';
- tab->headnblock = 1;
-/* Clean catalog and add the table to it */
- remove_tabs(cat);
- cat->tab = tab->prevtab = tab->nexttab = tab;
- cat->ntab = 1;
-
- return RETURN_OK;
- }
-
-
-/****** map_cat ****************************************************************
-PROTO int map_cat(catstruct *cat)
-PURPOSE Explores the whole FITS file
- and gets information for each of the FITS tables it contains.
-INPUT catalog structure.
-OUTPUT RETURN_OK if at least one table was found, RETURN_ERROR otherwise.
-NOTES Memory space for the array of fits structures is reallocated.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 14/12/2002
- ***/
-int map_cat(catstruct *cat)
-
- {
- int ntab;
- tabstruct *tab, *prevtab;
-
-/*scan through the file until we reach the end*/
- prevtab = NULL;
- QCALLOC(tab, tabstruct, 1);
- tab->cat = cat;
- QFTELL(cat->file, tab->headpos, cat->filename);
- for (ntab=0; !get_head(tab); ntab++)
- {
- readbasic_head(tab);
- readbintabparam_head(tab);
- QFTELL(cat->file, tab->bodypos, cat->filename);
- tab->nseg = tab->seg = 1;
- if (tab->tabsize)
- QFSEEK(cat->file, PADTOTAL(tab->tabsize), SEEK_CUR, cat->filename);
- if (prevtab)
- {
- tab->prevtab = prevtab;
- prevtab->nexttab = tab;
- }
- else
- cat->tab = tab;
- prevtab = tab;
- QCALLOC(tab, tabstruct, 1);
- tab->cat = cat;
- QFTELL(cat->file, tab->headpos, cat->filename);
- }
-
- cat->ntab = ntab;
- free(tab);
- if (prevtab)
- {
- prevtab->nexttab = cat->tab;
- cat->tab->prevtab = prevtab;
- }
- else
- return RETURN_ERROR;
-
-/*rewind to the beginning*/
-/*
- QFSEEK(cat->file, 0, SEEK_SET, cat->filename);
-*/
-
- return RETURN_OK;
- }
-
-
-/****** new_cat ****************************************************************
-PROTO catstruct *new_cat(int ncat)
-PURPOSE Initialize a structure for a FITS catalog.
-INPUT Number of catalogs.
-OUTPUT A pointer to the catalog array.
-NOTES All fields are initialized to 0.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 20/03/96
- ***/
-catstruct *new_cat(int ncat)
-
- {
- catstruct *cat;
-
- QCALLOC(cat, catstruct, ncat);
-
- cat->access_type = WRITE_ONLY;
-
- return cat;
- }
-
-
-/****** open_cat ***************************************************************
-PROTO int open_cat(catstruct *cat, access_type at)
-PURPOSE Open a FITS catalog with name filename.
-INPUT catalog structure,
- access type (can be WRITE_ONLY or READ_ONLY).
-OUTPUT RETURN_OK if the cat is found, RETURN_ERROR otherwise.
-NOTES If the file was already opened by this catalog, nothing is done.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 13/06/2002
- ***/
-int open_cat(catstruct *cat, access_type at)
-
- {
-
- if (cat->access_type == READ_ONLY && at == WRITE_ONLY)
- error(EXIT_FAILURE, "*Internal Error*: Trying to write to the "
- "READ_ONLY catalog ", cat->filename);
-
- if (!cat->file)
- {
- if ((cat->file = fopen(cat->filename, at==WRITE_ONLY?"wb":"rb")) == NULL)
- return RETURN_ERROR;
- cat->access_type = at;
- }
-
- return RETURN_OK;
- }
-
-
diff --git a/sextractor/src/fits/fitscat.h b/sextractor/src/fits/fitscat.h
deleted file mode 100644
index b4c4e6b..0000000
--- a/sextractor/src/fits/fitscat.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- fitscat.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: Simplified versin of the LDACTools: main include file
-*
-* Last modify: 10/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifndef _FITSCAT_H_
-#define _FITSCAT_H_
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#define MAXCHARS 256 /* max. number of characters */
-#define WARNING_NMAX 100 /* max. number of recorded warnings */
-
-/*---------------------------- return messages ------------------------------*/
-
-#ifndef RETURN_OK
-#define RETURN_OK 0
-#endif
-#ifndef RETURN_ERROR
-#define RETURN_ERROR (-1)
-#endif
-#ifndef RETURN_FATAL_ERROR
-#define RETURN_FATAL_ERROR (-2)
-#endif
-
-/*--------------------------- FITS BitPix coding ----------------------------*/
-
-#define BP_BYTE 8
-#define BP_SHORT 16
-#define BP_LONG 32
-#define BP_FLOAT (-32)
-#define BP_DOUBLE (-64)
-
-/*-------------------------------- macros -----------------------------------*/
-
-/* Standard FITS name suffix*/
-
-#define FITS_SUFFIX ".fits"
-
-/* size (in bytes) of one FITS block */
-
-#define FBSIZE 2880L
-
-/* FITS size after adding padding */
-
-#define PADTOTAL(x) (((x-1)/FBSIZE+1)*FBSIZE)
-
-/* extra size to add for padding */
-
-#define PADEXTRA(x) ((FBSIZE - (x%FBSIZE))% FBSIZE)
-
-/*--------------------------------- typedefs --------------------------------*/
-
-typedef enum {H_INT, H_FLOAT, H_EXPO, H_BOOL, H_STRING, H_STRINGS,
- H_COMMENT, H_HCOMMENT, H_KEY} h_type;
- /* type of FITS-header data */
-typedef enum {T_BYTE, T_SHORT, T_LONG, T_FLOAT, T_DOUBLE, T_STRING}
- t_type; /* Type of data */
-typedef enum {WRITE_ONLY, READ_ONLY}
- access_type; /* Type of access */
-typedef enum {SHOW_ASCII, SHOW_SKYCAT}
- output_type; /* Type of output */
-
-typedef float PIXTYPE; /* Pixel type */
-
-#ifdef HAVE_UNSIGNED_LONG_LONG
-typedef unsigned long long KINGSIZE_T; /* for large sizes */
-#else
-typedef size_t KINGSIZE_T; /* better than nothing */
-#endif
-#ifdef HAVE_LONG_LONG
-typedef long long KINGLONG; /* for large sizes */
-#else
-typedef long KINGLONG; /* better than nothing */
-#endif
-
-#if _FILE_OFFSET_BITS
-#define OFF_T off_t
-#else
-#define OFF_T KINGLONG
-#endif
-
-/*------------------------------- constants ---------------------------------*/
-
-extern const int t_size[]; /* size in bytes per t_type (see fitshead.c) */
-
-/*---------------------------------- key ------------------------------------*/
-
-typedef struct structkey
- {
- char name[80]; /* name */
- char comment[80]; /* a comment */
- void *ptr; /* pointer to the data */
- h_type htype; /* standard ``h_type'' (display) */
- t_type ttype; /* standard ``t_type'' (storage) */
- char printf[80]; /* printing format (C Convention) */
- char unit[80]; /* physical unit */
- char voucd[80]; /* VO ucd */
- char vounit[80]; /* VO unit */
- int naxis; /* number of dimensions */
- int *naxisn; /* pointer to an array of dim. */
- int nobj; /* number of objects */
- int nbytes; /* number of bytes per element */
- long pos; /* position within file */
- struct structkey *prevkey; /* previous key within the chain */
- struct structkey *nextkey; /* next key within the chain */
- struct structtab *tab; /* (original) parent tab */
- int allocflag; /* true if ptr dynamically allocated */
- } keystruct;
-
-/*------------------------------- catalog ---------------------------------*/
-
-typedef struct structcat
- {
- char filename[MAXCHARS]; /* file name */
- FILE *file; /* pointer to the file structure */
- struct structtab *tab; /* pointer to the first table */
- int ntab; /* number of tables included */
- access_type access_type; /* READ_ONLY or WRITE_ONLY */
- } catstruct;
-
-/*-------------------------------- table ----------------------------------*/
-
-typedef struct structtab
- {
- int bitpix; /* bits per element */
- int bytepix; /* bytes per element */
- int bitsgn; /* = 0 if unsigned data */
- double bscale; /* data scale factor */
- double bzero; /* data offset parameter */
- int blank; /* integer code for undefined values */
- int blankflag; /* set if a blank keyword was found */
- enum {COMPRESS_NONE, COMPRESS_BASEBYTE, COMPRESS_PREVPIX}
- compress_type; /* image compression type */
- char *compress_buf; /* de-compression buffer */
- char *compress_bufptr; /* present pixel in buffer */
- int compress_curval; /* current pixel or checksum value */
- int compress_checkval; /* foreseen pixel or checksum value */
- size_t compress_npix; /* remaining pixels in buffer */
- int naxis; /* number of dimensions */
- int *naxisn; /* array of dimensions */
- int tfields; /* number of fields */
- int pcount, gcount; /* alignment of the data */
- KINGSIZE_T tabsize; /* total table size (bytes) */
- char xtension[82]; /* FITS extension type */
- char extname[82]; /* FITS extension name */
- char *headbuf; /* buffer containing the header */
- int headnblock; /* number of FITS blocks */
- char *bodybuf; /* buffer containing the body */
- OFF_T bodypos; /* position of the body in the file */
- OFF_T headpos; /* position of the head in the file */
- struct structcat *cat; /* (original) parent catalog */
- struct structtab *prevtab, *nexttab; /* previous and next tab in chain */
- int seg; /* segment position */
- int nseg; /* number of tab segments */
- keystruct *key; /* pointer to keys */
- int nkey; /* number of keys */
- int swapflag; /* mapped to a swap file ? */
- char swapname[MAXCHARS]; /* name of the swapfile */
- unsigned int bodysum; /* Checksum of the FITS body */
- } tabstruct;
-
-
-/*------------------------------- functions ---------------------------------*/
-
-extern catstruct *new_cat(int ncat),
- *read_cat(char *filename),
- *read_cats(char **filenames, int ncat);
-
-extern tabstruct *asc2bin_tab(catstruct *catin, char *tabinname,
- catstruct *catout, char *taboutname),
- *init_readobj(tabstruct *tab, char **pbuf),
- *name_to_tab(catstruct *cat, char *tabname, int seg),
- *new_tab(char *tabname),
- *pos_to_tab(catstruct *cat, int pos, int seg);
-
-extern keystruct *name_to_key(tabstruct *tab, char *keyname),
- *new_key(char *keyname),
- *pos_to_key(tabstruct *tab, int pos),
- *read_key(tabstruct *tab, char *keyname);
-
-extern void add_cleanupfilename(char *filename),
- cleanup_files(void),
- copy_tab_fromptr(tabstruct *tabin, catstruct *catout, int pos),
- encode_checksum(unsigned int sum, char *str),
- end_readobj(tabstruct *keytab, tabstruct *tab, char *buf),
- end_writeobj(catstruct *cat, tabstruct *tab, char *buf),
- error(int, char *, char *),
- error_installfunc(void (*func)(char *msg1, char *msg2)),
- fixexponent(char *s),
- free_body(tabstruct *tab),
- free_cat(catstruct **cat, int ncat),
- free_key(keystruct *key),
- free_tab(tabstruct *tab),
- init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf),
- install_cleanup(void (*func)(void)),
- print_obj(FILE *stream, tabstruct *tab),
- read_keys(tabstruct *tab, char **keynames, keystruct **keys,
- int nkeys, unsigned char *mask),
- read_basic(tabstruct *tab),
- read_body(tabstruct *tab, PIXTYPE *ptr, size_t size),
- readbasic_head(tabstruct *tab),
- remove_cleanupfilename(char *filename),
- save_cat(catstruct *cat, char *filename),
- save_tab(catstruct *cat, tabstruct *tab),
- show_keys(tabstruct *tab, char **keynames, keystruct **keys,
- int nkeys, unsigned char *mask, FILE *stream,
- int strflag,int banflag, int leadflag,
- output_type o_type),
- swapbytes(void *, int, int),
- ttypeconv(void *ptrin, void *ptrout,
- t_type ttypein, t_type ttypeout),
- voprint_obj(FILE *stream, tabstruct *tab),
- warning(char *, char *),
- write_body(tabstruct *tab, PIXTYPE *ptr, size_t size),
- write_checksum(tabstruct *tab);
-
-extern char *tdisptoprintf(char *tdisp, char *str),
- *printftotdisp(char *cprintf, char *str),
- *fitsnfind(char *fitsbuf, char *str, int nblock),
- **tabs_list(catstruct *cat, int *n),
- **keys_list(tabstruct *tab, int *n),
- *warning_history(void);
-
-extern unsigned int
- compute_blocksum(char *buf, unsigned int sum),
- compute_bodysum(tabstruct *tab, unsigned int sum),
- decode_checksum(char *str);
-
-extern int about_cat(catstruct *cat, FILE *stream),
- about_tab(catstruct *cat, char *tabname, FILE *stream),
- addhistoryto_cat(catstruct *cat, char *str),
- add_key(keystruct *key, tabstruct *tab, int pos),
- addkeyto_head(tabstruct *tab, keystruct *key),
- addkeywordto_head(tabstruct *tab, char *keyword,char *comment),
- add_tab(tabstruct *tab, catstruct *cat, int pos),
- blank_keys(tabstruct *tab),
- close_cat(catstruct *cat),
- copy_key(tabstruct *tabin, char *keyname, tabstruct *tabout,
- int pos),
- copy_tab(catstruct *catin, char *tabname, int seg,
- catstruct *catout, int pos),
- copy_tabs(catstruct *catin, catstruct *catout),
- copy_tabs_blind(catstruct *catin, catstruct *catout),
- ext_head(tabstruct *tab),
- findkey(char *, char *, int),
- findnkey(char *, char *, int, int),
- fitsadd(char *fitsbuf, char *keyword, char *comment),
- fitsfind(char *fitsbuf, char *keyword),
- fitspick(char *fitsbuf, char *keyword, void *ptr,
- h_type *htype, t_type *ttype, char *comment),
- fitsread(char *fitsbuf, char *keyword, void *ptr,
- h_type htype, t_type ttype),
- fitsremove(char *fitsbuf, char *keyword),
- fitswrite(char *fitsbuf, char *keyword, void *ptr,
- h_type htype, t_type ttype),
- get_head(tabstruct *tab),
- inherit_cat(catstruct *catin, catstruct *catout),
- init_cat(catstruct *cat),
- map_cat(catstruct *cat),
- open_cat(catstruct *cat, access_type at),
- pad_tab(catstruct *cat, KINGSIZE_T size),
- prim_head(tabstruct *tab),
- readbintabparam_head(tabstruct *tab),
- read_field(tabstruct *tab, char **keynames, keystruct **keys,
- int nkeys, int field, tabstruct *ftab),
- read_obj(tabstruct *keytab, tabstruct *tab, char *buf),
- read_obj_at(tabstruct *keytab, tabstruct *tab, char *buf,
- long pos),
- remove_key(tabstruct *tab, char *keyname),
- remove_keys(tabstruct *tab),
- remove_tab(catstruct *cat, char *tabname, int seg),
- remove_tabs(catstruct *cat),
- save_head(catstruct *cat, tabstruct *tab),
- set_maxram(size_t maxram),
- set_maxvram(size_t maxvram),
- set_swapdir(char *dirname),
- tab_row_len(char *, char *),
- tformof(char *str, t_type ttype, int n),
- tsizeof(char *str),
- update_head(tabstruct *tab),
- update_tab(tabstruct *tab),
- verify_checksum(tabstruct *tab),
- write_obj(tabstruct *tab, char *buf),
- wstrncmp(char *, char *, int);
-
-extern PIXTYPE *alloc_body(tabstruct *tab,
- void (*func)(PIXTYPE *ptr, int npix));
-
-extern t_type ttypeof(char *str);
-
-extern void error(int, char *, char *),
- swapbytes(void *ptr, int nb, int n),
- warning(char *msg1, char *msg2);
-
-
-int bswapflag;
-
-#endif
diff --git a/sextractor/src/fits/fitscat_defs.h b/sextractor/src/fits/fitscat_defs.h
deleted file mode 100644
index 78c34d1..0000000
--- a/sextractor/src/fits/fitscat_defs.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- fitscat_defs.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: Simplified version of the LDACTools: internal defs
-*
-* Last modify: 16/08/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/* Check if we are using a configure script here */
-#ifndef HAVE_CONFIG_H
-#define VERSION "2.0"
-#define DATE "2003-x-x"
-#define HAVE_SYS_MMAN_H 1
-#endif
-
-/*------------------------ what, who, when and where ------------------------*/
-
-#define BANNER "LDACTools"
-#define COPYRIGHT "Emmanuel BERTIN (bertin at iap.fr)"
-#define INSTITUTE "IAP/Leiden"
-
-
-/*----------------------------- External constants --------------------------*/
-
-extern int bswapflag; /* != 0 if bytes are swapped/IEEE */
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define OUTPUT stdout /* where all msgs are sent */
-#define KBYTE 1024 /* 1 kbyte! */
-#define MBYTE (1024*KBYTE) /* 1 Mbyte! */
-#define GBYTE (1024*MBYTE) /* 1 Gbyte! */
-#define DATA_BUFSIZE (4*MBYTE) /* data buffer size for I/O's */
-#define BODY_DEFRAM (256*MBYTE) /* a fair number by 1999 standards */
-#define BODY_DEFVRAM (1.9*GBYTE) /* a fair number by 1999 standards */
-#define BODY_DEFSWAPDIR "/tmp" /* OK at least for Unix systems */
-
-#define BIG 1e+30 /* a huge number */
-#ifndef PI
-#define PI 3.14159265359 /* never met before? */
-#endif
-
-/* NOTES:
-We must have: MAXCHARS >= 16
- DATA_BUFSIZE >= 2 although DATA_BUFSIZE >= 100000
- is better!!
-*/
-
-/*--------------------- in case of missing constants ------------------------*/
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#endif
-#ifndef EXIT_FAILURE
-#define EXIT_FAILURE -1
-#endif
-
-/*--------------------------------- typedefs --------------------------------*/
-typedef unsigned char BYTE; /* a byte */
-typedef int LONG; /* for DEC-Alpha... */
-
-/*------------------------------- Other Macros -----------------------------*/
-
-#if _LARGEFILE_SOURCE
-#define FSEEKO fseeko
-#define FTELLO ftello
-#else
-#define FSEEKO fseek
-#define FTELLO ftell
-#endif
-
-#define QFREAD(ptr, size, file, fname) \
- {if (fread(ptr, (size_t)(size), (size_t)1, file)!=1) \
- error(EXIT_FAILURE, "*Error* while reading ", fname);;}
-
-#define QFWRITE(ptr, size, file, fname) \
- {if (fwrite(ptr, (size_t)(size), (size_t)1, file)!=1) \
- error(EXIT_FAILURE, "*Error* while writing ", fname);;}
-
-#define QFSEEK(file, offset, pos, fname) \
- {if (FSEEKO(file, offset, pos)) \
- error(EXIT_FAILURE,"*Error*: File positioning failed in ", \
- fname);;}
-
-#define QFTELL(file, pos, fname) \
- {if ((pos=FTELLO(file))==-1) \
- error(EXIT_FAILURE,"*Error*: File position unknown in ", \
- fname);;}
-
-
-#define QFREE(x) {free(x); x = NULL;}
-
-#define QCALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define QMALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define QMEMCPY(ptrin, ptrout, typ, nel) \
- {if (!(ptrout = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptrout " (" #nel " elements) !"); \
- memcpy(ptrout, ptrin, (size_t)(nel)*sizeof(typ));}
-
-#define QREALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)realloc(ptr, (size_t)(nel)*sizeof(typ)))) \
- error(EXIT_FAILURE, "Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define RINT(x) (int)(floor(x+0.5))
-
-
-#define QPRINTF if (qflag) fprintf
-
-#define QFPRINTF(w,x) {if (qflag) \
- fprintf(w, "\33[1M> %s\n\33[1A",x);;}
-
-
-#define QGETKEY(tab, key, keyname, dest) \
- {if (!(key = name_to_key(tab, keyname))) \
- error(EXIT_FAILURE, "*Error*: No such parameter in catalog: ", \
- keyname); \
- dest = key->ptr;}
-
-#define MIN(a,b) (a<b?a:b)
diff --git a/sextractor/src/fits/fitscheck.c b/sextractor/src/fits/fitscheck.c
deleted file mode 100644
index f7f0196..0000000
--- a/sextractor/src/fits/fitscheck.c
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- fitscheck.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Functions related to file integrity
-*
-* Last modify: 15/08/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-#define ENCODE_OFFSET 0x30
-unsigned int exclude[13] = {0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
- 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60};
-
-/****** encode_checksum *****************************************************
-PROTO void encode_checksum(unsigned int sum, char *str)
-PURPOSE Encode a checksum to ASCII
-INPUT Checksum,
- Destination string.
-OUTPUT -.
-NOTES Straightforward copy of Seaman & Pence 1995
- (ftp://iraf.noao.edu/misc/checksum/).
-AUTHOR E. Bertin (IAP)
-VERSION 08/05/2001
- ***/
-void encode_checksum(unsigned int sum, char *str)
-
- {
- int ch[4],
- i,j,k, byte, check;
-
- for (i=0; i<4; i++)
- {
-/*-- Each byte becomes four */
- byte = (sum << 8*i) >> 24;
- ch[0] = (ch[1] = ch[2] = ch[3] = byte/4 + ENCODE_OFFSET) + (byte%4);
- for (check=1; check;) /* avoid ASCII punctuation */
- for (check=k=0; k<13; k++)
- {
- if (ch[0]==exclude[k] || ch[1]==exclude[k])
- {
- ch[0]++;
- ch[1]--;
- check++;
- }
- if (ch[2]==exclude[k] || ch[3]==exclude[k])
- {
- ch[2]++;
- ch[3]--;
- check++;
- }
- }
- for (j=0; j<4; j++) /* assign the bytes */
- str[(4*j+i+1)%16] = ch[j]; /* permute the bytes for FITS */
- }
- str[16] = 0;
-
- return;
- }
-
-
-/****** decode_checksum *****************************************************
-PROTO unsigned int decode_checksum(char *str)
-PURPOSE Decode an ASCII checksum
-INPUT Checksum string.
-OUTPUT Checksum.
-NOTES Straightforward copy of Seaman & Pence 1995
- (ftp://iraf.noao.edu/misc/checksum/).
-AUTHOR E. Bertin (IAP)
-VERSION 08/05/2001
- ***/
-unsigned int decode_checksum(char *str)
-
- {
- char cbuf[16];
- unsigned short *sbuf,
- los,his;
- unsigned int hi,lo, hicarry,locarry;
- int i;
-
-/* Remove the permuted FITS byte alignment and the ASCII 0 offset */
- for (i=0; i<16; i++)
- cbuf[i] = str[(i+1)%16] - 0x30;
- sbuf = (unsigned short *)cbuf;
- hi = lo = 0;
- if (bswapflag)
- for (i=4; i--;)
- {
- his = *(sbuf++);
- los = *(sbuf++);
- hi += (*((unsigned char *)&his)<<8) + *((unsigned char *)&his+1);
- lo += (*((unsigned char *)&los)<<8) + *((unsigned char *)&los+1);
- }
- else
- for (i=4; i--;)
- {
- hi += *(sbuf++);
- lo += *(sbuf++);
- }
-
- hicarry = hi>>16;
- locarry = lo>>16;
- while (hicarry || locarry)
- {
- hi = (hi & 0xffff) + locarry;
- lo = (lo & 0xffff) + hicarry;
- hicarry = hi >> 16;
- locarry = lo >> 16;
- }
-
- return (hi<<16) + lo;
- }
-
-
-/****** compute_blocksum *****************************************************
-PROTO unsigned int compute_blocksum(char *buf, unsigned int sum)
-PURPOSE Compute the checksum of a FITS block (2880 bytes)
-INPUT Pointer to the block,
- The previous checksum.
-OUTPUT The new computed checksum.
-NOTES From Seaman & Pence 1995 (ftp://iraf.noao.edu/misc/checksum/). But
- contrarily to what is stated by the authors, the original algorithm
- depends on the endianity of the machine. The routine below adds
- support for ix386-like processors (non-IEEE).
-AUTHOR E. Bertin (IAP)
-VERSION 08/05/2001
- ***/
-unsigned int compute_blocksum(char *buf, unsigned int sum)
- {
- unsigned short *sbuf,
- his,los;
- unsigned int hi,lo, hicarry,locarry;
- int i;
-
- sbuf = (unsigned short *)buf;
- hi = (sum >> 16);
- lo = (sum << 16) >> 16;
- if (bswapflag)
- for (i=FBSIZE/4; i--;)
- {
- his = *(sbuf++);
- los = *(sbuf++);
- hi += (*((unsigned char *)&his)<<8) + *((unsigned char *)&his+1);
- lo += (*((unsigned char *)&los)<<8) + *((unsigned char *)&los+1);
- }
- else
- for (i=FBSIZE/4; i--;)
- {
- hi += *(sbuf++);
- lo += *(sbuf++);
- }
-
- hicarry = hi>>16; /* fold carry bits in */
- locarry = lo>>16;
- while (hicarry || locarry)
- {
- hi = (hi & 0xFFFF) + locarry;
- lo = (lo & 0xFFFF) + hicarry;
- hicarry = hi >> 16;
- locarry = lo >> 16;
- }
-
- return (hi << 16) + lo;
- }
-
-
-/****** compute_bodysum *****************************************************
-PROTO unsigned int compute_bodysum(tabstruct *tab, unsigned int sum)
-PURPOSE Compute the checksum of a FITS body
-INPUT Pointer to the tab,
- Checksum from a previous iteration.
-OUTPUT The computed checksum.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 15/08/2003
- ***/
-unsigned int compute_bodysum(tabstruct *tab, unsigned int sum)
- {
- catstruct *cat;
- char *buf;
- KINGSIZE_T size;
- int n, nblock;
-
-/* FITS data are generally padded */
- nblock = (tab->tabsize+FBSIZE-1)/FBSIZE;
-/* 2 cases: either the data are in memory or still on disk */
- if (tab->bodybuf)
- {
-/*-- In memory: they are probably not padded */
- buf = (char *)tab->bodybuf;
- for (n=nblock-1; n--; buf+=FBSIZE)
- sum = compute_blocksum(buf, sum);
- if ((size=PADEXTRA(tab->tabsize)))
- {
- QCALLOC(buf, char, FBSIZE);
- size = FBSIZE-size;
- memcpy(buf, (char *)tab->bodybuf+tab->tabsize-size, size);
- sum = compute_blocksum(buf, sum);
- free(buf);
- }
- }
- else
- {
-/*-- On disk: they are padded */
-/*-- We open the file (nothing is done if already open) */
- if (!(cat=tab->cat))
- {
- warning("Cannot access file while computing the checksum in HDU ",
- tab->extname);
- return 0;
- }
- open_cat(cat, READ_ONLY);
- QFSEEK(cat->file, tab->bodypos, SEEK_SET, cat->filename);
- QMALLOC(buf, char, FBSIZE);
- for (n=nblock; n--;)
- {
- QFREAD(buf, FBSIZE, cat->file, cat->filename);
-/*---- No need to swap bytes */
- sum = compute_blocksum(buf, sum);
- }
- }
-
- return sum;
- }
-
-
-/****** write_checksum *****************************************************
-PROTO void write_checksum(tabstruct *tab)
-PURPOSE Compute and write the checksum to a FITS table
-INPUT Pointer to the tab.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 04/06/2001
- ***/
-void write_checksum(tabstruct *tab)
-
- {
- char str[32],
- *buf;
- unsigned int sum;
- int i;
-
-/* Keep some margin */
- QREALLOC(tab->headbuf, char, 80*(tab->headnblock*36+3));
-/* Add or update keywords in the header */
- fitsadd(tab->headbuf, "CHECKSUM", "ASCII 1's complement checksum");
- fitswrite(tab->headbuf, "CHECKSUM", "0000000000000000",
- H_STRING, T_STRING);
- fitsadd(tab->headbuf, "DATASUM ", "Checksum of data records");
- fitswrite(tab->headbuf, "DATASUM ", "0", H_STRING, T_STRING);
- fitsadd(tab->headbuf, "CHECKVER", "Checksum version ID");
- fitswrite(tab->headbuf, "CHECKVER", "COMPLEMENT", H_STRING, T_STRING);
-/* Keep only what's necessary */
- tab->headnblock = ((fitsfind(tab->headbuf, "END ")+36)*80)/FBSIZE;
- QREALLOC(tab->headbuf, char, tab->headnblock*FBSIZE);
-/* First: the data */
- tab->bodysum = sum = compute_bodysum(tab, 0);
- sprintf(str, "%u", sum);
- fitswrite(tab->headbuf, "DATASUM ", str, H_STRING, T_STRING);
-
-
-/* Now the header */
- buf = tab->headbuf;
- for (i=tab->headnblock; i--; buf+=FBSIZE)
- sum = compute_blocksum(buf, sum);
-
-/* Complement to 1 */
- encode_checksum(~sum, str);
- fitswrite(tab->headbuf, "CHECKSUM", str, H_STRING, T_STRING);
-
- return;
- }
-
-
-/****** verify_checksum *****************************************************
-PROTO int verify_checksum(tabstruct *tab)
-PURPOSE Compute and check the checksum of a FITS table
-INPUT Pointer to the tab.
-OUTPUT RETURN_OK if the checksum is correct, RETURN_ERROR if it is
- incorrect, or RETURN_FATAL_ERROR if no checksum found.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 07/05/2001
- ***/
-int verify_checksum(tabstruct *tab)
-
- {
- char *buf;
- unsigned int sum;
- int i;
-
- if (fitsfind(tab->headbuf, "CHECKSUM")==RETURN_ERROR)
- return RETURN_FATAL_ERROR;
-
-/* First: the data */
- sum = compute_bodysum(tab, 0);
-/* Now the header */
- buf = tab->headbuf;
- for (i=tab->headnblock; i--; buf+=FBSIZE)
- sum = compute_blocksum(buf, sum);
-/* The result should sum to 0 */
- sum = ~sum;
-
- return sum? RETURN_ERROR : RETURN_OK;
- }
-
diff --git a/sextractor/src/fits/fitscleanup.c b/sextractor/src/fits/fitscleanup.c
deleted file mode 100644
index d8d3431..0000000
--- a/sextractor/src/fits/fitscleanup.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- fitscleanup.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Signal-catching routines to clean-up temporary files
-*
-* Last modify: 10/01/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-#define CLEANUP_NFILES 64
-
-void (*exit_func)(void);
-char **cleanup_filename;
-int cleanup_nfiles;
-
-/****** cleanup_files ********************************************************
-PROTO void cleanup_files(void)
-PURPOSE Remove temporary files on exit.
-INPUT -.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 25/04/2002
- ***/
-void cleanup_files(void)
- {
- char **filename;
- int i;
-
- filename = cleanup_filename;
- for (i=cleanup_nfiles; i--;)
- {
- remove(*filename);
- free(*(filename++));
- }
- if (cleanup_nfiles)
- {
- free(cleanup_filename);
- cleanup_nfiles = 0;
- }
-
- return;
- }
-
-
-/****** add_cleanupfilename **************************************************
-PROTO void add_cleanupfilename(char *filename)
-PURPOSE Add a file name to the list of files to be cleaned up at exit.
-INPUT pointer to filename char string.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 10/01/2003
- ***/
-void add_cleanupfilename(char *filename)
- {
-
- if (!cleanup_nfiles)
- {
- QMALLOC(cleanup_filename, char *, CLEANUP_NFILES);
- }
- else if (!(cleanup_nfiles%CLEANUP_NFILES))
- {
- QREALLOC(cleanup_filename, char *, cleanup_nfiles+CLEANUP_NFILES);
- }
- QMALLOC(cleanup_filename[cleanup_nfiles], char, MAXCHARS);
- strcpy(cleanup_filename[cleanup_nfiles++], filename);
-
- return;
- }
-
-
-/****** remove_cleanupfilename ***********************************************
-PROTO void remove_cleanupfilename(char *filename)
-PURPOSE remove a file name from the list of files to be cleaned up at exit.
-INPUT pointer to filename char string.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 21/08/2000
- ***/
-void remove_cleanupfilename(char *filename)
- {
- char **filename2, **filename3;
- int i, j;
-
- if (!cleanup_nfiles)
- return;
-
-/* Search the cleanup filename list for a match */
- filename2 = cleanup_filename;
- for (i=cleanup_nfiles; i--;)
- if (!strcmp(filename, *(filename2++)))
- {
-/* Match found: update the list and free memory is necessary*/
- filename3 = filename2 - 1;
- for (j=i; j--;)
- *(filename3++) = *(filename2++);
- if (!((--cleanup_nfiles)%CLEANUP_NFILES))
- {
- if (cleanup_nfiles)
- {
- filename2 = cleanup_filename + cleanup_nfiles;
- for (i=CLEANUP_NFILES; i--;)
- free(*(filename2++));
- QREALLOC(cleanup_filename, char *, cleanup_nfiles);
- }
- else
- {
- free(*cleanup_filename);
- free(cleanup_filename);
- }
- }
- break;
- }
-
- return;
- }
-
-
-/****** install_cleanup ******************************************************
-PROTO void install_cleanup(void (*func)(void))
-PURPOSE Install the signal-catching and exit routines to start cleanup_files().
-INPUT A pointer to a function to be executed on exit.
-OUTPUT -.
-NOTES Catches everything except STOP and KILL signals.
-AUTHOR E. Bertin (IAP)
-VERSION 25/04/2002
- ***/
-void install_cleanup(void (*func)(void))
- {
- void signal_function(int signum);
-
- exit_func = func;
-
- atexit(cleanup_files);
-/* Catch CTRL-Cs */
- signal(SIGINT, signal_function);
-/* Catch bus errors */
- signal(SIGBUS, signal_function);
-/* Catch segmentation faults */
- signal(SIGSEGV, signal_function);
-/* Catch floating exceptions */
- signal(SIGFPE, signal_function);
-
- return;
- }
-
-
-/****** signal_function ******************************************************
-PROTO void signal_function(void)
-PURPOSE The routine called when a signal is catched. Clean up temporary files
- and execute a user-provided function.
-INPUT signal number.
-OUTPUT -.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 25/04/2002
- ***/
-void signal_function(int signum)
- {
- cleanup_files();
- if (exit_func)
- exit_func();
-
- switch(signum)
- {
- case SIGINT:
- fprintf(stderr, "^C\n");
- exit(-1);
- case SIGBUS:
- fprintf(stderr, "bus error\n");
- exit(-1);
- case SIGSEGV:
- fprintf(stderr, "segmentation fault\n");
- exit(-1);
- case SIGFPE:
- fprintf(stderr, "floating exception\n");
- exit(-1);
- default:
- exit(-1);
- }
-
- return;
- }
-
diff --git a/sextractor/src/fits/fitsconv.c b/sextractor/src/fits/fitsconv.c
deleted file mode 100644
index d1f1d38..0000000
--- a/sextractor/src/fits/fitsconv.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- fitsconv.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: functions for converting LDAC FITS catalogs.
-*
-* Last modify: 25/09/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-/****** asc2bin_tab ***********************************************************
-PROTO tabstruct *asc2bin_tab(catstruct *catin, char *tabinname,
- catstruct *catout, char *taboutname)
-PURPOSE Convert an ASCII table to a BINARY table
- which is then stored in a destination catalog.
-INPUT Pointer to the input catalog,
- Name of the input ASCII table,
- Pointer to the output catalog,
- Name of the output binary table.
-OUTPUT RETURN_OK if the ASCII table was transformed, and RETURN_ERROR
- otherwise.
-NOTES This function can be used to stick the binary translation of
- similar ASCII tables.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/09/2004
- ***/
-tabstruct *asc2bin_tab(catstruct *catin, char *tabinname, catstruct *catout,
- char *taboutname)
-
- {
- catstruct *tabcat;
- keystruct *key;
- tabstruct *tabin,*tabout;
- char comment[82], keyword[16], ptr[82];
- h_type htype;
- t_type ttype;
- char *buf, *lptr;
- int i;
-
-/*Convert the table name to a pointer*/
- if (!(tabin = name_to_tab(catin, tabinname, 0)))
- return NULL;
-
-/*Get the original catalog*/
- tabcat = tabin->cat;
-
-/*Create a new binary table*/
- tabout = new_tab(taboutname);
-
-/*Alloc. mem. for the whole ASCII table at once (should not be very large)*/
- QMALLOC(buf, char, tabin->tabsize);
-/*Now read all the elements from the original table*/
- if (open_cat(tabcat, READ_ONLY) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Cannot access ", tabcat->filename);
- QFSEEK(tabcat->file, tabin->bodypos, SEEK_SET, tabcat->filename);
- QFREAD(buf, tabin->tabsize, tabcat->file, tabcat->filename);
- if (close_cat(tabcat) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Problem while closing", tabcat->filename);
- lptr = buf;
- for (i=tabin->tabsize/80; i-- && strncmp(lptr, "END ", 8);)
- {
-/*Interprete the next FITS line */
- if (fitspick(lptr, keyword, ptr, &htype, &ttype, comment) != RETURN_OK) {
- char line[81];
- int qflag=1;
- strncpy(line, lptr, 80);
- line[80] = '\0';
- QFPRINTF(OUTPUT, line);
- warning("*Warning*: incorrect FITS field will be ignored in ",
- tabcat->filename);
- }
- if (htype != H_COMMENT)
- {
-/*----Create a new key and fill it with the right parameters*/
- key = new_key(keyword);
- strcpy(key->comment, comment+strspn(comment, " "));
- key->htype = htype;
- key->ttype = ttype;
- key->nbytes = t_size[ttype];
-/*----!!Temporary (?) solution for STRINGS*/
- if (htype==H_STRING)
- {
- key->naxis = 1;
- QMALLOC(key->naxisn, int, 1);
- key->naxisn[0] = 32;
- key->nbytes *= key->naxisn[0];
- }
- key->nobj = 1;
-/*----Allocate memory and copy data in the same time*/
- QMEMCPY(ptr, key->ptr, char, key->nbytes);
- if (add_key(key, tabout, 0)==RETURN_ERROR)
- {
- sprintf(comment, "%s keyword found twice in ",
- keyword);
- warning(comment, tabcat->filename);
- }
- }
- lptr += 80;
- }
-
- free(buf);
-
- update_tab(tabout);
- return tabout;
- }
-
-
-/****** ttypeconv ************************************************************
-PROTO void ttypeconv(void *ptrin, void *ptrout,
- t_type ttypein, t_type ttypeout)
-PURPOSE Convert data from one type to another.
-INPUT Pointer to element to convert,
- destination pointer to the converted element,
- t_type of the element to convert,
- t_type of the converted element.
-OUTPUT -.
-NOTES ttypeconv does not yet handle arrays.
-AUTHOR E. Bertin (IAP)
-VERSION 25/09/2004
- ***/
-
-void ttypeconv(void *ptrin, void *ptrout, t_type ttypein, t_type ttypeout)
-
- {
- union {char tbyte; short tshort; int tlong; float tfloat;
- double tdouble; char tstring;} ival;
-
-#define OUTCONV(x, y) \
- switch(y) \
- { \
- case T_BYTE: \
- case T_STRING: \
- *((char *)ptrout) = (char)x; \
- break; \
- case T_SHORT: \
- *((short *)ptrout) = (short)x; \
- break; \
- case T_LONG: \
- *((int *)ptrout) = (int)x; \
- break; \
- case T_FLOAT: \
- *((float *)ptrout) = (float)x; \
- break; \
- case T_DOUBLE: \
- *((double *)ptrout) = (double)x; \
- break; \
- default: \
- break; \
- }
-
- switch(ttypein)
- {
- case T_BYTE:
- case T_STRING:
- ival.tbyte = *(char *)ptrin;
- OUTCONV(ival.tbyte, ttypeout);
- break;
- case T_SHORT:
- ival.tshort = *(short *)ptrin;
- OUTCONV(ival.tshort, ttypeout);
- break;
- case T_LONG:
- ival.tlong = *(int *)ptrin;
- OUTCONV(ival.tlong, ttypeout);
- break;
- case T_FLOAT:
- ival.tfloat = *(float *)ptrin;
- OUTCONV(ival.tfloat, ttypeout);
- break;
- case T_DOUBLE:
- ival.tdouble = *(double *)ptrin;
- OUTCONV(ival.tdouble, ttypeout);
- break;
- default:
- break;
- }
-
- return;
- }
-
diff --git a/sextractor/src/fits/fitshead.c b/sextractor/src/fits/fitshead.c
deleted file mode 100644
index 7a3409c..0000000
--- a/sextractor/src/fits/fitshead.c
+++ /dev/null
@@ -1,832 +0,0 @@
-/*
- fitshead.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: general functions for handling FITS file headers.
-*
-* Last modify: 25/09/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-extern char histokeys[][12];
-const int t_size[] = {1, 2, 4, 4, 8, 1}; /* size in bytes per t_type */
-
-/******* get_head *************************************************************
-PROTO int get_head(tabstruct *tab)
-PURPOSE Read a FITS header.
-INPUT Table structure.
-OUTPUT RETURN_OK if a FITS header has been found and loaded, or RETURN_ERROR
- otherwise.
-NOTES The file must be opened, and the file pointer must be located at
- the beginning of a header.
- The headbuf pointer in the catstruct is reallocated.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/02/96
- ***/
-int get_head(tabstruct *tab)
-
- {
- catstruct *cat;
- int i;
- char *buf;
-
- buf = tab->headbuf;
- if (!(cat = tab->cat))
- error(EXIT_FAILURE, "*Internal Error*: Table has no parent catalog","!");
-
- QFREE(buf);
- QMALLOC(buf, char, FBSIZE);
-
-/*Read the first block and check that it is FITS */
- if (!fread(buf, FBSIZE, 1, cat->file))
- {
- QFREE(buf);
- return RETURN_ERROR;
- }
-
- if (strncmp(buf, "SIMPLE ", 8) && strncmp(buf, "XTENSION", 8))
- {
- QFREE(buf);
- return RETURN_ERROR;
- }
-
-/*Find the number of FITS blocks of the header while reading it */
- for (i=1; !fitsnfind(buf,"END ", i); i++)
- {
- QREALLOC(buf, char, FBSIZE*(i+1));
- QFREAD(&buf[FBSIZE*i], FBSIZE, cat->file, cat->filename);
- }
-
- tab->headnblock = i;
- tab->headbuf = buf;
-
- return RETURN_OK;
- }
-
-
-/****** readbasic_head ********************************************************
-PROTO void readbasic_head(tabstruct *tab)
-PURPOSE Read the current FITS header basic keywords.
-INPUT pointer to catstruct.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 25/09/2004
- ***/
-void readbasic_head(tabstruct *tab)
-
- {
- char str[88];
- char key[12], name[16],
- *filename;
- int i;
- KINGSIZE_T tabsize;
-
- filename = (tab->cat? tab->cat->filename : strcpy(name, "internal header"));
-
- if (fitsread(tab->headbuf, "BITPIX ", &tab->bitpix, H_INT, T_LONG)
- ==RETURN_ERROR)
- error(EXIT_FAILURE, "*Error*: Corrupted FITS header in ", filename);
-
- tab->bytepix = tab->bitpix>0?(tab->bitpix/8):(-tab->bitpix/8);
-
- if (fitsread(tab->headbuf, "NAXIS ", &tab->naxis, H_INT, T_LONG)
- ==RETURN_ERROR)
- error(EXIT_FAILURE, "*Error*: Corrupted FITS header in ", filename);
-
- tabsize = 0;
- if (tab->naxis>0)
- {
- QFREE(tab->naxisn);
- QMALLOC(tab->naxisn, int, tab->naxis);
-/*--get the size of the array*/
- tabsize = 1;
- for (i=0; i<tab->naxis && i<999; i++)
- {
- sprintf(key,"NAXIS%-3d", i+1);
- if (fitsread(tab->headbuf, key, &tab->naxisn[i], H_INT, T_LONG)
- ==RETURN_ERROR)
- error(EXIT_FAILURE, "*Error*: incoherent FITS header in ", filename);
- tabsize *= tab->naxisn[i];
- }
- }
-
-/*random groups parameters (optional)*/
- tab->pcount = 0;
- fitsread(tab->headbuf, "PCOUNT ", &tab->pcount, H_INT, T_LONG);
- tab->gcount = 1;
- fitsread(tab->headbuf, "GCOUNT ", &tab->gcount, H_INT, T_LONG);
-
-/*number of fields (only for tables)*/
- tab->tfields = 0;
- fitsread(tab->headbuf, "TFIELDS ", &tab->tfields, H_INT, T_LONG);
-
-/*in case of a non-primary header*/
- tab->xtension[0] = (char)'\0';
- fitsread(tab->headbuf, "XTENSION", tab->xtension, H_STRING, T_STRING);
- tab->extname[0] = (char)'\0';
- fitsread(tab->headbuf, "EXTNAME ", tab->extname, H_STRING, T_STRING);
-
- tab->tabsize = tab->bytepix*tab->gcount*((size_t)tab->pcount+tabsize);
-
-/* Scaling parameters for basic FITS integer arrays */
- tab->bscale = 1.0;
- fitsread(tab->headbuf, "BSCALE ", &tab->bscale, H_FLOAT, T_DOUBLE);
- tab->bzero = 0.0;
- fitsread(tab->headbuf, "BZERO ", &tab->bzero, H_FLOAT, T_DOUBLE);
- tab->blankflag =
- (fitsread(tab->headbuf,"BLANK ",&tab->blank,H_INT,T_LONG) == RETURN_OK)?
- 1 : 0;
-
-/* Custom basic FITS parameters */
- tab->bitsgn = 1;
- fitsread(tab->headbuf, "BITSGN ", &tab->bitsgn, H_INT, T_LONG);
-
- if (fitsread(tab->headbuf, "IMAGECOD", str, H_STRING, T_STRING)==RETURN_OK)
- {
- if (!strcmp(str, "NONE"))
- tab->compress_type = COMPRESS_NONE;
- else if (!strcmp(str, "BASEBYTE"))
- tab->compress_type = COMPRESS_BASEBYTE;
- else if (!strcmp(str, "PREV_PIX"))
- tab->compress_type = COMPRESS_PREVPIX;
- else
- warning("Compression skipped: unknown IMAGECOD parameter:", str);
- }
-
-/* Checksum */
- if (fitsread(tab->headbuf, "DATASUM ", str, H_STRING, T_STRING)==RETURN_OK)
- tab->bodysum = (unsigned int)atoi(str);
-
- return;
- }
-
-
-/******* readbintabparam_head *************************************************
-PROTO int readbintabparam_head(tabstruct *tab)
-PURPOSE Read the current FITS header parameters concerning the binary-table.
-INPUT pointer to tabstruct.
-OUTPUT RETURN_OK if a binary table was found and mapped, RETURN_ERROR
- otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/09/2004
- ***/
-int readbintabparam_head(tabstruct *tab)
-
- {
- catstruct *cat;
- keystruct *key, *prevkey;
- char strf[88], strk[16];
- char *str;
- int naxisn[32];
- int i,j, larray, nfields,narray, pos;
-
- if (!(cat = tab->cat))
- error(EXIT_FAILURE, "*Internal Error*: Table has no parent catalog","!");
-
-/*We are expecting a 2D binary-table, and nothing else*/
- if ((tab->naxis != 2)
- || (tab->bitpix!=8)
- || (tab->tfields == 0)
- || strncmp(tab->xtension, "BINTABLE", 8))
- return RETURN_ERROR;
-
-/*Size and number of lines in the binary table*/
- larray = tab->naxisn[0];
- nfields= tab->nkey = tab->tfields;
- narray = tab->naxisn[1];
-
- prevkey = NULL;
-/*For each of the data fields...*/
- pos = 0;
- for (i=0; i<nfields; i++)
- {
-/*--manage the chaining of keys*/
- QCALLOC(key, keystruct, 1);
- if (prevkey)
- {
- prevkey->nextkey = key;
- key->prevkey = prevkey;
- }
- else
- tab->key = key;
- prevkey = key;
-
-/*--map binary-table fields*/
-
- sprintf(strk, "TTYPE%-3d", i+1);
- if (fitsread(tab->headbuf, strk, key->name, H_STRING, T_STRING)
- != RETURN_OK) {
- error(EXIT_FAILURE,
- "*Error*: Incorrect FITS binary-table header in ", cat->filename);
- }
- fitsread(tab->headbuf, strk, key->comment, H_HCOMMENT, T_STRING);
-
- sprintf(strk, "TUNIT%-3d", i+1);
- fitsread(tab->headbuf, strk, key->unit, H_STRING, T_STRING);
- sprintf(strk, "TDISP%-3d", i+1);
- fitsread(tab->headbuf, strk, key->printf, H_STRING, T_STRING);
- if (*key->printf)
- tdisptoprintf(key->printf, key->printf);
-
- sprintf(strk, "TFORM%-3d", i+1);
- if (fitsread(tab->headbuf, strk, strf, H_STRING, T_STRING) != RETURN_OK) {
- error(EXIT_FAILURE,
- "*Error*: Incorrect FITS binary-table header in ", cat->filename);
- }
- key->pos = pos;
- pos += (key->nbytes = tsizeof(strf));
- key->ttype = ttypeof(strf);
- switch(key->ttype)
- {
- case T_BYTE:
- case T_SHORT:
- case T_LONG:
- key->htype = H_INT;
- break;
- case T_FLOAT:
- case T_DOUBLE:
- key->htype = H_EXPO;
- break;
- case T_STRING:
- key->htype = H_STRING;
- break;
- default:
- error(EXIT_FAILURE, "*Internal Error*: Unkwown T_TYPE for ", str);
- }
-
-/*--handle the special case of multimensional arrays*/
- if ((naxisn[0] = key->nbytes/t_size[key->ttype]) > 1)
- {
- sprintf(strk, "TDIM%-3d", i+1);
- if (fitsread(tab->headbuf, strk, strf, H_STRING, T_STRING) == RETURN_OK)
- {
- str = strf;
- for (j=0; (naxisn[j]=(int)strtol(str+1, &str, 10)); j++);
- key->naxis = j;
- }
- else
- key->naxis = 1;
- QMALLOC(key->naxisn, int, key->naxis);
- for (j=0; j<key->naxis; j++)
- key->naxisn[j] = naxisn[j];
- }
- else
- key->naxis = 0;
-
- key->nobj = narray;
- key->tab = tab;
- }
-
- if (pos != larray)
- error(EXIT_FAILURE,
- "*Error*: Malformed FITS binary-table header in ", cat->filename);
-
-/*make both ends of the chain meet*/
- prevkey->nextkey = tab->key;
- tab->key->prevkey = prevkey;
-
- return RETURN_OK;
- }
-
-
-/****** update_head ***********************************************************
-PROTO int update_head(tabstruct *tab)
-PURPOSE Update a FITS header according to what's in the table.
-INPUT Table structure.
-OUTPUT RETURN_OK if tab is a binary table, or RETURN_ERROR otherwise.
-NOTES The headbuf pointer in the tabstruct might be reallocated.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/09/2004
- ***/
-int update_head(tabstruct *tab)
-
- {
- keystruct *key;
- tabstruct *ctab;
- int i,j,n,naxis1;
- char strk[88], str[88];
- char *buf;
-
-/*Update EXTNAME, the table name */
- if (*tab->extname)
- {
- addkeywordto_head(tab, "EXTNAME ", "EXTENSION NAME");
- fitswrite(tab->headbuf, "EXTNAME ", tab->extname, H_STRING, T_STRING);
- }
-
-/* If not a binary table, do only a few basic things */
- if ((tab->naxis != 2)
- || (tab->bitpix!=8)
- || (tab->tfields == 0)
- || strncmp(tab->xtension, "BINTABLE", 8))
- {
- addkeywordto_head(tab, "BITPIX ", "BITS PER PIXEL");
- fitswrite(tab->headbuf, "BITPIX ", &tab->bitpix, H_INT, T_LONG);
- addkeywordto_head(tab, "NAXIS ", "NUMBER OF AXES");
- fitswrite(tab->headbuf, "NAXIS ", &tab->naxis, H_INT, T_LONG);
- for (i=0; i<tab->naxis; i++)
- {
- sprintf(strk, "NAXIS%-3d", i+1);
- addkeywordto_head(tab, strk, "NUMBER OF ELEMENTS ALONG THIS AXIS");
- fitswrite(tab->headbuf, strk, &tab->naxisn[i], H_INT, T_LONG);
- }
- return RETURN_ERROR;
- }
-
-/*First, remove all existing TTYPE, TFORM, etc...*/
- fitsremove(tab->headbuf, "TTYPE???");
- fitsremove(tab->headbuf, "TFORM???");
- fitsremove(tab->headbuf, "TUNIT???");
- fitsremove(tab->headbuf, "TZERO???");
- fitsremove(tab->headbuf, "TSCAL???");
- fitsremove(tab->headbuf, "TDIM???");
- fitsremove(tab->headbuf, "TDISP???");
-
-
-/*Change NAXIS1 in order to take into account changes in width*/
- naxis1 = 0;
- key = tab->key;
- if (tab->nkey>1000) {
- for (i=0; i<MIN(999,tab->nkey); i++) {
- naxis1 += key->nbytes;
- key = key->nextkey;
- }
- fitswrite(tab->headbuf, "NAXIS1 ", &naxis1, H_INT, T_LONG);
- } else {
- fitswrite(tab->headbuf, "NAXIS1 ", &tab->naxisn[0], H_INT, T_LONG);
- }
-
-/*Change NAXIS1 in the number of fields */
- tab->tfields = MIN(999,tab->tfields);
- fitswrite(tab->headbuf, "TFIELDS ", &tab->tfields, H_INT, T_LONG);
-
-/*Changes in the number of elements (look for possible segments)*/
- for (ctab = tab, n = ctab->naxisn[1];
- (ctab=ctab->nexttab) && !ctab->nseg;)
- n += ctab->naxisn[1];
- fitswrite(tab->headbuf, "NAXIS2 ", &n, H_INT, T_LONG);
-
- key = tab->key;
- if (!key)
- return RETURN_ERROR;
-
- if (tab->nkey>1000)
- warning("Too many output keys, trashing the ones bejond 999", "");
- for (i=0; i<MIN(999,tab->nkey); i++)
- {
- sprintf(strk, "TTYPE%-3d", i+1);
- addkeywordto_head(tab, strk, key->comment);
- fitswrite(tab->headbuf, strk, key->name, H_STRING, T_STRING);
- sprintf(strk, "TFORM%-3d", i+1);
- addkeywordto_head(tab, strk, "");
- tformof(str, key->ttype, key->nbytes/t_size[key->ttype]);
- fitswrite(tab->headbuf, strk, str, H_STRING, T_STRING);
- if (key->naxis>1)
- {
- char *str2, *str2lim;
-
- sprintf(strk, "TDIM%-3d", i+1);
- addkeywordto_head(tab, strk, "");
- sprintf(str, "(");
- str2 = str+1;
- str2lim = str+70; /* Prevent an excessively large string */
- for (n=0; n<key->naxis && str2<str2lim; n++)
- {
- sprintf(str2, n?", %d%n":"%d%n", key->naxisn[n],&j);
- str2 += j;
- }
- sprintf(str2, ")");
- fitswrite(tab->headbuf, strk, str, H_STRING, T_STRING);
- }
- if (*key->unit)
- {
- sprintf(strk, "TUNIT%-3d", i+1);
- addkeywordto_head(tab, strk, "");
- fitswrite(tab->headbuf, strk, key->unit, H_STRING, T_STRING);
- }
- if (*key->printf)
- {
- sprintf(strk, "TDISP%-3d", i+1);
- addkeywordto_head(tab, strk, "");
- fitswrite(tab->headbuf, strk, printftotdisp(key->printf, str),
- H_STRING, T_STRING);
- }
- key = key->nextkey;
- }
-
-/*Finally re-compute CHECKSUM if present */
- if (fitsfind(tab->headbuf, "CHECKSUM")==RETURN_OK)
- {
- unsigned int sum;
-
- if (tab->bodysum)
- {
- sprintf(str, "%u", tab->bodysum);
- fitswrite(tab->headbuf, "DATASUM ", str, H_STRING, T_STRING);
- }
- sum = tab->bodysum;
-/*-- Now the header */
- buf = tab->headbuf;
- for (i=tab->headnblock; i--; buf+=FBSIZE)
- sum = compute_blocksum(buf, sum);
-/*-- Complement to 1 */
- encode_checksum(~sum, str);
- fitswrite(tab->headbuf, "CHECKSUM", str, H_STRING, T_STRING);
- }
-
-/*That may be enough for now; to be continued...*/
-
- return RETURN_OK;
- }
-
-
-/****** prim_head *************************************************************
-PROTO int prim_head(tabstruct *tab)
-PURPOSE Update a FITS header to make it "primary" (not extension)
-INPUT Table structure.
-OUTPUT RETURN_OK if tab header was already primary, or RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/05/2002
- ***/
-int prim_head(tabstruct *tab)
-
- {
- if (!tab->headbuf)
- return RETURN_ERROR;
- if (!strncmp(tab->headbuf, "XTENSION",8))
- {
- strncpy(tab->headbuf, "SIMPLE = T "
- "/ This is a FITS file ", 80);
- return RETURN_ERROR;
- }
- return RETURN_OK;
- }
-
-
-/****** ext_head *************************************************************
-PROTO int ext_head(tabstruct *tab)
-PURPOSE Update a FITS header to make it "extension" (not primary)
-INPUT Table structure.
-OUTPUT RETURN_OK if tab header was already extension, or RETURN_ERROR
- otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/05/2002
- ***/
-int ext_head(tabstruct *tab)
-
- {
- if (!tab->headbuf)
- return RETURN_ERROR;
- if (!strncmp(tab->headbuf, "SIMPLE ",8))
- {
- strncpy(tab->headbuf, "XTENSION= 'IMAGE ' "
- "/ Image extension ", 80);
- return RETURN_ERROR;
- }
-
- return RETURN_OK;
- }
-
-
-/****** addkeyto_head *********************************************************
-PROTO int addkeyto_head(tabstruct *tab, keystruct *key)
-PURPOSE Add a keyword and its value to a table header.
-INPUT Table structure,
- Key containing the keyword and its value.
-OUTPUT Line position in the FITS header.
-NOTES The headbuf pointer in the tabstruct might be reallocated.
- Pre-existing keywords are overwritten (but not their comments).
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 11/05/2002
- ***/
-int addkeyto_head(tabstruct *tab, keystruct *key)
-
- {
- int n;
-
- n = addkeywordto_head(tab, key->name, key->comment);
- fitswrite(tab->headbuf, key->name, key->ptr, key->htype, key->ttype);
-
- return n;
- }
-
-
-/****** addkeywordto_head *****************************************************
-PROTO int addkeywordto_head(tabstruct *tab, char *keyword, char *comment)
-PURPOSE Add a keyword and a comment to a table header.
-INPUT Table structure,
- String containing the keyword,
- String containing the comment.
-OUTPUT Line position in the FITS header.
-NOTES The headbuf pointer in the tabstruct might be reallocated.
- Pre-existing keywords are overwritten (but not their comments).
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 21/04/2003
- ***/
-int addkeywordto_head(tabstruct *tab, char *keyword, char *comment)
-
- {
- int n;
-
- if ((fitsfind(tab->headbuf, keyword) == RETURN_ERROR
- || findkey(keyword, (char *)histokeys, 12)!=RETURN_ERROR)
- && (fitsfind(tab->headbuf, "END ")+1)*80 >= tab->headnblock*FBSIZE)
- {
- tab->headnblock++;
- QREALLOC(tab->headbuf, char, tab->headnblock*FBSIZE);
- memset(tab->headbuf + (tab->headnblock-1)*FBSIZE, ' ', FBSIZE);
- }
-
- n = fitsadd(tab->headbuf, keyword, comment);
-
- return n;
- }
-
-
-/****** tformof ***************************************************************
-PROTO int tformof(char *str, t_type ttype, int n)
-PURPOSE Return the ``TFORM'' string corresponding to a t_type
- and the number of elements.
-INPUT a char pointer (to be filled with the T_FORM string),
- t_type,
- Number of elements.
-OUTPUT RETURN_OK if everything went as expected, or RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/02/96
- ***/
-int tformof(char *str, t_type ttype, int n)
-
- {
- char t;
-
- switch (ttype)
- {
- case T_BYTE: t = 'B';
- break;
- case T_SHORT: t = 'I';
- break;
- case T_LONG: t = 'J';
- break;
- case T_FLOAT: t = 'E';
- break;
- case T_DOUBLE: t = 'D';
- break;
- case T_STRING: t = 'A';
- break;
- default: return RETURN_ERROR;
- }
-
- sprintf(str, "%d%c", n, t);
-
- return RETURN_OK;
- }
-
-
-/****** tsizeof ***************************************************************
-PROTO int tsizeof(char *str)
-PURPOSE Return the size of a binary-table field from its ``TFORM''.
-INPUT TFORM string (see the FITS documentation).
-OUTPUT size in bytes, or RETURN_ERROR if the TFORM is unknown.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/02/96
- ***/
-int tsizeof(char *str)
-
- {
- int n;
- char *str2;
-
- str2 = str;
- if (!(n = strtol(str, &str2, 10)))
- n = 1;
-
- switch ((int)*str2)
- {
- case 'L': case 'B': case 'A': return n;
- case 'X': return (n-1)/8+1;
- case 'I': return 2*n;
- case 'J': case 'E': return 4*n;
- case 'C': case 'D': case 'P': return 8*n;
- case 'M': return 16*n;
- default: return RETURN_ERROR;
- }
-
- }
-
-
-/****** ttypeof ***************************************************************
-PROTO t_type ttypeof(char *str)
-PURPOSE Give the ``t_type'' of a binary-table field from its ``TFORM''.
-INPUT TFORM string (see the FITS documentation).
-OUTPUT size in bytes, or RETURN_ERROR if the TFORM is unknown.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 17/03/2002
- ***/
-t_type ttypeof(char *str)
-
- {
- char *str2;
-
- str2 = str;
- strtol(str, &str2, 10);
- switch ((int)*str2)
- {
- case 'L': case 'B': case 'X': return T_BYTE;
- case 'I': return T_SHORT;
- case 'J': return T_LONG;
- case 'E': return T_FLOAT;
- case 'D': return T_DOUBLE;
- case 'A': return T_STRING;
- default: return (t_type)RETURN_ERROR;
- }
-
- }
-
-
-/****** tdisptoprintf *********************************************************
-PROTO char *tdisptoprintf(char *tdisp, char *str)
-PURPOSE Convert the ``TDISP'' FITS format to the printf() format.
-INPUT TDISP format string (see the FITS documentation),
- output string (allocated pointer).
-OUTPUT printf() format string (see e.g. K&R).
-NOTES The present conversion does not handle binary or engineer notations.
- A NULL vector is returned if the conversion was unsuccessful.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/09/2004
- ***/
-char *tdisptoprintf(char *tdisp, char *str)
-
- {
- char control[4];
- int w,d, n;
-
- w = d = 0;
- n = 0;
- n=sscanf(tdisp,"%[ALIBOZFENSGD]%d.%d", control, &w, &d)-1;
- if (!w)
- {
- warning("Strange TDISP format: ", tdisp);
- return NULL;
- }
- switch ((int)*control)
- {
- case 'A':
- sprintf(str, "%%%dc",w);
- break;
- case 'L':
- sprintf(str, "%%%dd",w);
- break;
- case 'I':
- if (n>1)
- sprintf(str, "%%%d.%dd",w,d);
- else
- sprintf(str, "%%%dd",w);
- break;
- case 'B': case 'Z':
- if (n>1)
- sprintf(str, "%%%d.%dx",w,d);
- else
- sprintf(str, "%%%dx",w);
- break;
- case 'O':
- if (n>1)
- sprintf(str, "%%%d.%do",w,d);
- else
- sprintf(str, "%%%do",w);
- break;
- case 'F':
- if (n>1)
- sprintf(str, "%%%d.%df",w,d);
- else
- sprintf(str, "%%%df",w);
- break;
- case 'E': case 'D':
- if (n>1)
- sprintf(str, "%%%d.%dE",w,d);
- else
- sprintf(str, "%%%dE",w);
- break;
- case 'G':
- if (n>1)
- sprintf(str, "%%%d.%dG",w,d);
- else
- sprintf(str, "%%%dG",w);
- break;
- default:
- warning("Unknown TDISP format: ", tdisp);
- return NULL;
- }
-
- return str;
- }
-
-
-/****** printftotdisp *********************************************************
-PROTO char *printftotdisp(char *tdisp, char *str)
-PURPOSE Convert the printf() format to the ``TDISP'' FITS format.
-INPUT printf() format string (see e.g. K&R),
- output string (allocated pointer).
-OUTPUT TDISP format string (see the FITS documentation).
-NOTES The handling of C string formatting does not include the precision.
- NULL is returned in case of unsucessful conversion.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/09/2004
- ***/
-char *printftotdisp(char *cprintf, char *str)
-
- {
- char *control;
- int w,d,n;
-
- *str = 0;
- w = d = 0;
- if (!(control = strpbrk(cprintf, "cdueERfFgGoOxXs")))
- {
- warning("Unknown printf() format: ", cprintf);
- return NULL;
- }
-
- n = sscanf(cprintf,"%%%d.%d", &w, &d);
- w = abs(w);
- if (!n)
- {
- warning("Unconvertible printf() format: ", cprintf);
- return NULL;
- }
-
- switch ((int)*control)
- {
- case 'c':
- sprintf(str, "A%d",w);
- break;
- case 's':
- sprintf(str, "A%d",w);
- break;
- case 'd': case 'u':
- if (n>1)
- sprintf(str, "I%d.%d",w,d);
- else
- sprintf(str, "I%d",w);
- break;
- case 'o': case 'O':
- if (n>1)
- sprintf(str, "O%d.%d",w,d);
- else
- sprintf(str, "O%d",w);
- break;
- case 'x': case 'X':
- if (n>1)
- sprintf(str, "Z%d.%d",w,d);
- else
- sprintf(str, "Z%d",w);
- break;
- case 'f': case 'F':
- if (n>1)
- sprintf(str, "F%d.%d",w,d);
- else
- sprintf(str, "F%d",w);
- break;
- case 'e': case 'E':
- if (n>1)
- sprintf(str, "E%d.%d",w,d);
- else
- sprintf(str, "E%d",w);
- break;
- case 'g': case 'G':
- if (n>1)
- sprintf(str, "G%d.%d",w,d);
- else
- sprintf(str, "G%d",w);
- break;
- default:
- warning("Unknown printf() format: ", cprintf);
- return NULL;
- }
-
- return str;
- }
-
diff --git a/sextractor/src/fits/fitskey.c b/sextractor/src/fits/fitskey.c
deleted file mode 100644
index 4e1cfa3..0000000
--- a/sextractor/src/fits/fitskey.c
+++ /dev/null
@@ -1,952 +0,0 @@
-/*
- fitskey.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: Functions related to the management of keys.
-*
-* Last modify: 15/08/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-/****** add_key ****************************************************************
-PROTO int add_key(keystruct *key, tabstruct *tab, int pos)
-PURPOSE Copy a key from one table to another.
-INPUT Pointer to the key,
- Pointer to the table,
- Pointer to the destination table,
- Position (1= first, <=0 = at the end)
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES A preexisting key in the destination table yields a RETURN_ERROR.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/03/96
- ***/
-int add_key(keystruct *key, tabstruct *tab, int pos)
-
- {
-
-/*Check if a similar key doesn't already exist in the dest. cat */
- if (name_to_key(tab, key->name))
- return RETURN_ERROR;
-
-/*Update links (portion of code similar to that of copy_key below) */
- if ((key->nextkey = pos_to_key(tab, pos)))
- {
- (key->prevkey = key->nextkey->prevkey)->nextkey = key;
- key->nextkey->prevkey = key;
-/*--the first place has a special meaning*/
- if (pos==1)
- tab->key = key;
- }
- else
-/*There was no no key before*/
- tab->key = key->nextkey = key->prevkey = key;
-
- tab->nkey++;
-
- return RETURN_OK;
- }
-
-
-/****** blank_keys *************************************************************
-PROTO int blank_keys(tabstruct *tab)
-PURPOSE Put the array pointers from all keys in a table to NULL.
-INPUT Pointer to the table.
-OUTPUT RETURN_OK if keys were found, and RETURN_ERROR otherwise.
-Notes: -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/04/97
- ***/
-int blank_keys(tabstruct *tab)
-
- {
- keystruct *key;
- int k;
-
- if (!(key = tab->key))
- return RETURN_ERROR;
-
- for (k=tab->nkey; k--;)
- {
- key->ptr = NULL;
- key = key->nextkey;
- }
-
- return RETURN_OK;
- }
-
-
-/****** copy_key ***************************************************************
-PROTO int copy_key(tabstruct *tabin, char *keyname, tabstruct *tabout, int pos)
-PURPOSE Copy a key from one table to another.
-INPUT Pointer to the original table,
- Name of the key,
- Pointer to the destination table,
- Position (1= first, <=0 = at the end)
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES A preexisting key in the destination table yields a RETURN_ERROR,
- the ptr member is NOT COPIED.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 19/08/96
- ***/
-int copy_key(tabstruct *tabin, char *keyname, tabstruct *tabout, int pos)
-
- {
- keystruct *keyin, *keyout;
-
-/*Convert the key name to a pointer*/
- if (!(keyin = name_to_key(tabin, keyname)))
- return RETURN_ERROR;
-
-/*Check if a similar key doesn't already exist in the dest. cat */
- if (name_to_key(tabout, keyname))
- return RETURN_ERROR;
-
- tabout->nkey++;
-
-/*First, allocate memory and copy data */
- QCALLOC(keyout, keystruct, 1);
- *keyout = *keyin;
- keyout->ptr = NULL;
- if (keyin->naxis)
- QMEMCPY(keyin->naxisn, keyout->naxisn, int, keyin->naxis);
-
-/*Then, update the links */
- if ((keyout->nextkey = pos_to_key(tabout, pos)))
- {
- (keyout->prevkey = keyout->nextkey->prevkey)->nextkey = keyout;
- keyout->nextkey->prevkey = keyout;
-/*--the first place has a special meaning*/
- if (pos==1)
- tabout->key = keyout;
- }
- else
-/*There was no no key before*/
- tabout->key = keyout->nextkey = keyout->prevkey = keyout;
-
- return RETURN_OK;
- }
-
-
-/****** free_key ***************************************************************
-PROTO void free_key(keystruct *key)
-PURPOSE Free memory associated to a key ptr.
-INPUT Pointer to the key.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 19/08/96
- ***/
-void free_key(keystruct *key)
-
- {
- free(key->naxisn);
- free(key->ptr);
- free(key);
-
- return;
- }
-
-
-/****** new_key ****************************************************************
-PROTO keystruct *new_key(char *keyname)
-PURPOSE Create a new key.
-INPUT Name of the key.
-OUTPUT A pointer to the new keystruct.
-NOTES This function is only provided as a counterpart to new_tab() and
- new_cat(): in order to be usable, other key parameters MUST be
- handled by the user.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/03/96
- ***/
-keystruct *new_key(char *keyname)
-
- {
- keystruct *key;
-
- QCALLOC(key, keystruct, 1);
- strcpy(key->name, keyname);
-
- return key;
- }
-
-
-/****** read_key ***************************************************************
-PROTO keystruct *read_key(tabstruct *tab, char *keyname)
-PURPOSE Read one simple column from a FITS binary table.
-INPUT pointer to the table,
- name of the key,
-OUTPUT A pointer to the relevant key, or NULL if the desired key is not
- found in the table.
-NOTES If key->ptr is not NULL, the function doesn't do anything.
-AUTHOR E. Bertin (IAP & Leiden observatory)
- E.R. Deul (Sterrewacht Leiden) (Added open_cat error checking)
-VERSION 18/02/2000
- ***/
-keystruct *read_key(tabstruct *tab, char *keyname)
-
- {
- catstruct *cat;
- keystruct *key;
- char *buf, *ptr, *fptr,*fptr0;
- int i,j, larray,narray,size;
- int esize;
-
- if (!(key = name_to_key(tab, keyname)))
- return NULL;
-
-/*If ptr is not NULL, there is already something loaded there: let's free mem */
- QFREE(key->ptr);
-
-/*!! It is not necessarily the original table */
- tab = key->tab;
- cat = tab->cat;
-
-/*We are expecting a 2D binary-table, and nothing else*/
- if ((tab->naxis != 2)
- || (tab->bitpix!=8)
- || (tab->tfields == 0)
- || strncmp(tab->xtension, "BINTABLE", 8))
- error(EXIT_FAILURE, "*Error*: No binary table in ", cat->filename);
-
-/*Size and number of lines in the binary table*/
- larray = tab->naxisn[0];
- narray = tab->naxisn[1];
-
-/*Positioning to the first element*/
- if (open_cat(cat, READ_ONLY) == RETURN_ERROR)
- error(EXIT_FAILURE, "*Error*: opening catalog ",cat->filename);
- QFSEEK(cat->file, tab->bodypos , SEEK_SET, cat->filename);
-
-/*allocate memory for the buffer where we put one line of data*/
- QMALLOC(buf, char, larray);
-
- fptr0 = buf+key->pos;
- size = key->nbytes;
-
-/*allocate memory for the array*/
- QMALLOC(ptr, char, size*narray);
- key->ptr = ptr;
-
-/*read line by line*/
- for (i=narray; i--;)
- {
- QFREAD(buf, larray, cat->file, cat->filename);
- fptr = fptr0;
- if (bswapflag)
- {
- esize = t_size[key->ttype];
- swapbytes(fptr0, esize, size/esize);
- }
- for (j = size; j--;)
- *(ptr++) = *(fptr++);
- }
-
- free(buf);
- return key;
- }
-
-
-/****** read_keys **************************************************************
-PURPOSE Read several columns from a FITS binary table.
-INPUT pointer to the table,
- pointer to an array of char *,
- pointer to an array of keystruct * (memory must have been allocated),
- number of keys to read,
- an optional mask pointer.
-OUTPUT -.
-NOTES The array of pointers pointed by keys is filled with pointers
- to the relevant keys (a NULL means NO key with such name was found).
- A NULL keys pointer can be given (no info returned of course).
- A NULL keynames pointer means read ALL keys belonging to the table.
- A NULL mask pointer means NO selection for reading.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 18/02/2000
- ***/
-void read_keys(tabstruct *tab, char **keynames, keystruct **keys, int nkeys,
- BYTE *mask)
-
- {
- catstruct *cat;
- keystruct *key, **ckeys;
- BYTE *mask2;
- char *buf, *ptr, *fptr;
- int i,j,k,n, larray,narray, nb, kflag = 0, size;
- int esize;
-
-/*!! It is not necessarily the original table */
- tab = tab->key->tab;
- cat = tab->cat;
-
-/*We are expecting a 2D binary-table, and nothing else*/
- if ((tab->naxis != 2)
- || (tab->bitpix!=8)
- || (tab->tfields == 0)
- || strncmp(tab->xtension, "BINTABLE", 8))
- error(EXIT_FAILURE, "*Error*: No binary table in ", cat->filename);
-
-/*Size and number of lines in the binary table*/
- larray = tab->naxisn[0];
- narray = tab->naxisn[1];
-
- nb = 0;
- if ((mask2 = mask))
- {
- for (i=narray; i--;)
- if (*(mask2++))
- nb++;
- }
-
- if (!keynames)
- nkeys = tab->nkey;
-
-/*Allocate memory to store the list of keys to be read */
- if (!keys)
- {
- QMALLOC(keys, keystruct *, nkeys);
- kflag = 1;
- }
-
-/*allocate memory for the arrays*/
- ckeys = keys;
- if (keynames)
- for (i=nkeys; i--;)
- {
- if ((key = name_to_key(tab, *(keynames++))))
- {
- QFREE(key->ptr);
- if (nb)
- key->nobj = nb;
- else
- nb=key->nobj;
- QMALLOC(key->ptr, char, key->nbytes*nb);
- *(ckeys++) = key;
- }
- else
- *(ckeys++) = NULL;
- }
- else
- {
- key = tab->key;
- for (i=nkeys; i--;)
- {
- QFREE(key->ptr);
- if (nb)
- key->nobj = nb;
- else
- nb=key->nobj;
- QMALLOC(key->ptr, char, key->nbytes*nb);
- *(ckeys++) = key;
- key = key->nextkey;
- }
- }
-
-/*allocate memory for the buffer where we put one line of data*/
- QMALLOC(buf, char, larray);
-
-/*Positioning to the first element*/
- open_cat(cat, READ_ONLY);
- QFSEEK(cat->file, tab->bodypos , SEEK_SET, cat->filename);
-
-/*read line by line*/
- n = 0;
- mask2 = mask;
- for (i=narray; i--;)
- {
- QFREAD(buf, larray, cat->file, cat->filename);
- if (!mask || *(mask2++))
- {
- ckeys = keys;
- for (j=nkeys; j--;)
- if ((key = *(ckeys++)))
- {
- fptr = buf+key->pos;
- ptr = (char *)key->ptr+n*(size=key->nbytes);
- if (bswapflag)
- {
- esize = t_size[key->ttype];
- swapbytes(fptr, esize, size/esize);
- }
- for (k = size; k--;)
- *(ptr++) = *(fptr++);
- }
- n++;
- }
- }
-
- free(buf);
- if (kflag)
- free(keys);
-
- return;
- }
-
-/****** remove_key *************************************************************
-PROTO int remove_key(tabstruct *tab, char *keyname)
-PURPOSE Remove a key from a table.
-INPUT Pointer to the table,
- Name of the key.
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES If keyname = "", the last key from the list is removed.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/01/97
- ***/
-int remove_key(tabstruct *tab, char *keyname)
-
- {
- keystruct *key, *prevkey, *nextkey;
-
- if (!keyname || !tab->nkey || !tab->key)
- return RETURN_ERROR;
-
- if (keyname[0])
- {
-/*--Convert the key name to a pointer*/
- if (!(key = name_to_key(tab, keyname)))
- return RETURN_ERROR;
- }
- else
- key = tab->key->prevkey;
-
- prevkey = key->prevkey;
-/*Free memory*/
- nextkey = key->nextkey;
- if (tab->key==key)
- tab->key = nextkey;
- free_key(key);
-
- if (--tab->nkey)
- {
-/*--update the links of neighbours*/
- nextkey->prevkey = prevkey;
- prevkey->nextkey = nextkey;
- }
- else
- tab->key = NULL;
-
- return RETURN_OK;
- }
-
-
-/****** remove_keys ************************************************************
-PROTO int remove_keys(tabstruct *tab)
-PURPOSE Remove all keys from a table.
-INPUT Pointer to the table.
-OUTPUT RETURN_OK if keys were found, and RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 13/03/99
- ***/
-int remove_keys(tabstruct *tab)
-
- {
- int k;
-
- if (!tab->key)
- return RETURN_ERROR;
-
- for (k=tab->nkey; k--;)
- remove_key(tab, "");
-
- return RETURN_OK;
- }
-
-
-/****** name_to_key ************************************************************
-PROTO keystruct *name_to_key(tabstruct *tab, char *keyname)
-PURPOSE Name search of a key in a table.
-INPUT Pointer to the table,
- Key name.
-OUTPUT The key pointer if the name was matched, and NULL otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/04/97
- ***/
-keystruct *name_to_key(tabstruct *tab, char *keyname)
-
- {
- keystruct *key;
- int i;
-
- if (!(key=tab->key))
- return NULL;
-
- for (i=tab->nkey; strcmp(keyname, key->name) && i--; key=key->nextkey);
-
- return i<0? NULL:key;
- }
-
-/****** keys_list **************************************************************
-PROTO char **keys_list(catstruct *tab, int *n)
-PURPOSE List all keys in a table.
-INPUT Pointer to the table,
- Pointer to the number of names in that list.
-OUTPUT A list of all key names.
-NOTES -.
-AUTHOR E.R. Deul (Leiden observatory)
-VERSION ??/??/96
- ***/
-char **keys_list(tabstruct *tab, int *n)
-
- {
- keystruct *key;
- int i;
- char **names;
-
- QCALLOC(names, char *, tab->nkey);
- key = tab->key;
- for (i=0; i<tab->nkey; i++) {
- QCALLOC(names[i], char, MAXCHARS);
- strcpy(names[i],key->name);
- key = key->nextkey;
- }
- *n = tab->nkey;
- return names;
- }
-
-
-/****** pos_to_key *************************************************************
-PROTO keystruct *pos_to_key(tabstruct *tab, int pos)
-PURPOSE Position search of a key in a table.
-INPUT Pointer to the table,
- Position of the key.
-OUTPUT The key pointer if a key exists at the given position, and the
- pointer to the first key otherwise.
-NOTES pos = 0 or 1 means the first key.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 20/03/96
- ***/
-keystruct *pos_to_key(tabstruct *tab, int pos)
-
- {
- keystruct *key;
- int i;
-
- if (!(key=tab->key))
- return NULL;
-
- if ((pos--)==1)
- return tab->key;
-
- for (i=0; i!=pos && i<tab->nkey; i++, key=key->nextkey);
-
- return i<tab->nkey?key:tab->key;
- }
-
-
-/****** show_keys **************************************************************
-PROTO void show_keys(tabstruct *tab, char **keynames,
- keystruct **keys, int nkeys,
- BYTE *mask, FILE *stream,
- int strflag, int banflag, int leadflag,
- output_type o_type)
-PURPOSE Convert a binary table to an ASCII file.
-INPUT pointer to the table,
- pointer to an array of char *,
- pointer to an array of keystruct * (memory must have been allocated),
- number of keys to read,
- an optional mask pointer,
- a stream,
- a flag to indicate if arrays should be displayed (0=NO),
- a flag to indicate if a banner with keynames should be added (0=NO).
- a flag to indicate if a leading row number should be added (0=NO).
- the output type
-OUTPUT -.
-NOTES This is approximately the same code as for read_keys.
- The array of pointers pointed by keys is filled with pointers
- to the relevant keys (a NULL means NO key with such name was found).
- A NULL keys pointer can be given (no info returned of course).
- A NULL keynames pointer means read ALL keys belonging to the table.
- A NULL mask pointer means NO selection for reading.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/08/2003
- ***/
-void show_keys(tabstruct *tab, char **keynames, keystruct **keys, int nkeys,
- BYTE *mask, FILE *stream,
- int strflag, int banflag, int leadflag, output_type o_type)
-
- {
- catstruct *cat;
- keystruct *key, **ckeys;
- BYTE *mask2;
- char *buf, *rfield, *ptr;
- int i,j,k,n,c, larray,narray, nb, kflag, maxnbytes, nelem,
- esize, *key_col;
- typedef struct structreq_keyname
- {
- char oldname[80]; /* Name of the original pipeline key */
- char newname[80]; /* Name of the skycat required key */
- } req_keynamestruct;
-
- req_keynamestruct objectmap[] =
- {
- {"SeqNr", "id"},
- {"Ra", "ra"},
- {"Dec", "dec"},
- {"MAG_ISO", "Mag"},
- {"", ""}
- };
- req_keynamestruct *map;
-
- char skycathead[] = "QueryResult\n\n"
- "# Config entry for original catalog server:\n"
- "serv_type: catalog\n"
- "long_name: ldactoskycat catalog\n"
- "short_name: ldactoaskycat\n"
- "symbol: id circle %4.1f\n"
- "search_cols: mag {Brightest (min)} {Faintest (max)}\n"
- "# End config entry\n\n";
-
- char *t, skycattail[] = "";
-
-
-/* !! It is not necessarily the original table */
- if (tab->key)
- tab = tab->key->tab;
- cat = tab->cat;
-
-/* We are expecting a 2D binary-table, and nothing else */
- if ((tab->naxis != 2)
- || (tab->bitpix!=8)
- || (tab->tfields == 0)
- || strncmp(tab->xtension, "BINTABLE", 8))
- error(EXIT_FAILURE, "*Error*: Not a binary table in ", cat->filename);
-
-/* Size and number of lines in the binary table */
- larray = tab->naxisn[0];
- narray = tab->naxisn[1];
-
- nb = 0;
- if ((mask2 = mask))
- {
- for (i=narray; i--;)
- if (*(mask2++))
- nb++;
- }
-
- if (!keynames)
- nkeys = tab->nkey;
- QCALLOC(key_col, int, nkeys);
- if (keynames) {
- for (i=0;i<nkeys;i++)
- if ((t=strchr(keynames[i], ')'))!=NULL) {
- *t='\0';
- t=strchr(keynames[i], '(');
- *t='\0';
- key_col[i] = atoi(++t);
- }
- }
-/* Allocate memory to store the list of keys to be read */
- kflag = 0;
- if (!keys)
- {
- QMALLOC(keys, keystruct *, nkeys);
- kflag = 1;
- }
-
- n=1;
- switch (o_type) {
- case SHOW_ASCII:
- if (leadflag)
- fprintf(stream, "# %3d %-15.15s %.47s\n", n++,
- "(row_pos)", "running row");
- break;
- case SHOW_SKYCAT:
- fprintf(stream, skycathead, 6.0);
- break;
- }
-
-/* Allocate memory for the arrays */
- maxnbytes = 0;
- ckeys = keys;
- if (keynames)
- for (i=nkeys; i--;)
- {
- if ((key = name_to_key(tab, *(keynames++))))
- {
- for (map=objectmap; map->oldname[0]&&o_type == SHOW_SKYCAT; map++) {
- if (strcmp(key->name, map->oldname) == 0) {
- strcpy(key->name, map->newname);
- }
- }
- *(ckeys++) = key;
- switch (o_type) {
- case SHOW_ASCII:
- if (banflag)
- {
- if (*key->unit)
- fprintf(stream, "# %3d %-19.19s %-47.47s [%s]\n",
- n, key->name,key->comment, key->unit);
- else
- fprintf(stream, "# %3d %-19.19s %.47s\n",
- n, key->name,key->comment);
- n += key->nbytes/t_size[key->ttype];
- }
- break;
- case SHOW_SKYCAT:
- if (key->nbytes/t_size[key->ttype] > 1)
- for (j=0;j<key->nbytes/t_size[key->ttype];j++)
- fprintf(stream, "%s(%d)\t", key->name,j+1);
- else
- fprintf(stream, "%s\t", key->name);
- break;
- }
- if (key->nbytes>maxnbytes)
- maxnbytes = key->nbytes;
- }
- else
- *(ckeys++) = NULL;
- }
- else
- {
- key = tab->key;
- for (i=nkeys; i--; key = key->nextkey)
- if (strflag || key->naxis==0)
- {
- for (map=objectmap; map->oldname[0]&&o_type == SHOW_SKYCAT; map++) {
- if (strcmp(key->name, map->oldname) == 0) {
- strcpy(key->name, map->newname);
- }
- }
- *(ckeys++) = key;
- switch (o_type) {
- case SHOW_ASCII:
- if (banflag)
- {
- if (*key->unit)
- fprintf(stream, "# %3d %-19.19s %-47.47s [%s]\n",
- n, key->name,key->comment, key->unit);
- else
- fprintf(stream, "# %3d %-19.19s %.47s\n",
- n, key->name,key->comment);
- n += key->nbytes/t_size[key->ttype];
- }
- break;
- case SHOW_SKYCAT:
- if (key->nbytes/t_size[key->ttype] > 1)
- for (j=0;j<key->nbytes/t_size[key->ttype];j++)
- fprintf(stream, "%s(%d)\t", key->name,j+1);
- else
- fprintf(stream, "%s\t", key->name);
- break;
- }
- if (key->nbytes>maxnbytes)
- maxnbytes = key->nbytes;
- }
- else
- {
- switch (o_type) {
- case SHOW_ASCII:
- if (*key->unit)
- fprintf(stream, "# %-19.19s %-47.47s [%s]\n",
- key->name,key->comment, key->unit);
- else
- fprintf(stream, "# %-19.19s %.47s\n",
- key->name,key->comment);
- break;
- case SHOW_SKYCAT:
- break;
- }
- *(ckeys++) = NULL;
- }
- }
- if (o_type == SHOW_SKYCAT)
- fprintf(stream, "\n------------------\n");
-
-/* Allocate memory for the buffer where we put one line of data */
- QMALLOC(buf, char, larray);
-
-/* Allocate memory for the buffer where we put one element */
- QMALLOC(rfield, char, maxnbytes);
-
-/* Positioning to the first element */
- open_cat(cat, READ_ONLY);
- QFSEEK(cat->file, tab->bodypos , SEEK_SET, cat->filename);
-
-/*read line by line*/
- n = 0;
- mask2 = mask;
- for (i=narray; i--;)
- {
- QFREAD(buf, larray, cat->file, cat->filename);
- if (!mask || *(mask2++))
- {
- ckeys = keys;
- if (leadflag)
- {
- fprintf(stream, "%d", ++n);
- if (nkeys)
- putc(' ', stream);
- }
- for (k=0; k<nkeys; k++)
- {
- if ((key = *(ckeys++)) && (strflag || key->naxis==0))
- {
- ptr = memcpy(rfield, buf+key->pos, key->nbytes);
- esize = t_size[key->ttype];
- nelem = key->nbytes/esize;
- if (bswapflag)
- swapbytes(ptr, esize, nelem);
- switch(key->ttype)
- {
- case T_SHORT:
- for (j = 0; j<nelem; j++, ptr += esize)
- {
- if (key_col[k] == 0 || key_col[k] == j+1) {
- fprintf(stream, *key->printf?key->printf:"%d",
- *(short *)ptr);
- if (j < nelem-1) {
- switch (o_type) {
- case SHOW_ASCII:
- putc(' ', stream);
- break;
- case SHOW_SKYCAT:
- putc('\t', stream);
- break;
- }
- }
- }
- }
- break;
-
- case T_LONG:
- for (j = 0; j<nelem; j++,ptr += esize)
- {
- if (key_col[k] == 0 || key_col[k] == j+1) {
- fprintf(stream, *key->printf?key->printf:"%d",
- *(int *)ptr);
- if (j < nelem-1) {
- switch (o_type) {
- case SHOW_ASCII:
- putc(' ', stream);
- break;
- case SHOW_SKYCAT:
- putc('\t', stream);
- break;
- }
- }
- }
- }
- break;
-
- case T_FLOAT:
- for (j = 0; j<nelem; j++,ptr += esize)
- {
- if (key_col[k] == 0 || key_col[k] == j+1) {
- fprintf(stream, *key->printf?key->printf:"%g",
- *(float *)ptr);
- if (j < nelem-1) {
- switch (o_type) {
- case SHOW_ASCII:
- putc(' ', stream);
- break;
- case SHOW_SKYCAT:
- putc('\t', stream);
- break;
- }
- }
- }
- }
- break;
-
- case T_DOUBLE:
- for (j = 0; j<nelem; j++,ptr += esize)
- {
- if (key_col[k] == 0 || key_col[k] == j+1) {
- fprintf(stream, *key->printf?key->printf:"%f",
- *(double *)ptr);
- if (j < nelem-1) {
- switch (o_type) {
- case SHOW_ASCII:
- putc(' ', stream);
- break;
- case SHOW_SKYCAT:
- putc('\t', stream);
- break;
- }
- }
- }
- }
- break;
-
- case T_BYTE:
- if (key->htype==H_BOOL)
- for (j = 0; j<nelem; j++,ptr += esize)
- {
- if (key_col[k] == 0 || key_col[k] == j+1) {
- if (*(char *)ptr)
- fprintf(stream, "T");
- else
- fprintf(stream, "F");
- }
- }
- else
- for (j = 0; j<nelem; j++,ptr += esize)
- {
- if (key_col[k] == 0 || key_col[k] == j+1) {
- fprintf(stream, *key->printf?key->printf:"%d",
- (int)*((unsigned char *)ptr));
- if (j) {
- switch (o_type) {
- case SHOW_ASCII:
- putc(' ', stream);
- break;
- case SHOW_SKYCAT:
- putc('\t', stream);
- break;
- }
- }
- }
- }
- break;
-
- case T_STRING:
- for (j = nelem; j-- && (c=(int)*ptr); ptr += esize)
- fprintf(stream, "%c", c);
- break;
-
- default:
- error(EXIT_FAILURE, "*FATAL ERROR*: Unknown FITS type in ",
- "show_keys()");
- break;
- }
- if (k < nkeys - 1) {
- switch (o_type) {
- case SHOW_ASCII:
- putc(' ', stream);
- break;
- case SHOW_SKYCAT:
- putc('\t', stream);
- break;
- }
- }
- }
- }
- putc('\n', stream);
- }
- }
- free(key_col);
- free(buf);
- if (kflag)
- free(keys);
- if (o_type == SHOW_SKYCAT)
- fprintf(stream, skycattail);
- return;
- }
-
diff --git a/sextractor/src/fits/fitsmisc.c b/sextractor/src/fits/fitsmisc.c
deleted file mode 100644
index 44ae3e6..0000000
--- a/sextractor/src/fits/fitsmisc.c
+++ /dev/null
@@ -1,236 +0,0 @@
- /*
- fitsmisc.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: miscellaneous functions.
-*
-* Last modify: 14/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-static void (*errorfunc)(char *msg1, char *msg2) = NULL;
-static char warning_historystr[WARNING_NMAX][192]={""};
-static int nwarning = 0, nwarning_history = 0, nerror = 0;
-
-/********************************* error ************************************/
-/*
-I hope it will never be used!
-*/
-void error(int num, char *msg1, char *msg2)
- {
- fprintf(stderr, "\n> %s%s\n\n",msg1,msg2);
- if (num && errorfunc && !nerror)
- {
- nerror = 1;
- errorfunc(msg1, msg2);
- }
- exit(num);
- }
-
-
-/**************************** error_installfunc *****************************/
-/*
-I hope it will never be used!
-*/
-void error_installfunc(void (*func)(char *msg1, char *msg2))
- {
- if (func)
- errorfunc = func;
-
- return;
- }
-
-
-/********************************* warning **********************************/
-/*
-Print a warning message on screen.
-*/
-void warning(char *msg1, char *msg2)
- {
- time_t warntime;
- struct tm *tm;
-
- warntime = time(NULL);
- tm = localtime(&warntime);
-
- fprintf(stderr, "\n> WARNING: %s%s\n\n",msg1,msg2);
- sprintf(warning_historystr[(nwarning++)%WARNING_NMAX],
- "%04d-%02d-%02d %02d:%02d:%02d : %.80s%.80s",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
- msg1, msg2);
-
-
- return;
- }
-
-
-/****************************** warning_history ******************************/
-/*
-Return warning.
-*/
-char *warning_history(void)
- {
- char *str;
-
- if (nwarning_history >= WARNING_NMAX)
- {
- nwarning_history = 0; /* So it can be accessed later on */
- return "";
- }
-
- str = warning_historystr[((nwarning>WARNING_NMAX? (nwarning%WARNING_NMAX):0)
- + nwarning_history++)%WARNING_NMAX];
- if (!*str)
- nwarning_history = 0; /* So it can be accessed later on */
-
- return str;
- }
-
-
-/******************************* swapbytes **********************************/
-/*
-Swap bytes for doubles, longs and shorts (for DEC machines or PC for inst.).
-*/
-void swapbytes(void *ptr, int nb, int n)
- {
- char *cp;
- int j;
-
- cp = (char *)ptr;
-
- if (nb&4)
- {
- for (j=n; j--; cp+=4)
- {
- cp[0] ^= (cp[3]^=(cp[0]^=cp[3]));
- cp[1] ^= (cp[2]^=(cp[1]^=cp[2]));
- }
- return;
- }
-
- if (nb&2)
- {
- for (j=n; j--; cp+=2)
- cp[0] ^= (cp[1]^=(cp[0]^=cp[1]));
- return;
- }
-
- if (nb&1)
- return;
-
- if (nb&8)
- {
- for (j=n; j--; cp+=8)
- {
- cp[0] ^= (cp[7]^=(cp[0]^=cp[7]));
- cp[1] ^= (cp[6]^=(cp[1]^=cp[6]));
- cp[2] ^= (cp[5]^=(cp[2]^=cp[5]));
- cp[3] ^= (cp[4]^=(cp[3]^=cp[4]));
- }
- return;
- }
-
- error(EXIT_FAILURE, "*Internal Error*: Unknown size in ", "swapbytes()");
-
- return;
- }
-
-
-/****** wstrncmp ***************************************************************
-PROTO int wstrncmp(char *cs, char *ct, int n)
-PURPOSE simple wildcard strcmp.
-INPUT character string 1,
- character string 2,
- maximum number of characters to be compared.
-OUTPUT comparison integer (same meaning as strcmp).
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/02/96
- ***/
-int wstrncmp(char *cs, char *ct, int n)
-
- {
- int diff,i;
-
- i = n;
- diff = 0;
- do
- {
- diff = ((*cs=='?'&&*ct)||(*ct=='?'&&*cs))?0:*cs-*ct;
- } while (!diff && --i && *(cs++) && *(ct++));
-
- return diff;
- }
-
-
-/****** findkey ****************************************************************
-PROTO int findkey(char *str, char *key, int size)
-PURPOSE Find an item within a list of keywords.
-INPUT character string,
- an array of character strings containing the list of keywords,
- offset (in char) between each keyword.
-OUTPUT position in the list (0 = first) if keyword matched,
- RETURN_ERROR otherwise.
-NOTES the matching is case-sensitive.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/02/96
- ***/
-int findkey(char *str, char *key, int size)
-
- {
- int i;
-
- for (i=0; key[0]; i++, key += size)
- if (!strcmp(str, key))
- return i;
-
- return RETURN_ERROR;
- }
-
-
-/********************************* findnkey **********************************
-PROTO int findnkey(char *str, char *key, int size, int nkey)
-PURPOSE Find an item within a list of nkey keywords.
-INPUT character string,
- an array of character strings containing the list of keywords,
- offset (in char) between each keyword.
- number of keywords.
-OUTPUT position in the list (0 = first) if keyword matched,
- RETURN_ERROR otherwise.
-NOTES the matching is case-sensitive.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/02/96
- ***/
-int findnkey(char *str, char *key, int size, int nkey)
-
- {
- int i;
-
- for (i=0; i<nkey; i++, key += size)
- if (!strcmp(str, key))
- return i;
-
- return RETURN_ERROR;
- }
-
-
diff --git a/sextractor/src/fits/fitsread.c b/sextractor/src/fits/fitsread.c
deleted file mode 100644
index a6f67ba..0000000
--- a/sextractor/src/fits/fitsread.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- fitsread.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: low-level functions for reading LDAC FITS catalogs.
-*
-* Last modify: 26/09/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-char padbuf[FBSIZE];
-
-/****** read_cat ***************************************************************
-PROTO catstruct read_cat(char *filename)
-PURPOSE ``Read'' a FITS catalog with name filename.
-INPUT Filename,
-OUTPUT catstruct pointer.
-NOTES Returns NULL if no file with name \<filename\> is found.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 07/05/2002
- ***/
-catstruct *read_cat(char *filename)
-
- {
- catstruct *cat;
-
- if (!(cat = new_cat(1)))
- error (EXIT_FAILURE, "Not enough memory to read ", filename);
-
- strcpy(cat->filename, filename);
- if (open_cat(cat, READ_ONLY) != RETURN_OK)
- {
- free_cat(&cat, 1);
- return NULL;
- }
-
- if (map_cat(cat) != RETURN_OK)
- {
- free_cat(&cat, 1);
- return NULL;
- }
-
- return cat;
- }
-
-
-/****** read_cats **************************************************************
-PROTO read_cats(char **filenames, int ncat)
-PURPOSE ``Read'' several FITS catalogs.
-INPUT A pointer to pointers of char,
- The number of catalogs.
-OUTPUT catstruct pointer.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/04/97
- ***/
-catstruct *read_cats(char **filenames, int ncat)
-
- {
- catstruct *cat, *ccat;
- int i;
-
- if (!(cat = new_cat(ncat)))
- error (EXIT_FAILURE, "Not enough memory to read ", "catalogs");
-
- for (i=ncat, ccat = cat; i--; ccat++, filenames++)
- {
- strcpy(ccat->filename, *filenames);
- if (open_cat(ccat, READ_ONLY) != RETURN_OK)
- error (EXIT_FAILURE, "Cannot open ", *filenames);
- if (map_cat(ccat) != RETURN_OK)
- error (EXIT_FAILURE, "Cannot map ", *filenames);
- close_cat(ccat);
- }
-
- return cat;
- }
-
-
-/****** init_readobj **********************************************************
-PROTO tabstruct *init_readobj(tabstruct *tab, char **pbuf)
-PURPOSE Prepare the reading of individual sources in a FITS table
-INPUT Table structure,
- pointer to an array pointer to be used as a temporary buffer.
-OUTPUT Pointer to the table structure from which the data will be read.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-tabstruct *init_readobj(tabstruct *tab, char **pbuf)
-
- {
- catstruct *tabcat;
- tabstruct *keytab;
- keystruct *key;
- int k;
-
-/* Scan keys to find the reference tab and other things*/
- keytab = NULL;
- tabcat = NULL;
- key = tab->key;
- for (k=tab->nkey; k--; key = key->nextkey)
- if (!key->ptr)
- {
- keytab = key->tab;
- tabcat = keytab->cat;
- QMALLOC(key->ptr, char, key->nbytes);
- }
- else
- key->pos = -1;
-
- if (!keytab)
- error(EXIT_FAILURE,"*Error*: no original table found among keys in table ",
- tab->extname);
-
- if (open_cat(tabcat, READ_ONLY) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Cannot access ", tabcat->filename);
- QFSEEK(tabcat->file, keytab->bodypos, SEEK_SET, tabcat->filename);
-
-/* Allocate memory for the input buffer */
- QMALLOC(*pbuf, char, tab->naxisn[0]);
-
- return keytab;
- }
-
-
-/****** read_obj **************************************************************
-PROTO int read_obj(tabstruct *keytab, tabstruct *tab, char *buf)
-PURPOSE Read one individual source at the current position in a FITS table.
-INPUT Table which will be accessed from disk (provided by init_readobj()),
- table containing the keys that will be read,
- pointer to the temporary buffer.
-OUTPUT The number of table lines that remain to be read.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-int read_obj(tabstruct *keytab, tabstruct *tab, char *buf)
-
- {
- keystruct *key;
- char *pin, *pout;
- int b,k;
- int esize;
-
- QFREAD(buf,keytab->naxisn[0],keytab->cat->file,keytab->cat->filename);
- key = tab->key;
- for (k=tab->nkey; k--; key = key->nextkey)
- if (key->pos>=0)
- {
- pin = buf+key->pos;
- pout = key->ptr;
- if (bswapflag)
- {
- esize = t_size[key->ttype];
- swapbytes(pin, esize, key->nbytes/esize);
- }
- for (b=key->nbytes; b--;)
- *(pout++) = *(pin++);
- }
-
- return --keytab->naxisn[1];
- }
-
-
-/****** read_obj_at ***********************************************************
-PROTO int read_obj_at(tabstruct *keytab, tabstruct *tab, char *buf, long pos)
-PURPOSE Get one source at a specific position in a FITS table.
-INPUT Table which will be accessed from disk (provided by init_readobj()),
- table containing the keys that will be read.
- pointer to the temporary buffer,
- position number in table.
-OUTPUT RETURN_OK if the object has been accessed, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-int read_obj_at(tabstruct *keytab, tabstruct *tab, char *buf, long pos)
-
- {
- keystruct *key;
- char *pin, *pout;
- size_t n;
- int b,k;
- int esize;
-
- if ((n=keytab->naxisn[0]*pos) >= keytab->tabsize)
- return RETURN_ERROR;
- QFSEEK(keytab->cat->file,keytab->bodypos+n, SEEK_SET, keytab->cat->filename);
- QFREAD(buf,keytab->naxisn[0],keytab->cat->file,keytab->cat->filename);
- key = tab->key;
- for (k=tab->nkey; k--; key = key->nextkey)
- if (key->pos>=0)
- {
- pin = buf+key->pos;
- pout = key->ptr;
- if (bswapflag)
- {
- esize = t_size[key->ttype];
- swapbytes(pin, esize, key->nbytes/esize);
- }
- for (b=key->nbytes; b--;)
- *(pout++) = *(pin++);
- }
-
- return RETURN_OK;
- }
-
-
-/****** end_readobj **********************************************************
-PROTO void end_readobj(tabstruct *keytab, tabstruct *tab, char *buf)
-PURPOSE End the writing of individual sources in a FITS table
-INPUT Table which will be accessed from disk (provided by init_readobj()),
- table containing the keys that have been read,
- pointer to the temporary buffer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-void end_readobj(tabstruct *keytab, tabstruct *tab, char *buf)
-
- {
-
- if (close_cat(keytab->cat) != RETURN_OK)
- error(EXIT_FAILURE,"*Error*: Problem while closing",keytab->cat->filename);
-
-/* Recover the original state of the original table */
- update_tab(keytab);
- free(buf);
-
- return;
- }
-
diff --git a/sextractor/src/fits/fitstab.c b/sextractor/src/fits/fitstab.c
deleted file mode 100644
index d29412b..0000000
--- a/sextractor/src/fits/fitstab.c
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- fitstab.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: general functions for handling LDAC FITS catalogs.
-*
-* Last modify: 15/08/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-/****** about_tab **************************************************************
-PROTO int about_tab(catstruct *cat, char *tabname, FILE *stream)
-PURPOSE Print information concerning a tab structure.
-INPUT Pointer to the input catalog,
- table name,
- an output stream.
-OUTPUT RETURN_OK if the table was found, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E.R. Deul(Leiden observatory),
- E. Bertin (IAP & Leiden observatory): return value modified.
- E.R. Deul(Leiden observatory): output units
-VERSION 15/08/2003
- ***/
-int about_tab(catstruct *cat, char *tabname, FILE *stream)
-{
- tabstruct *tab;
- keystruct *key;
- int i, j;
-
- if ((tab = name_to_tab(cat, tabname, 0))) {
- fprintf(stream, "Table %s\n", tabname);
- for (i=0, key=tab->key; i<tab->nkey; i++,key=key->nextkey)
- {
- fprintf(stream,
- "****** Key #%d\n", i+1);
- fprintf(stream,
- " Key name:...............%s\n", key->name);
- fprintf(stream,
- " Key comment:............%s\n", key->comment);
- fprintf(stream,
- " Key type:...............");
- switch (key->ttype) {
- case T_BYTE: fprintf(stream,"Byte"); break;
- case T_SHORT: fprintf(stream,"Short Int"); break;
- case T_LONG: fprintf(stream,"Long Int"); break;
- case T_FLOAT: fprintf(stream,"Float"); break;
- case T_DOUBLE: fprintf(stream,"Double"); break;
- case T_STRING: fprintf(stream,"String"); break;
- }
- fprintf(stream,"\n");
- fprintf(stream,
- " Key dimension:..........%d ", key->naxis);
- if (key->naxis) fprintf(stream, "(");
- for (j=0;j<key->naxis;j++) {
- if (j>0) fprintf(stream, " ");
- fprintf(stream, "%d", key->naxisn[j]);
- }
- if (key->naxis) fprintf(stream, ")");
- fprintf(stream, "\n");
- if (key->unit[0] != '\0')
- fprintf(stream,
- " Key unit:...............%s\n", key->unit);
- }
- } else return RETURN_ERROR;
-
- return RETURN_OK;
-}
-
-/****** add_tab ****************************************************************
-PROTO int add_tab(tabstruct *tab, catstruct *cat, int pos)
-PURPOSE Add a table to a catalog.
-INPUT Pointer to the table,
- Pointer to the destination catalog,
- Position (1= first after the primary HDU, <=0 = at the end).
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES Only 1-segment tables are accepted. To copy multi-segment tables,
- use copy_tab() instead.
- If a table with the same name and basic attributes already exists in
- the destination catalog, then the new table is appended to it.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/08/2003
- ***/
-int add_tab(tabstruct *tab, catstruct *cat, int pos)
-
- {
- tabstruct *outtab, *prevtab;
- int i;
-
-/*Check if a similar table doesn't already exist in the dest. cat */
- if ((outtab = name_to_tab(cat, tab->extname, 0)))
- {
- if ((outtab->naxis != 2)
- || (outtab->bitpix!=8)
- || strcmp(outtab->xtension,tab->xtension)
- || (outtab->tfields != tab->tfields)
- || (outtab->naxisn[0] != tab->naxisn[0]))
- return RETURN_ERROR;
-
- prevtab = outtab;
- for (i=outtab->nseg-1; i--;)
- prevtab = prevtab->nexttab;
- tab->seg = prevtab->seg+1;
- tab->nseg = 0;
- outtab->nseg++;
- }
- else
- {
- if ((prevtab = pos_to_tab(cat, pos, 0)))
- prevtab = prevtab->prevtab;
- else
- tab->nexttab = tab->prevtab = prevtab = tab;
- cat->ntab++;
- }
-
- (tab->nexttab = (tab->prevtab = prevtab)->nexttab)->prevtab = tab;
- prevtab->nexttab = tab;
-
- return RETURN_OK;
- }
-
-
-/****** copy_tab **************************************************************
-PROTO int copy_tab(catstruct *catin, char *tabname, int seg,
- catstruct *catout, int pos)
-PURPOSE Copy a table from one catalog to another.
-INPUT Pointer to the original catalog,
- Name of the table,
- Table segment (0 = all),
- Pointer to the destination catalog,
- Position (1= first after the primary HDU, <=0 = at the end)
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES If a table with the same name and basic attributes already exists in
- the destination catalog, then the original table is appended to it.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/08/2003
- ***/
-int copy_tab(catstruct *catin, char *tabname, int seg,
- catstruct *catout, int pos)
-
- {
- keystruct *key;
- tabstruct *outtab, *prevtab, *nexttab, *tabin,*tabout;
- int i,j, nseg;
-
-/*Convert the table name to a pointer*/
- if (!(tabin = name_to_tab(catin, tabname, seg)))
- return RETURN_ERROR;
-
- nseg = seg?1:tabin->nseg;
-/*Check if a similar table doesn't already exist in the dest. cat */
- if (*tabname && (outtab = name_to_tab(catout, tabname, 0)))
- {
- if ((outtab->naxis != 2)
- || (outtab->bitpix!=8)
- || strcmp(outtab->xtension,tabin->xtension)
- || (outtab->tfields != tabin->tfields)
- || (outtab->naxisn[0] != tabin->naxisn[0]))
- return RETURN_ERROR;
- prevtab = outtab;
- for (i=0; i<outtab->nseg-1; i++)
- prevtab = prevtab->nexttab;
- nexttab = prevtab->nexttab;
- outtab->nseg += nseg;
- }
- else
- {
- prevtab = nexttab = outtab = NULL;
- catout->ntab++;
- }
-
-/*Now copy each segment of the original table*/
- tabout = NULL; /* to satisfy gcc -Wall */
- for (i=nseg; i--;)
- {
-/*---First, allocate memory and copy data */
- QCALLOC(tabout, tabstruct, 1);
- *tabout = *tabin;
- if (tabin->naxis)
- QMEMCPY(tabin->naxisn, tabout->naxisn, int, tabin->naxis);
- if (tabin->headbuf)
- QMEMCPY(tabin->headbuf, tabout->headbuf, char, tabin->headnblock*FBSIZE);
- if (tabin->bodybuf)
- QMEMCPY(tabin->bodybuf, tabout->bodybuf, char, tabin->tabsize);
-
- key = tabin->key;
- tabout->key = NULL;
- tabout->nkey = 0;
- for (j=tabin->nkey; j--;)
- {
- copy_key(tabin, key->name, tabout, 0);
- key = key->nextkey;
- }
-
-/*---Then, update the links */
- if (prevtab)
- {
- prevtab->nexttab = tabout;
- tabout->prevtab = prevtab;
- tabout->seg = prevtab->seg+1;
- tabout->nseg = 0;
- }
- else
- {
- outtab = tabout;
- outtab->prevtab = NULL;
- tabout->seg = 1;
- }
- tabin = tabin->nexttab;
- prevtab = tabout;
- }
-
-/*place the new chain of table-segments within the catalog (tricky, isn't it?)*/
- if (!nexttab)
-/*--if the table is new */
- {
- nexttab = pos_to_tab(catout, pos, 0);
- if (!nexttab)
- nexttab = catout->tab = tabout;
- else
- {
- outtab->prevtab = nexttab->prevtab;
- nexttab->prevtab->nexttab = outtab;
- }
- }
-
- prevtab->nexttab = nexttab;
- nexttab->prevtab = prevtab;
-
- return RETURN_OK;
- }
-
-
-/****** copy_tab_fromptr ******************************************************
-PROTO void copy_tab_fromptr(tabstruct *tabin, catstruct *catout, int pos)
-PURPOSE Copy a table from one catalog to another.
-INPUT Pointer to the original catalog,
- Pointer to the table,
- Pointer to the destination catalog,
- Position (1= first after the primary HDU, <=0 = at the end)
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 22/06/2001
- ***/
-void copy_tab_fromptr(tabstruct *tabin, catstruct *catout, int pos)
-
- {
- keystruct *key;
- tabstruct *prevtab, *nexttab,*tabout;
- int j;
-
- catout->ntab++;
-
-/* First, allocate memory and copy data */
- QCALLOC(tabout, tabstruct, 1);
- *tabout = *tabin;
- if (tabin->naxis)
- QMEMCPY(tabin->naxisn, tabout->naxisn, int, tabin->naxis);
- if (tabin->headbuf)
- QMEMCPY(tabin->headbuf, tabout->headbuf, char, tabin->headnblock*FBSIZE);
- if (tabin->bodybuf)
- QMEMCPY(tabin->bodybuf, tabout->bodybuf, char, tabin->tabsize);
-
- key = tabin->key;
- tabout->key = NULL;
- tabout->nkey = 0;
- for (j=tabin->nkey; j--;)
- {
- copy_key(tabin, key->name, tabout, 0);
- key = key->nextkey;
- }
-
-/* Then, update the links */
- tabout->prevtab = NULL;
- tabout->seg = 1;
- tabin = tabin->nexttab;
- prevtab = tabout;
-
- if (!(nexttab = pos_to_tab(catout, pos, 0)))
- nexttab = catout->tab = tabout;
- else
- {
- tabout->prevtab = nexttab->prevtab;
- nexttab->prevtab->nexttab = tabout;
- }
-
- prevtab->nexttab = nexttab;
- nexttab->prevtab = prevtab;
-
- return;
- }
-
-
-/****** copy_tabs **************************************************************
-PROTO int copy_tabs(catstruct *catin, catstruct *catout)
-PURPOSE Copy all tables from one catalog to another.
-INPUT Pointer to the original catalog,
- Pointer to the destination catalog,
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise
- (for instance if there were tabs that were not binary-tables, and
- therefore that were not copied).
-NOTES If a table with the same name and basic attributes already exists in
- the destination catalog, then the original table is appended to it.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 12/06/2001
- ***/
-int copy_tabs(catstruct *catin, catstruct *catout)
-
- {
- tabstruct *tab;
- int i, flag, ntab;
-
- if (!catin->tab)
- return RETURN_ERROR;
-
- tab = catin->tab->nexttab; /* skip the primary header */
- flag = RETURN_OK;
- ntab = catin->ntab-1;
- if (!ntab)
- ntab = 1;
- for (i=ntab; i--;)
- {
- flag |= copy_tab(catin, tab->extname, 0, catout, 0);
- while (!(tab=tab->nexttab)->nseg);
- }
-
- return flag;
- }
-
-
-/****** copy_tabs_blind *******************************************************
-PROTO int copy_tabs(catstruct *catin, catstruct *catout)
-PURPOSE Copy all tables from one catalog to another, without trying to append.
-INPUT Pointer to the original catalog,
- Pointer to the destination catalog,
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 07/05/2002
- ***/
-int copy_tabs_blind(catstruct *catin, catstruct *catout)
-
- {
- tabstruct *tab;
- int i, ntab;
-
- if (!catin->tab)
- return RETURN_ERROR;
-
- tab = catin->tab; /* don't skip the primary header */
- ntab = catin->ntab;
- for (i=ntab; i--;)
- {
- copy_tab_fromptr(tab, catout, 0);
- tab=tab->nexttab;
- }
-
- return RETURN_OK;
- }
-
-
-/****** free_tab ***************************************************************
-PROTO void free_tab(tabstruct *tab)
-PURPOSE Free memory associated to a table pointer.
-INPUT Pointer to the table.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 28/02/2000
- ***/
-void free_tab(tabstruct *tab)
-
- {
- free_body(tab);
- free(tab->naxisn);
- free(tab->headbuf);
- free(tab->compress_buf);
- remove_keys(tab);
- free(tab);
-
- return;
- }
-
-
-/****** new_tab ****************************************************************
-PROTO tabstruct *new_tab(char *tabname)
-PURPOSE Create a new binary table.
-INPUT Name.
-OUTPUT A pointer to the new table.
-NOTES A defaut header is also created.
- No links are initialized.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/04/97
- ***/
-tabstruct *new_tab(char *tabname)
-
- {
- static char bintabtemplate[][80] = {
-"XTENSION= 'BINTABLE' / THIS IS A BINARY TABLE (FROM THE LDACTOOLS)",
-"BITPIX = 8 / ",
-"NAXIS = 2 / ",
-"NAXIS1 = 0 / BYTES PER ROW",
-"NAXIS2 = 0 / NUMBER OF ROWS",
-"PCOUNT = 0 / RANDOM PARAMETER COUNT",
-"GCOUNT = 1 / GROUP COUNT",
-"TFIELDS = 0 / FIELDS PER ROWS",
-"EXTNAME = 'WHOCARES' / TABLE NAME",
-"END "};
- tabstruct *tab;
- char *buf;
- int i;
-
- QCALLOC(tab, tabstruct, 1);
- strcpy(tab->xtension, "BINTABLE");
- strcpy(tab->extname, tabname);
- tab->naxis = 2;
- QCALLOC(tab->naxisn, int, tab->naxis);
- tab->bitpix = 8;
- tab->bytepix = 1;
- tab->pcount = 0;
- tab->gcount = 1;
- tab->seg = 1;
- tab->nseg = 1;
-/*Provide a new header*/
- QCALLOC(tab->headbuf, char, FBSIZE);
- memcpy(tab->headbuf, bintabtemplate, sizeof(bintabtemplate));
- for (buf = tab->headbuf, i=FBSIZE; i--; buf++)
- if (!*buf)
- *buf = ' ';
- tab->headnblock = 1;
-
- return tab;
- }
-
-
-/****** remove_tab *************************************************************
-PROTO int remove_tab(catstruct *cat, char *tabname, int seg)
-PURPOSE Remove a table from a catalog.
-INPUT Pointer to the catalog,
- Name of the table,
- Table segment (0 = all).
-OUTPUT RETURN_OK if everything went as expected, and RETURN_ERROR otherwise.
-NOTES If tabname = "", the last table from the list is removed.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/08/2003
- ***/
-int remove_tab(catstruct *cat, char *tabname, int seg)
-
- {
- tabstruct *tab, *prevtab, *nexttab;
- int i,nseg;
-
- if (!tabname || !cat->ntab || !cat->tab)
- return RETURN_ERROR;
-
- if (tabname[0])
- {
-/*--Convert the table name to a pointer*/
- if (!(tab = name_to_tab(cat, tabname, seg)))
- return RETURN_ERROR;
-/*--a small trick to simplify decisions afterwards*/
- if (seg && tab->nseg==1)
- seg = 0;
- }
- else
- {
- tab = cat->tab->prevtab;
- if (!seg)
- for (;!tab->nseg; tab = tab->prevtab);
- }
-
- prevtab = tab->prevtab;
- nseg = seg?1:tab->nseg;
-
-/*Free memory for each table segment*/
- nexttab = NULL; /* to satisfy gcc -Wall */
- for (i=nseg; i--;)
- {
- nexttab = tab->nexttab;
- if (cat->tab == tab)
- cat->tab = nexttab;
- free_tab(tab);
- tab = nexttab;
- }
-
- if (!seg)
- if (!--cat->ntab)
- {
- cat->tab = NULL;
- return RETURN_OK;
- }
-
-/*update the links of neighbours*/
- nexttab->prevtab = prevtab;
- prevtab->nexttab = nexttab;
-
- if (seg)
-/*--update status for each table segment*/
- {
- for (tab=prevtab;!tab->nseg; tab = tab->prevtab);
- for (nexttab=tab->nexttab,i=2;!nexttab->nseg;nexttab=nexttab->nexttab,i++);
- nexttab->seg = i;
- tab->nseg = i;
- tab->seg = 1;
- }
-
- return RETURN_OK;
- }
-
-
-/****** remove_tabs ************************************************************
-PROTO int remove_tabs(catstruct *cat)
-PURPOSE Remove all tables from a catalog.
-INPUT Pointer to the catalog.
-OUTPUT RETURN_OK if tabs were found, and RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/05/97
- ***/
-int remove_tabs(catstruct *cat)
-
- {
- int t;
-
- if (!cat->tab)
- return RETURN_ERROR;
-
- for (t=cat->ntab; t--;)
- remove_tab(cat, "",0);
-
- return RETURN_OK;
- }
-
-
-/****** update_tab ************************************************************
-PROTO int update_tab(tabstruct *tab)
-PURPOSE Update a table according to what's in the keys.
-INPUT Table structure.
-OUTPUT RETURN_OK if tab is a binary table, or RETURN_ERROR otherwise.
-NOTES The headbuf pointer in the catstruct might be reallocated.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/02/97
- ***/
-int update_tab(tabstruct *tab)
-
- {
- tabstruct *keytab;
- keystruct *key;
- int i,j, nobj, nbytes;
-
-/*Just pass if not a binary table*/
- if ((tab->naxis != 2)
- || (tab->bitpix!=8)
- || strncmp(tab->xtension, "BINTABLE", 8))
- return RETURN_ERROR;
-
-/*Well, not much to do if there are no keys!*/
- if (!(key = tab->key))
- return RETURN_OK;
-
- nobj = -1;
- keytab = NULL;
- nbytes = 0;
- for (i=tab->nkey; i--;)
- {
- if (keytab && !key->ptr && key->tab != keytab)
- error(EXIT_FAILURE, "*Error*: wrong reference table in ",
- key->name);
- if (nobj!=-1 && (nobj != key->nobj))
- error(EXIT_FAILURE, "*Error*: wrong number of elements in key ",
- key->name);
- keytab = key->tab;
- nobj = key->nobj;
-/*-- If the number of bytes per element is not set, recover it */
- if (!key->nbytes)
- {
- key->nbytes = t_size[key->ttype];
- for (j=key->naxis; j--;)
- key->nbytes *= key->naxisn[j];
- }
- nbytes += key->nbytes;
- key = key->nextkey;
- }
-
- tab->tabsize = nobj*nbytes;
- tab->naxisn[0] = nbytes;
- tab->naxisn[1] = nobj;
- tab->tfields = tab->nkey;
-
- return RETURN_OK;
- }
-
-
-/****** name_to_tab ***********************************************************
-PROTO tabstruct *name_to_tab(catstruct *cat, char *tabname, int seg)
-PURPOSE Name search of a table in a catalog.
-INPUT Pointer to the catalog,
- Table name,
- Table segment (0 = first).
-OUTPUT The table pointer if the name was matched, and NULL otherwise.
-NOTES -
-VERSION 12/06/2001
- ***/
-tabstruct *name_to_tab(catstruct *cat, char *tabname, int seg)
-
- {
- tabstruct *tab;
- int i;
-
- if (!(tab = cat->tab))
- return NULL;
-
- for (i=cat->ntab; strcmp(tabname,tab->extname) && i--;)
- while (!(tab=tab->nexttab)->nseg);
-
- if (i<0)
- return NULL;
-
- if (seg)
- {
- for (;tab->seg!=seg && !tab->nexttab->nseg; tab=tab->nexttab);
- return tab->seg==seg?tab:NULL;
- }
-
- return tab;
- }
-
-
-/****** pos_to_tab *************************************************************
-PROTO tabstruct *pos_to_tab(catstruct *cat, int pos, int seg)
-PURPOSE Position search of a table in a catalog.
-INPUT Pointer to the catalog,
- Position of the table,
- Table segment (0 = first).
-OUTPUT The table pointer if the table exists at the given position, and the
- pointer to the primary ``table'' otherwise.
-NOTES pos = 1 means the first table after the primary one.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/02/96
- ***/
-tabstruct *pos_to_tab(catstruct *cat, int pos, int seg)
-
- {
- tabstruct *tab;
- int i;
-
- tab = cat->tab;
- for (i=0; i!=pos && i<cat->ntab; i++)
- while (!(tab=tab->nexttab)->nseg);
-
- if (seg)
- for (;tab->seg!=seg && !tab->nexttab->nseg; tab=tab->nexttab);
-
- return i<cat->ntab?tab:cat->tab;
- }
-
-/****** tabs_list **************************************************************
-PROTO char **tabs_list(catstruct *cat, int *n)
-PURPOSE List all tables in a catalog.
-INPUT Pointer to the catalog,
- Pointer to the number of names in that list.
-OUTPUT A list of all table names.
-NOTES -.
-AUTHOR E.R. Deul (Leiden observatory)
-VERSION ??/??/96
- ***/
-char **tabs_list(catstruct *cat, int *n)
-
- {
- tabstruct *tab;
- int i;
- char **names;
-
- tab = cat->tab;
- QCALLOC(names, char *, cat->ntab);
- for (i=0; i<cat->ntab; i++) {
- QCALLOC(names[i], char, MAXCHARS);
- strcpy(names[i],tab->extname);
- while (!(tab=tab->nexttab)->nseg);
- }
- *n = cat->ntab;
- return names;
- }
-
-/****** tabs_row_len ***********************************************************
-PROTO int tab_row_len(char *file, char *tabname)
-PURPOSE Return the row length in bytes of a given table in a given catalog.
-INPUT File pointer.
-OUTPUT Table size (bytes)
-NOTES -.
-AUTHOR E.R. Deul (Leiden observatory)
-VERSION 05/06/200`
- ***/
-int tab_row_len(char *file, char *tabname)
-
-{
- catstruct *tcat;
- tabstruct *tab;
- int retcode = -1;
-
- if ((tcat = read_cat(file)) != NULL) {
- if ((tab = name_to_tab(tcat, tabname, 0)) != NULL) {
- retcode = tab->naxisn[0];
- free_tab(tab);
- }
- close_cat(tcat);
- free_cat(&tcat,1);
- }
- return retcode;
-}
-
diff --git a/sextractor/src/fits/fitsutil.c b/sextractor/src/fits/fitsutil.c
deleted file mode 100644
index 6c87a77..0000000
--- a/sextractor/src/fits/fitsutil.c
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- fitsutil.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: functions for handling FITS keywords.
-*
-* Last modify: 17/11/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-char histokeys[][12] = {"COMMENT ", "HISTORY ", " ", ""};
-
-/****** fitsadd ***************************************************************
-PROTO int fitsadd(char *fitsbuf, char *keyword, char *comment)
-PURPOSE Write a FITS keyword in a fits header.
-INPUT pointer to the FITS buffer,
- name of the keyword to be created,
- a comment to put beyond the slash, or next to a COMMENT or HISTORY.
-OUTPUT line position or RETURN_ERROR if the keyword is invalid.
-NOTES For all keywords except commentary ones (like COMMENT, HISTORY or
- blank), it is checked that they do not exist already.
- Enough memory should be provided for the FITS header to contain one
- more line of 80 char.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 13/06/2004
- ***/
-int fitsadd(char *fitsbuf, char *keyword, char *comment)
-
- {
- char *key_ptr;
- char str[82];
- int headpos, headpos2, commentflag,
- i, n;
-
-
- if (strcspn(keyword, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 -_"))
- return RETURN_ERROR;
- commentflag = findkey(keyword, (char *)histokeys, 12)==RETURN_ERROR?0:1;
- if (commentflag || (headpos = fitsfind(fitsbuf, keyword))==RETURN_ERROR)
- {
- headpos2 = headpos = fitsfind(fitsbuf, "END ");
-/*-- Special case of NAXIS parameters */
- if (!strncmp(keyword, "NAXIS", 5) && keyword[5] && keyword[5] != ' ')
- {
- sscanf(keyword, "NAXIS%d", &n);
-/*---- Look for all previous NAXIS parameters */
- for (i=n; i--;)
- {
- sprintf(str, "NAXIS%-3d", i);
- headpos=fitsfind(fitsbuf, str);
- if (headpos>0)
- break;
- }
- if (headpos<0)
-/*---- Most likely keyword is NAXIS1 */
- headpos=fitsfind(fitsbuf, "NAXIS ");
- if (headpos>0)
- headpos++;
- else
- return RETURN_ERROR;
- }
- key_ptr = fitsbuf+80*headpos;
- memmove(key_ptr+80, key_ptr, 80*(headpos2-headpos+1));
-
- if (commentflag)
- sprintf(str, "%-8.8s %-71.71s",
- keyword, comment?comment:" ");
- else if (comment && *comment)
- sprintf(str, "%-8.8s= / %-47.47s",
- keyword, comment);
- else
- sprintf(str, "%-8.8s= %-47.47s",
- keyword, " ");
-
- memcpy(key_ptr, str, 80);
- }
-
- return headpos;
- }
-
-
-/****** fitsfind **************************************************************
-PROTO int fitsfind(char *fitsbuf, char *keyword)
-PURPOSE Search for a FITS keyword in a FITS header.
-INPUT pointer to the FITS buffer,
- name of the keyword to search for.
-OUTPUT position in lines of 80 char (0=first) of the keyword if it was
- found, RETURN_ERROR otherwise.
-NOTES The buffer MUST contain the ``END '' keyword.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 15/02/96
- ***/
-int fitsfind(char *fitsbuf, char *keyword)
-
- {
- char *ptr;
- int i, len;
-
- len = strlen(keyword);
- for (i=0; strncmp(ptr=&fitsbuf[80*i], "END ", 8); i++)
- if (!wstrncmp(ptr, keyword, len))
- return i;
- if (strncmp(keyword, "END ", 8))
- return RETURN_ERROR;
- else
- return i;
- }
-
-
-/****** fitsnfind *************************************************************
-PROTO char *fitsnfind(char *fitsbuf, char *str, int nblock)
-PURPOSE Search for a FITS keyword in a fits header of nblock blocks.
-INPUT pointer to the FITS buffer,
- name of the keyword to search for,
- number of FITS blocks (2880 bytes each).
-OUTPUT pointer at the keyword position if it was found, NULL otherwise.
-NOTES No need for an ``END '' keyword.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/04/97
- ***/
-char *fitsnfind(char *fitsbuf, char *str, int nblock)
- {
- int i;
-
- for (i=36*nblock;i--; fitsbuf+=80)
- if (!strncmp(fitsbuf, str, strlen(str)))
- return fitsbuf;
-
- return (char *)NULL;
- }
-
-
-/****** fitspick **************************************************************
-PROTO int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype,
- t_type *ttype, char *comment)
-
-PURPOSE Pick up FITS keyword,content,type and comment in a fits header line.
-INPUT pointer to the current line of FITS buffer,
- pointer to a char * (where to put the keyword),
- pointer to ``where to put the data'',
- pointer to ``where to put the h_type'',
- pointer to ``where to put the t_type'',
- pointer to a char * (where to put the comment).
-OUTPUT RETURN_OK if something was found, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP),
- E.R. Deul - Handling of NaN
-VERSION 04/08/2004
- ***/
-int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype,
- t_type *ttype, char *comment)
-
- {
- char *fptr, *cptr, c, *lastspace;
- int i,j, toggle;
-
- *((char *)ptr) = 0;
-/*First, get the keyword*/
- memcpy(keyword, fitsline, 8);
- keyword[8] = 0;
-
-/*Handle comments*/
- if ((int)fitsline[8] != '=')
- {
- if (strncmp(keyword, "COMMENT ", 8)
- && strncmp(keyword, "HISTORY ", 8)
- && strncmp(keyword, "HIERARCH", 8)
- && strncmp(keyword, " ", 8))
- return RETURN_ERROR;
- memcpy(comment, fitsline+9, 71);
- comment[71] = 0;
- *htype = H_COMMENT;
- *ttype = T_STRING;
- return RETURN_OK;
- }
-
- for (j=10; j<80 && fitsline[j] == (char)' '; j++);
- if (j==80 || fitsline[j] == '/')
- {
- *htype = H_COMMENT;
- *ttype = T_STRING;
- return RETURN_ERROR;
- }
- if ((int)fitsline[j] == '\'')
- {
- cptr = ptr;
- for (fptr = fitsline + (i=j+1); i<80; i++)
- {
- if (*fptr==(char)'\'')
- {
- if (i++>=79 || *(fptr+1)!=(char)'\'')
- break;
- else
- fptr++;
- }
- *cptr++ = *fptr++;
- }
- *cptr = 0;
-/*-- Check if there is a trailing space */
- *htype = (cptr != ptr && *(cptr-1)==' ') ? H_STRINGS: H_STRING;
- *ttype = T_STRING;
- }
- else if (fitsline[j] == (char)'T' || fitsline[j] == (char)'F')
- {
- *((BYTE *)ptr) = fitsline[j]==(char)'T'?1:0;
- *htype = H_BOOL;
- *ttype = T_BYTE;
- }
- else if (!strncmp(fitsline+j, "NaN", 3))
- {
- *((double *)ptr) = BIG;
- *htype = H_EXPO;
- *ttype = T_DOUBLE;
- }
- else
- {
- for (i=j; i<80 && fitsline[i]!=(char)'/' && fitsline[i]!=(char)'.'; i++);
-/*-- Handle floats*/
- if (i==80)
- {
- *((int *)ptr) = 0;
- *htype = H_INT;
- *ttype = T_LONG;
- }
- else if (fitsline[i]==(char)'.')
- {
- fixexponent(fitsline+j);
- *((double *)ptr) = atof(fitsline+j);
- *htype = H_EXPO;
- *ttype = T_DOUBLE;
- }
- else
-/*---- Handle ints*/
- {
- *((int *)ptr) = atoi(fitsline+j);
- *htype = H_INT;
- *ttype = T_LONG;
- }
- }
-
-/*Store comment if it is found*/
- toggle = 0;
- lastspace = NULL;
- for (fptr = fitsline + (i=j); i<80; i++)
- {
- if (*fptr == (char)'\'')
- toggle^=toggle;
- if (*(fptr++) == (char)'/' && !toggle)
- {
- while (++i<80 && *fptr<=' ')
- fptr++;
- i--;
- while (++i<80)
- if ((c=*(fptr++))>= ' ')
- {
- *(comment++) = c;
- if (c>' ')
- lastspace = comment;
- }
- }
- }
- if (lastspace)
- *lastspace = '\0';
- else
- *comment = '\0';
-
- return RETURN_OK;
- }
-
-
-/****** fitsread **************************************************************
-PROTO int fitsread(char *fitsbuf, char *keyword, void *ptr, h_type htype,
- t_type ttype)
-PURPOSE Read a FITS keyword in a fits header.
-INPUT pointer to the FITS buffer,
- name of the keyword to be read,
- pointer where to put the read data,
- h_type of the data to be read (see fitscat.h),
- t_type of the data to be read (see fitscat.h).
-OUTPUT RETURN_OK if the keyword was found, RETURN_ERROR otherwise.
-NOTES The buffer MUST contain the ``END '' keyword.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 04/08/2004
- ***/
-int fitsread(char *fitsbuf, char *keyword, void *ptr, h_type htype,
- t_type ttype)
-
- {
- int i,pos;
- char s[4], str[82];
- char *st, *st2;
-
- if ((pos = fitsfind(fitsbuf, keyword)) < 0)
- return RETURN_ERROR;
-
- strncpy(str,fitsbuf+80*pos,80);
- str[80] = '\0';
-
- switch(htype)
- {
- case H_INT: if (ttype == T_SHORT)
- sscanf(str+10, " %hd", (short *)ptr);
- else
- sscanf(str+10, " %d", (LONG *)ptr);
- break;
-
- case H_FLOAT:
- case H_EXPO: fixexponent(str);
- if (ttype == T_DOUBLE)
- sscanf(str+10, " %lf", (double *)ptr);
- else
- sscanf(str+10, " %f", (float *)ptr);
- break;
-
- case H_BOOL: sscanf(str+10, "%1s", s);
- if (ttype == T_BYTE)
- *(BYTE *)ptr = ((int)s[0] == 'T') ? 1 : 0;
- else if (ttype == T_SHORT)
- *(short *)ptr = ((int)s[0] == 'T') ? 1 : 0;
- else
- *(LONG *)ptr = ((int)s[0] == 'T') ? 1 : 0;
- break;
-
- case H_STRING: st = ptr;
- st2= str+10;
- for (i=70; i-- && *(st2++)!=(char)'\'';);
- while (i-->0)
- {
- if (*st2 == '\'' && *(++st2) != '\'')
- break;
- *(st++) = *(st2++);
- }
- do
- {
- *(st--) = (char)'\0';
- } while (st>(char *)ptr && (*st == (char)' '));
- break;
-
- case H_STRINGS: st = ptr;
- st2= str+10;
- for (i=70; i-- && *(st2++)!=(char)'\'';);
- while (i-->0)
- {
- if (*st2 == '\'' && *(++st2) != '\'')
- break;
- *(st++) = *(st2++);
- }
- *st = (char)'\0';
- break;
-
- case H_COMMENT: strcpy(ptr,str+9);
- break;
-
- case H_HCOMMENT: strcpy(ptr,str+33);
- break;
-
- default: error(EXIT_FAILURE,
- "*Internal Error*: Unknown FITS type in ",
- "fitsread()");
- break;
- }
-
- return RETURN_OK;
- }
-
-
-/****** fitsremove ************************************************************
-PROTO int fitsremove(char *fitsbuf, char *keyword)
-PURPOSE Remove one (or more) FITS keyword from a fits header.
-INPUT pointer to the FITS buffer,
- name of the keyword to be created.
-OUTPUT RETURN_OK if the keyword was found, RETURN_ERROR otherwise.
-NOTES '?' wildcard allowed;
- Don't remove the ``END'' keyword with this!!!
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 08/04/99
- ***/
-
-int fitsremove(char *fitsbuf, char *keyword)
-
- {
- char *cp1,*cp2;
- int endpos,pos, i,n;
-
- endpos = fitsfind(fitsbuf, "END ");
- for (n=0; (pos = fitsfind(fitsbuf, keyword))>=0; n++, endpos--)
- for (cp1=fitsbuf+80*(pos+1), cp2=fitsbuf+80*pos, i=80*(endpos - pos); i--;)
- *(cp2++) = *(cp1++);
-
- if (!n)
- return RETURN_ERROR;
-
- memset(fitsbuf+80*(endpos+1), ' ', 80*n);
-
- return RETURN_OK;
- }
-
-
-/****** fitswrite *************************************************************
-PROTO int fitswrite(char *fitsbuf, char *keyword, void *ptr, h_type htype,
- t_type ttype)
-PURPOSE Write a FITS keyword in a fits header.
-INPUT pointer to the FITS buffer,
- name of the keyword to be written,
- pointer where to retrieve the data,
- h_type of the data to be written (see fitscat.h),
- t_type of the data to be written (see fitscat.h).
-OUTPUT RETURN_OK if the keyword was found, RETURN_ERROR otherwise.
-NOTES The buffer MUST contain the ``END '' keyword.
- The keyword must already exist in the buffer (use fitsadd()).
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 17/11/2004
- ***/
-int fitswrite(char *fitsbuf, char *keyword, void *ptr, h_type htype,
- t_type ttype)
-
- {
- int i, l, pos, posoff, flag;
- char str[81],str2[81];
- char *cstr, *cstr1,*cstr2,
- c;
-
-/* Ignore HISTORY and COMMENTS */
- if (findkey(keyword, (char *)histokeys, 12)!=RETURN_ERROR
- || (pos = fitsfind(fitsbuf, keyword)) < 0)
- return RETURN_ERROR;
- posoff = 10;
- fitsbuf += 80*pos;
- switch(htype)
- {
- case H_INT: sprintf(str, "%20d", (ttype==T_SHORT)?
- *(short *)ptr: *(int *)ptr);
- break;
-
- case H_FLOAT: sprintf(str, " %12.4f", (ttype==T_DOUBLE)?
- *(double *)ptr: *(float *)ptr);
- break;
-
- case H_EXPO: sprintf(str, " %16.9E", (ttype==T_DOUBLE)?
- *(double *)ptr: *(float *)ptr);
- break;
-
- case H_BOOL: if (((ttype==T_SHORT)? *(short *)ptr : *(LONG *)ptr))
- sprintf(str, " T");
- else
- sprintf(str, " F");
- break;
-
- case H_STRING: /* Handle the famous quote */
- cstr1 = (char *)ptr;
- cstr2 = str2;
- for (i=0; i<80; i++)
- if (!(c=*(cstr2++) = *(cstr1++)))
- break;
- else if (c == '\'')
- {
- *(cstr2++) = '\'';
- i++;
- }
- if (strlen(str2)<=18)
- {
- sprintf(str, "'%-18.18s ", str2);
- cstr = str+18;
- i = 10;
- }
- else
- {
- sprintf(str, "'%-68.68s ", str2);
- cstr = str+68;
- i = 60;
- }
- for (; i-- && *cstr==(char)' '; cstr--);
- *(++cstr) = (char)'\'';
- if (i>9)
- *(++cstr) = 0;
- break;
-
- case H_STRINGS: /* Handle the famous quote */
- cstr1 = (char *)ptr;
- cstr2 = str2;
- for (i=0; i<80; i++)
- if (!(c=*(cstr2++) = *(cstr1++)))
- break;
- else if (c == '\'')
- {
- *(cstr2++) = '\'';
- i++;
- }
- sprintf(str, "'%s'", str2);
- for (i+=2;i<20; i++)
- str[i]=' ';
- str[i] = '\0';
- break;
-
- case H_COMMENT: sprintf(str, "%-70s", (char *)ptr);
- posoff = 9;
- break;
-
- /* Special case of ``half-comments'' */
- case H_HCOMMENT: sprintf(str, " / %-47s", (char *)ptr);
- posoff = 30;
- break;
-
- default: error(EXIT_FAILURE,
- "*FATAL ERROR*: Unknown FITS type in ",
- "fitswrite()");
- break;
- }
-
-
-/* Now the tricky problem of (former) comments */
- flag=1;
- cstr = fitsbuf+10;
- for (i=71; --i; cstr++)
- {
- if (*cstr=='\'')
- flag ^= 1;
- else if (flag && *cstr=='/')
- break;
- }
- if (posoff==10 && i && (l=69-strlen(str))>0)
- {
- strncpy(str2, cstr, i);
- str2[i+1] = 0;
- strcat(str, " ");
- strncat(str, str2, l);
- }
-
- memset(fitsbuf+9, ' ', 71);
- fitsbuf += posoff;
-
-/* Finally copy the result to the right place (except the trailing zero) */
- for (cstr = str; *cstr; *(fitsbuf++) = *(cstr++));
-
- return RETURN_OK;
- }
-
-
-/****** fixexponent ***********************************************************
-PROTO void fixexponent(char *s)
-PURPOSE Replaces the FORTRAN 'D' exponent sign to 'E' in a FITS line.
-INPUT FITS line
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 25/04/97
- ***/
-void fixexponent(char *s)
-
- {
- int i;
-
- s += 9;
- for (i=71; (int)*s != '/' && i--; s++)
- if ((int)*s == 'D' || (int)*s == 'd')
- *s = (char)'E';
-
- return;
- }
-
-
diff --git a/sextractor/src/fits/fitswrite.c b/sextractor/src/fits/fitswrite.c
deleted file mode 100644
index 480f8a0..0000000
--- a/sextractor/src/fits/fitswrite.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- fitswrite.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: The LDAC Tools
-*
-* Author: E.BERTIN, DeNIS/LDAC
-*
-* Contents: low-level functions for writing LDAC FITS catalogs.
-*
-* Last modify: 12/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "fitscat_defs.h"
-#include "fitscat.h"
-
-
-/****** save_cat **************************************************************
-PROTO void save_cat(catstruct *cat, char *filename)
-PURPOSE Save a FITS catalog with name filename.
-INPUT catalog structure,
- filename.
-OUTPUT -.
-NOTES Any preexisting file with name filename is overwritten.
-AUTHOR E. Bertin (IAP)
-VERSION 09/09/2003
- ***/
-void save_cat(catstruct *cat, char *filename)
-
- {
- tabstruct *tab;
- int i;
-
- strcpy(cat->filename, filename);
- if (open_cat(cat, WRITE_ONLY) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: cannot open for writing ", filename);
-
- tab = cat->tab;
-/*Go through each segment in the right order to save data*/
- for (i=0; i<cat->ntab; i++)
- {
-/*-- Make sure that the tab header is primary or extension! */
- if (i)
- ext_head(tab);
- else
- prim_head(tab);
- save_tab(cat, tab);
- while (!((tab=tab->nexttab)->nseg));
- }
-
- if (close_cat(cat) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Problem while closing", cat->filename);
-
- return;
- }
-
-
-/****** save_tab **************************************************************
-PROTO void save_tab(catstruct *cat, tabstruct *tab)
-PURPOSE Save a FITS table.
-INPUT pointer to the catalog structure,
- pointer to the table structure.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 09/09/2003
- ***/
-void save_tab(catstruct *cat, tabstruct *tab)
-
- {
- catstruct *tabcat;
- keystruct *key;
- tabstruct *keytab;
- KINGSIZE_T tabsize;
- KINGLONG size;
- int b,j,k,o, nbytes,nkey,nobj,spoonful,
- tabflag, larrayin,larrayout;
- char *buf, *inbuf, *outbuf, *fptr,*ptr;
- int esize;
-
-/* Make the table parameters reflect its content*/
- update_tab(tab);
-/* The header itself*/
- tabflag = save_head(cat, tab)==RETURN_OK?1:0;
-/* Allocate memory for the output buffer */
- tabsize = 0;
- tabcat = NULL; /* to satisfy gcc -Wall */
- inbuf = NULL; /* to satisfy gcc -Wall */
- if (tabflag)
- {
-/*-- If segment is a binary table, save it row by row */
- QMALLOC(outbuf, char, (larrayout = tab->naxisn[0]));
- nkey = tab->nkey;
- tabsize = larrayin = 0;
- for (j=tab->nseg; j--;)
- {
- update_tab(tab);
-/*---- Scan keys to find the reference tab and other things*/
- keytab = NULL;
- key = tab->key;
- for (k=nkey; k--; key = key->nextkey)
- if (!key->ptr)
- {
- keytab = key->tab;
- tabcat = keytab->cat;
- }
-/*---- If table contains some keys with no ptrs, we have to access a file */
- if (keytab)
- {
- QMALLOC(inbuf, char, (larrayin = keytab->naxisn[0]));
- if (open_cat(tabcat, READ_ONLY) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Cannot access ", tabcat->filename);
- QFSEEK(tabcat->file, keytab->bodypos, SEEK_SET, tabcat->filename);
- }
- nobj = tab->naxisn[1];
- for (o=0; o<nobj; o++)
- {
- if (keytab)
- QFREAD(inbuf, larrayin, tabcat->file, tabcat->filename);
- fptr = outbuf;
- for (k=nkey; k--; key = key->nextkey)
- {
- nbytes = key->nbytes;
- ptr = key->ptr? (char *)key->ptr+nbytes*o:inbuf+key->pos;
- for (b=nbytes; b--;)
- *(fptr++) = *(ptr++);
- if (bswapflag)
- if (key->ptr)
- {
- esize = t_size[key->ttype];
- swapbytes(fptr-nbytes, esize, nbytes/esize);
- }
- }
- QFWRITE(outbuf, larrayout, cat->file, cat->filename);
- }
- if (keytab)
- {
- free(inbuf);
- if (close_cat(tabcat) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Problem while closing",
- tabcat->filename);
- }
- tabsize += tab->tabsize;
- tab = tab->nexttab;
- }
- free(outbuf);
- }
- else
- {
-/*-- If segment is not a binary table, save it ``as it is'' */
-/*-- We use a limited-size buffer ``in case of'' */
- size = tabsize = tab->tabsize;
- if (tabsize)
- {
- if (tab->bodybuf)
- {
-/*------ A body is present in memory and needs to be written */
- if (bswapflag)
- swapbytes(tab->bodybuf, tab->bytepix, tabsize/tab->bytepix);
- QFWRITE(tab->bodybuf, (size_t)tabsize, cat->file, cat->filename);
- if (bswapflag)
- swapbytes(tab->bodybuf, tab->bytepix, tabsize/tab->bytepix);
- }
- else
-/*------ The body should be copied from the source tab */
- {
- tabcat = tab->cat;
- spoonful = size<DATA_BUFSIZE?size:DATA_BUFSIZE;
- QMALLOC(buf, char, spoonful);
- if (open_cat(tabcat, READ_ONLY) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Cannot access ", tabcat->filename);
- QFSEEK(tabcat->file, tab->bodypos, SEEK_SET, tabcat->filename);
- for (;size>0; size -= spoonful)
- {
- if (spoonful>size)
- spoonful = size;
- QFREAD(buf, spoonful, tabcat->file, tabcat->filename);
- QFWRITE(buf, spoonful, cat->file, cat->filename);
- }
- free(buf);
- if (close_cat(tabcat) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Problem while closing",
- tabcat->filename);
- }
- }
- }
-
-/* FITS padding*/
- pad_tab(cat, tabsize);
-
- return;
- }
-
-
-/****** save_head *************************************************************
-PROTO int save_head(catstruct *cat, tabstruct *tab)
-PURPOSE Save a FITS table header.
-INPUT catalog structure,
- table structure.
-OUTPUT RETURN_OK if tab is a binary table, or RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 16/12/2004
- ***/
-int save_head(catstruct *cat, tabstruct *tab)
-
- {
- int tabflag;
-
-/* Make the table parameters reflect its content*/
- update_tab(tab);
-/* The header itself*/
- tabflag = update_head(tab);
- QFTELL(cat->file, tab->headpos, cat->filename);
- QFWRITE(tab->headbuf, tab->headnblock*FBSIZE, cat->file, cat->filename);
-
- return tabflag;
- }
-
-
-/******* pad_tab *************************************************************
-PROTO int pad_tab(catstruct *cat, KINGSIZE_T size)
-PURPOSE Pad the FITS body of a tab with 0's to FBSIZE.
-INPUT A pointer to the cat structure,
- the number of elements that have been written.
-OUTPUT RETURN_OK if padding necessary, RETURN_ERROR otherwise.
-NOTES .
-AUTHOR E. Bertin (IAP)
-VERSION 23/01/2003
- ***/
-int pad_tab(catstruct *cat, KINGSIZE_T size)
- {
- static char padbuf[FBSIZE];
- int padsize;
-
- padsize = PADEXTRA(size);
- if (padsize)
- {
- QFWRITE(padbuf, padsize, cat->file, cat->filename);
- return RETURN_OK;
- }
- else
- return RETURN_ERROR;
- }
-
-
-/****** init_writeobj *********************************************************
-PROTO void init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf)
-PURPOSE Prepare the writing of individual sources in a FITS table
-INPUT catalog structure,
- table structure,
- pointer to an array pointer to be used as a temporary buffer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-void init_writeobj(catstruct *cat, tabstruct *tab, char **pbuf)
-
- {
- keystruct *key;
- int k;
-
-/* Make the table parameters reflect its content*/
- update_tab(tab);
-/* The header itself */
- if (save_head(cat, tab) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Not a binary table: ", tab->extname);
-
-/* Store the current position */
- QFTELL(cat->file, tab->bodypos, cat->filename);
-
-/* Allocate memory for the output buffer */
- QMALLOC(*pbuf, char, tab->naxisn[0]);
-
-/* Scan keys to check that memory has been allocated */
- key = tab->key;
- for (k=tab->nkey; k--; key = key->nextkey)
- if (!key->ptr)
- error(EXIT_FAILURE, "*Error*: no memory allocated for ", key->name);
-
-/* No object written yet: initialize counter */
- tab->naxisn[1] = 0;
-
- return;
- }
-
-
-/****** write_obj *************************************************************
-PROTO int write_obj(tabstruct *tab, char *buf)
-PURPOSE Write one individual source in a FITS table
-INPUT Table structure,
- pointer to the temporary buffer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-int write_obj(tabstruct *tab, char *buf)
-
- {
- keystruct *key;
- char *pin, *pout;
- int b,k;
- int esize;
-
- key = tab->key;
- pout = buf;
- for (k=tab->nkey; k--; key = key->nextkey)
- {
- pin = key->ptr;
- if (bswapflag)
- {
- esize = t_size[key->ttype];
- swapbytes(pin, esize, key->nbytes/esize);
- }
- for (b=key->nbytes; b--;)
- *(pout++) = *(pin++);
- }
-
- QFWRITE(buf, *tab->naxisn, tab->cat->file, tab->cat->filename);
-
- return ++tab->naxisn[1];
- }
-
-
-/****** end_writeobj **********************************************************
-PROTO void end_writeobj(catstruct *cat, tabstruct *tab, char *buf)
-PURPOSE End the writing of individual sources in a FITS table
-INPUT catalog structure,
- table structure,
- pointer to the temporary buffer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 26/09/2004
- ***/
-void end_writeobj(catstruct *cat, tabstruct *tab, char *buf)
-
- {
- keystruct *key;
- OFF_T pos;
- int k;
-
-/* Make the table parameters reflect its content*/
- key = tab->key;
- for (k=tab->nkey; k--; key = key->nextkey)
- key->nobj = tab->naxisn[1];
- update_tab(tab);
-/* The header itself */
- if (update_head(tab) != RETURN_OK)
- error(EXIT_FAILURE, "*Error*: Not a binary table: ", tab->extname);
-
-/*--FITS padding*/
- pad_tab(cat, tab->tabsize);
- pos = ftell(cat->file);
- QFTELL(cat->file, pos, cat->filename);
- QFSEEK(cat->file, tab->headpos, SEEK_SET, cat->filename);
- QFWRITE(tab->headbuf, FBSIZE*tab->headnblock, cat->file, cat->filename);
- QFSEEK(cat->file, pos, SEEK_SET, cat->filename);
-
- free(buf);
-
- return;
- }
-
-
-/****** print_obj *************************************************************
-PROTO void print_obj(FILE *stream, tabstruct *tab)
-PURPOSE Print one individual source to the output stream.
-INPUT Output stream
- Table structure.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden observatory)
-VERSION 12/07/2006
- ***/
-void print_obj(FILE *stream, tabstruct *tab)
-
- {
- keystruct *key;
- char *ptr;
- int i,k, esize;
-
- if (!(key = tab->key))
- error(EXIT_FAILURE, "*Error*: no key to print in table ", tab->extname);
-
- for (k=tab->nkey; k--; key = key->nextkey)
- {
- esize = t_size[key->ttype];
- ptr = key->ptr;
- for (i = key->nbytes/esize; i--; ptr += esize)
- switch(key->ttype)
- {
- case T_FLOAT:
- fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_DOUBLE:
- fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_SHORT:
- fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_LONG:
- fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_BYTE:
- if (key->htype==H_BOOL)
- {
- if (*ptr)
- fprintf(stream, "T");
- else
- fprintf(stream, "F");
- }
- else
- fprintf(stream, key->printf?key->printf:"%d", (int)*ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_STRING:
- fprintf(stream, "%c", (int)*ptr);
- break;
- default:
- error(EXIT_FAILURE, "*FATAL ERROR*: Unknown FITS type in ",
- "print_obj()");
- }
- if (k)
- putc(' ', stream);
- }
-
- putc('\n', stream);
-
- return;
- }
-
-
-/****** voprint_obj ***********************************************************
-PROTO void voprint_obj(FILE *stream, tabstruct *tab)
-PURPOSE Print one individual source to the output stream in VOTable format
-INPUT Output stream
- Table structure.
-OUTPUT -.
-NOTES -.
-AUTHOR G. Tissier & E.Bertin (IAP)
-VERSION 12/07/2006
- ***/
-void voprint_obj(FILE *stream, tabstruct *tab)
-
- {
- keystruct *key;
- char *ptr;
- int i,k, esize;
-
- if (!(key = tab->key))
- error(EXIT_FAILURE, "*Error*: no key to print in table ", tab->extname);
-
- fprintf(stream, " <TR>");
-
- for (k=tab->nkey; k--; key = key->nextkey)
- {
- fprintf(stream, "<TD>");
-
- esize = t_size[key->ttype];
- ptr = key->ptr;
- for (i = key->nbytes/esize; i--; ptr += esize)
- switch(key->ttype)
- {
- case T_FLOAT:
- fprintf(stream, *key->printf?key->printf:"%g", *(float *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_DOUBLE:
- fprintf(stream, *key->printf?key->printf:"%f", *(double *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_SHORT:
- fprintf(stream, *key->printf?key->printf:"%d", *(short *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_LONG:
- fprintf(stream, *key->printf?key->printf:"%d", *(int *)ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_BYTE:
- if (key->htype==H_BOOL)
- {
- if (*ptr)
- fprintf(stream, "T");
- else
- fprintf(stream, "F");
- }
- else
- fprintf(stream, key->printf?key->printf:"%d", (int)*ptr);
- if (i)
- putc(' ', stream);
- break;
- case T_STRING:
- fprintf(stream, "%c", (int)*ptr);
- break;
- default:
- error(EXIT_FAILURE, "*FATAL ERROR*: Unknown FITS type in ",
- "voprint_obj()");
- }
-
- fprintf(stream, "</TD>");
- }
-
- fprintf(stream, "</TR>\n");
-
- return;
- }
diff --git a/sextractor/src/flag.c b/sextractor/src/flag.c
deleted file mode 100644
index d331265..0000000
--- a/sextractor/src/flag.c
+++ /dev/null
@@ -1,228 +0,0 @@
- /*
- flag.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Function related to external flagging.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "plist.h"
-#include "flag.h"
-
-/********************************* getflags *********************************
-PROTO void getflags(objstruct *obj, pliststruct *pixel)
-PURPOSE Return the composited flags extracted from the flag-maps.
-INPUT obj structure,
- pixel list.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 18/11/98
- ***/
-void getflags(objstruct *obj, pliststruct *pixel)
- {
- pliststruct *pixt;
- FLAGTYPE imaflag,cimaflag,
- *flagstack, *fs;
- int i,n,nmax,nc,nflag,nflag0,
- *nflagstack, *nfs;
-
- for (i=0; i<prefs.nimaisoflag; i++)
- {
- nmax = 0;
- imaflag = 0;
- switch(prefs.flag_type[i])
- {
- case FLAG_OR:
- for (pixt=pixel+obj->firstpix;pixt>=pixel;
- pixt=pixel+PLIST(pixt,nextpix))
- if ((cimaflag = PLISTFLAG(pixt,flag[i])))
- {
- imaflag |= cimaflag;
- nmax++;
- }
- break;
- case FLAG_AND:
- for (pixt=pixel+obj->firstpix;pixt>=pixel;
- pixt=pixel+PLIST(pixt,nextpix))
- if ((cimaflag = PLISTFLAG(pixt,flag[i])))
- {
- imaflag &= cimaflag;
- nmax++;
- }
- break;
- case FLAG_MIN:
- imaflag = UINT_MAX;
- for (pixt=pixel+obj->firstpix;pixt>=pixel;
- pixt=pixel+PLIST(pixt,nextpix))
- if ((cimaflag = PLISTFLAG(pixt,flag[i])))
- {
- if (cimaflag<imaflag)
- {
- imaflag = cimaflag;
- nmax = 1;
- }
- else if (cimaflag==imaflag)
- nmax++;
- }
- if (!nmax)
- imaflag = 0;
- break;
- case FLAG_MAX:
- imaflag = 0;
- for (pixt=pixel+obj->firstpix;pixt>=pixel;
- pixt=pixel+PLIST(pixt,nextpix))
- if ((cimaflag = PLISTFLAG(pixt,flag[i])))
- {
- if (cimaflag>imaflag)
- {
- imaflag = cimaflag;
- nmax = 1;
- }
- else if (cimaflag==imaflag)
- nmax++;
- }
- if (!nmax)
- imaflag = 0;
- break;
- case FLAG_MOST:
-/*------ Allocate memory for the buffers */
- nflag = FLAG_BUFSIZE;
- QCALLOC(flagstack, FLAGTYPE, nflag);
- QCALLOC(nflagstack, int, nflag);
-/*------ Count flag values */
- for (pixt=pixel+obj->firstpix;pixt>=pixel;
- pixt=pixel+PLIST(pixt,nextpix))
- if ((cimaflag = PLISTFLAG(pixt,flag[i])))
- {
- for (n=nflag, fs=flagstack, nfs=nflagstack; n-- && *nfs; nfs++)
- if (*(fs++) == cimaflag)
- {
- (*nfs)++;
- break;
- }
- if (n<0)
- {
- nflag0 = nflag;
- nflag += FLAG_BUFSIZE;
- QREALLOC(flagstack, FLAGTYPE, nflag)
- fs = flagstack + nflag0;
- memset(fs, 0, (size_t)FLAG_BUFSIZE*sizeof(FLAGTYPE));
- QREALLOC(nflagstack, int, nflag)
- nfs = nflagstack + nflag0;
- memset(nfs, 0, (size_t)FLAG_BUFSIZE*sizeof(int));
- }
- if (!*nfs)
- {
- *fs = cimaflag;
- *nfs = 1;
- }
- }
-
-/*------ Explore the list we have built and search for most frequent flags */
- for (n=nflag, fs=flagstack, nfs=nflagstack; n-- && *nfs; fs++)
- if ((nc=*(nfs++))>nmax)
- {
- nmax = nc;
- imaflag = *fs;
- }
-
-/*------ Free memory allocated for the buffers */
- free(flagstack);
- free(nflagstack);
- break;
- default:
- error(EXIT_FAILURE, "*Internal Error*: Unknown FLAG_TYPE","");
- }
-
- if (i<prefs.imaflag_size)
- obj->imaflag[i] = imaflag;
- if (i<prefs.imanflag_size)
- obj->imanflag[i] = nmax;
- }
-
- return;
- }
-
-/******************************* mergeflags *********************************
-PROTO void mergeflags(objstruct *objmaster, objstruct *objslave)
-PURPOSE Composite flag extracted from the flag-maps.
-INPUT obj structure (,
- pixel list.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 29/04/98
- ***/
-void mergeflags(objstruct *objmaster, objstruct *objslave)
- {
- FLAGTYPE *masterflag,*slaveflag;
- int i, *masternflag,*slavenflag;
-
- masterflag = objmaster->imaflag;
- masternflag = objmaster->imanflag;
- slaveflag = objslave->imaflag;
- slavenflag = objslave->imanflag;
- for (i=0; i<prefs.nimaisoflag; i++,
- masterflag++,masternflag++,slaveflag++,slavenflag++)
- switch(prefs.flag_type[i])
- {
- case FLAG_OR:
- *masterflag |= *slaveflag;
- *masternflag += *slavenflag;
- break;
- case FLAG_AND:
- *masterflag &= *slaveflag;
- *masternflag += *slavenflag;
- break;
- case FLAG_MIN:
- if (*slaveflag == *masterflag)
- *masternflag += *slavenflag;
- else if (*slaveflag<*masterflag)
- {
- *masterflag = *slaveflag;
- *masternflag = *slavenflag;
- }
- break;
- case FLAG_MAX:
- if (*slaveflag == *masterflag)
- *masternflag += *slavenflag;
- else if (*slaveflag>*masterflag)
- {
- *masterflag = *slaveflag;
- *masternflag = *slavenflag;
- }
- break;
- case FLAG_MOST:
- if (*slavenflag>*masternflag)
- {
- *masterflag = *slaveflag;
- *masternflag = *slavenflag;
- }
- break;
- default:
- error(EXIT_FAILURE, "*Internal Error*: Unknown FLAG_TYPE","");
- }
-
- return;
- }
-
diff --git a/sextractor/src/flag.h b/sextractor/src/flag.h
deleted file mode 100644
index a51bfd3..0000000
--- a/sextractor/src/flag.h
+++ /dev/null
@@ -1,25 +0,0 @@
- /*
- flag.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP, Leiden observatory & ESO)
-*
-* Contents: include to flag.c (external flagging).
-*
-* Last modify: 28/04/98
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*--------------------------- Internal constants ----------------------------*/
-
-#define FLAG_BUFSIZE 32 /* Flag-stacksize at start */
-
-/*------------------------------- functions ---------------------------------*/
-
-void getflags(objstruct *obj, pliststruct *pixel),
- mergeflags(objstruct *objmaster, objstruct *objslave);
-
diff --git a/sextractor/src/globals.h b/sextractor/src/globals.h
deleted file mode 100644
index e9d62f0..0000000
--- a/sextractor/src/globals.h
+++ /dev/null
@@ -1,86 +0,0 @@
- /*
- globals.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: global declarations.
-*
-* Last modify: 14/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#include "types.h"
-
-/*----------------------- miscellaneous variables ---------------------------*/
-
-sexcatstruct thecat;
-picstruct thefield1,thefield2, thewfield1,thewfield2;
-objstruct flagobj;
-obj2struct flagobj2;
-extern obj2struct outobj2;
-float ctg[37], stg[37];
-char gstr[MAXCHAR];
-
-/*------------------------------- functions ---------------------------------*/
-extern void allocparcelout(void),
- analyse(picstruct *, picstruct *, int, objliststruct *),
- blankit(char *, int),
- endcat(char *error),
- reendcat(void),
- closecheck(void),
- copydata(picstruct *, int, int),
- endfield(picstruct *),
- endobject(picstruct *, picstruct *, picstruct *, picstruct *,
- int, objliststruct *),
- examineiso(picstruct *, picstruct *, objstruct *,
- pliststruct *),
- flagcleancrowded(int, objliststruct *),
- freeparcelout(void),
- getnnw(void),
- initcat(void),
- reinitcat(picstruct *),
- initglob(void),
- makeit(void),
- mergeobject(objstruct *, objstruct *),
- neurinit(void),
- neurclose(void),
- neurresp(double *, double *),
- preanalyse(int, objliststruct *, int),
- readcatparams(char *),
- readdata(picstruct *, PIXTYPE *, int),
- readidata(picstruct *, FLAGTYPE *, int),
- readimagehead(picstruct *),
- readprefs(char *, char **, char **, int),
- scanimage(picstruct *, picstruct *, picstruct **, int,
- picstruct *, picstruct *),
- sexcircle(PIXTYPE *bmp, int, int, double, double, double,
- PIXTYPE),
- sexdraw(PIXTYPE *bmp, int, int, double, double, PIXTYPE),
- sexellips(PIXTYPE *bmp, int, int, double, double, double,
- double, double, PIXTYPE, int),
- sexmove(double, double),
- updateparamflags(void),
- useprefs(void),
- writecat(int, objliststruct *),
- write_error(char *msg1, char *msg2),
- write_vo_fields(FILE *file);
-
-extern float hmedian(float *, int);
-
-extern int addobj(int, objliststruct *, objliststruct *),
- belong(int, objliststruct *, int, objliststruct *),
- gatherup(objliststruct *, objliststruct *),
- parcelout(objliststruct *, objliststruct *);
-
-extern void *loadstrip(picstruct *, picstruct *);
-
-extern char *readfitshead(FILE *, char *, int *);
-
-extern picstruct *inheritfield(picstruct *infield, int flags),
- *newfield(char *, int , int);
-
diff --git a/sextractor/src/graph.c b/sextractor/src/graph.c
deleted file mode 100644
index b558817..0000000
--- a/sextractor/src/graph.c
+++ /dev/null
@@ -1,158 +0,0 @@
- /*
- graph.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: simple graphical functions.
-*
-* Last modify: 13/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-
-#include "define.h"
-#include "globals.h"
-
-double sexx1, sexy1;
-
-/********************************* sexmove **********************************/
-/*
-Move function (related to sexdraw)..
-*/
-void sexmove(double x, double y)
-
- {
- sexx1 = x;
- sexy1 = y;
-
- return;
- }
-
-
-/********************************* sexdraw **********************************/
-/*
-Draw a line in a PIXTYPE bitmap.
-*/
-void sexdraw(PIXTYPE *bmp, int w, int h, double sexx2, double sexy2,
- PIXTYPE val)
-
- {
- double dx,dy, slope;
- int ix1,iy1, ix2,iy2, ix,iy;
-
- dx = sexx2-sexx1;
- dy = sexy2-sexy1;
- if (fabs(dx) > fabs(dy))
- {
- slope = dy/dx;
- ix1 = RINT(sexx1);
- ix2 = RINT(sexx2);
- if (ix2>ix1)
- {
- for (ix=ix1+1; ix<=ix2; ix++)
- if (ix>=0 && ix<w)
- {
- iy = RINT(sexy1+(ix-sexx1)*slope);
- if (iy>=0 && iy<h)
- bmp[ix+w*iy] += val;
- }
- }
- else
- {
- for (ix=ix1-1; ix>=ix2; ix--)
- if (ix>=0 && ix<w)
- {
- iy = RINT(sexy1+(ix-sexx1)*slope);
- if (iy>=0 && iy<h)
- bmp[ix+w*iy] += val;
- }
- }
- }
- else
- {
- slope = dx/(dy == 0.0? 1.0:dy);
- iy1 = RINT(sexy1);
- iy2 = RINT(sexy2);
- if (iy2>iy1)
- {
- for (iy=iy1+1; iy<=iy2; iy++)
- if (iy>=0 && iy<h)
- {
- ix = RINT(sexx1+(iy-sexy1)*slope);
- if (ix>=0 && ix<w)
- bmp[ix+w*iy] += val;
- }
- }
- else
- for (iy=iy1-1; iy>=iy2; iy--)
- {
- if (iy>=0 && iy<h)
- {
- ix = RINT(sexx1+(iy-sexy1)*slope);
- if (ix>=0 && ix<w)
- bmp[ix+w*iy] += val;
- }
- }
- }
-
- sexx1 = sexx2;
- sexy1 = sexy2;
- return;
- }
-
-
-/******************************** sexcircle *********************************/
-/*
-Draw a circle in a PIXTYPE bitmap.
-*/
-void sexcircle(PIXTYPE *bmp, int w, int h, double x, double y, double r,
- PIXTYPE val)
-
- {
- int i;
-
- sexmove(x+r, y);
- for (i=0; i<37; i++)
- sexdraw(bmp,w,h, x+r*ctg[i], y+r*stg[i], val);
-
- return;
- }
-
-
-/******************************** sexellips *********************************/
-/*
-Draw an ellips in a PIXTYPE bitmap.
-*/
-void sexellips(PIXTYPE *bmp, int w, int h, double x, double y, double a,
- double b, double theta, PIXTYPE val, int dotflag)
-
- {
- int i;
- double ct, st;
-
- ct = cos(PI*theta/180);
- st = sin(PI*theta/180);
-
- sexmove(x+a*ct, y+a*st);
- for (i=1; i<37; i++)
- if (dotflag && !(i&1))
- sexmove(x + a*ctg[i]*ct - b*stg[i]*st,
- y + a*ctg[i]*st + b*stg[i]*ct);
- else
- sexdraw(bmp,w,h, x + a*ctg[i]*ct - b*stg[i]*st,
- y + a*ctg[i]*st + b*stg[i]*ct, val);
-
- return;
- }
-
diff --git a/sextractor/src/growth.c b/sextractor/src/growth.c
deleted file mode 100644
index 0479841..0000000
--- a/sextractor/src/growth.c
+++ /dev/null
@@ -1,359 +0,0 @@
- /*
- growth.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Make growth curves.
-*
-* Last modify: 15/02/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "growth.h"
-
-/*------------------------------- variables ---------------------------------*/
-
-static double *growth;
-static int ngrowth;
-static obj2struct *obj2 = &outobj2;
-
-/******************************** initgrowth *********************************/
-/*
-Allocate memory for growth curve stuff.
-*/
-void initgrowth()
- {
-
- QMALLOC(growth, double, GROWTH_NSTEP);
-/* Quick (and dirty) fix to allow FLUX_RADIUS support */
- if (FLAG(obj2.flux_radius) && !prefs.flux_radiussize)
- {
- QCALLOC(obj2->flux_radius, float, 1);
- }
-
- return;
- }
-
-
-/******************************** endgrowth **********************************/
-/*
-Free memory occupied by growth curve stuff.
-*/
-void endgrowth()
- {
- free(growth);
- if (FLAG(obj2.flux_radius) && !prefs.flux_radiussize)
- free(obj2->flux_radius);
-
- return;
- }
-
-
-/****************************** makeavergrowth *******************************/
-/*
-Build growth curve based on averages.
-*/
-void makeavergrowth(picstruct *field, picstruct *wfield, objstruct *obj)
-
- {
- float *fgrowth;
- double *growtht,
- dx,dx1,dy,dy2,mx,my, r2,r,rlim, d, rextlim2, raper,
- offsetx,offsety,scalex,scaley,scale2, ngamma, locarea,
- tv, sigtv, area, pix, var, gain, dpos,step,step2, dg,
- stepdens, backnoise2, prevbinmargin, nextbinmargin;
- int i,j,n, x,y, x2,y2, xmin,xmax,ymin,ymax, sx,sy, w,h,
- fymin,fymax, pflag,corrflag, ipos;
- LONG pos;
- PIXTYPE *strip,*stript, *wstrip,*wstript,
- pdbkg, wthresh;
-
-
- if (wfield)
- wthresh = wfield->weight_thresh;
- else
- wthresh = 0.0; /* To avoid gcc -Wall warnings */
-
-/* Clear the growth-curve buffer */
- memset(growth, 0, (size_t)(GROWTH_NSTEP*sizeof(double)));
-
- mx = obj->mx;
- my = obj->my;
- w = field->width;
- h = field->stripheight;
- fymin = field->ymin;
- fymax = field->ymax;
- pflag = (prefs.detect_type==PHOTO)? 1:0;
- corrflag = (prefs.mask_type==MASK_CORRECT);
- var = backnoise2 = field->backsig*field->backsig;
- gain = prefs.gain;
-
-/* Integration radius */
- rlim = GROWTH_NSIG*obj->a;
- if (rlim<prefs.autoaper[0])
- rlim = prefs.autoaper[0];
- raper = rlim+1.5; /* margin for interpolation */
-/* External radius */
- rextlim2 = raper*raper;
-
- stepdens = GROWTH_NSTEP/rlim;
-/* It is useless to oversample too much! */
- if (0/*stepdens>GROWTH_OVERSAMP*/)
- {
- ngrowth = (int)(rlim*GROWTH_OVERSAMP);
- stepdens = ngrowth/rlim;
- }
- else
- ngrowth = GROWTH_NSTEP;
- step = 1/stepdens;
-
-/* Critical distances (in pixels) from bin boundaries */
- prevbinmargin = 0.75; /* > 1/sqrt(2) */
- nextbinmargin = step - 0.75; /* <step - sqrt(2) */
-/* For photographic data */
- if (pflag)
- {
- ngamma = field->ngamma;
- pdbkg = exp(obj->dbkg/ngamma);
- }
- else
- {
- ngamma = 0.0;
- pdbkg = 0.0;
- }
- tv = sigtv = area = 0.0;
- scaley = scalex = 1.0/GROWTH_OVERSAMP;
- scale2 = scalex*scaley;
- offsetx = 0.5*(scalex-1.0);
- offsety = 0.5*(scaley-1.0);
- xmin = (int)(mx-raper+0.499999);
- xmax = (int)(mx+raper+1.499999);
- ymin = (int)(my-raper+0.499999);
- ymax = (int)(my+raper+1.499999);
-
- if (xmin < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if (xmax > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if (ymin < fymin)
- {
- ymin = fymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if (ymax > fymax)
- {
- ymax = fymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- strip = field->strip;
- wstrip = wstript = NULL; /* To avoid gcc -Wall warnings */
- if (wfield)
- wstrip = wfield->strip;
- for (y=ymin; y<ymax; y++)
- {
- stript = strip + (pos = (y%h)*w + xmin);
- if (wfield)
- wstript = wstrip + pos;
- for (x=xmin; x<xmax; x++, stript++, wstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((r2=dx*dx+dy*dy)<rextlim2)
- {
-/*------ Here begin tests for pixel and/or weight overflows. Things are a */
-/*------ bit intricated to have it running as fast as possible in the most */
-/*------ common cases */
- if ((pix=*stript)<=-BIG || (wfield && (var=*wstript)>=wthresh))
- {
- if (corrflag
- && (x2=(int)(2*mx+0.49999-x))>=0 && x2<w
- && (y2=(int)(2*my+0.49999-y))>=fymin && y2<fymax
- && (pix=*(strip + (pos = (y2%h)*w + x2)))>-BIG)
- {
- if (wfield)
- {
- var = *(wstrip + pos);
- if (var>=wthresh)
- pix = var = 0.0;
- }
- }
- else
- {
- pix = 0.0;
- if (wfield)
- var = 0.0;
- }
- }
- if (pflag)
- pix = exp(pix/ngamma) - pdbkg;
-
-/*------ Check if oversampling is needed (close enough to a bin boundary) */
- d = fmod(r=sqrt(r2),step);
- if (d<prevbinmargin || d>nextbinmargin)
- {
- dx += offsetx;
- dy += offsety;
- locarea = 0.0;
- for (sy=GROWTH_OVERSAMP; sy--; dy+=scaley)
- {
- dx1 = dx;
- dy2 = dy*dy;
- for (sx=GROWTH_OVERSAMP; sx--; dx1+=scalex)
- {
- j = (int)(sqrt(dx1*dx1+dy2)*stepdens);
- if (j<ngrowth)
- {
- growth[j] += scale2*pix;
- locarea += scale2;
- }
- }
- }
- }
- else
- {
- j = (int)(r*stepdens);
- if (j<ngrowth)
- {
- growth[j] += pix;
- locarea = 1.0;
- }
- }
- area += locarea;
-/*
- if (pflag)
- sigtv += var*locarea*pix*pix;
- else
- sigtv += var*locarea;
- tv += locarea*pix;
- if (wfield && pix>0.0 && gain>0.0)
- sigtv += pix/gain*var/backnoise2;
-*/
- }
- }
- }
-
-/*
- if (pflag)
- {
- tv = ngamma*(tv-area*exp(obj->dbkg/ngamma));
- sigtv /= ngamma*ngamma;
- }
- else
- {
- tv -= area*obj->dbkg;
- if (!wfield && gain > 0.0 && tv>0.0)
- sigtv += tv/gain;
- }
-*/
-
-/* Integrate the growth curve */
- pix = 0.0;
- growtht = growth;
- for (i=ngrowth; i--;)
- {
- *growtht += pix;
- pix = *(growtht++);
- }
-
-/* Now let's remap the growth-curve to match user's choice */
- if (FLAG(obj2.flux_growth))
- {
- n = prefs.flux_growthsize;
- if (FLAG(obj2.flux_growthstep))
- obj2->flux_growthstep = rlim/n;
- fgrowth = obj2->flux_growth;
- step2 = (double)GROWTH_NSTEP/n;
- j = 1;
- for (i=n; i--; j++)
- {
- ipos = (int)(dpos=step2*j-0.99999);
- if (dpos<0.0)
- *(fgrowth++) = (float)(*growth*(0.99999+dpos));
- else
- {
- growtht = growth + ipos;
- *(fgrowth++) = (float)(*growtht+(*(growtht+1)-*growtht)*(dpos-ipos));
- }
- }
- }
-
- if (FLAG(obj2.mag_growth))
- {
- n = prefs.mag_growthsize;
- if (FLAG(obj2.mag_growthstep))
- obj2->mag_growthstep = rlim/n;
- fgrowth = obj2->mag_growth;
- step2 = (double)GROWTH_NSTEP/n;
- j = 1;
- for (i=n; i--; j++)
- {
- ipos = (int)(dpos=step2*j-0.99999);
- if (dpos<0.0)
- pix = *growth*(0.99999+dpos);
- else
- {
- growtht = growth + ipos;
- pix = *growtht+(*(growtht+1)-*growtht)*(dpos-ipos);
- }
- *(fgrowth++) = pix>0.0?(prefs.mag_zeropoint-2.5*log10(pix)):99.0;
- }
- }
-
- if (FLAG(obj2.flux_radius))
- {
- n = ngrowth-1;
- for (j=0; j<prefs.nflux_frac; j++)
- {
- tv = prefs.flux_frac[j]*obj2->flux_auto;
- growtht = growth-1;
- for (i=0; i<n && *(++growtht)<tv; i++);
- obj2->flux_radius[j] = step
- *(i? ((dg=*growtht - *(growtht-1)) != 0.0 ?
- i + (tv - *(growtht-1))/dg
- : i)
- : (*growth !=0.0 ?tv/(*growth) : 0.0));
- }
- }
-
-/* Specific to Half-light radius used by other parameters */
- if (FLAG(obj2.hl_radius))
- {
- n = ngrowth-1;
- tv = 0.5*obj2->flux_auto;
- growtht = growth-1;
- for (i=0; i<n && *(++growtht)<tv; i++);
- obj2->hl_radius = step*(i? ((dg=*growtht - *(growtht-1)) != 0.0 ?
- i + (tv - *(growtht-1))/dg
- : i)
- : (*growth !=0.0 ?tv/(*growth) : 0.0));
- }
-
- return;
- }
-
-
-
diff --git a/sextractor/src/growth.h b/sextractor/src/growth.h
deleted file mode 100644
index fd79452..0000000
--- a/sextractor/src/growth.h
+++ /dev/null
@@ -1,36 +0,0 @@
- /*
- growth.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden observatory
-*
-* Contents: Include file for growth.c.
-*
-* Last modify: 04/05/98
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define GROWTH_NSTEP 64 /* number of growth curve samples */
-#define GROWTH_OVERSAMP 5 /* pixel oversampling in each dimension */
-#define GROWTH_NSIG 3*MARGIN_SCALE /* MAG_AUTO analysis range (number */
- /* of sigma) */
-
-/* NOTES:
-One must have: GROWTH_SAMP >= 1
- GROWTH_OVERSAMP >= 1
- GROWTH_OVERSAMPRADIUS >= 0
- GROWTH_NSIG > 0.0
-*/
-
-/*------------------------------- functions ---------------------------------*/
-extern void endgrowth(void),
- initgrowth(void),
- makeavergrowth(picstruct *field, picstruct *wfield,
- objstruct *obj);
-
diff --git a/sextractor/src/image.c b/sextractor/src/image.c
deleted file mode 100644
index 425104c..0000000
--- a/sextractor/src/image.c
+++ /dev/null
@@ -1,643 +0,0 @@
- /*
- image.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Function related to image manipulations.
-*
-* Last modify: 13/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "image.h"
-
-static float interpm[INTERPW*INTERPH];
-
-/********************************* copyimage *********************************/
-/*
-Copy a small part of the image. Image parts which lie outside boundaries are
-set to -BIG.
-*/
-int copyimage(picstruct *field, PIXTYPE *dest, int w,int h, int ix,int iy)
- {
- PIXTYPE *destt;
- int i,y, xmin,xmax,ymin,ymax,w2;
-
-/* First put the retina background to -BIG */
- destt = dest;
- for (i=w*h; i--;)
- *(destt++) = -BIG;
-
-/* Don't go further if out of frame!! */
- if (ix<0 || ix>=field->width || iy<field->ymin || iy>=field->ymax)
- return RETURN_ERROR;
-
-/* Set the image boundaries */
- w2 = w;
- ymin = iy-h/2;
- ymax = ymin + h;
- if (ymin<field->ymin)
- {
- dest += (field->ymin-ymin)*w;
- ymin = field->ymin;
- }
- if (ymax>field->ymax)
- ymax = field->ymax;
-
- xmin = ix-w/2;
- xmax = xmin + w;
- if (xmax>field->width)
- {
- w2 -= xmax-field->width;
- xmax = field->width;
- }
- if (xmin<0)
- {
- dest += -xmin;
- w2 -= -xmin;
- xmin = 0;
- }
-
-/* Copy the right pixels to the destination */
- for (y=ymin; y<ymax; y++, dest += w)
- memcpy(dest, &PIX(field, xmin, y), w2*sizeof(PIXTYPE));
-
- return RETURN_OK;
- }
-
-
-/********************************* addimage **********************************/
-/*
-Add a PSF to a part of the image (with a multiplicative factor).
-Outside boundaries are taken into account.
-*/
-void addimage(picstruct *field, float *psf,
- int w,int h, int ix,int iy, float amplitude)
- {
- PIXTYPE *pix;
- int x,y, xmin,xmax,ymin,ymax,w2, dwpsf;
-
-/* Set the image boundaries */
- w2 = w;
- ymin = iy-h/2;
- ymax = ymin + h;
- if (ymin<field->ymin)
- {
- psf += (field->ymin-ymin)*w;
- ymin = field->ymin;
- }
- if (ymax>field->ymax)
- ymax = field->ymax;
-
- xmin = ix-w/2;
- xmax = xmin + w;
- if (xmax>field->width)
- {
- w2 -= xmax-field->width;
- xmax = field->width;
- }
- if (xmin<0)
- {
- psf += -xmin;
- w2 -= -xmin;
- xmin = 0;
- }
-
- dwpsf = w-w2;
-/* Subtract the right pixels to the destination */
- for (y=ymin; y<ymax; y++, psf += dwpsf)
- {
- pix = &PIX(field, xmin, y);
- for (x=w2; x--;)
- *(pix++) += amplitude**(psf++);
- }
-
- return;
- }
-
-
-/***************************** copyimage_center ******************************/
-/*
-Copy a small part of the image and recenter it through sinc interpolation.
-Image parts which lie outside boundaries are set to 0.
-*/
-int copyimage_center(picstruct *field, PIXTYPE *dest, int w,int h,
- float x,float y)
- {
- PIXTYPE *s,*s0, *dt,*dt0,*dt2;
- float *m,
- dx,dy, ddx0,ddx,ddy,sum, fy, mval;
- int i,ix,iy, idmx,idmy, mx,my, xmin,ymin,xmin2,x0,y0,y2, w2,h2,
- sw,sh, idx,idy;
-
- dx = x - (ix=(int)x);
- dy = y - (iy=(int)y);
-
-/* Initialize destination buffer to zero */
- memset(dest, 0, w*h*sizeof(PIXTYPE));
-
-/* Don't go further if out of frame!! */
- if (ix<0 || ix>=field->width || iy<field->ymin || iy>=field->ymax)
- return RETURN_ERROR;
-
-/* Compute the interpolation mask */
- ddx0 = -(idmx=(INTERPW-(dx>0.0?1:0))/2)-dx;
- ddy = -(idmy=(INTERPH-(dy>0.0?1:0))/2)-dy;
- sum = 0.0;
- m = interpm;
- for (my=INTERPH; my--; ddy+=1.0)
- {
- ddx = ddx0;
- fy = INTERPF(ddy);
- for (mx=INTERPW; mx--;ddx+=1.0)
- sum += *(m++) = fy*INTERPF(ddx);
- }
-
-/* Normalize it */
- m = interpm;
- for (i=INTERPW*INTERPH; i--;)
- *(m++) /= sum;
-
-/* Do the interpolation */
- m = interpm;
- xmin = ix - w/2 - idmx;
- ymin = iy - h/2 - idmy;
- sw = field->width;
- sh = field->stripheight;
- for (my=INTERPH; my--; ymin++)
- {
-/*-- Set the image boundaries in y */
- if ((idy = field->ymin-ymin) > 0)
- {
- dt0 = dest + w*idy;
- y0 = field->ymin;
- h2 = (idy<h ? (h - idy) : 0);
- }
- else
- {
- dt0 = dest;
- y0 = ymin;
- h2 = h;
- }
- if ((idy = field->ymax - y0) < h2)
- h2 = idy;
- xmin2 = xmin;
- for (mx=INTERPW; mx--; xmin2++)
- {
- mval = *(m++);
-/*---- Set the image boundaries in x */
- if (xmin2 < 0)
- {
- dt = dt0 - xmin2;
- x0 = 0;
- if ((w2 = w + xmin2) < 0)
- w2 = 0;
- }
- else
- {
- dt = dt0;
- x0 = xmin2;
- w2 = w;
- }
- if ((idx = sw - x0) < w2)
- w2 = idx;
-
- if (h2 >= 0 && w2 >= 0)
- {
- s0 = field->strip + x0;
- y2 = y0;
- for (iy=h2; iy--; dt+=w)
- {
- dt2 = dt;
- s = s0+sw*((y2++)%sh);
- for (ix=w2; ix--;)
- *(dt2++) += mval**(s++);
- }
- }
- }
- }
-
- return RETURN_OK;
- }
-
-
-/****************************** addimage_center ******************************/
-/*
-Add a vignet to an image (with a multiplicative factor), recentered through
-sinc interpolation.
-*/
-void addimage_center(picstruct *field, float *psf, int w,int h,
- float x,float y, float amplitude)
- {
- PIXTYPE *s,*s0, *dt,*dt0,*dt2;
- float *m,
- dx,dy, ddx0,ddx,ddy,sum, fy, mval;
- int i,ix,iy, idmx,idmy, mx,my, xmin,ymin,xmin2,x0,y0,y2, w2,h2,
- sw,sh, idx,idy;
-
-/*
-QMALLOC(psf2, float, w*h);
-copyimage_center(field, psf2, w, h, x, y)
-dt = psf;
-dt2 = psf2;
-for (i=w*h; i--; dt++)
-*dt = amplitude*(dt++) - *(dt2++);
-free(psf2);
-*/
- dx = x - (ix=(int)x);
- dy = y - (iy=(int)y);
-
-/* Don't go further if out of frame!! */
- if (ix<0 || ix>=field->width || iy<field->ymin || iy>=field->ymax)
- return;
-
-/* Compute the interpolation mask */
- ddx0 = -(idmx=(INTERPW-(dx>0.0?1:0))/2)-dx;
- ddy = -(idmy=(INTERPH-(dy>0.0?1:0))/2)-dy;
- sum = 0.0;
- m = interpm;
- for (my=INTERPH; my--; ddy+=1.0)
- {
- ddx = ddx0;
- fy = INTERPF(ddy);
- for (mx=INTERPW; mx--;ddx+=1.0)
- sum += *(m++) = fy*INTERPF(ddx);
- }
-
-/* Normalize it */
- m = interpm;
- for (i=INTERPW*INTERPH; i--;)
- *(m++) /= sum;
-
-/* Do the interpolation */
- m = interpm;
- xmin = ix - w/2 - idmx;
- ymin = iy - h/2 - idmy;
- sw = field->width;
- sh = field->stripheight;
- for (my=INTERPH; my--; ymin++)
- {
-/*-- Set the image boundaries in y */
- if ((idy = field->ymin-ymin) > 0)
- {
- dt0 = psf + w*idy;
- y0 = field->ymin;
- h2 = (idy<h ? (h - idy) : 0);
- }
- else
- {
- dt0 = psf;
- y0 = ymin;
- h2 = h;
- }
- if ((idy = field->ymax - y0) < h2)
- h2 = idy;
- xmin2 = xmin;
- for (mx=INTERPW; mx--; xmin2++)
- {
- mval = *(m++);
-/*---- Set the image boundaries in x */
- if (xmin2 < 0)
- {
- dt = dt0 - xmin2;
- x0 = 0;
- if ((w2 = w + xmin2) < 0)
- w2 = 0;
- }
- else
- {
- dt = dt0;
- x0 = xmin2;
- w2 = w;
- }
- if ((idx = sw - x0) < w2)
- w2 = idx;
-
- if (h2 >= 0 && w2 >= 0)
- {
- s0 = field->strip + x0;
- y2 = y0;
- for (iy=h2; iy--; dt+=w)
- {
- dt2 = dt;
- s = s0+sw*((y2++)%sh);
- for (ix=w2; ix--;)
- *(s++) += amplitude*mval**(dt2++);
- }
- }
- }
- }
-
- return;
- }
-
-
-/********************************* blankimage *******************************/
-/*
-Blank a small part of the image according to a mask.
-*/
-void blankimage(picstruct *field, PIXTYPE *mask, int w,int h,
- int xmin,int ymin, PIXTYPE val)
- {
- PIXTYPE *pixt;
- int x,y, xmax,ymax,w2;
-
-/* Don't go further if out of frame!! */
- if (xmin+w<0 || xmin>=field->width
- || ymin+h<field->ymin || ymin>=field->ymax)
- return;
-
-/* Set the image boundaries */
- w2 = w;
- ymax = ymin + h;
- if (ymin<field->ymin)
- {
- mask += (field->ymin-ymin)*w;
- ymin = field->ymin;
- }
- if (ymax>field->yblank)
- ymax = field->yblank;
-
- xmax = xmin + w;
- if (xmax>field->width)
- {
- w2 -= xmax-field->width;
- xmax = field->width;
- }
- if (xmin<0)
- {
- mask += -xmin;
- w2 -= -xmin;
- xmin = 0;
- }
-
- w -= w2;
-
-/* Blank the right pixels in the image */
- for (y=ymin; y<ymax; y++, mask += w)
- {
- pixt = &PIX(field, xmin,y);
- for (x=w2; x--; pixt++)
- if (*(mask++) > -BIG)
- *pixt = val;
- }
-
- return;
- }
-
-
-/********************************* pasteimage *******************************/
-/*
-Paste a mask onto an image.
-*/
-void pasteimage(picstruct *field, PIXTYPE *mask, int w,int h,
- int xmin,int ymin)
- {
- PIXTYPE *pixt, val;
- int x,y, xmax,ymax,w2;
-
-/* Don't go further if out of frame!! */
- if (xmin+w<0 || xmin>=field->width
- || ymin+h<field->ymin || ymin>=field->ymax)
- return;
-
-/* Set the image boundaries */
- w2 = w;
- ymax = ymin + h;
- if (ymin<field->ymin)
- {
- mask += (field->ymin-ymin)*w;
- ymin = field->ymin;
- }
- if (ymax>field->ymax)
- ymax = field->ymax;
-
- xmax = xmin + w;
- if (xmax>field->width)
- {
- w2 -= xmax-field->width;
- xmax = field->width;
- }
- if (xmin<0)
- {
- mask += -xmin;
- w2 -= -xmin;
- xmin = 0;
- }
-
- w -= w2;
-
-/* Blank the right pixels in the image */
- for (y=ymin; y<ymax; y++, mask += w)
- {
- pixt = &PIX(field, xmin,y);
- for (x=w2; x--; pixt++)
- if ((val = *(mask++)) > -BIG)
- *pixt = val;
- }
-
- return;
- }
-
-
-/****************************** vignet_resample ******************************/
-/*
-Scale and shift a small image through sinc interpolation.
-Image parts which lie outside boundaries are set to 0.
-*/
-int vignet_resample(double *pix1, int w1, int h1,
- double *pix2, int w2, int h2,
- double dx, double dy, double step2)
- {
- double *mask,*maskt, xc1,xc2,yc1,yc2, xs1,ys1, x1,y1, x,y, dxm,dym,
- val,
- *pix12, *pixin,*pixin0, *pixout,*pixout0;
- int i,j,k,n,t, *start,*startt, *nmask,*nmaskt,
- ixs2,iys2, ix2,iy2, dix2,diy2, nx2,ny2, iys1a, ny1, hmw,hmh,
- ix,iy, ix1,iy1;
-
-
-/* Initialize destination buffer to zero */
- memset(pix2, 0, w2*h2*sizeof(double));
-
- xc1 = (double)(w1/2); /* Im1 center x-coord*/
- xc2 = (double)(w2/2); /* Im2 center x-coord*/
- xs1 = xc1 + dx - xc2*step2; /* Im1 start x-coord */
-
- if ((int)xs1 >= w1)
- return RETURN_ERROR;
- ixs2 = 0; /* Int part of Im2 start x-coord */
- if (xs1<0.0)
- {
- dix2 = (int)(1-xs1/step2);
-/*-- Simply leave here if the images do not overlap in x */
- if (dix2 >= w2)
- return RETURN_ERROR;
- ixs2 += dix2;
- xs1 += dix2*step2;
- }
- nx2 = (int)((w1-1-xs1)/step2+1);/* nb of interpolated Im2 pixels along x */
- if (nx2>(ix2=w2-ixs2))
- nx2 = ix2;
- if (nx2<=0)
- return RETURN_ERROR;
- yc1 = (double)(h1/2); /* Im1 center y-coord */
- yc2 = (double)(h2/2); /* Im2 center y-coord */
- ys1 = yc1 + dy - yc2*step2; /* Im1 start y-coord */
- if ((int)ys1 >= h1)
- return RETURN_ERROR;
- iys2 = 0; /* Int part of Im2 start y-coord */
- if (ys1<0.0)
- {
- diy2 = (int)(1-ys1/step2);
-/*-- Simply leave here if the images do not overlap in y */
- if (diy2 >= h2)
- return RETURN_ERROR;
- iys2 += diy2;
- ys1 += diy2*step2;
- }
- ny2 = (int)((h1-1-ys1)/step2+1);/* nb of interpolated Im2 pixels along y */
- if (ny2>(iy2=h2-iys2))
- ny2 = iy2;
- if (ny2<=0)
- return RETURN_ERROR;
-
-/* Set the yrange for the x-resampling with some margin for interpolation */
- iys1a = (int)ys1; /* Int part of Im1 start y-coord with margin */
- hmh = INTERPH/2 - 1; /* Interpolant start */
- if (iys1a<0 || ((iys1a -= hmh)< 0))
- iys1a = 0;
- ny1 = (int)(ys1+ny2*step2)+INTERPW-hmh; /* Interpolated Im1 y size */
- if (ny1>h1) /* with margin */
- ny1 = h1;
-/* Express everything relative to the effective Im1 start (with margin) */
- ny1 -= iys1a;
- ys1 -= (double)iys1a;
-
-/* Allocate interpolant stuff for the x direction */
- QMALLOC(mask, double, nx2*INTERPW); /* Interpolation masks */
- QMALLOC(nmask, int, nx2); /* Interpolation mask sizes */
- QMALLOC(start, int, nx2); /* Int part of Im1 conv starts */
-/* Compute the local interpolant and data starting points in x */
- hmw = INTERPW/2 - 1;
- x1 = xs1;
- maskt = mask;
- nmaskt = nmask;
- startt = start;
- for (j=nx2; j--; x1+=step2)
- {
- ix = (ix1=(int)x1) - hmw;
- dxm = ix1 - x1 - hmw; /* starting point in the interpolation func */
- if (ix < 0)
- {
- n = INTERPW+ix;
- dxm -= (double)ix;
- ix = 0;
- }
- else
- n = INTERPW;
- if (n>(t=w1-ix))
- n=t;
- *(startt++) = ix;
- *(nmaskt++) = n;
- for (x=dxm, i=n; i--; x+=1.0)
- *(maskt++) = INTERPF(x);
- }
-
- QCALLOC(pix12, double, nx2*ny1); /* Intermediary frame-buffer */
-
-/* Make the interpolation in x (this includes transposition) */
- pixin0 = pix1+iys1a*w1;
- pixout0 = pix12;
- for (k=ny1; k--; pixin0+=w1, pixout0++)
- {
- maskt = mask;
- nmaskt = nmask;
- startt = start;
- pixout = pixout0;
- for (j=nx2; j--; pixout+=ny1)
- {
- pixin = pixin0+*(startt++);
- val = 0.0;
- for (i=*(nmaskt++); i--;)
- val += *(maskt++)**(pixin++);
- *pixout = val;
- }
- }
-
-/* Reallocate interpolant stuff for the y direction */
- QREALLOC(mask, double, ny2*INTERPH); /* Interpolation masks */
- QREALLOC(nmask, int, ny2); /* Interpolation mask sizes */
- QREALLOC(start, int, ny2); /* Int part of Im1 conv starts */
-
-/* Compute the local interpolant and data starting points in y */
- hmh = INTERPH/2 - 1;
- y1 = ys1;
- maskt = mask;
- nmaskt = nmask;
- startt = start;
- for (j=ny2; j--; y1+=step2)
- {
- iy = (iy1=(int)y1) - hmh;
- dym = iy1 - y1 - hmh; /* starting point in the interpolation func */
- if (iy < 0)
- {
- n = INTERPH+iy;
- dym -= (double)iy;
- iy = 0;
- }
- else
- n = INTERPH;
- if (n>(t=ny1-iy))
- n=t;
- *(startt++) = iy;
- *(nmaskt++) = n;
- for (y=dym, i=n; i--; y+=1.0)
- *(maskt++) = INTERPF(y);
- }
-
-/* Make the interpolation in y and transpose once again */
- pixin0 = pix12;
- pixout0 = pix2+ixs2+iys2*w2;
- for (k=nx2; k--; pixin0+=ny1, pixout0++)
- {
- maskt = mask;
- nmaskt = nmask;
- startt = start;
- pixout = pixout0;
- for (j=ny2; j--; pixout+=w2)
- {
- pixin = pixin0+*(startt++);
- val = 0.0;
- for (i=*(nmaskt++); i--;)
- val += *(maskt++)**(pixin++);
- *pixout = val;
- }
- }
-
-/* Free memory */
- free(pix12);
- free(mask);
- free(nmask);
- free(start);
-
- return RETURN_OK;
- }
-
-
diff --git a/sextractor/src/image.h b/sextractor/src/image.h
deleted file mode 100644
index 53afcc4..0000000
--- a/sextractor/src/image.h
+++ /dev/null
@@ -1,42 +0,0 @@
- /*
- image.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Include file for image.c.
-*
-* Last modify: 29/08/98
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define INTERPW 6 /* Interpolation function range (x) */
-#define INTERPH 6 /* Interpolation function range (y) */
-
-#define INTERPF(x) (x==0.0?1.0:sin(PI*x)*sin(PI*x/3.0)/(PI*PI/3.0*x*x))
- /* Lanczos approximation */
-
-/*--------------------------- structure definitions -------------------------*/
-
-
-/*----------------------------- Global variables ----------------------------*/
-
-/*------------------------------- functions ---------------------------------*/
-extern void addimage(picstruct *field, float *psf,
- int w,int h, int ix,int iy, float amplitude),
- addimage_center(picstruct *field, float *psf,
- int w,int h, float x, float y, float amplitude),
- blankimage(picstruct *, PIXTYPE *, int,int, int,int, PIXTYPE),
- pasteimage(picstruct *, PIXTYPE *, int ,int, int, int);
-
-extern int copyimage(picstruct *, PIXTYPE *, int, int, int, int),
- copyimage_center(picstruct *, PIXTYPE *, int,int, float,float),
- vignet_resample(double *pix1, int w1, int h1, double *pix2,
- int w2, int h2, double dx, double dy, double step2);
-
diff --git a/sextractor/src/interpolate.c b/sextractor/src/interpolate.c
deleted file mode 100644
index 5f5b947..0000000
--- a/sextractor/src/interpolate.c
+++ /dev/null
@@ -1,125 +0,0 @@
- /*
- interpolate.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Interpolation of input data.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "field.h"
-#include "interpolate.h"
-
-
-/****************************** init_interpolate ****************************/
-/*
-Init resources required for data interpolation.
-*/
-void init_interpolate(picstruct *field, int xtimeout, int ytimeout)
-
- {
- QMALLOC(field->interp_backup, PIXTYPE, field->width);
-/* ytimeout < 0 means we don't need a timeout buffer (it won't be used) */
- if (ytimeout>=0)
- {
- QMALLOC(field->interp_ytimeoutbuf, int, field->width);
- memset(field->interp_ytimeoutbuf, 0, (size_t)(field->width*sizeof(int)));
- }
-
- field->interp_xtimeout = xtimeout;
- field->interp_ytimeout = ytimeout;
-
- field->interp_flag = 1;
-
- return;
- }
-
-
-/******************************** interpolate *******************************/
-/*
-Interpolate (crudely) input data.
-*/
-void interpolate(picstruct *field, picstruct *wfield,
- PIXTYPE *data, PIXTYPE *wdata)
-
- {
- PIXTYPE *backup,*wbackup,
- thresh;
- int *ytimeout,
- xtimeout,xtimeout0,ytimeout0, allflag, i;
-
- thresh = wfield->weight_thresh;
- backup = field->interp_backup;
- wbackup = wfield->interp_backup;
- ytimeout = wfield->interp_ytimeoutbuf;
- xtimeout0 = wfield->interp_xtimeout;
- ytimeout0 = wfield->interp_ytimeout;
- xtimeout = 0; /* Start as if the previous pixel was already interpolated */
- allflag = field->interp_flag;
- for (i=field->width; i--; ytimeout++)
- {
-/*-- Check if interpolation is needed */
- if (*wdata>=thresh) /* It's a variance map: the bigger the worse */
- {
-/*---- Check if the previous pixel was already interpolated */
- if (!xtimeout)
- {
- if (*ytimeout)
- {
- (*ytimeout)--;
- *wdata = *wbackup;
- if (allflag)
- *data = *backup;
- }
- }
- else
- {
- xtimeout--;
- *wdata = *(wdata-1);
- if (allflag)
- *data = *(data-1);
- }
- }
- else
- {
- xtimeout = xtimeout0;
- *ytimeout = ytimeout0;
- }
- *(wbackup++) = *(wdata++);
- if (allflag)
- *(backup++) = *(data++);
- }
-
- return;
- }
-
-
-/******************************* end_interpolate ****************************/
-/*
-Free memory allocated for data interpolation.
-*/
-void end_interpolate(picstruct *field)
-
- {
- free(field->interp_backup);
- free(field->interp_ytimeoutbuf);
-
- return;
- }
-
diff --git a/sextractor/src/interpolate.h b/sextractor/src/interpolate.h
deleted file mode 100644
index 8ac7823..0000000
--- a/sextractor/src/interpolate.h
+++ /dev/null
@@ -1,24 +0,0 @@
- /*
- interpolate.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP, Leiden observatory & ESO)
-*
-* Contents: Include file for interpolate.c.
-*
-* Last modify: 29/04/98
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*---------------------------------- protos --------------------------------*/
-
-extern void end_interpolate(picstruct *field),
- init_interpolate(picstruct *field,
- int xtimeout, int ytimeout),
- interpolate(picstruct *field, picstruct *wfield,
- PIXTYPE *data, PIXTYPE *wdata);
-
diff --git a/sextractor/src/key.h b/sextractor/src/key.h
deleted file mode 100644
index b02101f..0000000
--- a/sextractor/src/key.h
+++ /dev/null
@@ -1,42 +0,0 @@
- /*
- key.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Keyword structure.
-*
-* Last modify: 14/12/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*--------------------------------- constants -------------------------------*/
-
-#define FIND_STRICT 0
-#define FIND_NOSTRICT 1
-
-/*--------------------------- structure definitions -------------------------*/
-/* Preference keyword */
-typedef struct
- {
- char name[32];
- enum {P_FLOAT, P_INT, P_STRING, P_BOOL, P_KEY, P_INTLIST, P_FLOATLIST,
- P_BOOLLIST, P_KEYLIST, P_STRINGLIST} type;
- void *ptr; /* Pointer to the keyword value */
- int imin, imax; /* Range for int's */
- double dmin, dmax; /* Range for doubles */
- char keylist[32][32]; /* List of keywords */
- int nlistmin; /* Minimum number of list members */
- int nlistmax; /* Maximum number of list members */
- int *nlistptr; /* Ptr to store the nb of read params*/
- int flag;
- } pkeystruct;
-
-/*---------------------------------- protos --------------------------------*/
-
-int findkeys(char *str, char key[][32], int mode);
-
diff --git a/sextractor/src/main.c b/sextractor/src/main.c
deleted file mode 100644
index c52f1c9..0000000
--- a/sextractor/src/main.c
+++ /dev/null
@@ -1,128 +0,0 @@
- /*
- main.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Command-line parsing.
-*
-* Last modify: 07/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-
-#define SYNTAX \
-EXECUTABLE " <image> [<image2>][-c <configuration_file>][-<keyword> <value>]\n" \
-"> to dump a default configuration file: " EXECUTABLE " -d \n" \
-"> to dump a default extended configuration file: " EXECUTABLE " -dd \n"
-
-extern const char notokstr[];
-
-/********************************** main ************************************/
-int main(int argc, char *argv[])
-
- {
- int a, narg, nim, opt, opt2;
- char **argkey, **argval, *str;
-
- if (argc<2)
- {
- fprintf(OUTPUT, "\n %s version %s (%s)\n", BANNER,MYVERSION,DATE);
- fprintf(OUTPUT, "\nby %s\n", COPYRIGHT);
- fprintf(OUTPUT, "visit %s\n", WEBSITE);
- error(EXIT_SUCCESS, "SYNTAX: ", SYNTAX);
- }
- QMALLOC(argkey, char *, argc);
- QMALLOC(argval, char *, argc);
-
-/*default parameters */
- prefs.command_line = argv;
- prefs.ncommand_line = argc;
- prefs.pipe_flag = 0;
- prefs.nimage_name = 1;
- prefs.image_name[0] = "image";
- strcpy(prefs.prefs_name, "default.sex");
- narg = nim = 0;
-
- for (a=1; a<argc; a++)
- {
- if (*(argv[a]) == '-')
- {
- opt = (int)argv[a][1];
- if (strlen(argv[a])<4 || opt == '-')
- {
- opt2 = (int)tolower((int)argv[a][2]);
- if (opt == '-')
- {
- opt = opt2;
- opt2 = (int)tolower((int)argv[a][3]);
- }
- switch(opt)
- {
- case 'c':
- if (a<(argc-1))
- strcpy(prefs.prefs_name, argv[++a]);
- break;
- case 'd':
- dumpprefs(opt2=='d' ? 1 : 0);
- exit(EXIT_SUCCESS);
- break;
- case 'v':
- printf("%s version %s (%s)\n", BANNER,MYVERSION,DATE);
- exit(0);
- break;
- case 'h':
- default:
- error(EXIT_SUCCESS,"SYNTAX: ", SYNTAX);
- }
- }
- else
- {
-/*------ Config parameters */
- argkey[narg] = &argv[a][1];
- argval[narg++] = argv[++a];
- }
- }
- else
- {
-/*---- The input image filename(s) */
- for(; (a<argc) && (*argv[a]!='-'); a++)
- for (str=NULL;(str=strtok(str?NULL:argv[a], notokstr)); nim++)
- if (nim<MAXIMAGE)
- prefs.image_name[nim] = str;
- else
- error(EXIT_FAILURE, "*Error*: Too many input images: ", str);
- prefs.nimage_name = nim;
- a--;
- }
- }
-
- readprefs(prefs.prefs_name, argkey, argval, narg);
-
- free(argkey);
- free(argval);
-
- makeit();
-
- NFPRINTF(OUTPUT, "");
- NPRINTF(OUTPUT, "> All done (in %.0f s)\n", prefs.time_diff);
-
- return EXIT_SUCCESS;
- }
-
diff --git a/sextractor/src/makeit.c b/sextractor/src/makeit.c
deleted file mode 100644
index de85cbb..0000000
--- a/sextractor/src/makeit.c
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- makeit.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden observatory
-*
-* Contents: main program.
-*
-* Last modify: 14/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "assoc.h"
-#include "back.h"
-#include "check.h"
-#include "field.h"
-#include "filter.h"
-#include "growth.h"
-#include "interpolate.h"
-#include "psf.h"
-#include "som.h"
-#include "weight.h"
-#include "xml.h"
-
-time_t thetimet, thetimet2;
-
-/******************************** makeit *************************************/
-/*
-Manage the whole stuff.
-*/
-void makeit()
-
- {
- checkstruct *check;
- picstruct *dfield, *field,*pffield[MAXFLAG], *wfield,*dwfield;
- catstruct *imacat;
- tabstruct *imatab;
- static time_t thetime1, thetime2;
- struct tm *tm;
- int i, nok, ntab, next;
-
-/* Install error logging */
- error_installfunc(write_error);
-
-/* Processing start date and time */
- thetimet = time(NULL);
- tm = localtime(&thetimet);
- sprintf(prefs.sdate_start,"%04d-%02d-%02d",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
- sprintf(prefs.stime_start,"%02d:%02d:%02d",
- tm->tm_hour, tm->tm_min, tm->tm_sec);
-
- NFPRINTF(OUTPUT, "");
- QPRINTF(OUTPUT, "----- %s %s started on %s at %s with %d thread%s\n\n",
- BANNER,
- MYVERSION,
- prefs.sdate_start,
- prefs.stime_start,
- prefs.nthreads,
- prefs.nthreads>1? "s":"");
-
-/* Initialize globals variables */
- initglob();
-
- NFPRINTF(OUTPUT, "Setting catalog parameters");
- readcatparams(prefs.param_name);
- useprefs(); /* update things accor. to prefs parameters */
-
- if (prefs.psf_flag)
- {
- NFPRINTF(OUTPUT, "Reading PSF information");
- thepsf = psf_load(prefs.psf_name[0]);
- if (prefs.dpsf_flag)
- ppsf = psf_load(prefs.psf_name[1]);
- /*-- Need to check things up because of PSF context parameters */
- updateparamflags();
- useprefs();
- }
-
- if (prefs.filter_flag)
- {
- NFPRINTF(OUTPUT, "Reading detection filter");
- getfilter(prefs.filter_name); /* get the detection filter */
- }
-
- if (FLAG(obj2.sprob))
- {
- NFPRINTF(OUTPUT, "Initializing Neural Network");
- neurinit();
- NFPRINTF(OUTPUT, "Reading Neural Network Weights");
- getnnw();
- }
-
- if (prefs.somfit_flag)
- {
- int margin;
-
- thesom = som_load(prefs.som_name);
- if ((margin=(thesom->inputsize[1]+1)/2) > prefs.cleanmargin)
- prefs.cleanmargin = margin;
- if (prefs.somfit_vectorsize>thesom->neurdim)
- {
- prefs.somfit_vectorsize = thesom->neurdim;
- sprintf(gstr,"%d", prefs.somfit_vectorsize);
- warning("Dimensionality of the SOM-fit vector limited to ", gstr);
- }
- }
-
-/* Prepare growth-curve buffer */
- if (prefs.growth_flag)
- initgrowth();
-
-/* Compute the number of valid input extensions */
- if (!(imacat = read_cat(prefs.image_name[0])))
- error(EXIT_FAILURE, "*Error*: cannot open ", prefs.image_name[0]);
- close_cat(imacat);
- imatab = imacat->tab;
- next = 0;
- for (ntab = 0 ; ntab<imacat->ntab; ntab++, imatab = imatab->nexttab)
- {
-/*-- Check for the next valid image extension */
- if ((imatab->naxis < 2)
- || !strncmp(imatab->xtension, "BINTABLE", 8)
- || !strncmp(imatab->xtension, "ASCTABLE", 8))
- continue;
- next++;
- }
- thecat.next = next;
-
-/*-- Init the CHECK-images */
- if (prefs.check_flag)
- {
- checkenum c;
-
- NFPRINTF(OUTPUT, "Initializing check-image(s)");
- for (i=0; i<prefs.ncheck_type; i++)
- if ((c=prefs.check_type[i]) != CHECK_NONE)
- {
- if (prefs.check[c])
- error(EXIT_FAILURE,"*Error*: 2 CHECK_IMAGEs cannot have the same ",
- " CHECK_IMAGE_TYPE");
- prefs.check[c] = initcheck(prefs.check_name[i], prefs.check_type[i],
- next);
- free(prefs.check_name[i]);
- }
- }
-
- NFPRINTF(OUTPUT, "Initializing catalog");
- initcat();
-
-/* Initialize XML data */
- if (prefs.xml_flag || prefs.cat_type==ASCII_VO)
- init_xml(next);
-
-/* Go through all images */
- nok = -1;
- for (ntab = 0 ; ntab<imacat->ntab; ntab++, imatab = imatab->nexttab)
- {
-/*-- Check for the next valid image extension */
- if ((imatab->naxis < 2)
- || !strncmp(imatab->xtension, "BINTABLE", 8)
- || !strncmp(imatab->xtension, "ASCTABLE", 8))
- continue;
- nok++;
-
-/*-- Initial time measurement*/
- time(&thetime1);
- thecat.currext = nok+1;
-
- dfield = field = wfield = dwfield = NULL;
-
- if (prefs.dimage_flag)
- {
-/*---- Init the Detection and Measurement-images */
- dfield = newfield(prefs.image_name[0], DETECT_FIELD, nok);
- field = newfield(prefs.image_name[1], MEASURE_FIELD, nok);
- if ((field->width!=dfield->width) || (field->height!=dfield->height))
- error(EXIT_FAILURE, "*Error*: Frames have different sizes","");
-/*---- Prepare interpolation */
- if (prefs.dweight_flag && prefs.interp_type[0] == INTERP_ALL)
- init_interpolate(dfield, -1, -1);
- if (prefs.interp_type[1] == INTERP_ALL)
- init_interpolate(field, -1, -1);
- }
- else
- {
- field = newfield(prefs.image_name[0], DETECT_FIELD | MEASURE_FIELD, nok);
-/*-- Prepare interpolation */
- if ((prefs.dweight_flag || prefs.weight_flag)
- && prefs.interp_type[0] == INTERP_ALL)
- init_interpolate(field, -1, -1); /* 0.0 or anything else */
- }
-
-/*-- Init the WEIGHT-images */
- if (prefs.dweight_flag || prefs.weight_flag)
- {
- weightenum wtype;
- PIXTYPE interpthresh;
-
- if (prefs.nweight_type>1)
- {
-/*------ Double-weight-map mode */
- if (prefs.weight_type[1] != WEIGHT_NONE)
- {
-/*-------- First: the "measurement" weights */
- wfield = newweight(prefs.wimage_name[1],field,prefs.weight_type[1],
- nok);
- wtype = prefs.weight_type[1];
- interpthresh = prefs.weight_thresh[1];
-/*-------- Convert the interpolation threshold to variance units */
- weight_to_var(wfield, &interpthresh, 1);
- wfield->weight_thresh = interpthresh;
- if (prefs.interp_type[1] != INTERP_NONE)
- init_interpolate(wfield,
- prefs.interp_xtimeout[1], prefs.interp_ytimeout[1]);
- }
-/*------ The "detection" weights */
- if (prefs.weight_type[0] != WEIGHT_NONE)
- {
- interpthresh = prefs.weight_thresh[0];
- if (prefs.weight_type[0] == WEIGHT_FROMINTERP)
- {
- dwfield=newweight(prefs.wimage_name[0],wfield,prefs.weight_type[0],
- nok);
- weight_to_var(wfield, &interpthresh, 1);
- }
- else
- {
- dwfield = newweight(prefs.wimage_name[0], dfield?dfield:field,
- prefs.weight_type[0], nok);
- weight_to_var(dwfield, &interpthresh, 1);
- }
- dwfield->weight_thresh = interpthresh;
- if (prefs.interp_type[0] != INTERP_NONE)
- init_interpolate(dwfield,
- prefs.interp_xtimeout[0], prefs.interp_ytimeout[0]);
- }
- }
- else
- {
-/*------ Single-weight-map mode */
- wfield = newweight(prefs.wimage_name[0], dfield?dfield:field,
- prefs.weight_type[0], nok);
- wtype = prefs.weight_type[0];
- interpthresh = prefs.weight_thresh[0];
-/*------ Convert the interpolation threshold to variance units */
- weight_to_var(wfield, &interpthresh, 1);
- wfield->weight_thresh = interpthresh;
- if (prefs.interp_type[0] != INTERP_NONE)
- init_interpolate(wfield,
- prefs.interp_xtimeout[0], prefs.interp_ytimeout[0]);
- }
- }
-
-/*-- Init the FLAG-images */
- for (i=0; i<prefs.nimaflag; i++)
- {
- pffield[i] = newfield(prefs.fimage_name[i], FLAG_FIELD, nok);
- if ((pffield[i]->width!=field->width)
- || (pffield[i]->height!=field->height))
- error(EXIT_FAILURE,
- "*Error*: Incompatible FLAG-map size in ", prefs.fimage_name[i]);
- }
-
-/*-- Compute background maps for `standard' fields */
- QPRINTF(OUTPUT, dfield? "Measurement image:"
- : "Detection+Measurement image: ");
- makeback(field, wfield);
- QPRINTF(OUTPUT, (dfield || (dwfield&&dwfield->flags^INTERP_FIELD))? "(M) "
- "Background: %-10g RMS: %-10g / Threshold: %-10g \n"
- : "(M+D) "
- "Background: %-10g RMS: %-10g / Threshold: %-10g \n",
- field->backmean, field->backsig, (field->flags & DETECT_FIELD)?
- field->dthresh: field->thresh);
- if (dfield)
- {
- QPRINTF(OUTPUT, "Detection image: ");
- makeback(dfield, dwfield? dwfield
- : (prefs.weight_type[0] == WEIGHT_NONE?NULL:wfield));
- QPRINTF(OUTPUT, "(D) "
- "Background: %-10g RMS: %-10g / Threshold: %-10g \n",
- dfield->backmean, dfield->backsig, dfield->dthresh);
- }
- else if (dwfield && dwfield->flags^INTERP_FIELD)
- {
- makeback(field, dwfield);
- QPRINTF(OUTPUT, "(D) "
- "Background: %-10g RMS: %-10g / Threshold: %-10g \n",
- field->backmean, field->backsig, field->dthresh);
- }
-
-/*-- For interpolated weight-maps, copy the background structure */
- if (dwfield && dwfield->flags&(INTERP_FIELD|BACKRMS_FIELD))
- copyback(dwfield->reffield, dwfield);
- if (wfield && wfield->flags&(INTERP_FIELD|BACKRMS_FIELD))
- copyback(wfield->reffield, wfield);
-
-/*-- Prepare learn and/or associations */
- if (prefs.assoc_flag)
- init_assoc(field); /* initialize assoc tasks */
-
-/*-- Update the CHECK-images */
- if (prefs.check_flag)
- for (i=0; i<MAXCHECK; i++)
- if ((check=prefs.check[i]))
- reinitcheck(field, check);
-
-/*-- Initialize PSF contexts and workspace */
- if (prefs.psf_flag)
- {
- psf_readcontext(thepsf, field);
- psf_init(thepsf);
- if (prefs.dpsf_flag)
- {
- psf_readcontext(thepsf, dfield);
- psf_init(thepsf); /*?*/
- }
- }
-
-/*-- Copy field structures to static ones (for catalog info) */
- if (dfield)
- {
- thefield1 = *field;
- thefield2 = *dfield;
- }
- else
- thefield1 = thefield2 = *field;
-
- if (wfield)
- {
- thewfield1 = *wfield;
- thewfield2 = dwfield? *dwfield: *wfield;
- }
- else if (dwfield)
- thewfield2 = *dwfield;
-
- reinitcat(field);
-
-/*-- Start the extraction pipeline */
- NFPRINTF(OUTPUT, "Scanning image");
- scanimage(field, dfield, pffield, prefs.nimaflag, wfield, dwfield);
-
-/*-- Finish the current CHECK-image processing */
- if (prefs.check_flag)
- for (i=0; i<MAXCHECK; i++)
- if ((check=prefs.check[i]))
- reendcheck(field, check);
-
-/*-- Final time measurements*/
- if (time(&thetime2)!=-1)
- {
- if (!strftime(thecat.ext_date, 12, "%d/%m/%Y", localtime(&thetime2)))
- error(EXIT_FAILURE, "*Internal Error*: Date string too long ","");
- if (!strftime(thecat.ext_time, 10, "%H:%M:%S", localtime(&thetime2)))
- error(EXIT_FAILURE, "*Internal Error*: Time/date string too long ","");
- thecat.ext_elapsed = difftime(thetime2, thetime1);
- }
-
- reendcat();
-
-/* Update XML data */
- if (prefs.xml_flag || prefs.cat_type==ASCII_VO)
- update_xml(&thecat, dfield? dfield:field, field,
- dwfield? dwfield:wfield, wfield);
-
-
-/*-- Close ASSOC routines */
- end_assoc(field);
-
- for (i=0; i<prefs.nimaflag; i++)
- endfield(pffield[i]);
- endfield(field);
- if (dfield)
- endfield(dfield);
- if (wfield)
- endfield(wfield);
- if (dwfield)
- endfield(dwfield);
-
- QPRINTF(OUTPUT, "Objects: detected %-8d / sextracted %-8d \n",
- thecat.ndetect, thecat.ntotal);
- }
-
- if (nok<0)
- error(EXIT_FAILURE, "Not enough valid FITS image extensions in ",
- prefs.image_name[0]);
- free_cat(&imacat, 1);
-
- NFPRINTF(OUTPUT, "Closing files");
-
-/* End CHECK-image processing */
- if (prefs.check_flag)
- for (i=0; i<MAXCHECK; i++)
- {
- if ((check=prefs.check[i]))
- endcheck(check);
- prefs.check[i] = NULL;
- }
-
- if (prefs.filter_flag)
- endfilter();
-
- if (prefs.somfit_flag)
- som_end(thesom);
-
- if (prefs.growth_flag)
- endgrowth();
-
- if (prefs.psf_flag)
- psf_end(thepsf,thepsfit); /*?*/
-
- if (prefs.dpsf_flag)
- psf_end(ppsf,ppsfit);
-
- if (FLAG(obj2.sprob))
- neurclose();
-
-/* Processing end date and time */
- thetimet2 = time(NULL);
- tm = localtime(&thetimet2);
- sprintf(prefs.sdate_end,"%04d-%02d-%02d",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
- sprintf(prefs.stime_end,"%02d:%02d:%02d",
- tm->tm_hour, tm->tm_min, tm->tm_sec);
- prefs.time_diff = difftime(thetimet2, thetimet);
-
-/* Write XML */
- if (prefs.xml_flag)
- write_xml(prefs.xml_name);
-
- endcat((char *)NULL);
-
- if (prefs.xml_flag || prefs.cat_type==ASCII_VO)
- end_xml();
-
- return;
- }
-
-
-/******************************** initglob ***********************************/
-/*
-Initialize a few global variables
-*/
-void initglob()
- {
- int i;
-
- for (i=0; i<37; i++)
- {
- ctg[i] = cos(i*PI/18);
- stg[i] = sin(i*PI/18);
- }
-
-
- return;
- }
-
-
-/****** write_error ********************************************************
-PROTO int write_error(char *msg1, char *msg2)
-PURPOSE Manage files in case of a catched error
-INPUT a character string,
- another character string
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 14/07/2006
- ***/
-void write_error(char *msg1, char *msg2)
- {
- char error[MAXCHAR];
-
- sprintf(error, "%s%s", msg1,msg2);
- if (prefs.xml_flag)
- write_xmlerror(prefs.xml_name, error);
-
-/* Also close existing catalog */
- endcat(error);
-
- end_xml();
-
- return;
- }
-
diff --git a/sextractor/src/manobjlist.c b/sextractor/src/manobjlist.c
deleted file mode 100644
index 5029ac0..0000000
--- a/sextractor/src/manobjlist.c
+++ /dev/null
@@ -1,113 +0,0 @@
- /*
- manobjlist.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions for the management of object lists.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "plist.h"
-
-/********************************* belong ************************************/
-/*
-say if an object is "included" in another.
-*/
-int belong(int corenb, objliststruct *coreobjlist,
- int shellnb, objliststruct *shellobjlist)
-
- {
- objstruct *cobj = &(coreobjlist->obj[corenb]),
- *sobj = &(shellobjlist->obj[shellnb]);
- pliststruct *cpl = coreobjlist->plist, *spl = shellobjlist->plist, *pixt;
-
- int xc=PLIST(cpl+cobj->firstpix,x), yc=PLIST(cpl+cobj->firstpix,y);
-
- for (pixt = spl+sobj->firstpix; pixt>=spl; pixt = spl+PLIST(pixt,nextpix))
- if ((PLIST(pixt,x) == xc) && (PLIST(pixt,y) == yc))
- return 1;
-
- return 0;
- }
-
-
-/********************************* addobj ************************************/
-/*
-Add an object to an objlist.
-*/
-int addobj(int objnb, objliststruct *objl1, objliststruct *objl2)
-
- {
- objstruct *objl2obj;
- pliststruct *plist1 = objl1->plist, *plist2 = objl2->plist;
- int fp, i, j, npx, objnb2;
-
- j = (fp = objl2->npix)*plistsize;
- objnb2 = objl2->nobj;
-
-/* Update the object list */
- if (objl2->nobj)
- {
- if (!(objl2obj = (objstruct *)realloc(objl2->obj,
- (++objl2->nobj) * sizeof(objstruct))))
- goto exit_addobj;
- }
- else
- if (!(objl2obj = (objstruct *)malloc((++objl2->nobj)*sizeof(objstruct))))
- goto exit_addobj;
-
-/* Update the pixel list */
- npx = objl1->obj[objnb].fdnpix;
- if (fp)
- {
- if (!(plist2 = (pliststruct *)realloc(plist2,
- (objl2->npix+=npx) * plistsize)))
- goto exit_addobj;
- }
- else
- if (!(plist2=(pliststruct *)malloc((objl2->npix=npx)*plistsize)))
- goto exit_addobj;
-
- objl2->obj = objl2obj;
- objl2->plist = plist2;
-
- plist2 += j;
- for(i=objl1->obj[objnb].firstpix; i!=-1; i=PLIST(plist1+i,nextpix))
- {
- memcpy(plist2, plist1+i, (size_t)plistsize);
- PLIST(plist2,nextpix) = (j+=plistsize);
- plist2 += plistsize;
- }
-
- PLIST(plist2-=plistsize, nextpix) = -1;
-
- objl2->obj[objnb2] = objl1->obj[objnb];
- objl2->obj[objnb2].firstpix = fp*plistsize;
- objl2->obj[objnb2].lastpix = j-plistsize;
- return objnb2;
-
-exit_addobj:
-
- objl2->nobj--;
- objl2->npix = fp;
- return RETURN_FATAL_ERROR;
- }
-
-
-
diff --git a/sextractor/src/misc.c b/sextractor/src/misc.c
deleted file mode 100644
index 7165532..0000000
--- a/sextractor/src/misc.c
+++ /dev/null
@@ -1,72 +0,0 @@
- /*
- misc.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: miscellaneous functions.
-*
-* Last modify: 13/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "define.h"
-#include "globals.h"
-
-
-/******************************** hmedian ***********************************/
-/*
-Median using Heapsort algorithm (for float arrays) (based on Num.Rec algo.).
-Warning: changes the order of data!
-*/
-float hmedian(float *ra, int n)
-
- {
- int l, j, ir, i;
- float rra;
-
-
- if (n<2)
- return *ra;
- ra--;
- for (l = ((ir=n)>>1)+1;;)
- {
- if (l>1)
- rra = ra[--l];
- else
- {
- rra = ra[ir];
- ra[ir] = ra[1];
- if (--ir == 1)
- {
- ra[1] = rra;
- return n&1? ra[n/2+1] : (float)((ra[n/2]+ra[n/2+1])/2.0);
- }
- }
- for (j = (i=l)<<1; j <= ir;)
- {
- if (j < ir && ra[j] < ra[j+1])
- ++j;
- if (rra < ra[j])
- {
- ra[i] = ra[j];
- j += (i=j);
- }
- else
- j = ir + 1;
- }
- ra[i] = rra;
- }
-
-/* (the 'return' is inside the loop!!) */
- }
-
-
diff --git a/sextractor/src/neurro.c b/sextractor/src/neurro.c
deleted file mode 100644
index 92d9eca..0000000
--- a/sextractor/src/neurro.c
+++ /dev/null
@@ -1,188 +0,0 @@
- /*
- neurro.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using neural networks.
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: run only version of the neural network.
-*
-* Last modify: 26/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "neurro.h"
-
-brainstruct *brain;
-
-/******************************** neurinit **********************************/
-/*
-Initialization of the "brain".
-*/
-void neurinit()
- {
- QMALLOC(brain, brainstruct, 1);
-
- return;
- }
-
-/********************************* neurend **********************************/
-/*
-Close the "brain".
-*/
-void neurclose()
- {
- free(brain);
-
- return;
- }
-
-/******************************** neurresp **********************************/
-/*
-Neural network response to an input vector.
-*/
-void neurresp(double *input, double *output)
-
- {
- int i, j, l, lastlay = brain->layersnb-1;
- double neursum;
-
- for (i=0; i<brain->nn[0]; i++)
- brain->n[0][i] = input[i]*brain->inscale[i] + brain->inbias[i];
- for (l=0; l<lastlay; l++)
- for (j=0; j<brain->nn[l+1]; j++)
- {
- neursum = brain->b[l][j];
- for (i=0; i<brain->nn[l]; i++)
- neursum += brain->w[l][i][j] * brain->n[l][i];
- brain->n[l+1][j] = f(neursum);
- }
- for (i=0; i<brain->nn[lastlay]; i++)
- output[i] = (brain->n[lastlay][i]-brain->outbias[i])
- / brain->outscale[i];
-
- return;
- }
-
-
-/************************************ f *************************************/
-/*
-Sigmoid function for a neural network.
-*/
-double f(double x)
-
- {
- return 1.0 / (1.0 + exp(-x));
- }
-
-
-/********************************* getnnw ***********************************/
-/*
-Read the NNW table that contains the weights.
-*/
-void getnnw()
-
- {
- FILE *infile;
- int i, j, k, step;
- char str[MAXCHAR], *sstr, *null;
-
- if ((infile = fopen(prefs.nnw_name,"r")) == NULL)
- error(EXIT_FAILURE,"*ERROR*: can't read ", prefs.nnw_name);
-
- fgets(str, MAXCHAR, infile);
- if (strncmp(str,"NNW",3))
- error(EXIT_FAILURE, prefs.nnw_name, " is NOT a NNW table!");
-
- step = 1;
- i=j=0; /* To avoid gcc -Wall warnings */
- while (fgets(str, MAXCHAR, infile))
- {
- sstr = &str[(int)strspn(str," \t")];
- if (sstr[0]!=(char)'#' && sstr[0]!=(char)'\n')
- {
- null = sstr;
- switch(step)
- {
- case 1: brain->layersnb = atoi(strtok(sstr, " \t\n"));
- for (i=0; i<brain->layersnb; i++)
- brain->nn[i] = atoi(strtok(NULL, " \t\n"));
- step++;
- break;
-
- case 2: for (i=0; i<brain->nn[0]; i++)
- {
- brain->inbias[i] = atof(strtok(null, " \t\n"));
- null = NULL;
- }
- step++;
- break;
-
- case 3: for (i=0; i<brain->nn[0]; i++)
- {
- brain->inscale[i] = atof(strtok(null, " \t\n"));
- null = NULL;
- }
- i=j=0;
- step++;
- break;
-
- case 4: if (j == brain->nn[i+1])
- {
- j = 0;
- i++;
- }
- if (i < brain->layersnb-1)
- {
- for (k=0; k<brain->nn[i]; k++)
- {
- brain->w[i][k][j] = atof(strtok(null, " \t\n"));
- null = NULL;
- }
- brain->b[i][j] = atof(strtok(NULL, " \t\n"));
- j++;
- break;
- }
- else
- step++;
-
- case 5: for (i=0; i<brain->nn[brain->layersnb-1]; i++)
- {
- brain->outbias[i] = atof(strtok(null, " \t\n"));
- null = NULL;
- }
- step++;
- break;
- case 6: for (i=0; i<brain->nn[brain->layersnb-1]; i++)
- {
- brain->outscale[i] = atof(strtok(null, " \t\n"));
- null = NULL;
- }
- step++;
- break;
- default:error(EXIT_FAILURE, "*Error*: inconsistency in ", prefs.nnw_name);
- }
-
- }
- }
-
- fclose(infile);
-
- return;
- }
-
diff --git a/sextractor/src/neurro.h b/sextractor/src/neurro.h
deleted file mode 100644
index 1747723..0000000
--- a/sextractor/src/neurro.h
+++ /dev/null
@@ -1,40 +0,0 @@
- /*
- neurro.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: neurro.c
-*
-* Author: E.BERTIN, Institut d'Astrophysique de Paris.
-*
-* Contents: global definitions.
-*
-* Last modify: 30/03/95
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*--------------------------- Neural Network parameters ---------------------*/
-#define LAYERS 3 /* max. number of hidden+i/o layers */
-#define CONNEX LAYERS-1
-#define NEURONS 10 /* maximum number of neurons/layer */
-
-/*------------------------------- structures --------------------------------*/
-typedef struct
- {
- int layersnb;
- int nn[LAYERS];
- double inbias[NEURONS];
- double inscale[NEURONS];
- double outbias[NEURONS];
- double outscale[NEURONS];
- double ni[NEURONS];
- double no[NEURONS];
- double n[LAYERS][NEURONS];
- double w[CONNEX][NEURONS][NEURONS];
- double b[CONNEX][NEURONS];
- } brainstruct;
-
-/*------------------------------- globals ----------------------------------*/
-
-extern double f(double);
diff --git a/sextractor/src/param.h b/sextractor/src/param.h
deleted file mode 100644
index 3cfe049..0000000
--- a/sextractor/src/param.h
+++ /dev/null
@@ -1,873 +0,0 @@
-/*
- param.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: parameter list for catalog data.
-*
-* Last modify: 07/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-objstruct outobj;
-obj2struct outobj2;
-
-/*--------------------------------- initialization --------------------------*/
-keystruct objkey[] = {
- {"NUMBER", "Running object number",
- &outobj.number, H_INT, T_LONG, "%10d", "",
- "meta.record", ""},
- {"EXT_NUMBER", "FITS extension number",
- &outobj2.ext_number, H_INT, T_SHORT, "%3d", "",
- "meta.id;meta.dataset", ""},
- {"FLUX_ISO", "Isophotal flux",
- &outobj2.flux_iso, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct"},
- {"FLUXERR_ISO", "RMS error for isophotal flux",
- &outobj2.fluxerr_iso, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_ISO", "Isophotal magnitude",
- &outobj2.mag_iso, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_ISO", "RMS error for isophotal magnitude",
- &outobj2.magerr_iso, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
-
- {"FLUX_ISOCOR", "Corrected isophotal flux",
- &outobj2.flux_isocor, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct"},
- {"FLUXERR_ISOCOR", "RMS error for corrected isophotal flux",
- &outobj2.fluxerr_isocor, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_ISOCOR", "Corrected isophotal magnitude",
- &outobj2.mag_isocor, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_ISOCOR", "RMS error for corrected isophotal magnitude",
- &outobj2.magerr_isocor, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
-
- {"FLUX_APER", "Flux vector within fixed circular aperture(s)",
- &outobj2.flux_aper, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct", 1, &prefs.flux_apersize},
- {"FLUXERR_APER", "RMS error vector for aperture flux(es)",
- &outobj2.fluxerr_aper, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct", 1, &prefs.fluxerr_apersize},
- {"MAG_APER", "Fixed aperture magnitude vector",
- &outobj2.mag_aper, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag", 1, &prefs.mag_apersize},
- {"MAGERR_APER", "RMS error vector for fixed aperture mag.",
- &outobj2.magerr_aper, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag", 1, &prefs.magerr_apersize},
-
- {"FLUX_AUTO", "Flux within a Kron-like elliptical aperture",
- &outobj2.flux_auto, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux;meta.main", "ct"},
- {"FLUXERR_AUTO", "RMS error for AUTO flux",
- &outobj2.fluxerr_auto, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux;meta.main", "ct"},
- {"MAG_AUTO", "Kron-like elliptical aperture magnitude",
- &outobj2.mag_auto, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag;meta.main", "mag"},
- {"MAGERR_AUTO", "RMS error for AUTO magnitude",
- &outobj2.magerr_auto, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag;meta.main", "mag"},
-
- {"FLUX_PETRO", "Flux within a Petrosian-like elliptical aperture",
- &outobj2.flux_petro, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct"},
- {"FLUXERR_PETRO", "RMS error for PETROsian flux",
- &outobj2.fluxerr_petro, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_PETRO", "Petrosian-like elliptical aperture magnitude",
- &outobj2.mag_petro, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_PETRO", "RMS error for PETROsian magnitude",
- &outobj2.magerr_petro, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
-
- {"FLUX_BEST", "Best of FLUX_AUTO and FLUX_ISOCOR",
- &outobj2.flux_best, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct"},
- {"FLUXERR_BEST", "RMS error for BEST flux",
- &outobj2.fluxerr_best, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_BEST", "Best of MAG_AUTO and MAG_ISOCOR",
- &outobj2.mag_best, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_BEST", "RMS error for MAG_BEST",
- &outobj2.magerr_best, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
-
- {"FLUX_PROFILE", "Flux weighted by the FILTERed profile",
- &outobj2.flux_prof, H_FLOAT, T_FLOAT, "%12.7g", "count"
- "phot.flux", "ct"},
- {"FLUXERR_PROFILE", "RMS error for PROFILE flux",
- &outobj2.fluxerr_prof, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_PROFILE", "Magnitude weighted by the FILTERed profile",
- &outobj2.mag_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_PROFILE", "RMS error for MAG_PROFILE",
- &outobj2.magerr_prof, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
-
- {"FLUX_WIN", "Gaussian-weighted flux",
- &outobj2.flux_win, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct"},
- {"FLUXERR_WIN", "RMS error for WIN flux",
- &outobj2.fluxerr_win, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_WIN", "Gaussian-weighted magnitude",
- &outobj2.mag_win, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_WIN", "RMS error for MAG_WIN",
- &outobj2.magerr_win, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
-
- {"FLUX_SOMFIT", "Flux derived from SOM fit",
- &outobj2.flux_somfit, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux", "ct"},
- {"FLUXERR_SOMFIT", "RMS error for SOMFIT flux",
- &outobj2.fluxerr_somfit, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.flux", "ct"},
- {"MAG_SOMFIT", "Magnitude derived from SOM fit",
- &outobj2.mag_somfit, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag"},
- {"MAGERR_SOMFIT", "Magnitude error derived from SOM fit",
- &outobj2.magerr_somfit, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag"},
- {"ERROR_SOMFIT", "Reduced Chi-square error of the SOM fit",
- &outobj2.stderr_somfit, H_FLOAT, T_FLOAT, "%10.4g", "",
- "stat.fit.chi2", ""},
- {"VECTOR_SOMFIT", "Position vector of the winning SOM node",
- &outobj2.vector_somfit, H_FLOAT, T_FLOAT, "%5.2f", "",
- "src.morph.param", "", 1, &prefs.somfit_vectorsize},
-
- {"FLUX_GALFIT", "Flux derived from the galaxy fit",
- &outobj2.flux_galfit, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux;stat.fit.param", "ct"},
-/*
- {"FLUXERR_GALFIT", "RMS error for GALFIT flux",
- &outobj2.fluxerr_galfit, H_FLOAT, T_FLOAT, "%12.7g", "count"},
-*/
- {"MAG_GALFIT", "Magnitude derived from galaxy fit",
- &outobj2.mag_galfit, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag;stat.fit.param", "mag"},
-
-/*
- {"MAGERR_GALFIT", "Magnitude error derived from galaxy fit",
- &outobj2.magerr_galfit, H_FLOAT, T_FLOAT, "%8.4f", "mag"},
- {"ERROR_GALFIT", "Reduced Chi-square error of the galaxy fit",
- &outobj2.stderr_galfit, H_FLOAT, T_FLOAT, "%10g", ""},
-*/
- {"GALDANG_IMAGE", "Galaxy disk position angle from the galaxy fit",
- &outobj2.gdposang, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;stat.fit.param", "deg"},
- {"GALDSCALE_IMAGE", "Galaxy disk-scale from the galaxy fit",
- &outobj2.gdscale, H_FLOAT, T_FLOAT, "%9.3f", "pixel",
- "src.morph.scLength;stat.fit.param", "pix"},
- {"GALDASPEC_IMAGE", "Galaxy disk aspect ratio from the galaxy fit",
- &outobj2.gdaspect, H_FLOAT, T_FLOAT, "%5.3f", "",
- "phys.size.axisRatio;stat.fit.param", ""},
- {"GALDE1_IMAGE", "Galaxy disk ellipticity #1 from the galaxy fit",
- &outobj2.gde1, H_FLOAT, T_FLOAT, "%6.4f", "",
- "src.ellipticity", ""},
- {"GALDE2_IMAGE", "Galaxy disk ellipticity #2 from the galaxy fit",
- &outobj2.gde2, H_FLOAT, T_FLOAT, "%6.4f", "",
- "src.ellipticity", ""},
- {"GALBRATIO_IMAGE", "Galaxy bulge ratio from the galaxy fit",
- &outobj2.gbratio, H_FLOAT, T_FLOAT, "%5.3f", "",
- "src.morph.param;stat.fit.param", ""},
- {"GALBANG_IMAGE", "Galaxy bulge position angle from the galaxy fit",
- &outobj2.gbposang, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;stat.fit.param", "deg"},
- {"GALBSCALE_IMAGE", "Galaxy bulge-scale from the galaxy fit",
- &outobj2.gbscale, H_FLOAT, T_FLOAT, "%9.3f", "pixel",
- "src.morph.scLength;stat.fit.param", "pix"},
- {"GALBASPEC_IMAGE", "Galaxy bulge aspect ratio from the galaxy fit",
- &outobj2.gbaspect, H_FLOAT, T_FLOAT, "%5.3f", "",
- "phys.size.axisRatio;stat.fit.param", ""},
-
- {"KRON_RADIUS", "Kron apertures in units of A or B",
- &outobj2.kronfactor, H_FLOAT, T_FLOAT, "%5.2f", "",
- "arith.factor;arith.ratio", ""},
- {"PETRO_RADIUS", "Petrosian apertures in units of A or B",
- &outobj2.petrofactor, H_FLOAT, T_FLOAT, "%5.2f", "",
- "arith.factor;arith.ratio", ""},
- {"BACKGROUND", "Background at centroid position",
- &outobj.bkg, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "instr.skyLevel", "ct"},
- {"THRESHOLD", "Detection threshold above background",
- &outobj.dthresh, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "instr.sensitivity;phot.flux.sb", "ct"},
- {"FLUX_MAX", "Peak flux above background",
- &outobj.peak, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux.sb;stat.max", "ct"},
- {"ISOAREA_IMAGE", "Isophotal area above Analysis threshold",
- &outobj.npix, H_INT, T_LONG, "%9d", "pixel**2",
- "phys.area", "pix2"},
- {"ISOAREAF_IMAGE", "Isophotal area (filtered) above Detection threshold",
- &outobj.fdnpix, H_INT, T_LONG, "%9d", "pixel**2",
- "phys.area", "pix2"},
-
- {"XMIN_IMAGE", "Minimum x-coordinate among detected pixels",
- &outobj.xmin, H_INT, T_LONG, "%10d", "pixel",
- "pos.cartesian.x;stat.min", "pix"},
- {"YMIN_IMAGE", "Minimum y-coordinate among detected pixels",
- &outobj.ymin, H_INT, T_LONG, "%10d", "pixel",
- "pos.cartesian.y;stat.min", "pix"},
- {"XMAX_IMAGE", "Maximum x-coordinate among detected pixels",
- &outobj.xmax, H_INT, T_LONG, "%10d", "pixel",
- "pos.cartesian.x;stat.max", "pix"},
- {"YMAX_IMAGE", "Maximum y-coordinate among detected pixels",
- &outobj.ymax, H_INT, T_LONG, "%10d", "pixel",
- "pos.cartesian.y;stat.max", "pix"},
-
- {"XPEAK_IMAGE", "x-coordinate of the brightest pixel",
- &outobj.peakx, H_INT, T_LONG, "%10d", "pixel",
- "pos.cartesian.x", "pix"},
- {"YPEAK_IMAGE", "y-coordinate of the brightest pixel",
- &outobj.peaky, H_INT, T_LONG, "%10d", "pixel",
- "pos.cartesian.y", "pix"},
- {"XPEAK_WORLD", "World-x coordinate of the brightest pixel",
- &outobj2.peakxw, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.ra", "deg"},
- {"YPEAK_WORLD", "World-y coordinate of the brightest pixel",
- &outobj2.peakyw, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.dec", "deg"},
-
- {"ALPHAPEAK_SKY", "Right ascension of brightest pix (native)",
- &outobj2.peakalphas, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra", "deg"},
- {"DELTAPEAK_SKY", "Declination of brightest pix (native)",
- &outobj2.peakdeltas, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec", "deg"},
-
- {"ALPHAPEAK_J2000", "Right ascension of brightest pix (J2000)",
- &outobj2.peakalpha2000, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra", "deg"},
- {"DELTAPEAK_J2000", "Declination of brightest pix (J2000)",
- &outobj2.peakdelta2000, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec", "deg"},
-
- {"ALPHAPEAK_B1950", "Right ascension of brightest pix (B1950)",
- &outobj2.peakalpha1950, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra", "deg"},
- {"DELTAPEAK_B1950", "Declination of brightest pix (B1950)",
- &outobj2.peakdelta1950, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec", "deg"},
-
- {"X_IMAGE", "Object position along x",
- &outobj2.sposx, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "pos.cartesian.x;pos.barycenter;instr.det;meta.main", "pix"},
- {"Y_IMAGE", "Object position along y",
- &outobj2.sposy, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "pos.cartesian.y;pos.barycenter;instr.det;meta.main", "pix"},
- {"X_IMAGE_DBL", "Object position along x (double precision)",
- &outobj2.posx, H_FLOAT, T_DOUBLE, "%10.3f", "pixel",
- "pos.cartesian.x;pos.barycenter;instr.det", "pix"},
- {"Y_IMAGE_DBL", "Object position along y (double precision)",
- &outobj2.posy, H_FLOAT, T_DOUBLE, "%10.3f", "pixel",
- "pos.cartesian.x;pos.barycenter;instr.det", "pix"},
- {"X_WORLD", "Barycenter position along world x axis",
- &outobj2.mxw, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.ra", "deg"},
- {"Y_WORLD", "Barycenter position along world y axis",
- &outobj2.myw, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.dec", "deg"},
- {"X_MAMA", "Barycenter position along MAMA x axis",
- &outobj2.mamaposx, H_FLOAT, T_DOUBLE, "%8.1f", "m**(-6)",
- "pos.cartesian.x;instr.det;pos.barycenter", "um"},
- {"Y_MAMA", "Barycenter position along MAMA y axis",
- &outobj2.mamaposy, H_FLOAT, T_DOUBLE, "%8.1f", "m**(-6)",
- "pos.cartesian.y;instr.det;pos.barycenter", "um"},
-
- {"ALPHA_SKY", "Right ascension of barycenter (native)",
- &outobj2.alphas, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra;pos.barycenter", "deg"},
- {"DELTA_SKY", "Declination of barycenter (native)",
- &outobj2.deltas, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec;pos.barycenter", "deg"},
-
- {"ALPHA_J2000", "Right ascension of barycenter (J2000)",
- &outobj2.alpha2000, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra;pos.barycenter;meta.main", "deg"},
- {"DELTA_J2000", "Declination of barycenter (J2000)",
- &outobj2.delta2000, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec;pos.barycenter;meta.main", "deg"},
-
- {"ALPHA_B1950", "Right ascension of barycenter (B1950)",
- &outobj2.alpha1950, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra;pos.barycenter", "deg"},
- {"DELTA_B1950", "Declination of barycenter (B1950)",
- &outobj2.delta1950, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec;pos.barycenter", "deg"},
-
- {"X2_IMAGE", "Variance along x",
- &outobj.mx2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"Y2_IMAGE", "Variance along y",
- &outobj.my2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"XY_IMAGE", "Covariance between x and y",
- &outobj.mxy, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"X2_WORLD", "Variance along X-WORLD (alpha)",
- &outobj2.mx2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "src.impactParam", "deg2"},
- {"Y2_WORLD", "Variance along Y-WORLD (delta)",
- &outobj2.my2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "src.impactParam", "deg2"},
- {"XY_WORLD", "Covariance between X-WORLD and Y-WORLD",
- &outobj2.mxyw, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "src.impactParam", "deg2"},
-
- {"CXX_IMAGE", "Cxx object ellipse parameter",
- &outobj.cxx, H_EXPO, T_FLOAT, "%12.7e", "pixel**(-2)",
- "src.impactParam;instr.det", "pix-2"},
- {"CYY_IMAGE", "Cyy object ellipse parameter",
- &outobj.cyy, H_EXPO, T_FLOAT, "%12.7e", "pixel**(-2)",
- "src.impactParam;instr.det", "pix-2"},
- {"CXY_IMAGE", "Cxy object ellipse parameter",
- &outobj.cxy, H_EXPO, T_FLOAT, "%12.7e", "pixel**(-2)",
- "src.impactParam;instr.det", "pix-2"},
- {"CXX_WORLD", "Cxx object ellipse parameter (WORLD units)",
- &outobj2.cxxw, H_EXPO, T_FLOAT, "%12.7e", "deg**(-2)",
- "src.impactParam", "deg-2"},
- {"CYY_WORLD", "Cyy object ellipse parameter (WORLD units)",
- &outobj2.cyyw, H_EXPO, T_FLOAT, "%12.7e", "deg**(-2)",
- "src.impactParam", "deg-2"},
- {"CXY_WORLD", "Cxy object ellipse parameter (WORLD units)",
- &outobj2.cxyw, H_EXPO, T_FLOAT, "%12.7e", "deg**(-2)",
- "src.impactParam", "deg-2"},
-
- {"A_IMAGE", "Profile RMS along major axis",
- &outobj.a, H_FLOAT, T_FLOAT, "%9.3f", "pixel",
- "phys.size.smajAxis;instr.det;meta.main", "pix"},
- {"B_IMAGE", "Profile RMS along minor axis",
- &outobj.b, H_FLOAT, T_FLOAT, "%9.3f", "pixel",
- "phys.size.sminAxis;instr.det;meta.main", "pix"},
- {"THETA_IMAGE", "Position angle (CCW/x)",
- &outobj.theta, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;instr.det;meta.main", "deg"},
- {"A_WORLD", "Profile RMS along major axis (world units)",
- &outobj2.aw, H_FLOAT, T_FLOAT, "%12.7g", "deg",
- "phys.size.smajAxis;meta.main", "deg"},
- {"B_WORLD", "Profile RMS along minor axis (world units)",
- &outobj2.bw, H_FLOAT, T_FLOAT, "%12.7g", "deg",
- "phys.size.sminAxis;meta.main", "deg"},
- {"THETA_WORLD", "Position angle (CCW/world-x)",
- &outobj2.thetaw, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng", "deg"},
- {"THETA_SKY", "Position angle (east of north) (native)",
- &outobj2.thetas, H_FLOAT, T_FLOAT, "%+6.2f", "deg",
- "pos.posAng", "deg"},
- {"THETA_J2000", "Position angle (east of north) (J2000)",
- &outobj2.theta2000, H_FLOAT, T_FLOAT, "%+6.2f", "deg",
- "pos.posAng;meta.main", "deg"},
- {"THETA_B1950", "Position angle (east of north) (B1950)",
- &outobj2.theta1950, H_FLOAT, T_FLOAT, "%+6.2f", "deg",
- "pos.posAng", "deg"},
-
- {"ERRX2_IMAGE", "Variance of position along x",
- &outobj.poserr_mx2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.variance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRY2_IMAGE", "Variance of position along y",
- &outobj.poserr_my2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.variance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRXY_IMAGE", "Covariance of position between x and y",
- &outobj.poserr_mxy, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.covariance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRX2_WORLD", "Variance of position along X-WORLD (alpha)",
- &outobj2.poserr_mx2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.variance;pos.errorEllipse", "deg2"},
- {"ERRY2_WORLD", "Variance of position along Y-WORLD (delta)",
- &outobj2.poserr_my2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.variance;pos.errorEllipse", "deg2"},
- {"ERRXY_WORLD", "Covariance of position X-WORLD/Y-WORLD",
- &outobj2.poserr_mxyw, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.covariance;pos.errorEllipse", "deg2"},
-
- {"ERRCXX_IMAGE", "Cxx error ellipse parameter",
- &outobj2.poserr_cxx, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCYY_IMAGE", "Cyy error ellipse parameter",
- &outobj2.poserr_cyy, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCXY_IMAGE", "Cxy error ellipse parameter",
- &outobj2.poserr_cxy, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCXX_WORLD", "Cxx error ellipse parameter (WORLD units)",
- &outobj2.poserr_cxxw, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
- {"ERRCYY_WORLD", "Cyy error ellipse parameter (WORLD units)",
- &outobj2.poserr_cyyw, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
- {"ERRCXY_WORLD", "Cxy error ellipse parameter (WORLD units)",
- &outobj2.poserr_cxyw, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
-
- {"ERRA_IMAGE", "RMS position error along major axis",
- &outobj2.poserr_a, H_FLOAT, T_FLOAT, "%8.4f", "pixel"
- "stat.stdev;stat.max;pos.errorEllipse;instr.det;meta.main", "pix"},
- {"ERRB_IMAGE", "RMS position error along minor axis",
- &outobj2.poserr_b, H_FLOAT, T_FLOAT, "%8.4f", "pixel",
- "stat.stdev;stat.min;pos.errorEllipse;instr.det;meta.main", "pix"},
- {"ERRTHETA_IMAGE", "Error ellipse position angle (CCW/x)",
- &outobj2.poserr_theta, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse;instr.det;meta.main", "deg"},
- {"ERRA_WORLD", "World RMS position error along major axis",
- &outobj2.poserr_aw, H_FLOAT, T_FLOAT, "%12.7g", "pixel",
- "stat.stdev;stat.max;pos.errorEllipse;meta.main", "deg"},
- {"ERRB_WORLD", "World RMS position error along minor axis",
- &outobj2.poserr_bw, H_FLOAT, T_FLOAT, "%12.7g", "pixel",
- "stat.stdev;stat.min;pos.errorEllipse;meta.main", "deg"},
- {"ERRTHETA_WORLD", "Error ellipse pos. angle (CCW/world-x)",
- &outobj2.poserr_thetaw, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHETA_SKY", "Native error ellipse pos. angle (east of north)",
- &outobj2.poserr_thetas, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHETA_J2000", "J2000 error ellipse pos. angle (east of north)",
- &outobj2.poserr_theta2000, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse;meta.main", "deg"},
- {"ERRTHETA_B1950", "B1950 error ellipse pos. angle (east of north)",
- &outobj2.poserr_theta1950, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
-
- {"XWIN_IMAGE", "Windowed position estimate along x",
- &outobj2.winpos_x, H_FLOAT, T_DOUBLE, "%10.3f", "pixel",
- "pos.cartesian.x;instr.det", "pix"},
- {"YWIN_IMAGE", "Windowed position estimate along y",
- &outobj2.winpos_y, H_FLOAT, T_DOUBLE, "%10.3f", "pixel",
- "pos.cartesian.y;instr.det", "pix"},
-
- {"XWIN_WORLD", "Windowed position along world x axis",
- &outobj2.winpos_xw, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.ra", "deg"},
- {"YWIN_WORLD", "Windowed position along world y axis",
- &outobj2.winpos_yw, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.dec", "deg"},
-
- {"ALPHAWIN_SKY", "Windowed right ascension (native)",
- &outobj2.winpos_alphas, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra", "deg"},
- {"DELTAWIN_SKY", "Windowed declination (native)",
- &outobj2.winpos_deltas, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec", "deg"},
-
- {"ALPHAWIN_J2000", "Windowed right ascension (J2000)",
- &outobj2.winpos_alpha2000, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra", "deg"},
- {"DELTAWIN_J2000", "windowed declination (J2000)",
- &outobj2.winpos_delta2000, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec", "deg"},
-
- {"ALPHAWIN_B1950", "Windowed right ascension (B1950)",
- &outobj2.winpos_alpha1950, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra", "deg"},
- {"DELTAWIN_B1950", "Windowed declination (B1950)",
- &outobj2.winpos_delta1950, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.deg", "deg"},
- {"X2WIN_IMAGE", "Windowed variance along x",
- &outobj2.win_mx2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"Y2WIN_IMAGE", "Windowed variance along y",
- &outobj2.win_my2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"XYWIN_IMAGE", "Windowed covariance between x and y",
- &outobj2.win_mxy, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"X2WIN_WORLD", "Windowed variance along X-WORLD (alpha)",
- &outobj2.win_mx2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "src.impactParam", "deg2"},
- {"Y2WIN_WORLD", "Windowed variance along Y-WORLD (delta)",
- &outobj2.win_my2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "src.impactParam", "deg2"},
- {"XYWIN_WORLD", "Windowed covariance between X-WORLD and Y-WORLD",
- &outobj2.win_mxyw, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "src.impactParam", "deg2"},
-
- {"CXXWIN_IMAGE", "Windowed Cxx object ellipse parameter",
- &outobj2.win_cxx, H_EXPO, T_FLOAT, "%12.7e", "pixel**(-2)",
- "src.impactParam;instr.det", "pix-2"},
- {"CYYWIN_IMAGE", "Windowed Cyy object ellipse parameter",
- &outobj2.win_cyy, H_EXPO, T_FLOAT, "%12.7e", "pixel**(-2)",
- "src.impactParam;instr.det", "pix-2"},
- {"CXYWIN_IMAGE", "Windowed Cxy object ellipse parameter",
- &outobj2.win_cxy, H_EXPO, T_FLOAT, "%12.7e", "pixel**(-2)",
- "src.impactParam;instr.det", "pix-2"},
- {"CXXWIN_WORLD", "Windowed Cxx object ellipse parameter (WORLD units)",
- &outobj2.win_cxxw, H_EXPO, T_FLOAT, "%12.7e", "deg**(-2)",
- "src.impactParam", "deg-2"},
- {"CYYWIN_WORLD", "Windowed Cyy object ellipse parameter (WORLD units)",
- &outobj2.win_cyyw, H_EXPO, T_FLOAT, "%12.7e", "deg**(-2)",
- "src.impactParam", "deg-2"},
- {"CXYWIN_WORLD", "Windowed Cxy object ellipse parameter (WORLD units)",
- &outobj2.win_cxyw, H_EXPO, T_FLOAT, "%12.7e", "deg**(-2)",
- "src.impactParam", "deg-2"},
-
- {"AWIN_IMAGE", "Windowed profile RMS along major axis",
- &outobj2.win_a, H_FLOAT, T_FLOAT, "%9.3f", "pixel",
- "phys.size.smajAxis;instr.det", "pix"},
- {"BWIN_IMAGE", "Windowed profile RMS along minor axis",
- &outobj2.win_b, H_FLOAT, T_FLOAT, "%9.3f", "pixel",
- "phys.size.sminAxis;instr.det", "pix"},
- {"THETAWIN_IMAGE", "Windowed position angle (CCW/x)",
- &outobj2.win_theta, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;instr.det", "deg"},
- {"AWIN_WORLD", "Windowed profile RMS along major axis (world units)",
- &outobj2.win_aw, H_FLOAT, T_FLOAT, "%12.7g", "deg",
- "phys.size.smajAxis", "deg"},
- {"BWIN_WORLD", "Windowed profile RMS along minor axis (world units)",
- &outobj2.win_bw, H_FLOAT, T_FLOAT, "%12.7g", "deg",
- "phys.size.sminAxis", "deg"},
- {"THETAWIN_WORLD", "Windowed position angle (CCW/world-x)",
- &outobj2.win_thetaw, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng", "deg"},
- {"THETAWIN_SKY", "Windowed position angle (east of north) (native)",
- &outobj2.win_thetas, H_FLOAT, T_FLOAT, "%+6.2f", "deg",
- "pos.posAng", "deg"},
- {"THETAWIN_J2000", "Windowed position angle (east of north) (J2000)",
- &outobj2.win_theta2000, H_FLOAT, T_FLOAT, "%+6.2f", "deg",
- "pos.posAng", "deg"},
- {"THETAWIN_B1950", "Windowed position angle (east of north) (B1950)",
- &outobj2.win_theta1950, H_FLOAT, T_FLOAT, "%+6.2f", "deg",
- "pos.posAng", "deg"},
-
- {"ERRX2WIN_IMAGE", "Variance of windowed pos along x",
- &outobj2.winposerr_mx2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.variance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRY2WIN_IMAGE", "Variance of windowed pos along y",
- &outobj2.winposerr_my2, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.variance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRXYWIN_IMAGE", "Covariance of windowed pos between x and y",
- &outobj2.winposerr_mxy, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.covariance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRX2WIN_WORLD", "Variance of windowed pos along X-WORLD (alpha)",
- &outobj2.winposerr_mx2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.variance;pos.errorEllipse", "deg2"},
- {"ERRY2WIN_WORLD", "Variance of windowed pos along Y-WORLD (delta)",
- &outobj2.winposerr_my2w, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.variance;pos.errorEllipse", "deg2"},
- {"ERRXYWIN_WORLD", "Covariance of windowed pos X-WORLD/Y-WORLD",
- &outobj2.winposerr_mxyw, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.covariance;pos.errorEllipse", "deg2"},
-
- {"ERRCXXWIN_IMAGE", "Cxx windowed error ellipse parameter",
- &outobj2.winposerr_cxx, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCYYWIN_IMAGE", "Cyy windowed error ellipse parameter",
- &outobj2.winposerr_cyy, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCXYWIN_IMAGE", "Cxy windowed error ellipse parameter",
- &outobj2.winposerr_cxy, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCXXWIN_WORLD", "Cxx windowed error ellipse parameter (WORLD units)",
- &outobj2.winposerr_cxxw, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
- {"ERRCYYWIN_WORLD", "Cyy windowed error ellipse parameter (WORLD units)",
- &outobj2.winposerr_cyyw, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
- {"ERRCXYWIN_WORLD", "Cxy windowed error ellipse parameter (WORLD units)",
- &outobj2.winposerr_cxyw, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
-
- {"ERRAWIN_IMAGE", "RMS windowed pos error along major axis",
- &outobj2.winposerr_a, H_FLOAT, T_FLOAT, "%8.4f", "pixel",
- "stat.stdev;stat.max;pos.errorEllipse;instr.det", "pix"},
- {"ERRBWIN_IMAGE", "RMS windowed pos error along minor axis",
- &outobj2.winposerr_b, H_FLOAT, T_FLOAT, "%8.4f", "pixel",
- "stat.stdev;stat.min;pos.errorEllipse;instr.det", "pix"},
- {"ERRTHETAWIN_IMAGE", "Windowed error ellipse pos angle (CCW/x)",
- &outobj2.winposerr_theta, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse;instr.det", "deg"},
- {"ERRAWIN_WORLD", "World RMS windowed pos error along major axis",
- &outobj2.winposerr_aw, H_FLOAT, T_FLOAT, "%12.7g", "pixel",
- "stat.stdev;stat.max;pos.errorEllipse", "deg"},
- {"ERRBWIN_WORLD", "World RMS windowed pos error along minor axis",
- &outobj2.winposerr_bw, H_FLOAT, T_FLOAT, "%12.7g", "pixel",
- "stat.stdev;stat.min;pos.errorEllipse", "deg"},
- {"ERRTHETAWIN_WORLD", "Windowed error ellipse pos. angle (CCW/world-x)",
- &outobj2.winposerr_thetaw, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHETAWIN_SKY", "Native windowed error ellipse pos. angle (east of north)",
- &outobj2.winposerr_thetas, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHETAWIN_J2000", "J2000 windowed error ellipse pos. angle (east of north)",
- &outobj2.winposerr_theta2000, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHETAWIN_B1950", "B1950 windowed error ellipse pos. angle (east of north)",
- &outobj2.winposerr_theta1950, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
-
- {"NITER_WIN", "Number of iterations for WIN centering",
- &outobj2.winpos_niter, H_INT, T_SHORT, "%3d", "",
- "meta.number", ""},
-
- {"MU_THRESHOLD", "Detection threshold above background",
- &outobj2.threshmu, H_FLOAT, T_FLOAT, "%8.4f", "mag * arcsec**(-2)",
- "instr.sensitivity;phot.mag.sb", "mag.arcsec-2"},
- {"MU_MAX", "Peak surface brightness above background",
- &outobj2.maxmu, H_FLOAT, T_FLOAT, "%8.4f", "mag * arcsec**(-2)",
- "phot.mag.sb;stat.max", "mag.arcsec-2"},
- {"ISOAREA_WORLD", "Isophotal area above Analysis threshold",
- &outobj2.npixw, H_FLOAT, T_FLOAT, "%12.7g", "deg**2",
- "phys.angArea", "deg2"},
- {"ISOAREAF_WORLD", "Isophotal area (filtered) above Detection threshold",
- &outobj2.fdnpixw, H_FLOAT, T_FLOAT, "%12.7g", "deg**2",
- "phys.angArea", "deg2"},
- {"ISO0", "Isophotal area at level 0",
- &outobj.iso[0], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO1", "Isophotal area at level 1",
- &outobj.iso[1], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO2", "Isophotal area at level 2",
- &outobj.iso[2], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO3", "Isophotal area at level 3",
- &outobj.iso[3], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO4", "Isophotal area at level 4",
- &outobj.iso[4], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO5", "Isophotal area at level 5",
- &outobj.iso[5], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO6", "Isophotal area at level 6",
- &outobj.iso[6], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
- {"ISO7", "Isophotal area at level 7",
- &outobj.iso[7], H_INT, T_LONG, "%8d", "pixel**2",
- "phys.area;instr.det", "pix2"},
-
- {"FLAGS", "Extraction flags",
- &outobj.flag, H_INT, T_SHORT, "%3d", "",
- "meta.code.qual", ""},
- {"FLAGS_WEIGHT", "Weighted extraction flags",
- &outobj.wflag, H_INT, T_SHORT, "%1d", "",
- "meta.code.qual", ""},
- {"FLAGS_WIN", "Flags for WINdowed parameters",
- &outobj2.win_flag, H_INT, T_SHORT, "%3d", "",
- "meta.code.qual", ""},
- {"IMAFLAGS_ISO", "FLAG-image flags OR'ed over the iso. profile",
- outobj.imaflag, H_INT, T_LONG, "%9u", "",
- "meta.code.qual", "", 1, &prefs.imaflag_size},
- {"NIMAFLAGS_ISO", "Number of flagged pixels entering IMAFLAGS_ISO",
- outobj.imanflag, H_INT, T_LONG, "%9d", "",
- "meta.number", "", 1, &prefs.imanflag_size},
-
- {"FWHM_IMAGE", "FWHM assuming a gaussian core",
- &outobj.fwhm, H_FLOAT, T_FLOAT, "%8.2f", "pixel",
- "phys.size.diameter;instr.det.psf", "pix"},
- {"FWHM_WORLD", "FWHM assuming a gaussian core",
- &outobj2.fwhmw, H_FLOAT, T_FLOAT, "%12.7g", "deg",
- "phys.angSize;instr.det.psf", "deg"},
- {"ELONGATION", "A_IMAGE/B_IMAGE",
- &outobj2.elong, H_FLOAT, T_FLOAT, "%8.3f", "",
- "src.ellipticity;arith.ratio;instr.det", ""},
- {"ELLIPTICITY", "1 - B_IMAGE/A_IMAGE",
- &outobj2.ellip, H_FLOAT, T_FLOAT, "%8.3f", "",
- "src.ellipticity;instr.det ", ""},
- {"POLAR_IMAGE", "(A_IMAGE^2 - B_IMAGE^2)/(A_IMAGE^2 + B_IMAGE^2)",
- &outobj2.polar, H_FLOAT, T_FLOAT, "%7.5f", "",
- "src.ellipticity;instr.det", ""},
- {"POLAR_WORLD", "(A_WORLD^2 - B_WORLD^2)/(A_WORLD^2 + B_WORLD^2)",
- &outobj2.polarw, H_FLOAT, T_FLOAT, "%7.5f", "",
- "src.ellipticity", ""},
- {"POLARWIN_IMAGE", "(AWIN^2 - BWIN^2)/(AWIN^2 + BWIN^2)",
- &outobj2.win_polar, H_FLOAT, T_FLOAT, "%7.5f", "",
- "src.ellipticity;instr.det", ""},
- {"POLARWIN_WORLD", "(AWIN^2 - BWIN^2)/(AWIN^2 + BWIN^2)",
- &outobj2.win_polarw, H_FLOAT, T_FLOAT, "%7.5f", "",
- "src.ellipticity", ""},
- {"CLASS_STAR", "S/G classifier output",
- &outobj2.sprob, H_FLOAT, T_FLOAT, "%5.2f", "",
- "src.class.starGalaxy", ""},
- {"VIGNET", "Pixel data around detection",
- &outobj2.vignet, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "obs.image", "ct", 2, prefs.vignetsize},
- {"VIGNET_SHIFT", "Pixel data around detection, corrected for shift",
- &outobj2.vigshift, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "obs.image", "ct", 2, prefs.vigshiftsize},
- {"VECTOR_ASSOC", "ASSOCiated parameter vector",
- &outobj2.assoc, H_FLOAT, T_FLOAT, "%12.7g", "",
- "src", "", 1, &prefs.assoc_size},
- {"NUMBER_ASSOC", "Number of ASSOCiated IDs",
- &outobj2.assoc_number, H_INT, T_LONG, "%10d", "",
- "meta.number;src", ""},
-
- {"THRESHOLDMAX", "Maximum threshold possible for detection",
- &outobj.dthresh, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.flux.sb;stat.max", "ct"},
-
- {"FLUX_GROWTH", "Cumulated growth-curve",
- &outobj2.flux_growth, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.count", "ct", 1, &prefs.flux_growthsize},
- {"FLUX_GROWTHSTEP", "Step for growth-curves",
- &outobj2.flux_growthstep, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "pos.distance", "pix"},
- {"MAG_GROWTH", "Cumulated magnitude growth-curve",
- &outobj2.mag_growth, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag", 1, &prefs.mag_growthsize},
- {"MAG_GROWTHSTEP", "Step for growth-curves",
- &outobj2.mag_growthstep, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "pos.distance", "pix"},
- {"FLUX_RADIUS", "Fraction-of-light radii",
- &outobj2.flux_radius, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "phys.size.radius;instr.det", "pix", 1, &prefs.flux_radiussize},
-
- {"XPSF_IMAGE", "X coordinate from PSF-fitting",
- &outobj2.x_psf, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "pos.cartesian.x;stat.fit.param;instr.det", "pix", 1, &prefs.psf_xsize},
- {"YPSF_IMAGE", "Y coordinate from PSF-fitting",
- &outobj2.y_psf, H_FLOAT, T_FLOAT, "%10.3f", "pixel",
- "pos.cartesian.y;stat.fit.param;instr.det", "pix", 1, &prefs.psf_ysize},
- {"XPSF_WORLD", "PSF position along world x axis",
- &outobj2.xw_psf, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.ra;stat.fit.param", "deg", 1, &prefs.psf_xwsize},
- {"YPSF_WORLD", "PSF position along world y axis",
- &outobj2.yw_psf, H_FLOAT, T_DOUBLE, "%15.10e", "deg",
- "pos.eq.dec;stat.fit.param", "deg", 1, &prefs.psf_ywsize},
-
- {"ALPHAPSF_SKY", "Right ascension of the fitted PSF (native)",
- &outobj2.alphas_psf, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra;stat.fit.param", "deg", 1, &prefs.psf_alphassize},
- {"DELTAPSF_SKY", "Declination of the fitted PSF (native)",
- &outobj2.deltas_psf, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec;stat.fit.param", "deg", 1, &prefs.psf_deltassize},
-
- {"ALPHAPSF_J2000", "Right ascension of the fitted PSF (J2000)",
- &outobj2.alpha2000_psf, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra;stat.fit.param", "deg", 1, &prefs.psf_alpha2000size},
- {"DELTAPSF_J2000", "Declination of the fitted PSF (J2000)",
- &outobj2.delta2000_psf, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec;stat.fit.param", "deg", 1, &prefs.psf_delta2000size},
-
- {"ALPHAPSF_B1950", "Right ascension of the fitted PSF (B1950)",
- &outobj2.alpha1950_psf, H_FLOAT, T_DOUBLE, "%11.7f", "deg",
- "pos.eq.ra;stat.fit.param", "deg", 1, &prefs.psf_alpha1950size},
- {"DELTAPSF_B1950", "Declination of the fitted PSF (B1950)",
- &outobj2.delta1950_psf, H_FLOAT, T_DOUBLE, "%+11.7f", "deg",
- "pos.eq.dec;stat.fit.param", "deg", 1, &prefs.psf_delta1950size},
-
- {"FLUX_PSF", "Flux from PSF-fitting",
- &outobj2.flux_psf, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "phot.count;stat.fit.param", "ct", 1, &prefs.psf_fluxsize},
- {"FLUXERR_PSF", "RMS flux error for PSF-fitting",
- &outobj2.fluxerr_psf, H_FLOAT, T_FLOAT, "%12.7g", "count",
- "stat.stdev;phot.count", "ct", 1, &prefs.psf_fluxerrsize},
- {"MAG_PSF", "Magnitude from PSF-fitting",
- &outobj2.mag_psf, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "phot.mag", "mag", 1, &prefs.psf_magsize},
- {"MAGERR_PSF", "RMS magnitude error from PSF-fitting",
- &outobj2.magerr_psf, H_FLOAT, T_FLOAT, "%8.4f", "mag",
- "stat.stdev;phot.mag", "mag", 1, &prefs.psf_magsize},
-
- {"NITER_PSF", "Number of iterations for PSF-fitting",
- &outobj2.niter_psf, H_INT, T_SHORT, "%3d", "",
- "meta.number", ""},
- {"CHI2_PSF", "Reduced chi2 from PSF-fitting",
- &outobj2.chi2_psf, H_FLOAT, T_FLOAT, "%9.4g", "",
- "stat.fit.chi2", ""},
-
- {"ERRX2PSF_IMAGE", "Variance of PSF position along x",
- &outobj2.poserrmx2_psf, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.variance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRY2PSF_IMAGE", "Variance of PSF position along y",
- &outobj2.poserrmy2_psf, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.variance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRXYPSF_IMAGE", "Covariance of PSF position between x and y",
- &outobj2.poserrmxy_psf, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "stat.covariance;pos.errorEllipse;instr.det", "pix2"},
- {"ERRX2PSF_WORLD", "Variance of PSF position along X-WORLD (alpha)",
- &outobj2.poserrmx2w_psf, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.variance;pos.errorEllipse", "deg2"},
- {"ERRY2PSF_WORLD", "Variance of PSF position along Y-WORLD (delta)",
- &outobj2.poserrmy2w_psf, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.variance;pos.errorEllipse", "deg2"},
- {"ERRXYPSF_WORLD", "Covariance of PSF position X-WORLD/Y-WORLD",
- &outobj2.poserrmxyw_psf, H_EXPO, T_DOUBLE, "%15.10e", "deg**2",
- "stat.covariance;pos.errorEllipse", "deg2"},
-
- {"ERRCXXPSF_IMAGE", "Cxx PSF error ellipse parameter",
- &outobj2.poserrcxx_psf, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCYYPSF_IMAGE", "Cyy PSF error ellipse parameter",
- &outobj2.poserrcyy_psf, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCXYPSF_IMAGE", "Cxy PSF error ellipse parameter",
- &outobj2.poserrcxy_psf, H_EXPO, T_FLOAT, "%12.7g", "pixel**(-2)",
- "src.impactParam;pos.errorEllipse;instr.det", "pix-2"},
- {"ERRCXXPSF_WORLD", "Cxx PSF error ellipse parameter (WORLD units)",
- &outobj2.poserrcxxw_psf, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
- {"ERRCYYPSF_WORLD", "Cyy PSF error ellipse parameter (WORLD units)",
- &outobj2.poserrcyyw_psf, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
- {"ERRCXYPSF_WORLD", "Cxy PSF error ellipse parameter (WORLD units)",
- &outobj2.poserrcxyw_psf, H_EXPO, T_FLOAT, "%12.7g", "deg**(-2)",
- "src.impactParam;pos.errorEllipse", "deg-2"},
-
- {"ERRAPSF_IMAGE", "PSF RMS position error along major axis",
- &outobj2.poserra_psf, H_FLOAT, T_FLOAT, "%8.4f", "pixel",
- "stat.stdev;stat.max;pos.errorEllipse;instr.det", "pix"},
- {"ERRBPSF_IMAGE", "PSF RMS position error along minor axis",
- &outobj2.poserrb_psf, H_FLOAT, T_FLOAT, "%8.4f", "pixel",
- "stat.stdev;stat.min;pos.errorEllipse;instr.det", "pix"},
- {"ERRTHTPSF_IMAGE", "PSF error ellipse position angle (CCW/x)",
- &outobj2.poserrtheta_psf, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse;instr.det", "deg"},
- {"ERRAPSF_WORLD", "World PSF RMS position error along major axis",
- &outobj2.poserraw_psf, H_FLOAT, T_FLOAT, "%12.7g", "pixel",
- "stat.stdev;stat.max;pos.errorEllipse", "deg"},
- {"ERRBPSF_WORLD", "World PSF RMS position error along minor axis",
- &outobj2.poserrbw_psf, H_FLOAT, T_FLOAT, "%12.7g", "pixel",
- "stat.stdev;stat.min;pos.errorEllipse", "deg"},
- {"ERRTHTPSF_WORLD", "PSF error ellipse pos. angle (CCW/world-x)",
- &outobj2.poserrthetaw_psf, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHTPSF_SKY", "Native PSF error ellipse pos. angle (east of north)",
- &outobj2.poserrthetas_psf, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHTPSF_J2000", "J2000 PSF error ellipse pos. angle (east of north)",
- &outobj2.poserrtheta2000_psf, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
- {"ERRTHTPSF_B1950", "B1950 PSF error ellipse pos. angle (east of north)",
- &outobj2.poserrtheta1950_psf, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;pos.errorEllipse", "deg"},
-
- {"X2PC_IMAGE", "PC variance along x",
- &outobj2.mx2_pc, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"Y2PC_IMAGE", "PC variance along y",
- &outobj2.my2_pc, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
- {"XYPC_IMAGE", "PC covariance between x and y",
- &outobj2.mxy_pc, H_EXPO, T_DOUBLE, "%15.10e", "pixel**2",
- "src.impactParam;instr.det", "pix2"},
-
- {"APC_IMAGE", "PC profile RMS along major axis",
- &outobj2.a_pc, H_FLOAT, T_FLOAT, "%8.2f", "pixel",
- "phys.size.smajAxis;instr.det", "pix"},
- {"BPC_IMAGE", "PC profile RMS along minor axis",
- &outobj2.b_pc, H_FLOAT, T_FLOAT, "%8.2f", "pixel",
- "phys.size.sminAxis;instr.det", "pix"},
- {"THETAPC_IMAGE", "PC position angle (CCW/x)",
- &outobj2.theta_pc, H_FLOAT, T_FLOAT, "%5.1f", "deg",
- "pos.posAng;instr.det", "deg"},
- {"PC", "Principal components",
- &outobj2.vector_pc, H_FLOAT, T_FLOAT, "%15.10e", "",
- "src.morph.param", "", 1, &prefs.pc_vectorsize},
-/*
- {"RETINOUT", T_FLOAT, &outobj.retinout, "%13g "},
-*/
- {""}
- };
-
diff --git a/sextractor/src/pc.c b/sextractor/src/pc.c
deleted file mode 100644
index 25034b7..0000000
--- a/sextractor/src/pc.c
+++ /dev/null
@@ -1,478 +0,0 @@
- /*
- pc.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Stuff related to Principal Component Analysis (PCA).
-*
-* Last modify: 27/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "check.h"
-#include "image.h"
-#include "poly.h"
-#include "psf.h"
-
-static obj2struct *obj2 = &outobj2;
-
-/****** pc_end ***************************************************************
-PROTO void pc_end(pcstruct *pc)
-PURPOSE Free a PC structure and everything it contains.
-INPUT pcstruct pointer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 15/07/99
- ***/
-void pc_end(pcstruct *pc)
- {
- int i;
-
- free(pc->maskcomp);
- free(pc->omaskcomp);
- free(pc->omasksize);
- free(pc->maskcurr);
- free(pc->masksize);
- free(pc->mx2);
- free(pc->my2);
- free(pc->mxy);
- free(pc->flux);
- free(pc->bt);
- if (pc->code)
- {
- free(pc->code->pc);
- for (i=0; i<pc->code->nparam;i++)
- free(pc->code->param[i]);
- free(pc->code->param);
- free(pc->code);
- }
- free(pc);
-
- return;
- }
-
-
-/********************************** pc_load **********************************/
-/*
-Load the PC data from a FITS file.
-*/
-pcstruct *pc_load(catstruct *cat)
- {
- pcstruct *pc;
- tabstruct *tab;
- keystruct *key;
- codestruct *code;
- char *head, str[80], *ci, *filename;
- int i, ncode,nparam;
-
- if (!(tab = name_to_tab(cat, "PC_DATA", 0)))
- return NULL;
-
- filename = cat->filename;
-
-/* OK, we now allocate memory for the PC structure itself */
- QCALLOC(pc, pcstruct, 1);
-
-/* Store a short copy of the PC filename */
- if ((ci=strrchr(filename, '/')))
- strcpy(pc->name, ci+1);
- else
- strcpy(pc->name, filename);
-
-/* Load important scalars (which are stored as FITS keywords) */
- head = tab->headbuf;
-
-/* Dimensionality of the PC mask */
- if (fitsread(head, "PCNAXIS", &pc->maskdim, H_INT, T_LONG) != RETURN_OK)
- return NULL;
- if (pc->maskdim<2 || pc->maskdim>4)
- error(EXIT_FAILURE, "*Error*: wrong dimensionality for the PC "
- "mask in ", filename);
- QMALLOC(pc->masksize, int, pc->maskdim);
- for (i=0; i<pc->maskdim; i++)
- pc->masksize[i] = 1;
- pc->masknpix = 1;
- for (i=0; i<pc->maskdim; i++)
- {
- sprintf(str, "PCAXIS%1d ", i+1);
- if (fitsread(head, str, &pc->masksize[i], H_INT,T_LONG) != RETURN_OK)
- goto headerror;
- pc->masknpix *= pc->masksize[i];
- }
-
- pc->npc = pc->masksize[pc->maskdim-1];
-
- ncode = 0;
- fitsread(head, "NCODE", &ncode, H_INT, T_LONG);
- fitsread(head, "NCODEPAR", &nparam, H_INT, T_LONG);
-
-/* Load the PC mask data */
- key = read_key(tab, "PC_CONVMASK");
- pc->maskcomp = key->ptr;
-
- key = read_key(tab, "PC_MASK");
- pc->omaskcomp = key->ptr;
- pc->omaskdim = key->naxis;
- pc->omasknpix = 1;
- QMALLOC(pc->omasksize, int, pc->omaskdim);
- for (i=0; i<pc->omaskdim; i++)
- pc->omasknpix *= (pc->omasksize[i] = key->naxisn[i]);
-
- key = read_key(tab, "PC_MX2");
- pc->mx2 = key->ptr;
-
- key = read_key(tab, "PC_MY2");
- pc->my2 = key->ptr;
-
- key = read_key(tab, "PC_MXY");
- pc->mxy = key->ptr;
-
- key = read_key(tab, "PC_FLUX");
- pc->flux = key->ptr;
-
- key = read_key(tab, "PC_BRATIO");
- pc->bt = key->ptr;
-
- if (ncode)
- {
- QMALLOC(pc->code, codestruct, 1);
- code = pc->code;
- QMALLOC(code->param, float *, nparam);
- QMALLOC(code->parammod, int, nparam);
- code->ncode = ncode;
- code->nparam = nparam;
- key = read_key(tab, "CODE_PC");
- code->pc = (float *)key->ptr;
- for (i=0; i<nparam; i++)
- {
- sprintf(str, "CODE_P%d", i+1);
- key = read_key(tab, str);
- code->param[i] = (float *)key->ptr;
- sprintf(str, "CODE_M%d", i+1);
- fitsread(head, str, &code->parammod[i], H_INT, T_LONG);
- }
- }
-
- QMALLOC(pc->maskcurr, double, pc->masksize[0]*pc->masksize[1]*pc->npc);
-
-/* But don't touch my arrays!! */
- blank_keys(tab);
-
- return pc;
-
-headerror:
- error(EXIT_FAILURE, "*Error*: Incorrect or obsolete PC data in ", filename);
- return NULL;
- }
-
-
-/********************************** pc_fit **********************************/
-/*
-Fit the PC data to the current data.
-*/
-void pc_fit(psfstruct *psf, double *data, double *weight,
- int width, int height,int ix, int iy,
- double dx, double dy, int npc, float backrms)
- {
- pcstruct *pc;
- checkstruct *check;
- codestruct *code;
- double *basis,*basis0, *cpix,*cpix0, *pcshift,*wpcshift,
- *spix,*wspix, *w, *sumopc,*sumopct, *checkbuf,
- *sol,*solt, *datat,
- *mx2t, *my2t, *mxyt,
- val,val2, xm2,ym2,xym,flux, temp,temp2, theta, pmx2,pmy2,
- wnorm, ellip, norm, snorm;
- float **param, *ppix, *ospix, *cpc,*cpc2, *fparam,
- pixstep, fval, fvalmax, fscale, dparam;
- int *parammod,
- c,n,p, npix,npix2,nopix, ncoeff, nparam, nmax,nmax2, ncode;
-
- pc = psf->pc;
-/* Build the "local PCs", using the basis func. coeffs computed in psf_fit() */
- if (npc > pc->npc)
- npc = pc->npc;
- npix = pc->masksize[0]*pc->masksize[1];
- npix2 = width*height;
- ncoeff = psf->poly->ncoeff;
- pixstep = 1.0/psf->pixstep;
- dx *= pixstep;
- dy *= pixstep;
-
- memset(pc->maskcurr, 0, npix*npc*sizeof(double));
- basis0 = psf->poly->basis;
- cpix0 = pc->maskcurr;
- ppix = pc->maskcomp;
-
-/* Sum each (PSF-dependent) component */
- for (c=npc; c--; cpix0 += npix)
- {
- basis = basis0;
- for (n = ncoeff; n--;)
- {
- cpix = cpix0;
- val = *(basis++);
- for (p=npix; p--;)
- *(cpix++) += val*(double)*(ppix++);
- }
- }
-
-/* Allocate memory for temporary buffers */
- QMALLOC(pcshift, double, npix2*npc);
- QMALLOC(wpcshift, double, npix2*npc);
- QMALLOC(sol, double, npc);
-
-/* Now shift and scale to the right position, and weight the PCs */
- cpix = pc->maskcurr;
- spix = pcshift;
- wspix = wpcshift;
- for (c=npc; c--; cpix += npix)
- {
- vignet_resample(cpix, pc->masksize[0], pc->masksize[1],
- spix, width, height, -dx, -dy, pixstep);
- w = weight;
- for (p=npix2; p--;)
- *(wspix++) = *(spix++)**(w++);
- }
-
-/* Compute the weight normalization */
- wnorm = 0.0;
- w = weight;
- for (p=npix2; p--;)
- {
- val = *(w++);
- wnorm += val*val;
- }
-
-/* Scalar product of data and (approximately orthogonal) basis functions */
- wspix = wpcshift;
- solt = sol;
- snorm = 0.0;
- for (c=npc; c--;)
- {
- datat = data;
- val = 0.0;
- for (p=npix2; p--;)
- val += *(datat++)**(wspix++);
- val2 = *(solt++) = val*npix2/wnorm;
- snorm += val2*val2;
- }
-
-
-/* Normalize solution vector */
- snorm = sqrt(snorm);
- solt = sol;
- for (c=npc; c--;)
- *(solt++) /= snorm;
-
- if ((code = pc->code))
- {
- ncode = code->ncode;
-/*-- Codebook search */
- cpc = code->pc;
- fvalmax = -BIG;
- nmax = 0;
- for (n=ncode; n--;)
- {
- fval = 0.0;
- solt = sol;
- for (p=npc; p--;)
- fval += *(solt++)**(cpc++);
- if (fval>fvalmax)
- {
- fvalmax = fval;
- nmax = n;
- }
- }
- nmax = ncode - 1 - nmax;
-
-/*-- Interpolation */
- param = code->param;
- parammod = code->parammod;
- nparam = code->nparam;
- QMALLOC(fparam, float, nparam);
- for (p=0; p<nparam; p++)
- {
- dparam = 0.0;
- if (parammod[p])
- {
- val2 = 0.0;
- if ((nmax2 = nmax+parammod[p]) < ncode)
- {
- cpc = code->pc+npc*nmax;
- cpc2 = code->pc+npc*nmax2;
- solt = sol;
- norm = 0.0;
- for (c=npc; c--;)
- {
- val = *(cpc2++)-*cpc;
- val2 += val*(*(solt++) - *(cpc++));
- norm += val*val;
- }
- if (norm>0.0)
- dparam = val2/norm*(param[p][nmax2]-param[p][nmax]);
- else
- val2 = 0.0;
- }
-/*------ If dot product negative of something went wrong, try other side */
- if (val2<=0.0 && (nmax2 = nmax-parammod[p]) >= 0)
- {
- cpc = code->pc+npc*nmax;
- cpc2 = code->pc+npc*nmax2;
- solt = sol;
- norm = val2 = 0.0;
- for (c=npc; c--;)
- {
- val = *(cpc2++)-*cpc;
- val2 += val*(*(solt++) - *(cpc++));
- norm += val*val;
- }
- if (norm>0.0)
- dparam = val2/norm*(param[p][nmax2]-param[p][nmax]);
- }
- fparam[p] = param[p][nmax] + dparam;
- }
- }
-
- solt = sol;
- cpc = code->pc+npc*nmax;
- fscale = fvalmax*code->param[0][nmax]*snorm;
- for (p=npc; p--;)
- *(solt++) = fscale**(cpc++);
-
-/*-- Copy the derived physical quantities to output parameters */
-/*-- (subject to changes) */
- obj2->flux_galfit = fscale;
- obj2->gdposang = fparam[1];
- if (obj2->gdposang>90.0)
- obj2->gdposang -= 180.0;
- else if (obj2->gdposang<-90.0)
- obj2->gdposang += 180.0;
- obj2->gdscale = fparam[2];
- obj2->gdaspect = fparam[3];
- ellip = (1.0 - obj2->gdaspect)/(1.0 + obj2->gdaspect);
- obj2->gde1 = (float)(ellip*cos(2*obj2->gdposang*PI/180.0));
- obj2->gde2 = (float)(ellip*sin(2*obj2->gdposang*PI/180.0));
-/*---- Copy the best-fitting PCs to the VECTOR_PC output vector */
- if (FLAG(obj2.vector_pc))
- {
- solt = sol;
- ppix = obj2->vector_pc;
- for (c=prefs.pc_vectorsize>npc?npc:prefs.pc_vectorsize; c--;)
- *(ppix++) = *(solt++);
- }
-
- free(fparam);
- }
-
- xm2 = ym2 = xym = flux = 0.0;
- solt = sol;
- mx2t = pc->mx2;
- my2t = pc->my2;
- mxyt = pc->mxy;
- for (c=npc; c--;)
- {
- val = *(solt++);
- xm2 += val**(mx2t++);
- ym2 += val**(my2t++);
- xym += val**(mxyt++);
- }
-
- obj2->mx2_pc = xm2;
- obj2->my2_pc = ym2;
- obj2->mxy_pc = xym;
-
- if (FLAG(obj2.a_pc))
- {
-/* Handle fully correlated x/y (which cause a singularity...) */
- if ((temp2=xm2*ym2-xym*xym)<0.00694)
- {
- xm2 += 0.0833333;
- ym2 += 0.0833333;
- temp2 = xm2*ym2-xym*xym;
- }
-
- if ((fabs(temp=xm2-ym2)) > 0.0)
- theta = atan2(2.0 * xym,temp) / 2.0;
- else
- theta = PI/4.0;
-
- temp = sqrt(0.25*temp*temp+xym*xym);
- pmy2 = pmx2 = 0.5*(xm2+ym2);
- pmx2 += temp;
- pmy2 -= temp;
-
- obj2->a_pc = (float)sqrt(pmx2);
- obj2->b_pc = (float)sqrt(pmy2);
- obj2->theta_pc = (float)(theta*180.0/PI);
- }
-
-/* CHECK-Images */
- if (prefs.check[CHECK_SUBPCPROTOS] || prefs.check[CHECK_PCPROTOS])
- {
- spix = pcshift;
- solt = sol;
- for (c=npc; c--; solt++)
- {
- ppix = checkmask;
- for (p=npix2; p--;)
- *(ppix++) = (PIXTYPE)*(spix++);
- if ((check = prefs.check[CHECK_SUBPCPROTOS]))
- addcheck(check, checkmask, width,height, ix,iy, -*solt);
- if ((check = prefs.check[CHECK_PCPROTOS]))
- addcheck(check, checkmask, width,height, ix,iy, *solt);
- }
- }
- if ((check = prefs.check[CHECK_PCOPROTOS]))
- {
-/*- Reconstruct the unconvolved profile */
- nopix = pc->omasksize[0]*pc->omasksize[1];
- QCALLOC(sumopc, double, nopix);
- solt = sol;
- ospix = pc->omaskcomp;
- for (c=npc; c--;)
- {
- val = *(solt++);
- sumopct = sumopc;
- for (p=nopix; p--;)
- *(sumopct++) += val*(double)*(ospix++);
- }
- QMALLOC(checkbuf, double, npix2);
- vignet_resample(sumopc, pc->omasksize[0], pc->omasksize[1],
- checkbuf, width, height, -dx, -dy, pixstep);
- ppix = checkmask;
- spix = checkbuf;
- for (p=npix2; p--;)
- *(ppix++) = (PIXTYPE)*(spix++);
- addcheck(check, checkmask, width,height, ix,iy, 1.0);
- free(checkbuf);
- free(sumopc);
- }
-
-/* Free memory */
- free(pcshift);
- free(wpcshift);
- free(sol);
-
- return;
- }
-
diff --git a/sextractor/src/photom.c b/sextractor/src/photom.c
deleted file mode 100644
index b4149fe..0000000
--- a/sextractor/src/photom.c
+++ /dev/null
@@ -1,913 +0,0 @@
- /*
- photom.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Compute magnitudes and other photometrical parameters.
-*
-* Last modify: 24/08/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "photom.h"
-#include "plist.h"
-
-static obj2struct *obj2 = &outobj2;
-
-/***************************** computeaperflux********************************/
-/*
-Compute the total flux within a circular aperture.
-*/
-void computeaperflux(picstruct *field, picstruct *wfield,
- objstruct *obj, int i)
-
- {
- float r2, raper,raper2, rintlim,rintlim2,rextlim2,
- mx,my,dx,dx1,dy,dy2,
- offsetx,offsety,scalex,scaley,scale2, ngamma, locarea;
- double tv, sigtv, area, pix, var, backnoise2, gain;
- int x,y, x2,y2, xmin,xmax,ymin,ymax, sx,sy, w,h,
- fymin,fymax, pflag,corrflag, gainflag;
- long pos;
- PIXTYPE *strip,*stript, *wstrip,*wstript,
- wthresh = 0.0;
-
- if (wfield)
- wthresh = wfield->weight_thresh;
- wstrip = wstript = NULL;
- mx = obj->mx;
- my = obj->my;
- w = field->width;
- h = field->stripheight;
- fymin = field->ymin;
- fymax = field->ymax;
- ngamma = field->ngamma;
- pflag = (prefs.detect_type==PHOTO)? 1:0;
- corrflag = (prefs.mask_type==MASK_CORRECT);
- gainflag = wfield && prefs.weightgain_flag;
- var = backnoise2 = field->backsig*field->backsig;
- gain = prefs.gain;
-/* Integration radius */
- raper = prefs.apert[i]/2.0;
- raper2 = raper*raper;
-/* Internal radius of the oversampled annulus (<r-sqrt(2)/2) */
- rintlim = raper - 0.75;
- rintlim2 = (rintlim>0.0)? rintlim*rintlim: 0.0;
-/* External radius of the oversampled annulus (>r+sqrt(2)/2) */
- rextlim2 = (raper + 0.75)*(raper + 0.75);
- tv = sigtv = area = 0.0;
- scaley = scalex = 1.0/APER_OVERSAMP;
- scale2 = scalex*scaley;
- offsetx = 0.5*(scalex-1.0);
- offsety = 0.5*(scaley-1.0);
-
- xmin = (int)(mx-raper+0.499999);
- xmax = (int)(mx+raper+1.499999);
- ymin = (int)(my-raper+0.499999);
- ymax = (int)(my+raper+1.499999);
-
- if (xmin < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if (xmax > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if (ymin < fymin)
- {
- ymin = fymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if (ymax > fymax)
- {
- ymax = fymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- strip = field->strip;
- if (wfield)
- wstrip = wfield->strip;
- for (y=ymin; y<ymax; y++)
- {
- stript = strip + (pos = (y%h)*w + xmin);
- if (wfield)
- wstript = wstrip + pos;
- for (x=xmin; x<xmax; x++, stript++, wstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((r2=dx*dx+dy*dy) < rextlim2)
- {
- if (r2> rintlim2)
- {
- dx += offsetx;
- dy += offsety;
- locarea = 0.0;
- for (sy=APER_OVERSAMP; sy--; dy+=scaley)
- {
- dx1 = dx;
- dy2 = dy*dy;
- for (sx=APER_OVERSAMP; sx--; dx1+=scalex)
- if (dx1*dx1+dy2<raper2)
- locarea += scale2;
- }
- }
- else
- locarea = 1.0;
- area += locarea;
-/*------ Here begin tests for pixel and/or weight overflows. Things are a */
-/*------ bit intricated to have it running as fast as possible in the most */
-/*------ common cases */
- if ((pix=*stript)<=-BIG || (wfield && (var=*wstript)>=wthresh))
- {
- if (corrflag
- && (x2=(int)(2*mx+0.49999-x))>=0 && x2<w
- && (y2=(int)(2*my+0.49999-y))>=fymin && y2<fymax
- && (pix=*(strip + (pos = (y2%h)*w + x2)))>-BIG)
- {
- if (wfield)
- {
- var = *(wstrip + pos);
- if (var>=wthresh)
- pix = var = 0.0;
- }
- }
- else
- {
- pix = 0.0;
- if (wfield)
- var = 0.0;
- }
- }
- if (pflag)
- {
- pix=exp(pix/ngamma);
- sigtv += var*locarea*pix*pix;
- }
- else
- sigtv += var*locarea;
- tv += locarea*pix;
- if (gainflag && pix>0.0 && gain>0.0)
- sigtv += pix/gain*var/backnoise2;
- }
- }
- }
-
- if (pflag)
- {
- tv = ngamma*(tv-area*exp(obj->dbkg/ngamma));
- sigtv /= ngamma*ngamma;
- }
- else
- {
- tv -= area*obj->dbkg;
- if (!gainflag && gain > 0.0 && tv>0.0)
- sigtv += tv/gain;
- }
-
- if (i<prefs.flux_apersize)
- obj2->flux_aper[i] = tv;
- if (i<prefs.fluxerr_apersize)
- obj2->fluxerr_aper[i] = sqrt(sigtv);
- if (i<prefs.mag_apersize)
- obj2->mag_aper[i] = tv>0.0? -2.5*log10(tv) + prefs.mag_zeropoint : 99.0;
- if (i<prefs.magerr_apersize)
- obj2->magerr_aper[i] = tv>0.0? 1.086*sqrt(sigtv)/tv:99.0;
-
- return;
- }
-
-
-/***************************** computepetroflux ******************************/
-/*
-Compute the total flux within an automatic elliptical aperture.
-*/
-void computepetroflux(picstruct *field, picstruct *dfield, picstruct *wfield,
- picstruct *dwfield, objstruct *obj)
-
- {
- double sigtv, tv, r1, v1,var,gain,backnoise2, muden,munum;
- float bkg, ngamma, mx,my, dx,dy, cx2,cy2,cxy, r2,
- klim, klim2,kmin,kmin2,kmax,kmax2,kstep,kmea,kmea2,
- dxlim, dylim;
- int area,areab, areaden, areanum,
- x,y, x2,y2, xmin,xmax,ymin,ymax,
- fymin,fymax, w,h,
- pflag, corrflag, gainflag, pos;
- PIXTYPE *strip,*stript, *dstrip,*dstript, *wstrip,*wstript,
- *dwstrip,*dwstript,
- pix, wthresh=0.0, dwthresh=0.0;
-
-
-/* Let's initialize some variables */
- if (!dfield)
- dfield = field;
- if (dwfield)
- dwthresh = dwfield->weight_thresh;
- wstrip = dwstrip = NULL;
- if (wfield)
- wthresh = wfield->weight_thresh;
- wstript = dwstript = NULL;
- w = field->width;
- h = field->stripheight;
- fymin = field->ymin;
- fymax = field->ymax;
- ngamma = field->ngamma;
- bkg = (double)obj->dbkg;
- mx = obj->mx;
- my = obj->my;
- var = backnoise2 = field->backsig*field->backsig;
- gain = prefs.gain;
- pflag = (prefs.detect_type==PHOTO)? 1:0;
- corrflag = (prefs.mask_type==MASK_CORRECT);
- gainflag = wfield && prefs.weightgain_flag;
-
-/* First step: find the extent of the ellipse (the Petrosian factor) */
-/* Clip boundaries in x and y */
-/* We first check that the search ellipse is large enough... */
- if (PETRO_NSIG*sqrt(obj->a*obj->b)>prefs.autoaper[0]/2.0)
- {
- cx2 = obj->cxx;
- cy2 = obj->cyy;
- cxy = obj->cxy;
- dxlim = cx2 - cxy*cxy/(4.0*cy2);
- dxlim = dxlim>0.0 ? PETRO_NSIG/sqrt(dxlim) : 0.0;
- dylim = cy2 - cxy*cxy/(4.0*cx2);
- dylim = dylim > 0.0 ? PETRO_NSIG/sqrt(dylim) : 0.0;
- klim2 = PETRO_NSIG*PETRO_NSIG;
- }
- else
-/*-- ...if not, use the circular aperture provided by the user */
- {
- cx2 = cy2 = 1.0;
- cxy = 0.0;
- dxlim = dylim = prefs.autoaper[0]/2.0;
- klim2 = dxlim*dxlim;
- }
-
- if ((xmin = RINT(mx-dxlim)) < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((xmax = RINT(mx+dxlim)+1) > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymin = RINT(my-dylim)) < field->ymin)
- {
- ymin = field->ymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymax = RINT(my+dylim)+1) > field->ymax)
- {
- ymax = field->ymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- dstrip = dfield->strip;
- if (dwfield)
- dwstrip = dwfield->strip;
- klim = sqrt(klim2);
- kstep = klim/20.0;
- area = areab = areanum = areaden = 0;
- munum = muden = 0.0;
- kmea = 0.0;
- for (kmin=kstep; (kmax=kmin*1.2)<klim; kmin += kstep)
- {
- kmea = (kmin+kmax)/2.0;
- kmea2 = kmea*kmea;
- kmin2 = kmin*kmin;
- kmax2 = kmax*kmax;
- v1 = r1 = 0.0;
- area = areab = areanum = areaden = 0;
- munum = muden = 0.0;
- for (y=ymin; y<ymax; y++)
- {
- dstript = dstrip + (pos = xmin + (y%h)*w);
- if (dwfield)
- dwstript = dwstrip + pos;
- for (x=xmin; x<xmax; x++, dstript++, dwstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((r2=cx2*dx*dx + cy2*dy*dy + cxy*dx*dy) <= kmax2)
- {
- if ((pix=*dstript)>-BIG && (!dwfield || (dwfield&&*dwstript<dwthresh)))
- {
- area++;
- if (r2>=kmin2)
- {
- munum += pix;
- areanum++;
- }
- if (r2<kmea2)
- {
- muden += pix;
- areaden++;
- }
- }
- else
- areab++;
- }
- }
- }
- if (areanum && areaden)
- {
- munum /= (double)areanum;
- muden /= (double)areaden;
- if (munum<muden*0.2)
- break;
- }
- }
-
- area += areab;
- if (area)
- {
-/*-- Go further only if some pixels are available !! */
- if (areanum && areaden && munum && muden)
- {
- obj2->petrofactor = prefs.petroparam[0]*kmea;
- if (obj2->petrofactor < prefs.petroparam[1])
- obj2->petrofactor = prefs.petroparam[1];
- }
- else
- obj2->petrofactor = prefs.petroparam[1];
-
-/*-- Flag if the Petrosian photometry can be strongly affected by neighhours */
- if ((float)areab/area > CROWD_THRESHOLD)
- obj->flag |= OBJ_CROWDED;
-
-/*-- Second step: integrate within the ellipse */
-/*-- Clip boundaries in x and y (bis) */
-/*-- We first check that the derived ellipse is large enough... */
- if (obj2->petrofactor*sqrt(obj->a*obj->b)>prefs.autoaper[1]/2.0)
- {
- cx2 = obj->cxx;
- cy2 = obj->cyy;
- cxy = obj->cxy;
- dxlim = cx2 - cxy*cxy/(4.0*cy2);
- dxlim = dxlim>0.0 ? obj2->petrofactor/sqrt(dxlim) : 0.0;
- dylim = cy2 - cxy*cxy/(4.0*cx2);
- dylim = dylim > 0.0 ? obj2->petrofactor/sqrt(dylim) : 0.0;
- klim2 = obj2->petrofactor*obj2->petrofactor;
- }
- else
-/*---- ...if not, use the circular aperture provided by the user */
- {
- cx2 = cy2 = 1.0;
- cxy = 0.0;
- dxlim = dylim = prefs.autoaper[1]/2.0;
- klim2 = dxlim*dxlim;
- obj2->petrofactor = 0.0;
- }
-
- if ((xmin = RINT(mx-dxlim)) < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((xmax = RINT(mx+dxlim)+1) > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymin = RINT(my-dylim)) < field->ymin)
- {
- ymin = field->ymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymax = RINT(my+dylim)+1) > field->ymax)
- {
- ymax = field->ymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- area = areab = 0;
- tv = sigtv = 0.0;
- strip = field->strip;
- if (wfield)
- wstrip = wfield->strip;
- for (y=ymin; y<ymax; y++)
- {
- stript = strip + (pos = xmin + (y%h)*w);
- if (wfield)
- wstript = wstrip + pos;
- for (x=xmin; x<xmax; x++, stript++, wstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((cx2*dx*dx + cy2*dy*dy + cxy*dx*dy) <= klim2)
- {
- area++;
-/*-------- Here begin tests for pixel and/or weight overflows. Things are a */
-/*-------- bit intricated to have it running as fast as possible in the most */
-/*-------- common cases */
- if ((pix=*stript)<=-BIG || (wfield && (var=*wstript)>=wthresh))
- {
- areab++;
- if (corrflag
- && (x2=(int)(2*mx+0.49999-x))>=0 && x2<w
- && (y2=(int)(2*my+0.49999-y))>=fymin && y2<fymax
- && (pix=*(strip + (pos = (y2%h)*w + x2)))>-BIG)
- {
- if (wfield)
- {
- var = *(wstrip + pos);
- if (var>=wthresh)
- pix = var = 0.0;
- }
- }
- else
- {
- pix = 0.0;
- if (wfield)
- var = 0.0;
- }
- }
- if (pflag)
- {
- pix = exp(pix/ngamma);
- sigtv += var*pix*pix;
- }
- else
- sigtv += var;
- tv += pix;
- if (gainflag && pix>0.0 && gain>0.0)
- sigtv += pix/gain*var/backnoise2;
- }
- }
- }
-
-/*-- Flag if the Petrosian photometry can be strongly affected by neighhours */
- if ((float)areab > CROWD_THRESHOLD*area)
- obj->flag |= OBJ_CROWDED;
-
- if (pflag)
- {
- tv = ngamma*(tv-area*exp(bkg/ngamma));
- sigtv /= ngamma*ngamma;
- }
- else
- {
- tv -= area*bkg;
- if (!gainflag && gain > 0.0 && tv>0.0)
- sigtv += tv/gain;
- }
- }
- else
-/*-- No available pixels: set the flux to zero */
- tv = sigtv = 0.0;
-
-
- obj2->flux_petro = tv;
- obj2->fluxerr_petro = sqrt(sigtv);
-
- if (FLAG(obj2.mag_petro))
- obj2->mag_petro = obj2->flux_petro>0.0?
- -2.5*log10(obj2->flux_petro) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_petro))
- obj2->magerr_petro = obj2->flux_petro>0.0?
- 1.086*obj2->fluxerr_petro/obj2->flux_petro
- :99.0;
- if (tv<=0.0)
- obj2->petrofactor = 0.0;
-
- return;
- }
-
-
-/***************************** computeautoflux********************************/
-/*
-Compute the total flux within an automatic elliptical aperture.
-*/
-void computeautoflux(picstruct *field, picstruct *dfield, picstruct *wfield,
- picstruct *dwfield, objstruct *obj)
-
- {
- double sigtv, tv, r1, v1,var,gain,backnoise2;
- float bkg, ngamma, mx,my, dx,dy, cx2,cy2,cxy, r2,klim2,
- dxlim, dylim;
- int area,areab, x,y, x2,y2, xmin,xmax,ymin,ymax,
- fymin,fymax, w,h,
- pflag, corrflag, gainflag, pos;
- PIXTYPE *strip,*stript, *dstrip,*dstript, *wstrip,*wstript,
- *dwstrip,*dwstript,
- pix, wthresh=0.0, dwthresh=0.0;
-
-
-/* Let's initialize some variables */
- if (!dfield)
- dfield = field;
- if (dwfield)
- dwthresh = dwfield->weight_thresh;
- wstrip = dwstrip = NULL;
- if (wfield)
- wthresh = wfield->weight_thresh;
- wstript = dwstript = NULL;
- w = field->width;
- h = field->stripheight;
- fymin = field->ymin;
- fymax = field->ymax;
- ngamma = field->ngamma;
- bkg = (double)obj->dbkg;
- mx = obj->mx;
- my = obj->my;
- var = backnoise2 = field->backsig*field->backsig;
- gain = prefs.gain;
- pflag = (prefs.detect_type==PHOTO)? 1:0;
- corrflag = (prefs.mask_type==MASK_CORRECT);
- gainflag = wfield && prefs.weightgain_flag;
-
-/* First step: find the extent of the ellipse (the kron factor r1) */
-/* Clip boundaries in x and y */
-/* We first check that the search ellipse is large enough... */
- if (KRON_NSIG*sqrt(obj->a*obj->b)>prefs.autoaper[0]/2.0)
- {
- cx2 = obj->cxx;
- cy2 = obj->cyy;
- cxy = obj->cxy;
- dxlim = cx2 - cxy*cxy/(4.0*cy2);
- dxlim = dxlim>0.0 ? KRON_NSIG/sqrt(dxlim) : 0.0;
- dylim = cy2 - cxy*cxy/(4.0*cx2);
- dylim = dylim > 0.0 ? KRON_NSIG/sqrt(dylim) : 0.0;
- klim2 = KRON_NSIG*KRON_NSIG;
- }
- else
-/*-- ...if not, use the circular aperture provided by the user */
- {
- cx2 = cy2 = 1.0;
- cxy = 0.0;
- dxlim = dylim = prefs.autoaper[0]/2.0;
- klim2 = dxlim*dxlim;
- }
-
- if ((xmin = RINT(mx-dxlim)) < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((xmax = RINT(mx+dxlim)+1) > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymin = RINT(my-dylim)) < field->ymin)
- {
- ymin = field->ymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymax = RINT(my+dylim)+1) > field->ymax)
- {
- ymax = field->ymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- v1 = r1 = 0.0;
- area = areab = 0;
- dstrip = dfield->strip;
- if (dwfield)
- dwstrip = dwfield->strip;
- for (y=ymin; y<ymax; y++)
- {
- dstript = dstrip + (pos = xmin + (y%h)*w);
- if (dwfield)
- dwstript = dwstrip + pos;
- for (x=xmin; x<xmax; x++, dstript++, dwstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((r2=cx2*dx*dx + cy2*dy*dy + cxy*dx*dy) <= klim2)
- {
- if ((pix=*dstript)>-BIG && (!dwfield || (dwfield&&*dwstript<dwthresh)))
- {
- area++;
- r1 += sqrt(r2)*pix;
- v1 += pix;
- }
- else
- areab++;
- }
- }
- }
-
- area += areab;
- if (area)
- {
-/*-- Go further only if some pixels are available !! */
- if (r1>0.0 && v1>0.0)
- {
- obj2->kronfactor = prefs.autoparam[0]*r1/v1;
- if (obj2->kronfactor < prefs.autoparam[1])
- obj2->kronfactor = prefs.autoparam[1];
- }
- else
- obj2->kronfactor = prefs.autoparam[1];
-
-/*-- Flag if the Kron photometry can be strongly affected by neighhours */
- if ((float)areab/area > CROWD_THRESHOLD)
- obj->flag |= OBJ_CROWDED;
-
-/*-- Second step: integrate within the ellipse */
-/*-- Clip boundaries in x and y (bis) */
-/*-- We first check that the derived ellipse is large enough... */
- if (obj2->kronfactor*sqrt(obj->a*obj->b)>prefs.autoaper[1]/2.0)
- {
- cx2 = obj->cxx;
- cy2 = obj->cyy;
- cxy = obj->cxy;
- dxlim = cx2 - cxy*cxy/(4.0*cy2);
- dxlim = dxlim>0.0 ? obj2->kronfactor/sqrt(dxlim) : 0.0;
- dylim = cy2 - cxy*cxy/(4.0*cx2);
- dylim = dylim > 0.0 ? obj2->kronfactor/sqrt(dylim) : 0.0;
- klim2 = obj2->kronfactor*obj2->kronfactor;
- }
- else
-/*---- ...if not, use the circular aperture provided by the user */
- {
- cx2 = cy2 = 1.0;
- cxy = 0.0;
- dxlim = dylim = prefs.autoaper[1]/2.0;
- klim2 = dxlim*dxlim;
- obj2->kronfactor = 0.0;
- }
-
- if ((xmin = RINT(mx-dxlim)) < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((xmax = RINT(mx+dxlim)+1) > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymin = RINT(my-dylim)) < field->ymin)
- {
- ymin = field->ymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if ((ymax = RINT(my+dylim)+1) > field->ymax)
- {
- ymax = field->ymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- area = areab = 0;
- tv = sigtv = 0.0;
- strip = field->strip;
- if (wfield)
- wstrip = wfield->strip;
- for (y=ymin; y<ymax; y++)
- {
- stript = strip + (pos = xmin + (y%h)*w);
- if (wfield)
- wstript = wstrip + pos;
- for (x=xmin; x<xmax; x++, stript++, wstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((cx2*dx*dx + cy2*dy*dy + cxy*dx*dy) <= klim2)
- {
- area++;
-/*-------- Here begin tests for pixel and/or weight overflows. Things are a */
-/*-------- bit intricated to have it running as fast as possible in the most */
-/*-------- common cases */
- if ((pix=*stript)<=-BIG || (wfield && (var=*wstript)>=wthresh))
- {
- areab++;
- if (corrflag
- && (x2=(int)(2*mx+0.49999-x))>=0 && x2<w
- && (y2=(int)(2*my+0.49999-y))>=fymin && y2<fymax
- && (pix=*(strip + (pos = (y2%h)*w + x2)))>-BIG)
- {
- if (wfield)
- {
- var = *(wstrip + pos);
- if (var>=wthresh)
- pix = var = 0.0;
- }
- }
- else
- {
- pix = 0.0;
- if (wfield)
- var = 0.0;
- }
- }
- if (pflag)
- {
- pix = exp(pix/ngamma);
- sigtv += var*pix*pix;
- }
- else
- sigtv += var;
- tv += pix;
- if (gainflag && pix>0.0 && gain>0.0)
- sigtv += pix/gain*var/backnoise2;
- }
- }
- }
-
-/*-- Flag if the Kron photometry can be strongly affected by neighhours */
- if ((float)areab > CROWD_THRESHOLD*area)
- obj->flag |= OBJ_CROWDED;
-
- if (pflag)
- {
- tv = ngamma*(tv-area*exp(bkg/ngamma));
- sigtv /= ngamma*ngamma;
- }
- else
- {
- tv -= area*bkg;
- if (!gainflag && gain > 0.0 && tv>0.0)
- sigtv += tv/gain;
- }
- }
- else
-/*-- No available pixels: set the flux to zero */
- tv = sigtv = 0.0;
-
-
- obj2->flux_auto = tv;
- obj2->fluxerr_auto = sqrt(sigtv);
-
- if (FLAG(obj2.mag_auto))
- obj2->mag_auto = obj2->flux_auto>0.0?
- -2.5*log10(obj2->flux_auto) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_auto))
- obj2->magerr_auto = obj2->flux_auto>0.0?
- 1.086*obj2->fluxerr_auto/obj2->flux_auto
- :99.0;
- if (tv<=0.0)
- obj2->kronfactor = 0.0;
-
- return;
- }
-
-
-/****************************** computeisocorflux ****************************/
-/*
-Compute the (corrected) isophotal flux.
-*/
-void computeisocorflux(picstruct *field, objstruct *obj)
-
- {
- double ati;
-
- ati = (obj->flux>0.0)? (obj->fdnpix*obj->dthresh/obj->flux) : 0.0;
- if (ati>1.0)
- ati = 1.0;
- else if (ati<0.0)
- ati = 0.0;
- obj2->flux_isocor = obj->flux/(1.0-0.196099*ati-0.751208*ati*ati);
- if (FLAG(obj2.fluxerr_isocor))
- {
- if (obj->flux>0.0)
- {
- double dati, sigtv;
-
- sigtv = obj->fluxerr/(obj->flux*obj->flux);
- dati = obj->fdnpix?ati*sqrt(sigtv+1.0/obj->fdnpix): 0.0;
- dati = 0.196099*dati + 0.751208*2*ati*dati;
- obj2->fluxerr_isocor = sqrt(sigtv+dati*dati)*obj->flux;
- }
- else
- obj2->fluxerr_isocor = sqrt(obj->fluxerr);
- }
-
- return;
- }
-
-
-/******************************* computemags *********************************/
-/*
-Compute magnitude parameters.
-*/
-void computemags(picstruct *field, objstruct *obj)
-
- {
-/* Mag. isophotal */
- if (FLAG(obj2.mag_iso))
- obj2->mag_iso = obj2->flux_iso>0.0?
- -2.5*log10(obj2->flux_iso) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_iso))
- obj2->magerr_iso = obj2->flux_iso>0.0?
- 1.086*obj2->fluxerr_iso/obj2->flux_iso
- :99.0;
-
-/* Mag. isophotal corrected */
- if (FLAG(obj2.mag_isocor))
- obj2->mag_isocor = obj2->flux_isocor>0.0?
- -2.5*log10(obj2->flux_isocor) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_isocor))
- obj2->magerr_isocor = obj2->flux_isocor>0.0?
- 1.086*obj2->fluxerr_isocor/obj2->flux_isocor
- :99.0;
-
-/* Choose the ``best'' flux according to the local crowding */
-
- if (FLAG(obj2.flux_best))
- {
- if (obj->flag&OBJ_CROWDED)
- {
- obj2->flux_best = obj2->flux_isocor;
- obj2->fluxerr_best = obj2->fluxerr_isocor;
- }
- else
- {
- obj2->flux_best = obj2->flux_auto;
- obj2->fluxerr_best = obj2->fluxerr_auto;
- }
- }
-
-/* Mag. Best */
- if (FLAG(obj2.mag_best))
- obj2->mag_best = obj2->flux_best>0.0?
- -2.5*log10(obj2->flux_best) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_best))
- obj2->magerr_best = obj2->flux_best>0.0?
- 1.086*obj2->fluxerr_best/obj2->flux_best
- :99.0;
-
-/* Mag. SOM-fit */
- if (FLAG(obj2.mag_somfit))
- obj2->mag_somfit = obj2->flux_somfit>0.0?
- -2.5*log10(obj2->flux_somfit) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_somfit))
- obj2->magerr_somfit = obj2->flux_somfit>0.0?
- 1.086*obj2->fluxerr_somfit/obj2->flux_somfit
- :99.0;
-
-/* Mag. PROFILE */
- if (FLAG(obj2.mag_prof))
- obj2->mag_prof = obj2->flux_prof>0.0?
- -2.5*log10(obj2->flux_prof) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_prof))
- obj2->magerr_prof = obj2->flux_prof>0.0?
- 1.086*obj2->fluxerr_prof/obj2->flux_prof
- :99.0;
-
-/* Mag. WINdowed */
- if (FLAG(obj2.mag_win))
- obj2->mag_win = obj2->flux_win>0.0?
- -2.5*log10(obj2->flux_win) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_win))
- obj2->magerr_win = obj2->flux_win>0.0?
- 1.086*obj2->fluxerr_win/obj2->flux_win
- :99.0;
-/* Mag. GALFIT */
- if (FLAG(obj2.mag_galfit))
- obj2->mag_galfit = obj2->flux_galfit>0.0?
- -2.5*log10(obj2->flux_galfit) + prefs.mag_zeropoint
- :99.0;
- if (FLAG(obj2.magerr_galfit))
- obj2->magerr_galfit = obj2->flux_galfit>0.0?
- 1.086*obj2->fluxerr_galfit/obj2->flux_galfit
- :99.0;
-
-/* SB units */
- if (FLAG(obj2.maxmu))
- outobj2.maxmu = obj->peak > 0.0 ?
- -2.5*log10((obj->peak)
- / (field->pixscale * field->pixscale)) + prefs.mag_zeropoint
- : 99.0;
-
- if (FLAG(obj2.threshmu))
- obj2->threshmu = obj->thresh > 0.0 ?
- -2.5*log10((obj->thresh)
- / (field->pixscale * field->pixscale)) + prefs.mag_zeropoint
- : 99.0;
-
- return;
- }
-
-
diff --git a/sextractor/src/photom.h b/sextractor/src/photom.h
deleted file mode 100644
index c0bb9c2..0000000
--- a/sextractor/src/photom.h
+++ /dev/null
@@ -1,42 +0,0 @@
- /*
- photom.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden observatory
-*
-* Contents: Include file for photom.h.
-*
-* Last modify: 22/10/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define APER_OVERSAMP 5 /* oversampling in each dimension (MAG_APER) */
-#define KRON_NSIG 3*MARGIN_SCALE /* MAG_AUTO analysis range (number */
- /* of sigma) */
-#define PETRO_NSIG 3*MARGIN_SCALE /* MAG_PETRO analysis range (number */
- /* of sigma) */
-#define CROWD_THRESHOLD 0.1 /* The OBJ_CROWDED flag is set if photometric*/
- /* contamination may exceed this fraction of */
- /* flux */
-
-/* NOTES:
-One must have: APER_OVERSAMP >= 1
- KRON_NSIG > 0.0
- PETRO_NSIG > 0.0
- CROWD_THRESHOLD >= 0
-*/
-
-/*------------------------------- functions ---------------------------------*/
-extern void computeaperflux(picstruct *, picstruct *, objstruct *, int),
- computeautoflux(picstruct *, picstruct *, picstruct *,
- picstruct *, objstruct *),
- computeisocorflux(picstruct *, objstruct *),
- computemags(picstruct *, objstruct *),
- computepetroflux(picstruct *, picstruct *, picstruct *,
- picstruct *, objstruct *);
diff --git a/sextractor/src/plist.c b/sextractor/src/plist.c
deleted file mode 100644
index 203d673..0000000
--- a/sextractor/src/plist.c
+++ /dev/null
@@ -1,216 +0,0 @@
- /*
- plist.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions dealing with the handling of pixel lists.
-*
-* Last modify: 29/11/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "plist.h"
-
-
-/******************************** createblank *******************************
-PROTO int createblank(int no, objliststruct *objlist)
-PURPOSE Create pixel map for BLANKing.
-INPUT objlist number,
- objlist pointer,
-OUTPUT RETURN_OK if success, RETURN_FATAL_ERROR otherwise (memory overflow).
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 27/11/2003
- ***/
-int createblank(objliststruct *objlist, int no)
-
- {
- objstruct *obj;
- pliststruct *pixel, *pixt;
- int i, n, pos, xmin,ymin, w, dflag;
- PIXTYPE *pix, *dpix, *pt;
-
- obj = objlist->obj+no;
- pixel = objlist->plist;
- dpix = NULL; /* To avoid gcc -Wall warnings */
- dflag = prefs.dimage_flag;
-
- obj->subx = xmin = obj->xmin;
- obj->suby = ymin = obj->ymin;
- obj->subw = w = obj->xmax - xmin + 1;
- obj->subh = obj->ymax - ymin + 1;
-
- n = w*obj->subh;
- if (!(obj->blank = pix = (PIXTYPE *)malloc(n*sizeof(PIXTYPE))))
- return RETURN_FATAL_ERROR;
- pt = pix;
- for (i=n; i--;)
- *(pt++) = -BIG;
-
- if (dflag)
- {
- if (!(obj->dblank = dpix = (PIXTYPE *)malloc(n*sizeof(PIXTYPE))))
- {
- free(pix);
- return RETURN_FATAL_ERROR;
- }
- pt = dpix;
- for (i=n; i--;)
- *(pt++) = -BIG;
- }
- else
- obj->dblank = NULL;
-
- for (i=obj->firstpix; i!=-1; i=PLIST(pixt,nextpix))
- {
- pixt = pixel+i;
- pos = (PLIST(pixt,x)-xmin) + (PLIST(pixt,y)-ymin)*w;
- *(pix+pos) = PLIST(pixt, value);
- if (dflag)
- *(dpix+pos) = PLISTPIX(pixt, dvalue);
- }
-
- return RETURN_OK;
- }
-
-
-/******************************** createsubmap *******************************
-PROTO int createpixmap(int no, objliststruct *objlist)
-PURPOSE Create pixel-index submap for deblending.
-INPUT objlist number,
- objlist pointer,
-OUTPUT RETURN_OK if success, RETURN_FATAL_ERROR otherwise (memory overflow).
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 08/10/97
- ***/
-int createsubmap(objliststruct *objlist, int no)
-
- {
- objstruct *obj;
- pliststruct *pixel, *pixt;
- int i, n, xmin,ymin, w, *pix, *pt;
-
- obj = objlist->obj+no;
- pixel = objlist->plist;
-
- obj->subx = xmin = obj->xmin;
- obj->suby = ymin = obj->ymin;
- obj->subw = w = obj->xmax - xmin + 1;
- obj->subh = obj->ymax - ymin + 1;
- n = w*obj->subh;
- if (!(obj->submap = pix = (int *)malloc(n*sizeof(int))))
- return RETURN_FATAL_ERROR;
- pt = pix;
- for (i=n; i--;)
- *(pt++) = -1;
-
- for (i=obj->firstpix; i!=-1; i=PLIST(pixt,nextpix))
- {
- pixt = pixel+i;
- *(pix+(PLIST(pixt,x)-xmin) + (PLIST(pixt,y)-ymin)*w) = i;
- }
-
- return RETURN_OK;
- }
-
-
-/****************************** init_plist ************************************
-PROTO pliststruct *init_plist(void)
-PURPOSE initialize a pixel-list and its components.
-INPUT -.
-OUTPUT -.
-NOTES The preparation of components relies on the preferences.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 29/11/2005
- ***/
-void init_plist(void)
-
- {
- pbliststruct *pbdum = NULL;
- int i;
-
- plistsize = sizeof(pbliststruct);
- plistoff_value = (char *)&pbdum->value - (char *)pbdum;
-
- if (prefs.dimage_flag)
- {
- plistexist_dvalue = 1;
- plistoff_dvalue = plistsize;
- plistsize += sizeof(PIXTYPE);
- }
- else
- {
- plistexist_dvalue = 0;
- plistoff_dvalue = plistoff_value;
- }
-
- if (prefs.filter_flag)
- {
- plistexist_cdvalue = 1;
- plistoff_cdvalue = plistsize;
- plistsize += sizeof(PIXTYPE);
- }
- else
- {
- plistexist_cdvalue = 0;
- plistoff_cdvalue = plistoff_dvalue;
- }
-
- if (VECFLAG(obj.imaflag))
- {
- plistexist_flag = 1;
- for (i=0; i<prefs.nimaisoflag; i++)
- {
- plistoff_flag[i] = plistsize;
- plistsize += sizeof(FLAGTYPE);
- }
- }
- else
- plistexist_flag = 0;
-
- if (FLAG(obj.wflag))
- {
- plistexist_wflag = 1;
- plistoff_wflag = plistsize;
- plistsize += sizeof(FLAGTYPE);
- }
- else
- plistexist_wflag = 0;
-
- if (prefs.weight_flag)
- {
- plistexist_var = 1;
- plistoff_var = plistsize;
- plistsize += sizeof(PIXTYPE);
- }
- else
- plistexist_var = 0;
-
- if (prefs.dweight_flag)
- {
- plistexist_dthresh = 1;
- plistoff_dthresh = plistsize;
- plistsize += sizeof(PIXTYPE);
- }
- else
- plistexist_dthresh = 0;
-
- return;
- }
-
diff --git a/sextractor/src/plist.h b/sextractor/src/plist.h
deleted file mode 100644
index 6de28ea..0000000
--- a/sextractor/src/plist.h
+++ /dev/null
@@ -1,49 +0,0 @@
- /*
- plist.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, (IAP)
-*
-* Contents: functions dealing with the handling of pixel lists.
-*
-* Last modify: 29/11/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*------------------------------- definitions -------------------------------*/
-
-#define PLIST(ptr, elem) (((pbliststruct *)(ptr))->elem)
-
-#define PLISTEXIST(elem) (plistexist_##elem)
-
-#define PLISTPIX(ptr, elem) (*((PIXTYPE *)((ptr)+plistoff_##elem)))
-
-#define PLISTFLAG(ptr, elem) (*((FLAGTYPE *)((ptr)+plistoff_##elem)))
-
-/*------------------------------- structures --------------------------------*/
-
-typedef struct
- {
- int nextpix;
- int x, y;
- PIXTYPE value;
- } pbliststruct;
-
-/*-------------------------------- globals ----------------------------------*/
-
-int plistexist_value, plistexist_dvalue, plistexist_cdvalue,
- plistexist_flag, plistexist_wflag, plistexist_dthresh, plistexist_var,
- plistoff_value, plistoff_dvalue, plistoff_cdvalue,
- plistoff_flag[MAXFLAG], plistoff_wflag, plistoff_dthresh, plistoff_var,
- plistsize;
-
-/*------------------------------- functions ---------------------------------*/
-
-void init_plist(void);
-
-int createblank(objliststruct *objlist, int n),
- createsubmap(objliststruct *objlist, int n);
diff --git a/sextractor/src/poly.c b/sextractor/src/poly.c
deleted file mode 100644
index fdbd40d..0000000
--- a/sextractor/src/poly.c
+++ /dev/null
@@ -1,350 +0,0 @@
- /*
- poly.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using Polynomials
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Polynomial fitting
-*
-* Last modify: 13/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "poly.h"
-
-
-/****** poly_init ************************************************************
-PROTO polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
-PURPOSE Allocate and initialize a polynom structure.
-INPUT 1D array containing the group for each parameter,
- number of dimensions (parameters),
- 1D array with the polynomial degree for each group,
- number of groups.
-OUTPUT polystruct pointer.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 11/02/99
- ***/
-polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
- {
- polystruct *poly;
- char str[MAXCHAR];
- static int nd[POLY_MAXDIM];
- int *groupt,
- d,g,n,num,den;
-
- QCALLOC(poly, polystruct, 1);
- if ((poly->ndim=ndim) > POLY_MAXDIM)
- {
- sprintf(str, "The dimensionality of the polynom (%d) exceeds the maximum\n"
- "allowed one (%d)", ndim, POLY_MAXDIM);
- error(EXIT_FAILURE, "*Error*: ", str);
- }
-
- if (ndim)
- QMALLOC(poly->group, int, poly->ndim);
- for (groupt=poly->group, d=ndim; d--;)
- *(groupt++) = *(group++)-1;
-
- poly->ngroup = ngroup;
- if (ngroup)
- {
- group = poly->group; /* Forget the original *group */
-
- QMALLOC(poly->degree, int, poly->ngroup);
-
-/*-- Compute the number of context parameters for each group */
- memset(nd, 0, ngroup*sizeof(int));
- for (d=0; d<ndim; d++)
- {
- if ((g=group[d])>ngroup)
- error(EXIT_FAILURE, "*Error*: polynomial GROUP out of range", "");
- nd[g]++;
- }
- }
-
-/* Compute the total number of coefficients */
- poly->ncoeff = 1;
- for (g=0; g<ngroup; g++)
- {
- if ((d=poly->degree[g]=*(degree++))>POLY_MAXDEGREE)
- {
- sprintf(str, "The degree of the polynom (%d) exceeds the maximum\n"
- "allowed one (%d)", poly->degree[g], POLY_MAXDEGREE);
- error(EXIT_FAILURE, "*Error*: ", str);
- }
-
-/*-- There are (n+d)!/(n!d!) coeffs per group, that is Prod_(i<=d) (n+i)/i */
- for (num=den=1, n=nd[g]; d; num*=(n+d), den*=d--);
- poly->ncoeff *= num/den;
- }
-
- QMALLOC(poly->basis, double, poly->ncoeff);
- QCALLOC(poly->coeff, double, poly->ncoeff);
-
- return poly;
- }
-
-
-/****** poly_end *************************************************************
-PROTO void poly_end(polystruct *poly)
-PURPOSE Free a polynom structure and everything it contains.
-INPUT polystruct pointer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 28/01/99
- ***/
-void poly_end(polystruct *poly)
- {
- free(poly->coeff);
- free(poly->basis);
- free(poly->degree);
- free(poly->group);
- free(poly);
- }
-
-
-/****** poly_func ************************************************************
-PROTO double poly_func(polystruct *poly, double *pos)
-PURPOSE Evaluate a multidimensional polynom.
-INPUT polystruct pointer,
- pointer to the 1D array of input vector data.
-OUTPUT Polynom value.
-NOTES Values of the basis functions are updated in poly->basis.
-AUTHOR E. Bertin (IAP)
-VERSION 11/02/99
- ***/
-double poly_func(polystruct *poly, double *pos)
- {
- static double xpol[POLY_MAXDIM+1];
- double *post, *xpolt, *basis, *coeff, val, xval;
- static int expo[POLY_MAXDIM+1], gexpo[POLY_MAXDIM+1];
- int *expot, *degree,*degreet, *group,*groupt, *gexpot,
- d,g,t, ndim;
-
-/* Prepare the vectors and counters */
- ndim = poly->ndim;
- basis = poly->basis;
- coeff = poly->coeff;
- group = poly->group;
- degree = poly->degree;
- if (ndim)
- {
- for (xpolt=xpol, expot=expo, post=pos, d=ndim; --d;)
- {
- *(++xpolt) = 1.0;
- *(++expot) = 0;
- }
- for (gexpot=gexpo, degreet=degree, g=poly->ngroup; g--;)
- *(gexpot++) = *(degreet++);
- if (gexpo[*group])
- gexpo[*group]--;
- }
-
-/*
-*pos=1.001;*(pos+1)=1.0001;*(pos+2)=1.00001;
-*/
-/* The constant term is handled separately */
- val = *(coeff++);
- *(basis++) = 1.0;
- *expo = 1;
- *xpol = *pos;
-
-/* Compute the rest of the polynom */
- for (t=poly->ncoeff; --t; )
- {
-/*-- xpol[0] contains the current product of the x^n's */
- val += (*(basis++)=*xpol)**(coeff++);
-/*-- A complex recursion between terms of the polynom speeds up computations */
- post = pos;
- groupt = group;
- expot = expo;
- xpolt = xpol;
-/*
-printf("%d%d%d %7.5f %7.5f %7.5f %d %d\n",
- *expo, *(expo+1), *(expo+2), *xpol,
- *(xpol+1), *(xpol+2) , *gexpo, *(gexpo+1));
-*/
- for (d=0; d<ndim; d++, groupt++)
- if (gexpo[*groupt]--)
- {
- ++*(expot++);
- xval = (*(xpolt--) *= *post);
- while (d--)
- *(xpolt--) = xval;
- break;
- }
- else
- {
- gexpo[*groupt] = *expot;
- *(expot++) = 0;
- *(xpolt++) = 1.0;
- post++;
- }
- }
-
- return val;
- }
-
-
-/****** poly_fit *************************************************************
-PROTO double poly_fit(polystruct *poly, double *x, double *y, double *w,
- int ndata, double *extbasis)
-PURPOSE Least-Square fit of a multidimensional polynom to weighted data.
-INPUT polystruct pointer,
- pointer to the (pseudo)2D array of inputs to basis functions,
- pointer to the 1D array of data values,
- pointer to the 1D array of data weights,
- number of data points,
- pointer to a (pseudo)2D array of computed basis function values.
-OUTPUT Chi2 of the fit.
-NOTES If different from NULL, extbasis can be provided to store the
- values of the basis functions. If x==NULL and extbasis!=NULL, the
- precomputed basis functions stored in extbasis are used (which saves
- CPU).
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 05/04/99
- ***/
-void poly_fit(polystruct *poly, double *x, double *y, double *w, int ndata,
- double *extbasis)
- {
- double *alpha,*alphat, *beta,*betat, *basis,*basis1,*basis2, *coeff,
- *extbasist,
- val,wval,yval;
- int ncoeff, ndim, matsize,
- i,j,n;
-
- if (!x && !extbasis)
- error(EXIT_FAILURE, "*Internal Error*: One of x or extbasis should be "
- "different from NULL\nin ", "poly_func()");
- ncoeff = poly->ncoeff;
- ndim = poly->ndim;
- matsize = ncoeff*ncoeff;
- basis = poly->basis;
- extbasist = extbasis;
- QCALLOC(alpha, double, matsize);
- QCALLOC(beta, double, ncoeff);
-
-/* Build the covariance matrix */
- for (n=ndata; n--;)
- {
- if (x)
- {
-/*---- If x!=NULL, compute the basis functions */
- poly_func(poly, x);
- x+=ndim;
-/*---- If, in addition, extbasis is provided, then fill it */
- if (extbasis)
- for (basis1=basis,j=ncoeff; j--;)
- *(extbasist++) = *(basis1++);
- }
- else
-/*---- If x==NULL, then rely on pre-computed basis functions */
- for (basis1=basis,j=ncoeff; j--;)
- *(basis1++) = *(extbasist++);
-
- basis1 = basis;
- wval = *(w++);
- yval = *(y++);
- betat = beta;
- alphat = alpha;
- for (j=ncoeff; j--;)
- {
- val = *(basis1++)*wval;
- *(betat++) += val*yval;
- for (basis2=basis,i=ncoeff; i--;)
- *(alphat++) += val**(basis2++);
- }
- }
-
-/* Solve the system */
- cholsolve(alpha,beta,ncoeff);
-
- free(alpha);
-
-/* Now fill the coeff array with the result of the fit */
- betat = beta;
- coeff = poly->coeff;
- for (j=ncoeff; j--;)
- *(coeff++) = *(betat++);
-
- free(beta);
-
- return;
- }
-
-
-/****** cholsolve *************************************************************
-PROTO void cholsolve(double *a, double *b, int n)
-PURPOSE Solve a system of linear equations, using Cholesky decomposition.
-INPUT Pointer to the (pseudo 2D) matrix of coefficients,
- pointer to the 1D column vector,
- matrix size.
-OUTPUT -.
-NOTES Based on Numerical Recipes, 2nd ed. (Chap 2.9). The matrix of
- coefficients must be symmetric and positive definite.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 13/12/98
- ***/
-void cholsolve(double *a, double *b, int n)
- {
- double *p, *x, sum;
- int i,j,k;
-
-/* Allocate memory to store the diagonal elements */
- QMALLOC(p, double, n);
-
-/* Cholesky decomposition */
- for (i=0; i<n; i++)
- for (j=i; j<n; j++)
- {
- for (sum=a[i*n+j],k=i-1; k>=0; k--)
- sum -= a[i*n+k]*a[j*n+k];
- if (i==j)
- {
- if (sum <= 0.0)
- error(EXIT_FAILURE, "*Error*: Non positive definite matrix in ",
- "cholsolve()");
- p[i] = sqrt(sum);
- }
- else
- a[j*n+i] = sum/p[i];
- }
-
-/* Solve the system */
- x = b; /* Just to save memory: the solution replaces b */
- for (i=0; i<n; i++)
- {
- for (sum=b[i],k=i-1; k>=0; k--)
- sum -= a[i*n+k]*x[k];
- x[i] = sum/p[i];
- }
-
- for (i=n-1; i>=0; i--)
- {
- for (sum=x[i],k=i+1; k<n; k++)
- sum -= a[k*n+i]*x[k];
- x[i] = sum/p[i];
- }
-
- free(p);
-
- return;
- }
-
diff --git a/sextractor/src/poly.h b/sextractor/src/poly.h
deleted file mode 100644
index a89272f..0000000
--- a/sextractor/src/poly.h
+++ /dev/null
@@ -1,47 +0,0 @@
- /*
- poly.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using polynomial fits
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Include for poly.c
-*
-* Last modify: 05/04/99
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*--------------------------------- constants -------------------------------*/
-
-#define POLY_MAXDIM 4 /* Max dimensionality of polynom */
-#define POLY_MAXDEGREE 10 /* Max degree of the polynom */
-
-/*---------------------------------- macros ---------------------------------*/
-
-/*--------------------------- structure definitions -------------------------*/
-
-typedef struct poly
- {
- double *basis; /* Current values of the basis functions */
- double *coeff; /* Polynom coefficients */
- int ncoeff; /* Number of coefficients */
- int *group; /* Groups */
- int ndim; /* dimensionality of the polynom */
- int *degree; /* Degree in each group */
- int ngroup; /* Number of different groups */
- } polystruct;
-
-/*---------------------------------- protos --------------------------------*/
-
-extern polystruct *poly_init(int *group,int ndim,int *degree,int ngroup);
-
-extern double poly_func(polystruct *poly, double *pos);
-
-extern void cholsolve(double *a, double *b, int n),
- poly_end(polystruct *poly),
- poly_fit(polystruct *poly, double *x, double *y,
- double *w, int ndata, double *extbasis);
-
diff --git a/sextractor/src/preflist.h b/sextractor/src/preflist.h
deleted file mode 100644
index deac3e4..0000000
--- a/sextractor/src/preflist.h
+++ /dev/null
@@ -1,286 +0,0 @@
- /*
- preflist.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Keywords for the configuration file.
-*
-* Last modify: 14/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-
-#include "key.h"
-
-#ifndef _XML_H_
-#include "xml.h"
-#endif
-
-#ifdef USE_THREADS
-#define THREADS_PREFMAX THREADS_NMAX
-#else
-#define THREADS_PREFMAX 65535
-#endif
-
-/*-------------------------------- initialization ---------------------------*/
- int idummy;
-
- pkeystruct key[] =
- {
- {"ANALYSIS_THRESH", P_FLOATLIST, prefs.thresh, 0,0, -BIG, BIG,
- {""}, 1, 2, &prefs.nthresh},
- {"ASSOC_DATA", P_INTLIST, prefs.assoc_data, 0, 1000000,0.0,0.0,
- {""}, 1,MAXLIST, &prefs.nassoc_data},
- {"ASSOC_NAME", P_STRING, prefs.assoc_name},
- {"ASSOC_PARAMS", P_INTLIST, prefs.assoc_param, 1, 1000000,0.0,0.0,
- {""}, 2,3, &prefs.nassoc_param},
- {"ASSOC_RADIUS", P_FLOAT, &prefs.assoc_radius, 0,0, 1e-10,1e+10},
- {"ASSOC_TYPE", P_KEY, &prefs.assoc_type, 0,0, 0.0,0.0,
- {"FIRST", "NEAREST", "MEAN", "MAG_MEAN", "SUM", "MAG_SUM",
- "MIN", "MAX", ""}},
- {"ASSOCSELEC_TYPE", P_KEY, &prefs.assocselec_type, 0,0, 0.0,0.0,
- {"ALL","MATCHED","-MATCHED",""}},
- {"BACK_FILTERSIZE", P_INTLIST, prefs.backfsize, 1,11, 0.0,0.0,
- {""}, 1,2, &prefs.nbackfsize},
- {"BACK_FILTTHRESH", P_FLOAT, &prefs.backfthresh, 0,0, 0.0,BIG},
- {"BACKPHOTO_THICK", P_INT, &prefs.pback_size, 1, 256},
- {"BACKPHOTO_TYPE", P_KEY, &prefs.pback_type, 0,0, 0.0,0.0,
- {"GLOBAL","LOCAL",""}},
- {"BACK_SIZE", P_INTLIST, prefs.backsize, 1,2000000000, 0.0,0.0,
- {""}, 1,2, &prefs.nbacksize},
- {"BACK_TYPE", P_KEYLIST, prefs.back_type, 0,0, 0.0,0.0,
- {"AUTO","MANUAL",""},
- 1, 2, &prefs.nback_type},
- {"BACK_VALUE", P_FLOATLIST, prefs.back_val, 0,0, -BIG,BIG,
- {""}, 1, 2, &prefs.nback_val},
- {"CATALOG_NAME", P_STRING, prefs.cat_name},
- {"CATALOG_TYPE", P_KEY, &prefs.cat_type, 0,0, 0.0,0.0,
- {"NONE", "ASCII","ASCII_HEAD", "ASCII_SKYCAT", "ASCII_VOTABLE",
- "FITS_LDAC", "FITS_TPX", "FITS_1.0",""}},
- {"CHECKIMAGE_NAME", P_STRINGLIST, prefs.check_name, 0,0,0.0,0.0,
- {""}, 0, MAXCHECK, &prefs.ncheck_name},
- {"CHECKIMAGE_TYPE", P_KEYLIST, prefs.check_type, 0,0, 0.0,0.0,
- {"NONE", "IDENTICAL",
- "BACKGROUND", "BACKGROUND_RMS", "MINIBACKGROUND",
- "MINIBACK_RMS", "-BACKGROUND",
- "FILTERED", "OBJECTS", "APERTURES", "SEGMENTATION", "ASSOC",
- "-OBJECTS", "-PSF_PROTOS", "PSF_PROTOS",
- "-PC_CONVPROTOS", "PC_CONVPROTOS", "PC_PROTOS", ""},
- 0, 17, &prefs.ncheck_type},
- {"CLEAN", P_BOOL, &prefs.clean_flag},
- {"CLEAN_PARAM", P_FLOAT, &prefs.clean_param, 0,0, 0.1,10.0},
- {"DEBLEND_MINCONT", P_FLOAT, &prefs.deblend_mincont, 0,0, 0.0,1.0},
- {"DEBLEND_NTHRESH", P_INT, &prefs.deblend_nthresh, 1,64},
- {"DETECT_MINAREA", P_INT, &prefs.ext_minarea, 1,1000000},
- {"DETECT_THRESH", P_FLOATLIST, prefs.dthresh, 0,0, -BIG, BIG,
- {""}, 1, 2, &prefs.ndthresh},
- {"DETECT_TYPE", P_KEY, &prefs.detect_type, 0,0, 0.0,0.0,
- {"CCD","PHOTO",""}},
- {"FILTER", P_BOOL, &prefs.filter_flag},
- {"FILTER_NAME", P_STRING, prefs.filter_name},
- {"FILTER_THRESH", P_FLOATLIST, prefs.filter_thresh, 0,0,-BIG,BIG,
- {""}, 0, 2, &prefs.nfilter_thresh},
- {"FITS_UNSIGNED", P_BOOL, &prefs.fitsunsigned_flag},
- {"FLAG_IMAGE", P_STRINGLIST, prefs.fimage_name, 0,0,0.0,0.0,
- {""}, 0, MAXFLAG, &prefs.nfimage_name},
- {"FLAG_TYPE", P_KEYLIST, prefs.flag_type, 0,0, 0.0,0.0,
- {"OR","AND","MIN", "MAX", "MOST",""}, 0, MAXFLAG, &idummy},
- {"GAIN", P_FLOAT, &prefs.gain, 0,0, 0.0, 1e+30},
- {"INTERP_MAXXLAG", P_INTLIST, prefs.interp_xtimeout, 1,1000000, 0.0,0.0,
- {""}, 1, 2, &prefs.ninterp_xtimeout},
- {"INTERP_MAXYLAG", P_INTLIST, prefs.interp_ytimeout, 1,1000000, 0.0,0.0,
- {""}, 1, 2, &prefs.ninterp_ytimeout},
- {"INTERP_TYPE", P_KEYLIST, prefs.interp_type, 0,0, 0.0,0.0,
- {"NONE","VAR_ONLY","ALL",""}, 1, 2, &prefs.ninterp_type},
- {"MAG_GAMMA", P_FLOAT, &prefs.mag_gamma, 0,0, 1e-10,1e+30},
- {"MAG_ZEROPOINT", P_FLOAT, &prefs.mag_zeropoint, 0,0, -100.0, 100.0},
- {"MASK_TYPE", P_KEY, &prefs.mask_type, 0,0, 0.0,0.0,
- {"NONE","BLANK","CORRECT",""}},
- {"MEMORY_BUFSIZE", P_INT, &prefs.mem_bufsize, 8, 65534},
- {"MEMORY_OBJSTACK", P_INT, &prefs.clean_stacksize, 16,65536},
- {"MEMORY_PIXSTACK", P_INT, &prefs.mem_pixstack, 1000, 10000000},
- {"NTHREADS", P_INT, &prefs.nthreads, 0, THREADS_PREFMAX},
- {"PARAMETERS_NAME", P_STRING, prefs.param_name},
- {"PHOT_APERTURES", P_FLOATLIST, prefs.apert, 0,0, 0.0,2*MAXPICSIZE,
- {""}, 1, MAXNAPER, &prefs.naper},
- {"PHOT_AUTOPARAMS", P_FLOATLIST, prefs.autoparam, 0,0, 0.0,10.0,
- {""}, 2,2, &prefs.nautoparam},
- {"PHOT_AUTOAPERS", P_FLOATLIST, prefs.autoaper, 0,0, 0.0,1e6,
- {""}, 2,2, &prefs.nautoaper},
- {"PHOT_FLUXFRAC", P_FLOATLIST, prefs.flux_frac, 0,0, 1e-6, 1.0,
- {""}, 1, MAXNAPER, &prefs.nflux_frac},
- {"PHOT_PETROPARAMS", P_FLOATLIST, prefs.petroparam, 0,0, 0.0,10.0,
- {""}, 2,2, &prefs.npetroparam},
- {"PIXEL_SCALE", P_FLOAT, &prefs.pixel_scale, 0,0, 0.0, 1e+10},
- {"PSF_NAME", P_STRINGLIST, prefs.psf_name, 0,0, 0.0,0.0,
- {""}, 1, 2, &prefs.npsf_name}, /*?*/
- {"PSF_NMAX", P_INT, &prefs.psf_npsfmax, 1, PSF_NPSFMAX},
- {"PSFDISPLAY_TYPE", P_KEY, &prefs.psfdisplay_type, 0,0, 0.0,0.0,
- {"SPLIT","VECTOR",""}},
- {"SATUR_LEVEL", P_FLOAT, &prefs.satur_level, 0,0, -1e+30, 1e+30},
- {"SEEING_FWHM", P_FLOAT, &prefs.seeing_fwhm, 0,0, 1e-10, 1e+10},
- {"SOM_NAME", P_STRING, prefs.som_name},
- {"STARNNW_NAME", P_STRING, prefs.nnw_name},
- {"THRESH_TYPE", P_KEYLIST, prefs.thresh_type, 0,0, 0.0,0.0,
- {"RELATIVE","ABSOLUTE"},
- 1, 2, &prefs.nthresh_type},
- {"VERBOSE_TYPE", P_KEY, &prefs.verbose_type, 0,0, 0.0,0.0,
- {"QUIET","NORMAL", "EXTRA_WARNINGS", "FULL",""}},
- {"WEIGHT_GAIN", P_BOOL, &prefs.weightgain_flag},
- {"WEIGHT_IMAGE", P_STRINGLIST, prefs.wimage_name, 0,0,0.0,0.0,
- {""}, 0, MAXIMAGE, &prefs.nwimage_name},
- {"WEIGHT_THRESH", P_FLOATLIST, prefs.weight_thresh, 0,0, 0.0, BIG,
- {""}, 0, 2, &prefs.nweight_thresh},
- {"WEIGHT_TYPE", P_KEYLIST, prefs.weight_type, 0,0, 0.0,0.0,
- {"NONE","BACKGROUND", "MAP_RMS", "MAP_VAR","MAP_WEIGHT", ""},
- 0, MAXIMAGE, &prefs.nweight_type},
- {"WRITE_XML", P_BOOL, &prefs.xml_flag},
- {"XML_NAME", P_STRING, prefs.xml_name},
- {"XSL_URL", P_STRING, prefs.xsl_name},
- {""}
- };
-
-char keylist[sizeof(key)/sizeof(pkeystruct)][32];
-const char notokstr[] = {" \t=,;\n\r\""};
-
-char *default_prefs[] =
- {
-"# Default configuration file for " BANNER " " MYVERSION,
-"# EB " DATE,
-"#",
-" ",
-"#-------------------------------- Catalog ------------------------------------",
-" ",
-"CATALOG_NAME test.cat # name of the output catalog",
-"CATALOG_TYPE ASCII_HEAD # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT,",
-" # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC",
-"PARAMETERS_NAME default.param # name of the file containing catalog contents",
-" ",
-"#------------------------------- Extraction ----------------------------------",
-" ",
-"DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction)",
-"DETECT_MINAREA 5 # minimum number of pixels above threshold",
-"*THRESH_TYPE RELATIVE # threshold type: RELATIVE (in sigmas)",
-"* # or ABSOLUTE (in ADUs)",
-"DETECT_THRESH 1.5 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2",
-"ANALYSIS_THRESH 1.5 # <sigmas> or <threshold>,<ZP> in mag.arcsec-2",
-" ",
-"FILTER Y # apply filter for detection (Y or N)?",
-"FILTER_NAME default.conv # name of the file containing the filter",
-"*FILTER_THRESH # Threshold[s] for retina filtering",
-
-" ",
-"DEBLEND_NTHRESH 32 # Number of deblending sub-thresholds",
-"DEBLEND_MINCONT 0.005 # Minimum contrast parameter for deblending",
-" ",
-"CLEAN Y # Clean spurious detections? (Y or N)?",
-"CLEAN_PARAM 1.0 # Cleaning efficiency",
-" ",
-"MASK_TYPE CORRECT # type of detection MASKing: can be one of",
-" # NONE, BLANK or CORRECT",
-" ",
-"*#-------------------------------- WEIGHTing ----------------------------------",
-"*",
-"*WEIGHT_TYPE NONE # type of WEIGHTing: NONE, BACKGROUND,",
-"* # MAP_RMS, MAP_VAR or MAP_WEIGHT",
-"*WEIGHT_IMAGE weight.fits # weight-map filename",
-"*WEIGHT_GAIN Y # modulate gain (E/ADU) with weights? (Y/N)",
-"*WEIGHT_THRESH # weight threshold[s] for bad pixels",
-"*",
-"*#-------------------------------- FLAGging -----------------------------------",
-"*",
-"*FLAG_IMAGE flag.fits # filename for an input FLAG-image",
-"*FLAG_TYPE OR # flag pixel combination: OR, AND, MIN, MAX",
-"* # or MOST",
-"*",
-"#------------------------------ Photometry -----------------------------------",
-" ",
-"PHOT_APERTURES 5 # MAG_APER aperture diameter(s) in pixels",
-"PHOT_AUTOPARAMS 2.5, 3.5 # MAG_AUTO parameters: <Kron_fact>,<min_radius>",
-"PHOT_PETROPARAMS 2.0, 3.5 # MAG_PETRO parameters: <Petrosian_fact>,",
-" # <min_radius>",
-"*PHOT_AUTOAPERS 0.0,0.0 # <estimation>,<measurement> minimum apertures",
-"* # for MAG_AUTO and MAG_PETRO",
-"*PHOT_FLUXFRAC 0.5 # flux fraction[s] used for FLUX_RADIUS",
-" ",
-"SATUR_LEVEL 50000.0 # level (in ADUs) at which arises saturation",
-" ",
-"MAG_ZEROPOINT 0.0 # magnitude zero-point",
-"MAG_GAMMA 4.0 # gamma of emulsion (for photographic scans)",
-"GAIN 0.0 # detector gain in e-/ADU",
-"PIXEL_SCALE 1.0 # size of pixel in arcsec (0=use FITS WCS info)",
-" ",
-"#------------------------- Star/Galaxy Separation ----------------------------",
-" ",
-"SEEING_FWHM 1.2 # stellar FWHM in arcsec",
-"STARNNW_NAME default.nnw # Neural-Network_Weight table filename",
-" ",
-"#------------------------------ Background -----------------------------------",
-" ",
-"*BACK_TYPE AUTO # AUTO or MANUAL",
-"*BACK_VALUE 0.0 # Default background value in MANUAL mode",
-"BACK_SIZE 64 # Background mesh: <size> or <width>,<height>",
-"BACK_FILTERSIZE 3 # Background filter: <size> or <width>,<height>",
-" ",
-"BACKPHOTO_TYPE GLOBAL # can be GLOBAL or LOCAL",
-"*BACKPHOTO_THICK 24 # thickness of the background LOCAL annulus",
-"*BACK_FILTTHRESH 0.0 # Threshold above which the background-",
-"* # map filter operates",
-" ",
-"#------------------------------ Check Image ----------------------------------",
-" ",
-"CHECKIMAGE_TYPE NONE # can be NONE, BACKGROUND, BACKGROUND_RMS,",
-" # MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND,",
-" # FILTERED, OBJECTS, -OBJECTS, SEGMENTATION,",
-" # or APERTURES",
-"CHECKIMAGE_NAME check.fits # Filename for the check-image",
-" ",
-"#--------------------- Memory (change with caution!) -------------------------",
-" ",
-"MEMORY_OBJSTACK 3000 # number of objects in stack",
-"MEMORY_PIXSTACK 300000 # number of pixels in stack",
-"MEMORY_BUFSIZE 1024 # number of lines in buffer",
-" ",
-"*#------------------------------- ASSOCiation ---------------------------------",
-"*",
-"*ASSOC_NAME sky.list # name of the ASCII file to ASSOCiate",
-"*ASSOC_DATA 2,3,4 # columns of the data to replicate (0=all)",
-"*ASSOC_PARAMS 2,3,4 # columns of xpos,ypos[,mag]",
-"*ASSOC_RADIUS 2.0 # cross-matching radius (pixels)",
-"*ASSOC_TYPE MAG_SUM # ASSOCiation method: FIRST, NEAREST, MEAN,",
-"* # MAG_MEAN, SUM, MAG_SUM, MIN or MAX",
-"*ASSOCSELEC_TYPE MATCHED # ASSOC selection type: ALL, MATCHED or -MATCHED",
-"*",
-"#----------------------------- Miscellaneous ---------------------------------",
-" ",
-"VERBOSE_TYPE NORMAL # can be QUIET, NORMAL or FULL",
-"WRITE_XML N # Write XML file (Y/N)?",
-"XML_NAME sex.xml # Filename for XML output",
-"*XSL_URL " XSL_URL,
-"* # Filename for XSL style-sheet",
-#ifdef USE_THREADS
-"*NTHREADS 0 # Number of simultaneous threads for",
-"* # the SMP version of " BANNER,
-"* # 0 = automatic",
-#else
-"*NTHREADS 1 # 1 single thread",
-#endif
-"*",
-"*FITS_UNSIGNED N # Treat FITS integer values as unsigned (Y/N)?",
-"*INTERP_MAXXLAG 16 # Max. lag along X for 0-weight interpolation",
-"*INTERP_MAXYLAG 16 # Max. lag along Y for 0-weight interpolation",
-"*INTERP_TYPE ALL # Interpolation type: NONE, VAR_ONLY or ALL",
-"*",
-"*#--------------------------- Experimental Stuff -----------------------------",
-"*",
-"*PSF_NAME default.psf # File containing the PSF model",
-"*PSF_NMAX 9 # Max.number of PSFs fitted simultaneously",
-"*PSFDISPLAY_TYPE SPLIT # Catalog type for PSF-fitting: SPLIT or VECTOR",
-"*SOM_NAME default.som # File containing Self-Organizing Map weights",
-""
- };
diff --git a/sextractor/src/prefs.c b/sextractor/src/prefs.c
deleted file mode 100644
index cb841d0..0000000
--- a/sextractor/src/prefs.c
+++ /dev/null
@@ -1,600 +0,0 @@
- /*
- prefs.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Functions to handle the configuration file.
-*
-* Last modify: 12/01/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ctype.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "preflist.h"
-#include "fits/fitscat.h"
-
-
-/********************************* dumpprefs ********************************/
-/*
-Print the default preference parameters.
-*/
-void dumpprefs(int state)
- {
- char **dp;
-
- dp = default_prefs;
- while (**dp)
- if (**dp != '*')
- printf("%s\n",*(dp++));
- else if (state)
- printf("%s\n",*(dp++)+1);
- else
- dp++;
- return;
- }
-
-
-/********************************* readprefs ********************************/
-/*
-Read a configuration file in ``standard'' format (see the SExtractor
-documentation)
-*/
-void readprefs(char *filename, char **argkey, char **argval, int narg)
-
- {
- FILE *infile;
- char *cp, str[MAXCHARL], *keyword, *value, **dp;
- int i, ival, nkey, warn, argi, flagc, flagd, flage, flagz;
- float dval;
-#ifndef NO_ENVVAR
- static char value2[MAXCHARL],envname[MAXCHAR];
- char *dolpos;
-#endif
-
-
- if ((infile = fopen(filename,"r")) == NULL)
- {
- flage = 1;
- warning(filename, " not found, using internal defaults");
- }
- else
- flage = 0;
-
-/*Build the keyword-list from pkeystruct-array */
-
- for (i=0; key[i].name[0]; i++)
- strcpy(keylist[i], key[i].name);
- keylist[i][0] = '\0';
-
-
-/*Scan the configuration file*/
-
- argi=0;
- flagc = 0;
- flagd = 1;
- dp = default_prefs;
- for (warn=0;;)
- {
- if (flagd)
- {
- if (**dp)
- {
- if (**dp=='*')
- strcpy(str, *(dp++)+1);
- else
- strcpy(str, *(dp++));
- }
- else
- flagd = 0;
- }
- if (!flagc && !flagd)
- if (flage || !fgets(str, MAXCHARL, infile))
- flagc=1;
-
- if (flagc)
- {
- if (argi<narg)
- {
- sprintf(str, "%s %s", argkey[argi], argval[argi]);
- argi++;
- }
- else
- break;
- }
-
- keyword = strtok(str, notokstr);
- if (keyword && keyword[0]!=0 && keyword[0]!=(char)'#')
- {
- if (warn>=10)
- error(EXIT_FAILURE, "*Error*: No valid keyword found in ", filename);
- nkey = findkeys(keyword, keylist, FIND_STRICT);
- if (nkey!=RETURN_ERROR)
- {
- value = strtok((char *)NULL, notokstr);
-#ifndef NO_ENVVAR
-/*------ Expansion of environment variables (preceded by '$') */
- if (value && (dolpos=strchr(value, '$')))
- {
- int nc;
- char *valuet,*value2t, *envval;
-
- value2t = value2;
- valuet = value;
- while (dolpos)
- {
- while (valuet<dolpos)
- *(value2t++) = *(valuet++); /* verbatim copy before '$' */
- if (*(++valuet) == (char)'{')
- valuet++;
- strncpy(envname, valuet, nc=strcspn(valuet,"}/:\"\'\\"));
- *(envname+nc) = (char)'\0';
- if (*(valuet+=nc) == (char)'}')
- valuet++;
- if (!(envval=getenv(envname)))
- error(EXIT_FAILURE, "Environment variable not found: ",
- envname);
- while(*envval) /* Copy the ENV content */
- *(value2t++) = *(envval++);
- while(*valuet && *valuet!=(char)'$')/* Continue verbatim copy */
- *(value2t++) = *(valuet++);
- if (*valuet)
- dolpos = valuet;
- else
- {
- dolpos = NULL;
- *value2t = (char)'\0';
- }
- }
-
- value = value2;
- }
-#endif
- switch(key[nkey].type)
- {
- case P_FLOAT:
- if (!value || value[0]==(char)'#')
- error(EXIT_FAILURE, keyword," keyword has no value!");
- dval = atof(value);
- if (dval>=key[nkey].dmin && dval<=key[nkey].dmax)
- *(double *)(key[nkey].ptr) = dval;
- else
- error(EXIT_FAILURE, keyword," keyword out of range");
- break;
-
- case P_INT:
- if (!value || value[0]==(char)'#')
- error(EXIT_FAILURE, keyword," keyword has no value!");
- ival = atoi(value);
- if (ival>=key[nkey].imin && ival<=key[nkey].imax)
- *(int *)(key[nkey].ptr) = ival;
- else
- error(EXIT_FAILURE, keyword, " keyword out of range");
- break;
-
- case P_STRING:
- if (!value || value[0]==(char)'#')
- error(EXIT_FAILURE, keyword," string is empty!");
- strcpy((char *)key[nkey].ptr, value);
- break;
-
- case P_BOOL:
- if (!value || value[0]==(char)'#')
- error(EXIT_FAILURE, keyword," keyword has no value!");
- if ((cp = strchr("yYnN", (int)value[0])))
- *(int *)(key[nkey].ptr) = (tolower((int)*cp)=='y')?1:0;
- else
- error(EXIT_FAILURE, keyword, " value must be Y or N");
- break;
-
- case P_KEY:
- if (!value || value[0]==(char)'#')
- error(EXIT_FAILURE, keyword," keyword has no value!");
- if ((ival = findkeys(value, key[nkey].keylist,FIND_STRICT))
- != RETURN_ERROR)
- *(int *)(key[nkey].ptr) = ival;
- else
- error(EXIT_FAILURE, keyword, " set to an unknown keyword");
- break;
-
- case P_BOOLLIST:
- for (i=0; i<MAXLIST&&value&&value[0]!=(char)'#'; i++)
- {
- if (i>=key[nkey].nlistmax)
- error(EXIT_FAILURE, keyword, " has too many members");
- if ((cp = strchr("yYnN", (int)value[0])))
- ((int *)(key[nkey].ptr))[i] = (tolower((int)*cp)=='y')?1:0;
- else
- error(EXIT_FAILURE, keyword, " value must be Y or N");
- value = strtok((char *)NULL, notokstr);
- }
- if (i<key[nkey].nlistmin)
- error(EXIT_FAILURE, keyword, " list has not enough members");
- *(key[nkey].nlistptr) = i;
- break;
-
- case P_INTLIST:
- for (i=0; i<MAXLIST&&value&&value[0]!=(char)'#'; i++)
- {
- if (i>=key[nkey].nlistmax)
- error(EXIT_FAILURE, keyword, " has too many members");
- ival = strtol(value, NULL, 0);
- if (ival>=key[nkey].imin && ival<=key[nkey].imax)
- ((int *)key[nkey].ptr)[i] = ival;
- else
- error(EXIT_FAILURE, keyword, " keyword out of range");
- value = strtok((char *)NULL, notokstr);
- }
- if (i<key[nkey].nlistmin)
- error(EXIT_FAILURE, keyword, " list has not enough members");
- *(key[nkey].nlistptr) = i;
- break;
-
- case P_FLOATLIST:
- for (i=0; i<MAXLIST&&value&&value[0]!=(char)'#'; i++)
- {
- if (i>=key[nkey].nlistmax)
- error(EXIT_FAILURE, keyword, " has too many members");
- dval = atof(value);
- if (dval>=key[nkey].dmin && dval<=key[nkey].dmax)
- ((double *)key[nkey].ptr)[i] = dval;
- else
- error(EXIT_FAILURE, keyword, " keyword out of range");
- value = strtok((char *)NULL, notokstr);
- }
- if (i<key[nkey].nlistmin)
- error(EXIT_FAILURE, keyword, " list has not enough members");
- *(key[nkey].nlistptr) = i;
- break;
-
- case P_KEYLIST:
- for (i=0; i<MAXLIST && value && value[0]!=(char)'#'; i++)
- {
- if (i>=key[nkey].nlistmax)
- error(EXIT_FAILURE, keyword, " has too many members");
- if ((ival = findkeys(value, key[nkey].keylist, FIND_STRICT))
- != RETURN_ERROR)
- ((int *)(key[nkey].ptr))[i] = ival;
- else
- error(EXIT_FAILURE, keyword, " set to an unknown keyword");
- value = strtok((char *)NULL, notokstr);
- }
- if (i<key[nkey].nlistmin)
- error(EXIT_FAILURE, keyword, " list has not enough members");
- *(key[nkey].nlistptr) = i;
- break;
-
- case P_STRINGLIST:
- if (!value || value[0]==(char)'#')
- {
- value = "";
- flagz = 1;
- }
- else
- flagz = 0;
- for (i=0; i<MAXLIST && value && value[0]!=(char)'#'; i++)
- {
- if (i>=key[nkey].nlistmax)
- error(EXIT_FAILURE, keyword, " has too many members");
- free(((char **)key[nkey].ptr)[i]);
- QMALLOC(((char **)key[nkey].ptr)[i], char, MAXCHAR);
- strcpy(((char **)key[nkey].ptr)[i], value);
- value = strtok((char *)NULL, notokstr);
- }
- if (i<key[nkey].nlistmin)
- error(EXIT_FAILURE, keyword, " list has not enough members");
- *(key[nkey].nlistptr) = flagz?0:i;
- break;
-
- default:
- error(EXIT_FAILURE, "*Internal ERROR*: Type Unknown",
- " in readprefs()");
- break;
- }
- key[nkey].flag = 1;
- }
- else
- {
- warning(keyword, " keyword unknown");
- warn++;
- }
- }
- }
-
- for (i=0; key[i].name[0]; i++)
- if (!key[i].flag)
- error(EXIT_FAILURE, key[i].name, " configuration keyword missing");
- if (!flage)
- fclose(infile);
-
- return;
- }
-
-
-/********************************** findkeys **********************************/
-/*
- find an item within a list of keywords, SExtractor version.
-*/
-int findkeys(char *str, char keyw[][32], int mode)
-
- {
- int i;
-
- for (i=0; keyw[i][0]; i++)
- if (!cistrcmp(str, keyw[i], mode))
- return i;
-
- return RETURN_ERROR;
- }
-
-
-/******************************* cistrcmp ***********************************/
-/*
-case-insensitive strcmp.
-*/
-int cistrcmp(char *cs, char *ct, int mode)
-
- {
- int i, diff;
-
- if (mode)
- {
- for (i=0; cs[i]&&ct[i]; i++)
- if ((diff=tolower((int)cs[i])-tolower((int)ct[i])))
- return diff;
- }
- else
- {
- for (i=0; cs[i]||ct[i]; i++)
- if ((diff=tolower((int)cs[i])-tolower((int)ct[i])))
- return diff;
- }
-
- return 0;
- }
-
-
-/********************************* useprefs **********************************/
-/*
-Update various structures according to the prefs.
-*/
-void useprefs()
-
- {
- unsigned short ashort=1;
- int i, margin, naper;
- char *str;
-
-/* Test if byteswapping will be needed */
- bswapflag = *((char *)&ashort);
-
-/*-------------------------------- Images ----------------------------------*/
- prefs.dimage_flag = (prefs.nimage_name>1);
-
-/*--------------------------------- ASSOC ----------------------------------*/
- prefs.assoc_flag = FLAG(obj2.assoc) || FLAG(obj2.assoc_number);
-
-/*-------------------------------- Extracting ------------------------------*/
- if (prefs.nthresh_type<2)
- prefs.thresh_type[1] = prefs.thresh_type[0];
-
-/*-------------------------------- Deblending ------------------------------*/
- prefs.deb_maxarea = (prefs.ext_minarea<MAXDEBAREA ?
- prefs.ext_minarea:MAXDEBAREA);
-
-/*-------------------------------- Astrometry ------------------------------*/
- prefs.world_flag = FLAG(obj2.mxw) || FLAG(obj2.mamaposx)
- || FLAG(obj2.peakxw) || FLAG(obj2.winpos_xw)
- || FLAG(obj2.mx2w) || FLAG(obj2.win_mx2w)
- || FLAG(obj2.poserr_mx2w) || FLAG(obj2.winposerr_mx2w)
- || FLAG(obj2.npixw) || FLAG(obj2.fdnpixw)
- || FLAG(obj2.fwhmw);
-/* Default astrometric settings */
- strcpy(prefs.coosys, "ICRS");
- prefs.epoch = 2000.0;
-
-/*-------------------------------- Photometry ------------------------------*/
-
-/* Find the largest APERture-photometry vector */
- if (FLAG(obj2.flux_aper))
- {
- naper = prefs.flux_apersize;
- if (prefs.fluxerr_apersize>naper)
- naper = prefs.fluxerr_apersize;
- if (prefs.mag_apersize>naper)
- naper = prefs.mag_apersize;
- if (prefs.magerr_apersize>naper)
- naper = prefs.magerr_apersize;
- if (naper>prefs.naper)
- {
- warning("Not enough apertures provided in config.:\n",
- " some APER photometric values will remain blank ");
- naper = prefs.naper;
- }
- else
- prefs.naper = naper;
- }
- else
- naper = 0; /* To avoid gcc -Wall warnings */
-
-/* Find the largest "minimum margin" necessary for apertures */
- prefs.cleanmargin = 0;
- if (FLAG(obj2.vignet)
- && (margin=(prefs.vignetsize[1]+1)/2) > prefs.cleanmargin)
- prefs.cleanmargin = margin;
- if (FLAG(obj2.vigshift)
- && (margin=(prefs.vigshiftsize[1]+1)/2+3)>prefs.cleanmargin)
- prefs.cleanmargin = margin;
- if (FLAG(obj2.flux_aper))
- for (i=0; i<naper; i++)
- if ((margin=(int)((prefs.apert[i]+1)/2)+1) > prefs.cleanmargin)
- prefs.cleanmargin = margin;
-
-/* Growth-curve flag */
- if (FLAG(obj2.flux_growth)
- || FLAG(obj2.mag_growth)
- || FLAG(obj2.flux_radius)
- || FLAG(obj2.hl_radius)
- || FLAG(obj2.flux_growthstep)
- || FLAG(obj2.mag_growthstep))
- prefs.growth_flag = 1;
-
- if (FLAG(obj2.flux_radius) && prefs.flux_radiussize)
- if (prefs.nflux_frac>prefs.flux_radiussize)
- prefs.nflux_frac = prefs.flux_radiussize;
-
-/*------------------------------- MASKing ----------------------------------*/
- prefs.blank_flag = (prefs.mask_type!=MASK_NONE);
-
-/*--------------------------- SOM-fitting ----------------------------------*/
- prefs.somfit_flag = FLAG(obj2.flux_somfit);
-
-/*------------------------------ Background --------------------------------*/
- if (prefs.nbacksize<2)
- prefs.backsize[1] = prefs.backsize[0];
- if (prefs.nbackfsize<2)
- prefs.backfsize[1] = prefs.backfsize[0];
- if (prefs.nback_type<2)
- prefs.back_type[1] = prefs.back_type[0];
-
-/*------------------------------ FLAG-images -------------------------------*/
- prefs.nimaisoflag = (prefs.imaflag_size > prefs.imanflag_size) ?
- prefs.imaflag_size : prefs.imanflag_size;
- prefs.nimaflag = (prefs.nimaisoflag < prefs.nfimage_name) ?
- prefs.nimaisoflag : prefs.nfimage_name;
-
-/*----------------------------- CHECK-images -------------------------------*/
- prefs.check_flag = 0;
- for (i=0; i<prefs.ncheck_type; i++)
- if (prefs.check_type[i] != CHECK_NONE) /* at least 1 is not NONE */
- prefs.check_flag = 1;
-
- if (prefs.check_flag && prefs.ncheck_name!=prefs.ncheck_type)
- error(EXIT_FAILURE, "*Error*: CHECKIMAGE_NAME(s) and CHECKIMAGE_TYPE(s)",
- " are not in equal number");
-
-/*---------------------------- PSF-fitting ---------------------------------*/
- if (FLAG(obj2.flux_psf) )
- {
- prefs.psf_flag = 1;
- prefs.dpsf_flag = (prefs.npsf_name>1); /*?*/
- }
- if (prefs.check_flag)
- for (i=0; i<prefs.ncheck_type; i++)
- if (prefs.check_type[i] == CHECK_SUBPSFPROTOS
- || prefs.check_type[i] == CHECK_PSFPROTOS)
- prefs.psf_flag = 1;
-
-/*---------------------------- PC-fitting ----------------------------------*/
-/* PC-fitting is possible only if a PSF file is loaded */
- if (prefs.psf_flag)
- {
- prefs.pc_flag = FLAG(obj2.mx2_pc);
- if (prefs.check_flag)
- for (i=0; i<prefs.ncheck_type; i++)
- if (prefs.check_type[i] == CHECK_SUBPCPROTOS
- || prefs.check_type[i] == CHECK_PCPROTOS
- || prefs.check_type[i] == CHECK_PCOPROTOS)
- prefs.pc_flag = 1;
- }
-
-/*----------------------------- WEIGHT-images ------------------------------*/
- if (prefs.nweight_type<2)
- prefs.weight_type[1] = prefs.weight_type[0];
-
- prefs.dweight_flag = (prefs.weight_type[0]!= WEIGHT_NONE);
- prefs.weight_flag = (prefs.weight_type[1]!= WEIGHT_NONE);
-
- if (prefs.dweight_flag || prefs.weight_flag)
- {
-/*-- Handle the default weight-threshold values */
- if (prefs.nweight_thresh<2)
- for (i=2; --i >= prefs.nweight_thresh;)
- prefs.weight_thresh[i] = (prefs.weight_type[i]==WEIGHT_FROMWEIGHTMAP)?
- 0.0 : BIG;
-/*-- Check WEIGHT_IMAGE parameter(s) */
- if ((!prefs.nwimage_name
- && ((prefs.weight_type[0]!=WEIGHT_FROMBACK
- && prefs.weight_type[0]!=WEIGHT_NONE)
- || (prefs.weight_type[1]!=WEIGHT_FROMBACK
- && prefs.weight_type[1]!=WEIGHT_NONE)))
- || (prefs.nwimage_name<2
- && prefs.weight_type[0]!=WEIGHT_FROMBACK
- && prefs.weight_type[0]!=WEIGHT_NONE
- && prefs.weight_type[1]!=WEIGHT_FROMBACK
- && prefs.weight_type[1]!=WEIGHT_NONE
- && prefs.weight_type[0]!=prefs.weight_type[1]))
- error(EXIT_FAILURE, "*Error*: WEIGHT_IMAGE missing","");
-
- if (prefs.nwimage_name && prefs.nwimage_name<2)
- prefs.wimage_name[1] = prefs.wimage_name[0];
- if (prefs.nwimage_name==2 && prefs.nweight_type==1)
- prefs.nweight_type = 2;
-
-/*-- If detection-only interpolation is needed with 1 Weight image... */
-/*-- ...pretend we're using 2, with only one being interpolated */
- if (prefs.nweight_type==1
- && prefs.nwimage_name && prefs.wimage_name[1]==prefs.wimage_name[0]
- && prefs.interp_type[0]==INTERP_VARONLY )
- {
- prefs.nweight_type = 2;
- prefs.weight_type[1] = prefs.weight_type[0];
- prefs.weight_type[0] = WEIGHT_FROMINTERP;
- prefs.wimage_name[1] = prefs.wimage_name[0];
- prefs.interp_type[1] = INTERP_NONE;
- prefs.dweight_flag = 1;
- if (prefs.nweight_thresh<2)
- {
- prefs.nweight_thresh = 2;
- prefs.weight_thresh[1] = prefs.weight_thresh[0];
- }
- }
- }
-
-/*------------------------------ Catalogue ---------------------------------*/
-
- if (!strcmp(prefs.cat_name, "STDOUT"))
- prefs.pipe_flag = 1;
-
- if ((str=strrchr(prefs.filter_name, '/')))
- strcpy(thecat.filter_name, str+1);
- else
- strcpy(thecat.filter_name, prefs.filter_name);
-
- if ((str=strrchr(prefs.prefs_name, '/')))
- strcpy(thecat.prefs_name, str+1);
- else
- strcpy(thecat.prefs_name, prefs.prefs_name);
-
- if ((str=strrchr(prefs.nnw_name, '/')))
- strcpy(thecat.nnw_name, str+1);
- else
- strcpy(thecat.nnw_name, prefs.nnw_name);
-
- if ((str=strrchr(prefs.image_name[prefs.nimage_name-1], '/')))
- strcpy(thecat.image_name, str+1);
- else
- strcpy(thecat.image_name, prefs.image_name[prefs.nimage_name-1]);
-
- sprintf(thecat.soft_name, "%s %s", BANNER, VERSION);
-
- return;
- }
-
-
diff --git a/sextractor/src/prefs.h b/sextractor/src/prefs.h
deleted file mode 100644
index c3b5860..0000000
--- a/sextractor/src/prefs.h
+++ /dev/null
@@ -1,217 +0,0 @@
- /*
- prefs.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Keywords for the configuration file.
-*
-* Last modify: 13/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifndef _PREFS_H_
-#define _PREFS_H_
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define MAXLIST 32 /* max. nb of list members */
-
-/* NOTES:
-One must have: MAXLIST >= 1 (preferably >= 16!)
-*/
-/*------------------------------- preferences -------------------------------*/
-typedef struct
- {
- char **command_line; /* Command line */
- int ncommand_line; /* nb of params */
- char prefs_name[MAXCHAR]; /* prefs filename*/
- char *(image_name[2]); /* image filenames */
- int nimage_name; /* nb of params */
- char cat_name[MAXCHAR]; /* catalog filename*/
-/*----- thresholding */
- double dthresh[2]; /* detect. threshold */
- int ndthresh; /* (1 or 2 entries) */
- double thresh[2]; /* analysis thresh. */
- int nthresh; /* (1 or 2 entries) */
- enum {THRESH_RELATIVE, THRESH_ABSOLUTE}
- thresh_type[2]; /* bkgnd type */
- int nthresh_type; /* nb of params */
-/*----- extraction */
- int dimage_flag; /* detect. image ? */
- int ext_minarea; /* min area in pix. */
- int deb_maxarea; /* max deblend. area */
- int filter_flag; /* smoothing on/off */
- char filter_name[MAXCHAR]; /* mask filename */
- double filter_thresh[2]; /* Filter thresholds */
- int nfilter_thresh; /* nb of params */
- int deblend_nthresh; /* threshold number */
- double deblend_mincont; /* minimum contrast */
- double satur_level; /* saturation level */
- enum {CCD, PHOTO} detect_type; /* detection type */
-/*----- Flagging */
- char *(fimage_name[MAXFLAG]); /* flagmap filenames */
- int nfimage_name; /* nb of params */
- enum {FLAG_OR, FLAG_AND, FLAG_MIN, FLAG_MAX, FLAG_MOST}
- flag_type[MAXFLAG]; /* flag combination */
- int imaflag_size; /* requested iso nb1 */
- int imanflag_size; /* requested iso nb2 */
- int nimaisoflag; /* effective iso nb */
- int nimaflag; /* effective ima nb */
-/*----- cleaning */
- int clean_flag; /* allow cleaning ? */
- double clean_param; /* cleaning effic. */
-/*----- Weighting */
- char *(wimage_name[2]); /* weight filenames */
- int nwimage_name; /* nb of params */
- weightenum weight_type[2]; /* weighting scheme */
- int nweight_type; /* nb of params */
- int weight_flag; /* do we weight ? */
- int dweight_flag; /* detection weight? */
- int weightgain_flag; /* weight gain? */
-/*----- photometry */
- enum {CAT_NONE, ASCII, ASCII_HEAD, ASCII_SKYCAT, ASCII_VO,
- FITS_LDAC, FITS_TPX, FITS_10}
- cat_type; /* type of catalog */
- enum {PNONE, FIXED, AUTO} apert_type; /* type of aperture */
- double apert[MAXNAPER]; /* apert size (pix) */
- int naper; /* effective apert. */
- int flux_apersize, fluxerr_apersize; /* requested apert. */
- int mag_apersize, magerr_apersize; /* requested apert. */
- double autoparam[2]; /* Kron parameters */
- int nautoparam; /* nb of Kron params */
- double petroparam[2]; /* Kron parameters */
- int npetroparam; /* nb of Kron params */
- double autoaper[2]; /* minimum apertures */
- int nautoaper; /* nb of min. aperts */
- double mag_zeropoint; /* magnitude offsets */
- double mag_gamma; /* for emulsions */
- double gain; /* only for CCD */
-/*----- S/G separation */
- double pixel_scale; /* in arcsec */
- double seeing_fwhm; /* in arcsec */
- char nnw_name[MAXCHAR]; /* nnw filename */
-/*----- background */
- enum {IMAGE, AFILE} back_origin; /* origin of bkgnd */
- char back_name[MAXCHAR]; /* bkgnd filename */
- backenum back_type[2]; /* bkgnd type */
- int nback_type; /* nb of params */
- double back_val[2]; /* user-def. bkg */
- int nback_val; /* nb of params */
- int backsize[2]; /* bkgnd mesh size */
- int nbacksize; /* nb of params */
- int backfsize[2]; /* bkgnd filt. size */
- int nbackfsize; /* nb of params */
- double backfthresh; /* bkgnd fil. thresh */
- enum {GLOBAL, LOCAL} pback_type; /* phot. bkgnd type */
- int pback_size; /* rect. ann. width */
-/*----- memory */
- int clean_stacksize; /* size of buffer */
- int mem_pixstack; /* pixel stack size */
- int mem_bufsize; /* strip height */
-/*----- catalog output */
- char param_name[MAXCHAR]; /* param. filename */
-/*----- miscellaneous */
- int pipe_flag; /* allow piping ? */
- enum {QUIET, NORM, WARN, FULL} verbose_type; /* display type */
- int xml_flag; /* Write XML file? */
- char xml_name[MAXCHAR]; /* XML file name */
- char xsl_name[MAXCHAR]; /* XSL file name (or URL) */
- char sdate_start[12]; /* SCAMP start date */
- char stime_start[12]; /* SCAMP start time */
- char sdate_end[12]; /* SCAMP end date */
- char stime_end[12]; /* SCAMP end time */
- double time_diff; /* Execution time */
-/*----- CHECK-images */
- int check_flag; /* CHECK-image flag */
- checkenum check_type[MAXCHECK]; /* check-image types */
- int ncheck_type; /* nb of params */
- char *(check_name[MAXCHECK]); /* check-image names */
- int ncheck_name; /* nb of params */
- struct structcheck *(check[MAXCHECK]); /* check-image ptrs */
-/*----- ASSOCiation */
- int assoc_flag; /* ASSOCiation flag */
- char assoc_name[MAXCHAR]; /* ASSOC-list name */
- int assoc_param[3]; /* ASSOC param cols */
- int nassoc_param; /* nb of params */
- int assoc_data[MAXNASSOC]; /* ASSOC data cols */
- int nassoc_data; /* nb of params */
- enum {ASSOC_FIRST, ASSOC_NEAREST, ASSOC_MEAN, ASSOC_MAGMEAN,
- ASSOC_SUM, ASSOC_MAGSUM, ASSOC_MIN, ASSOC_MAX}
- assoc_type; /* type of assoc. */
- enum {ASSOCSELEC_ALL, ASSOCSELEC_MATCHED, ASSOCSELEC_NOMATCHED}
- assocselec_type; /* type of assoc. */
- double assoc_radius; /* ASSOC range */
- int assoc_size; /* nb of parameters */
- char retina_name[MAXCHAR]; /* retina filename */
- int vignetsize[2]; /* vignet size */
- int vigshiftsize[2]; /* shift-vignet size */
- int cleanmargin; /* CLEANing margin */
- char som_name[MAXCHAR]; /* SOM filename */
- int somfit_flag; /* ASSOCiation flag */
- int somfit_vectorsize; /* SOMfit vec. size */
-/*----- masking */
- enum {MASK_NONE, MASK_BLANK, MASK_CORRECT}
- mask_type; /* type of masking */
- int blank_flag; /* BLANKing flag */
- double weight_thresh[2]; /* weight threshlds */
- int nweight_thresh; /* nb of params */
-/*----- interpolation */
- enum {INTERP_NONE, INTERP_VARONLY, INTERP_ALL}
- interp_type[2]; /* interpolat. type */
- int ninterp_type; /* nb of params */
- int interp_xtimeout[2]; /* interp. x timeout */
- int ninterp_xtimeout; /* nb of params */
- int interp_ytimeout[2]; /* interp. y timeout */
- int ninterp_ytimeout; /* nb of params */
-/*----- astrometry */
- int world_flag; /* WORLD required */
- char coosys[16]; /* VOTable coord.sys */
- double epoch; /* VOTable epoch */
-/*----- growth curve */
- int growth_flag; /* gr. curve needed */
- int flux_growthsize; /* number of elem. */
- int mag_growthsize; /* number of elem. */
- int flux_radiussize; /* number of elem. */
- double growth_step; /* step size (pix) */
- double flux_frac[MAXNAPER]; /* for FLUX_RADIUS */
- int nflux_frac; /* number of elem. */
-/*----- PSF-fitting */
- int psf_flag; /* PSF-fit needed */
- int dpsf_flag; /* dual image PSF-fit */
- char *(psf_name[2]); /* PSF filename */
- int npsf_name; /* nb of params */
- int psf_npsfmax; /* Max # of PSFs */
- enum {PSFDISPLAY_SPLIT, PSFDISPLAY_VECTOR}
- psfdisplay_type; /* PSF display type */
- int psf_xsize,psf_ysize; /* nb of params */
- int psf_xwsize,psf_ywsize; /* nb of params */
- int psf_alphassize,psf_deltassize; /* nb of params */
- int psf_alpha2000size,psf_delta2000size; /* nb of params */
- int psf_alpha1950size,psf_delta1950size; /* nb of params */
- int psf_fluxsize; /* nb of params */
- int psf_fluxerrsize; /* nb of params */
- int psf_magsize; /* nb of params */
- int psf_magerrsize; /* nb of params */
- int pc_flag; /* PC-fit needed */
- int pc_vectorsize; /* nb of params */
-/*----- customize */
- int fitsunsigned_flag; /* Force unsign FITS */
- int next; /* Number of extensions in file */
-/* Multithreading */
- int nthreads; /* Number of active threads */
- } prefstruct;
-
- prefstruct prefs;
-
-/*-------------------------------- protos -----------------------------------*/
-extern int cistrcmp(char *cs, char *ct, int mode);
-
-extern void dumpprefs(int state),
- readprefs(char *filename,char **argkey,char **argval,int narg),
- useprefs(void);
-#endif
diff --git a/sextractor/src/psf.c b/sextractor/src/psf.c
deleted file mode 100644
index a9e6352..0000000
--- a/sextractor/src/psf.c
+++ /dev/null
@@ -1,1594 +0,0 @@
- /*
- psf.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Authors: E.BERTIN (IAP)
-* P.DELORME (LAOG)
-*
-* Contents: Fit the PSF to a detection.
-*
-* Last modify: 12/01/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "fits/fitscat.h"
-#include "check.h"
-#include "filter.h"
-#include "image.h"
-#include "poly.h"
-#include "psf.h"
-
-/*------------------------------- variables ---------------------------------*/
-
-
-extern keystruct objkey[];
-extern objstruct outobj;
-
-/********************************* psf_init **********************************/
-/*
-Allocate memory and stuff for the PSF-fitting.
-*/
-void psf_init(psfstruct *psf)
- {
- QMALLOC(thepsfit, psfitstruct, 1);
- QMALLOC(thepsfit->x, float, prefs.psf_npsfmax);
- QMALLOC(thepsfit->y, float, prefs.psf_npsfmax);
- QMALLOC(thepsfit->flux, float, prefs.psf_npsfmax);
- QMALLOC(ppsfit, psfitstruct, 1); /*?*/
- QMALLOC(ppsfit->x, float, prefs.psf_npsfmax);
- QMALLOC(ppsfit->y, float, prefs.psf_npsfmax);
- QMALLOC(ppsfit->flux, float, prefs.psf_npsfmax);
-
- return;
- }
-
-
-/********************************* psf_end ***********************************/
-/*
-Free memory occupied by the PSF-fitting stuff.
-*/
-void psf_end(psfstruct *psf, psfitstruct *psfit)
- {
- int d, ndim;
-
- if (psf->pc)
- pc_end(psf->pc);
-
- ndim = psf->poly->ndim;
- for (d=0; d<ndim; d++)
- free(psf->contextname[d]);
- free(psf->context);
- free(psf->contextname);
- free(psf->contextoffset);
- free(psf->contextscale);
- free(psf->contexttyp);
- poly_end(psf->poly);
- free(psf->maskcomp);
- free(psf->maskloc);
- free(psf->masksize);
- free(psf);
-
- free(psfit->x);
- free(psfit->y);
- free(psfit->flux);
- free(psfit);
-
- return;
- }
-
-
-/********************************* psf_load *********************************/
-/*
-Read the PSF data from a FITS file.
-*/
-psfstruct *psf_load(char *filename)
- {
- static objstruct saveobj;
- static obj2struct saveobj2;
- psfstruct *psf;
- catstruct *cat;
- tabstruct *tab;
- keystruct *key;
- char *head, *ci,*co;
- int deg[POLY_MAXDIM], group[POLY_MAXDIM], ndim, ngroup,
- i,k;
-
-/* Open the cat (well it is not a "cat", but simply a FITS file */
- if (!(cat = read_cat(filename)))
- error(EXIT_FAILURE, "*Error*: PSF file not found: ", filename);
-
-/* OK, we now allocate memory for the PSF structure itself */
- QCALLOC(psf, psfstruct, 1);
-
-/* Store a short copy of the PSF filename */
- if ((ci=strrchr(filename, '/')))
- strcpy(psf->name, ci+1);
- else
- strcpy(psf->name, filename);
-
- if (!(tab = name_to_tab(cat, "PSF_DATA", 0)))
- error(EXIT_FAILURE, "*Error*: PSF_DATA table not found in catalog ",
- filename);
-
- head = tab->headbuf;
-
-/*-- Dimension of the polynomial */
- if (fitsread(head, "POLNAXIS", &ndim, H_INT,T_LONG) == RETURN_OK
- && ndim)
- {
-/*-- So we have a polynomial description of the PSF variations */
- if (ndim > POLY_MAXDIM)
- {
- sprintf(gstr, "*Error*: The POLNAXIS parameter in %s exceeds %d",
- psf->name, POLY_MAXDIM);
- error(EXIT_FAILURE, gstr, "");
- }
-
- QMALLOC(psf->contextname, char *, ndim);
- QMALLOC(psf->context, double *, ndim);
- QMALLOC(psf->contexttyp, t_type, ndim);
- QMALLOC(psf->contextoffset, double, ndim);
- QMALLOC(psf->contextscale, double, ndim);
-
-/*-- We will have to use the outobj structs, so we first save their content */
- saveobj = outobj;
- saveobj2 = outobj2;
-/*-- outobj's are used as FLAG arrays, so we initialize them to 0 */
- memset(&outobj, 0, sizeof(outobj));
- memset(&outobj2, 0, sizeof(outobj2));
- for (i=0; i<ndim; i++)
- {
-/*---- Polynomial groups */
- sprintf(gstr, "POLGRP%1d", i+1);
- if (fitsread(head, gstr, &group[i], H_INT,T_LONG) != RETURN_OK)
- goto headerror;
-
-/*---- Contexts */
- QMALLOC(psf->contextname[i], char, 80);
- sprintf(gstr, "POLNAME%1d", i+1);
- if (fitsread(head,gstr,psf->contextname[i],H_STRING,T_STRING)!=RETURN_OK)
- goto headerror;
- if (*psf->contextname[i]==(char)':')
-/*------ It seems we're facing a FITS header parameter */
- psf->context[i] = NULL; /* This is to tell we'll have to load */
- /* a FITS header context later on */
- else
-/*------ The context element is a dynamic object parameter */
- {
- if ((k = findkey(psf->contextname[i], (char *)objkey,
- sizeof(keystruct)))==RETURN_ERROR)
- {
- sprintf(gstr, "*Error*: %s CONTEXT parameter in %s unknown",
- psf->contextname[i], psf->name);
- error(EXIT_FAILURE, gstr, "");
- }
- key = objkey+k;
- psf->context[i] = key->ptr;
- psf->contexttyp[i] = key->ttype;
-/*------ Declare the parameter "active" to trigger computation by SExtractor */
- *((char *)key->ptr) = (char)'\1';
- }
-/*---- Scaling of the context parameter */
- sprintf(gstr, "POLZERO%1d", i+1);
- if (fitsread(head, gstr, &psf->contextoffset[i], H_EXPO, T_DOUBLE)
- !=RETURN_OK)
- goto headerror;
- sprintf(gstr, "POLSCAL%1d", i+1);
- if (fitsread(head, gstr, &psf->contextscale[i], H_EXPO, T_DOUBLE)
- !=RETURN_OK)
- goto headerror;
- }
-
-/*-- Number of groups */
- if (fitsread(head, "POLNGRP ", &ngroup, H_INT, T_LONG) != RETURN_OK)
- goto headerror;
-
- for (i=0; i<ngroup; i++)
- {
-/*---- Polynomial degree for each group */
- sprintf(gstr, "POLDEG%1d", i+1);
- if (fitsread(head, gstr, °[i], H_INT,T_LONG) != RETURN_OK)
- goto headerror;
- }
-
- psf->poly = poly_init(group, ndim, deg, ngroup);
-
-/*-- Update the permanent FLAG arrays (that is, perform an "OR" on them) */
- for (ci=(char *)&outobj,co=(char *)&flagobj,i=sizeof(objstruct); i--;)
- *(co++) |= *(ci++);
- for (ci=(char *)&outobj2,co=(char *)&flagobj2,i=sizeof(obj2struct); i--;)
- *(co++) |= *(ci++);
-
-/*-- Restore previous outobj contents */
- outobj = saveobj;
- outobj2 = saveobj2;
- }
- else
- {
-/*-- This is a simple, constant PSF */
- psf->poly = poly_init(group, 0, deg, 0);
- psf->context = NULL;
- }
-
-/* Dimensionality of the PSF mask */
- if (fitsread(head, "PSFNAXIS", &psf->maskdim, H_INT, T_LONG) != RETURN_OK)
- goto headerror;
- if (psf->maskdim<2 || psf->maskdim>3)
- error(EXIT_FAILURE, "*Error*: wrong dimensionality for the PSF "
- "mask in ", filename);
- QMALLOC(psf->masksize, int, psf->maskdim);
- for (i=0; i<psf->maskdim; i++)
- psf->masksize[i] = 1;
- psf->masknpix = 1;
- for (i=0; i<psf->maskdim; i++)
- {
- sprintf(gstr, "PSFAXIS%1d", i+1);
- if (fitsread(head, gstr, &psf->masksize[i], H_INT,T_LONG) != RETURN_OK)
- goto headerror;
- psf->masknpix *= psf->masksize[i];
- }
-
-/* PSF FWHM: defaulted to 3 pixels */
- if (fitsread(head, "PSF_FWHM", &psf->fwhm, H_FLOAT,T_DOUBLE) != RETURN_OK)
- psf->fwhm = 3.0;
-
-/* PSF oversampling: defaulted to 1 */
- if (fitsread(head, "PSF_SAMP", &psf->pixstep,H_FLOAT,T_FLOAT) != RETURN_OK)
- psf->pixstep = 1.0;
-
-/* Load the PSF mask data */
- key = read_key(tab, "PSF_MASK");
- psf->maskcomp = key->ptr;
-
- psf->pc = pc_load(cat);
-
- QMALLOC(psf->maskloc, double, psf->masksize[0]*psf->masksize[1]);
-
-/* But don't touch my arrays!! */
- blank_keys(tab);
-
- free_cat(&cat, 1);
-
- return psf;
-
-headerror:
- error(EXIT_FAILURE, "*Error*: Incorrect or obsolete PSF data in ", filename);
- return NULL;
- }
-
-
-/***************************** psf_readcontext *******************************/
-/*
-Read the PSF context parameters in the FITS header.
-*/
-void psf_readcontext(psfstruct *psf, picstruct *field)
- {
- static double contextval[POLY_MAXDIM];
- int i, ndim;
-
- ndim = psf->poly->ndim;
- for (i=0; i<ndim; i++)
- if (!psf->context[i])
- {
- psf->context[i] = &contextval[i];
- psf->contexttyp[i] = T_DOUBLE;
- if (fitsread(field->fitshead, psf->contextname[i]+1, &contextval[i],
- H_FLOAT,T_DOUBLE) == RETURN_ERROR)
- {
- sprintf(gstr, "*Error*: %s parameter not found in the header of ",
- psf->contextname[i]+1);
- error(EXIT_FAILURE, gstr, field->rfilename);
- }
- }
-
- return;
- }
-
-
-/******************************** psf_fit ***********************************/
-/* standart PSF fit for one component */
-/****************************************************************************/
-
-void psf_fit(psfstruct *psf, picstruct *field, picstruct *wfield,
- objstruct *obj)
-{
- checkstruct *check;
- static obj2struct *obj2 = &outobj2;
- static double x2[PSF_NPSFMAX],y2[PSF_NPSFMAX],xy[PSF_NPSFMAX],
- deltax[PSF_NPSFMAX],
- deltay[PSF_NPSFMAX],flux[PSF_NPSFMAX],
- deltaxb[PSF_NPSFMAX],deltayb[PSF_NPSFMAX],
- fluxb[PSF_NPSFMAX],
- sol[PSF_NTOT], covmat[PSF_NTOT*PSF_NTOT],
- vmat[PSF_NTOT*PSF_NTOT], wmat[PSF_NTOT];
- double **psfmasks, **psfmaskx,**psfmasky,
- *data, *data2, *data3, *weight, *mat, *checkdata,
- *d, *m, *w, *ps, *var,
- dx,dy,
- pix,pix2, wthresh,val,
- backnoise2, gain, radmin2,radmax2,satlevel,chi2,
- r2, valmax, psf_fwhm;
- float *dh, *wh, pixstep,fluxerr;
- PIXTYPE *datah, *weighth, *cpix;
- int i,j,p, npsf,npsfmax, npix, nppix, ix,iy,niter,
- width, height, pwidth,pheight, x,y,
- xmax,ymax, wbad, gainflag, convflag, npsfflag,
- ival,kill=0;
-
- checkdata = NULL; /* To avoid gcc -Wall warnings */
- dx = dy = 0.0;
- niter = 0;
- npsfmax = prefs.psf_npsfmax;
- pixstep = 1.0/psf->pixstep;
- gain = prefs.gain;
- backnoise2 = field->backsig*field->backsig;
- satlevel = prefs.satur_level - obj->bkg;
- wthresh = wfield?wfield->weight_thresh:BIG;
- gainflag = prefs.weightgain_flag;
- psf_fwhm = psf->fwhm*psf->pixstep;
-
-
- /* Initialize outputs */
- thepsfit->niter = 0;
- thepsfit->npsf = 0;
- for (j=0; j<npsfmax; j++)
- {
- thepsfit->x[j] = obj2->posx;
- thepsfit->y[j] = obj2->posy;
- thepsfit->flux[j] = 0.0;
- }
-
- /* Scale data area with object "size" */
- ix = (obj->xmax+obj->xmin+1)/2;
- iy = (obj->ymax+obj->ymin+1)/2;
- width = obj->xmax-obj->xmin+1+psf_fwhm;
- if (width < (ival=(int)(psf_fwhm*2)))
- width = ival;
- height = obj->ymax-obj->ymin+1+psf_fwhm;
- if (height < (ival=(int)(psf_fwhm*2)))
- height = ival;
- npix = width*height;
- radmin2 = PSF_MINSHIFT*PSF_MINSHIFT;
- radmax2 = npix/2.0;
- fluxerr = 0.0;
-
- /* Scale total area with PSF FWHM */
- pwidth = (int)(psf->masksize[0]*psf->pixstep)+width;;
- pheight = (int)(psf->masksize[1]*psf->pixstep)+height;
- nppix = pwidth*pheight;
-
- /* Allocate working space */
- if (prefs.psf_flag==1)
- if (prefs.dpsf_flag!=1)
- if(!FLAG(obj2.fluxerr_psf))
- QMALLOC(obj2->fluxerr_psf, float, prefs.psf_npsfmax);
-
- QMALLOC(weighth, PIXTYPE, npix);
- QMALLOC(weight, double, npix);
- QMALLOC(datah, PIXTYPE, npix);
- QMALLOC(data, double, npix);
- QMALLOC(data2, double, npix);
- QMALLOC(data3, double, npix);
- QMALLOC(mat, double, npix*PSF_NTOT);
- if (prefs.check[CHECK_SUBPSFPROTOS] || prefs.check[CHECK_PSFPROTOS]
- || prefs.check[CHECK_SUBPCPROTOS] || prefs.check[CHECK_PCPROTOS]
- || prefs.check[CHECK_PCOPROTOS])
- {
- QMALLOC(checkdata, double, nppix);
- QMALLOC(checkmask, PIXTYPE, nppix);
- }
-
- QMALLOC(psfmasks, double *, npsfmax);
- QMALLOC(psfmaskx, double *, npsfmax);
- QMALLOC(psfmasky, double *, npsfmax);
- for (i=0; i<npsfmax; i++)
- {
- QMALLOC(psfmasks[i], double, npix);
- QMALLOC(psfmaskx[i], double, npix);
- QMALLOC(psfmasky[i], double, npix);
- }
-
- copyimage(field, datah, width, height, ix, iy);
-
- /* Compute weights */
- wbad = 0;
- if (wfield)
- {
- copyimage(wfield, weighth, width, height, ix, iy);
- for (wh=weighth, w=weight, dh=datah,p=npix; p--;)
- if ((pix=*(wh++)) < wthresh && pix>0
- && (pix2=*(dh++))>-BIG
- && pix2<satlevel)
- *(w++) = 1/sqrt(pix+(pix2>0.0?
- (gainflag? pix2*pix/backnoise2:pix2)/gain
- :0.0));
- else
- {
- *(w++) = 0.0;
- wbad++;
- }
- }
- else
- for (w=weight, dh=datah, p=npix; p--;)
- if ((pix=*(dh++))>-BIG && pix<satlevel)
- *(w++) = 1.0/sqrt(backnoise2+(pix>0.0?pix/gain:0.0));
- else
- {
- *(w++) = 0.0;
- wbad++;
- }
-
- /* Special action if most of the weights are zero!! */
- if (wbad>=npix-3)
- return;
-
- /* Weight the data */
- dh = datah;
- val = obj->dbkg; /* Take into account a local background change */
- d = data;
- w = weight;
- for (p=npix; p--;)
- *(d++) = (*(dh++)-val)**(w++);
-
- /* Get the local PSF */
- psf_build(psf);
-
- npsfflag = 1;
- r2 = psf_fwhm*psf_fwhm/2.0;
- fluxb[0] = deltaxb[0] = deltayb[0] = 0.0;
-
- for (npsf=1; npsf<=npsfmax && npsfflag; npsf++)
- {
- kill=0;
-/*-- First compute an optimum initial guess for the positions of components */
- if (npsf>1)
- {
-/*---- Subtract previously fitted components */
- d = data2;
- dh = datah;
- for (p=npix; p--;)
- *(d++) = (double)*(dh++);
- for (j=0; j<npsf-1; j++)
- {
- d = data2;
- ps = psfmasks[j];
- for (p=npix; p--;)
- *(d++) -= flux[j]**(ps++);
- }
- convolve_image(field, data2, data3, width,height);
-/*---- Ignore regions too close to stellar cores */
- for (j=0; j<npsf-1; j++)
- {
- d = data3;
- dy = -((double)(height/2)+deltay[j]);
- for (y=height; y--; dy += 1.0)
- {
- dx = -((double)(width/2)+deltax[j]);
- for (x=width; x--; dx+= 1.0, d++)
- if (dx*dx+dy*dy<r2)
- *d = -BIG;
- }
- }
-/*---- Now find the brightest pixel (poor man's guess, to be refined later) */
- d = data3;
- valmax = -BIG;
- xmax = width/2;
- ymax = height/2;
- for (y=0; y<height; y++)
- for (x=0; x<width; x++)
- {
- if ((val = *(d++))>valmax)
- {
- valmax = val;
- xmax = x;
- ymax = y;
- }
- }
- deltax[npsf-1] = (double)(xmax - width/2);
- deltay[npsf-1] = (double)(ymax - height/2);
- }
- else
- {
-/*---- Only one component to fit: simply use the barycenter as a guess */
- deltax[npsf-1] = obj->mx - ix;
- deltay[npsf-1] = obj->my - iy;
- }
-
- niter = 0;
- convflag = 1;
- for (i=0; i<PSF_NITER && convflag; i++)
- {
- convflag = 0,niter++,m=mat;
- for (j=0; j<npsf; j++)
- {
-/*------ Resample the PSFs here for the 1st iteration */
- vignet_resample(psf->maskloc, psf->masksize[0], psf->masksize[1],
- psfmasks[j], width, height,
- -deltax[j]*pixstep, -deltay[j]*pixstep,
- pixstep);
- m=compute_gradient(weight,width,height,
- psfmasks[j],psfmaskx[j],psfmasky[j],m);
- }
-
-
- svdfit(mat, data, npix, npsf*PSF_NA, sol, vmat, wmat);
-
- compute_pos( &npsf, &convflag, &npsfflag,radmin2,radmax2,
- r2, sol,flux, deltax, deltay,&dx,&dy);
- }
- for (j=0; j<npsf; j++)
- {
-/*-- Compute variances and covariances */
- svdvar(vmat, wmat, npsf*PSF_NA, covmat);
- var = covmat;
-/*---- First, the error on the flux estimate */
- fluxerr = sqrt(*var)>0.0? sqrt(*var):999999.0;
- //if (flux[j]<12*fluxerr && j>0)
- // npsfmax--,flux[j]=0;
- if (flux[j]<12*fluxerr && j>0)
- {
- flux[j]=0,kill++,npsfmax--;
- //if(j==npsfmax-1)
- // kill++;
- }
- }
- if (npsfflag)
- {
-/*--- If we reach this point we know the data are worth backuping */
- for (j=0; j<npsf; j++)
- {
- deltaxb[j] = deltax[j];
- deltayb[j] = deltay[j];
- fluxb[j] = flux[j];
- obj2->fluxerr_psf[j]=fluxerr;
- }
- }
- }
- npsf=npsf-1-kill;
-
-/* Now keep only fitted stars that fall within the current detection area */
- i = 0;
- for (j=0; j<npsf; j++)
- {
- x = (int)(deltaxb[j]+0.4999)+width/2;
- y = (int)(deltayb[j]+0.4999)+height/2;
- if (x<0 || x>=width || y<0 || y>=height)
- continue;
- if (weight[y*width+x] < 1/BIG)
- continue;
- if (10*fluxb[j]<fluxb[0] )
- continue;
- if (fluxb[j]<=0 )
- continue;
-
- if (FLAG(obj2.poserrmx2_psf))
- {
- compute_poserr(j,var,sol,obj2,x2,y2,xy);
- }
- else
- var += 3*PSF_NA+3;
-
- deltax[i] = deltaxb[j];
- deltay[i] = deltayb[j];
- flux[i++] = fluxb[j];
- }
-
- npsf = i;
-
- /* Compute chi2 if asked to
- if (FLAG(obj2.chi2_psf))
- {
- for (j=0; j<npsf; j++)
- {
- chi2 = 0.0;
- for (d=data,w=weight,p=0; p<npix; w++,p++)
- {
- pix = *(d++);
- pix -= psfmasks[j][p]*flux[j]**w;
- chi2 += pix*pix;
- if (chi2>1E29) chi2=1E28;
- }
- obj2->chi2_psf = obj->sigbkg>0.?
- chi2/((npix - 3*npsf)*obj->sigbkg*obj->sigbkg):999999;
-
- }
-
- }*/
- /* Compute relative chi2 if asked to */
- if (FLAG(obj2.chi2_psf))
- {
- for (j=0; j<npsf; j++)
- {
- chi2 = 0.0;
- for (d=data,w=weight,p=0; p<npix; w++,p++)
- {
- pix = *(d++)/flux[j];
- pix -= psfmasks[j][p]**w;
- chi2 += pix*pix;
- if (chi2>1E29) chi2=1E28;
- }
- obj2->chi2_psf = flux[j]>0?
- chi2/((npix - 3*npsf)*obj->sigbkg*obj->sigbkg):999999;
-
- }
-
- }
- /* CHECK images */
- if (prefs.check[CHECK_SUBPSFPROTOS] || prefs.check[CHECK_PSFPROTOS])
- for (j=0; j<npsf; j++)
- {
- vignet_resample(psf->maskloc, psf->masksize[0], psf->masksize[1],
- checkdata, pwidth, pheight,
- -deltax[j]*pixstep, -deltay[j]*pixstep, pixstep);
- cpix = checkmask;
- d = checkdata;
- for (p=nppix; p--;)
- *(cpix++) = (PIXTYPE)*(d++);
- if ((check = prefs.check[CHECK_SUBPSFPROTOS]))
- addcheck(check, checkmask, pwidth,pheight, ix,iy,-flux[j]);
- if ((check = prefs.check[CHECK_PSFPROTOS]))
- addcheck(check, checkmask, pwidth,pheight, ix,iy,flux[j]);
- }
-
- thepsfit->niter = niter;
- thepsfit->npsf = npsf;
- for (j=0; j<npsf; j++)
- {
- thepsfit->x[j] = ix+deltax[j]+1.0;
- thepsfit->y[j] = iy+deltay[j]+1.0;
- thepsfit->flux[j] = flux[j];
- }
-
-
-
-
- /* Now the morphology stuff */
- if (prefs.pc_flag)
- {
- width = pwidth-1;
- height = pheight-1;
- npix = width*height;
- copyimage(field, datah, width, height, ix, iy);
-
- /*-- Re-compute weights */
- if (wfield)
- {
- copyimage(wfield, weighth, width, height, ix, iy);
- for (wh=weighth ,w=weight, p=npix; p--;)
- *(w++) = (pix=*(wh++))<wthresh? sqrt(pix): 0.0;
- }
- else
- for (w=weight, dh=datah, p=npix; p--;)
- *(w++) = ((pix = *(dh++))>-BIG && pix<satlevel)?
- 1.0/sqrt(backnoise2+(pix>0.0?pix/gain:0.0))
- :0.0;
-
- /*-- Weight the data */
- dh = datah;
- d = data;
- w = weight;
- for (p=npix; p--;)
- *(d++) = *(dh++)*(*(w++));
-
- pc_fit(psf, data, weight, width, height, ix,iy, dx,dy, npix,
- field->backsig);
- }
-
-
- for (i=0; i<prefs.psf_npsfmax; i++)
- {
- QFREE(psfmasks[i]);
- QFREE(psfmaskx[i]);
- QFREE(psfmasky[i]);
- }
-
- QFREE(psfmasks);
- QFREE(psfmaskx);
- QFREE(psfmasky);
- QFREE(datah);
- QFREE(data);
- QFREE(data2);
- QFREE(data3);
- QFREE(weighth);
- QFREE(weight);
- QFREE(data);
- QFREE(mat);
-
- if (prefs.check[CHECK_SUBPSFPROTOS] || prefs.check[CHECK_PSFPROTOS]
- || prefs.check[CHECK_SUBPCPROTOS] || prefs.check[CHECK_PCPROTOS]
- || prefs.check[CHECK_PCOPROTOS])
- {
- QFREE(checkdata);
- QFREE(checkmask);
- }
-
- return;
-}
-
-
-/******************************** double_psf_fit *******************************
-****/
-/* double fit to make the psf detection on one image and the photometry on anoth
-er */
-/*******************************************************************************
-****/
-
-void double_psf_fit(psfstruct *ppsf, picstruct *pfield, picstruct *pwfield,
- objstruct *obj, psfstruct *psf, picstruct *field,
- picstruct *wfield)
-{
- static double /* sum[PSF_NPSFMAX]*/ pdeltax[PSF_NPSFMAX],
- pdeltay[PSF_NPSFMAX],psol[PSF_NPSFMAX], pcovmat[PSF_NPSFMAX*PSF_NPSFMAX],
- pvmat[PSF_NPSFMAX*PSF_NPSFMAX], pwmat[PSF_NPSFMAX],pflux[PSF_NPSFMAX];
-
- double **ppsfmasks, **ppsfmaskx,**ppsfmasky,
- *pmat, *checkdata,
- *pdata, *pdata2, *pdata3,
- *pm,*pd, *pw, *pps,*pweight,/* *pps, *px, *py,*/
- dx,dy,pdx,pdy, /* x1,y1, mx,my,mflux, */
- val, ppix,ppix2, /* dflux, */
- gain, radmin2,radmax2,satlevel
- ,chi2,pwthresh,pbacknoise2, /* mr, */
- r2=0, psf_fwhm,ppsf_fwhm ;
- float *pdh, *pwh, pixstep,ppixstep;
- PIXTYPE *pdatah, *pweighth;
- int i,j,k,p, npsf, npix,ix,iy,
- width, height, /* hw,hh, */
- x,y, /* yb, */
- wbad, gainflag,
- ival,npsfmax;
- double *pvar;
-
- static obj2struct *obj2 = &outobj2;
- checkdata = NULL; /* To avoid gcc -Wall warnings */
- pdx = pdy =dx = dy = 0.0;
- ppixstep = 1.0/ppsf->pixstep;
- pixstep = 1.0/psf->pixstep;
- gain = prefs.gain;
- npsfmax=prefs.psf_npsfmax;
- pbacknoise2 = pfield->backsig*pfield->backsig;
- satlevel = prefs.satur_level - obj->bkg;
- gainflag = prefs.weightgain_flag;
- psf_fwhm = psf->fwhm*psf->pixstep;
- ppsf_fwhm = ppsf->fwhm*ppsf->pixstep;
- pwthresh = pwfield?pwfield->weight_thresh:BIG;
-
- /* Initialize outputs */
- ppsfit->niter = 0;
- ppsfit->npsf = 0;
- if(!FLAG(obj2.fluxerr_psf))
- QMALLOC(obj2->fluxerr_psf, float, npsfmax);
- for (j=0; j<npsfmax; j++)
- {
- ppsfit->x[j] = 999999.0;
- ppsfit->y[j] = 999999.0;
- ppsfit->flux[j] = 0.0;
- obj2->fluxerr_psf[j] = 0.0;
- pdeltax[j]= pdeltay[j]=psol[j]= pwmat[j]=pflux[j]=0.0;
-
- }
-
- ix = (obj->xmax+obj->xmin+1)/2;
- iy = (obj->ymax+obj->ymin+1)/2;
- width = obj->xmax-obj->xmin+1+psf_fwhm;
- if (width < (ival=(int)(psf_fwhm*2)))
- width = ival;
- height = obj->ymax-obj->ymin+1+psf_fwhm;
- if (height < (ival=(int)(psf_fwhm*2)))
- height = ival;
- npix = width*height;
- radmin2 = PSF_MINSHIFT*PSF_MINSHIFT;
- radmax2 = npix/2.0;
- psf_fit(psf,field, wfield,obj);
- npsf=thepsfit->npsf;
-
- QMALLOC(ppsfmasks,double *,npsfmax);
- QMALLOC(ppsfmaskx,double *,npsfmax);
- QMALLOC(ppsfmasky,double *,npsfmax);
-
- for (i=0; i<npsfmax; i++)
- {
- QMALLOC(ppsfmasks[i],double,npix);
- QMALLOC(ppsfmaskx[i],double,npix);
- QMALLOC(ppsfmasky[i],double,npix);
- }
-
- QMALLOC(pweighth, PIXTYPE, npix);
- QMALLOC(pweight, double, npix);
- QMALLOC(pdatah, PIXTYPE, npix);
- QMALLOC(pdata, double, npix);
- QMALLOC(pdata2, double, npix);
- QMALLOC(pdata3, double, npix);
- QMALLOC(pmat, double, npix*npsfmax);
-
- for (j=0; j<npsf; j++)
- {
- pdeltax[j] =thepsfit->x[j]-ix-1 ;
- pdeltay[j] =thepsfit->y[j]-iy-1 ;
- ppsfit->flux[j] = 0;
- }
-
-/*------------------- Now the photometry fit ---------------------*/
- copyimage(pfield, pdatah, width, height, ix, iy);
- /* Compute photometry weights */
- wbad = 0;
- if (pwfield)
- {
- copyimage(pwfield, pweighth, width, height, ix, iy);
- for (pwh=pweighth, pw=pweight, pdh=pdatah,p=npix; p--;)
- {
- if ((ppix=*(pwh++)) < pwthresh && ppix>0
- && (ppix2=*(pdh++))>-BIG && ppix2<satlevel)
- {
- *(pw++) = 1/sqrt(ppix+(ppix2>0.0?
- (gainflag? ppix2*ppix/pbacknoise2:ppix2)/gain : 0.0));
- }
- else
- {
- *(pw++) = 0.0;
- wbad++;
- }
- }
- }
- else
- for (pw=pweight, pdh=pdatah, p=npix; p--;)
- if ((ppix=*(pdh++))>-BIG && ppix<satlevel)
- {
- *(pw++) = 1.0/sqrt(pbacknoise2+(ppix>0.0?ppix/gain:0.0));
- }
- else
- {
- *(pw++) = 0.0;
- wbad++;
- }
- /* Special action if most of the weights are zero!! */
- if (wbad>=npix-3)
- return;
-
- /* Weight the data */
- pdh = pdatah;
- pd = pdata;
- pw = pweight;
- val = obj->dbkg;
- for (p=npix; p--;)
- *(pd++) = (*(pdh++)-val)**(pw++);
-
-
- /* Get the photmetry PSF */
- psf_build(ppsf);
- for (j=1; j<=npsf; j++)
- {
- if (j>1)
- {
- /*---- Subtract //previously fitted components in photometry image */
- pd = pdata2;
- pdh = pdatah;
- for (p=npix; p--;)
- *(pd++) = (double)*(pdh++);
- for (k=0; k<j-1; k++)
- {
- pd = pdata2;
- pps = ppsfmasks[k];
- for (p=npix; p--;)
- *(pd++) -= pflux[k]**(pps++);
- }
- convolve_image(pfield, pdata2, pdata3, width,height);
- /*---- Ignore regions too close to stellar cores */
- for (k=0; k<j-1; k++)
- {
- pd = pdata3;
- dy = -((double)(height/2)+pdeltay[k]);
- for (y=height; y--; dy += 1.0)
- {
- dx = -((double)(width/2)+pdeltax[k]);
- for (x=width; x--; dx+= 1.0, pd++)
- if (dx*dx+dy*dy<r2) /*?*/
- *pd = -BIG;
- }
- }
- }
-
- pm=pmat;
- for (k=0; k<j; k++)
- {
- /*------ Resample the PSFs here for the 1st iteration */
- vignet_resample(ppsf->maskloc,
- ppsf->masksize[0], ppsf->masksize[1],
- ppsfmasks[k], width, height,
- -pdeltax[k]*ppixstep, -pdeltay[k]*ppixstep,
- ppixstep);
- pm=compute_gradient_phot(pweight,width,height, ppsfmasks[k],pm);
- }
-
- svdfit(pmat, pdata, npix, j, psol, pvmat, pwmat);
- compute_pos_phot( &j, psol,pflux);
-
- for (k=0; k<j; k++)
- {
- svdvar(pvmat, pwmat, j, pcovmat);
- pvar = pcovmat;
- obj2->fluxerr_psf[k]= sqrt(*pvar)>0.0 && sqrt(*pvar)<99?
- sqrt(*pvar):99;
- }
- }
- /* Compute chi2 if asked to
- if (FLAG(obj2.chi2_psf))
- {
- for (j=0; j<npsf; j++)
- {
- chi2 = 0.0;
- for (pd=pdata,pw=pweight,p=0; p<npix; pw++,p++)
- {
- ppix = *(pd++);
- ppix -= ppsfmasks[j][p]*pflux[j]**pw;
- chi2 += ppix*ppix;
- if (chi2>1E29) chi2=1E28;
- }
- obj2->chi2_psf = obj->sigbkg>0.?
- chi2/((npix - 3*npsf)*obj->sigbkg*obj->sigbkg):999999;
-
- }
-
- }
- */
- /* Compute relative error if asked to */
- if (FLAG(obj2.chi2_psf))
- {
- for (j=0; j<npsf; j++)
- {
- chi2 = 0.0;
- for (pd=pdata,pw=pweight,p=0; p<npix; pw++,p++)
- {
- ppix = *(pd++)/pflux[j];
- ppix -= ppsfmasks[j][p]**pw;
- chi2 += ppix*ppix;
- if (chi2>1E29) chi2=1E28;
- }
- obj2->chi2_psf = pflux[j]>0?
- chi2/((npix - 3*npsf)*obj->sigbkg*obj->sigbkg):999999;
-
- }
-
- }
- ppsfit->niter = thepsfit->niter;
- ppsfit->npsf = npsf;
-
- for (j=0; j<npsf; j++)
- {
- thepsfit->x[j] = ix+pdeltax[j]+1.0;
- thepsfit->y[j] = iy+pdeltay[j]+1.0;
- thepsfit->flux[j] = pflux[j];
- ppsfit->x[j] = ix+pdeltax[j]+1.0;
- ppsfit->y[j] = iy+pdeltay[j]+1.0;
- ppsfit->flux[j] = pflux[j];
- }
-
-
- for (i=0; i<npsfmax; i++)
- {
- QFREE(ppsfmasks[i]);
- QFREE(ppsfmaskx[i]);
- QFREE(ppsfmasky[i]);
- }
-
-
- QFREE(ppsfmasks);
- QFREE(ppsfmaskx);
- QFREE(ppsfmasky);
- QFREE(pdatah);
- QFREE(pdata);
- QFREE(pdata2);
- QFREE(pdata3);
- QFREE(pweighth);
- QFREE(pweight);
- QFREE(pdata);
- QFREE(pmat);
-
- if (prefs.check[CHECK_SUBPSFPROTOS] || prefs.check[CHECK_PSFPROTOS]
- || prefs.check[CHECK_SUBPCPROTOS] || prefs.check[CHECK_PCPROTOS]
- || prefs.check[CHECK_PCOPROTOS])
- {
- QFREE(checkdata);
- QFREE(checkmask);
- }
- return;
-}
-
-/******************************* psf_build **********************************/
-/*
-Build the local PSF (function of "context").
-*/
-void psf_build(psfstruct *psf)
- {
- static double pos[POLY_MAXDIM];
- double *pl, *basis, fac;
- float *ppc;
- int i,n,p, ndim, npix;
-
- npix = psf->masksize[0]*psf->masksize[1];
-
-/* Reset the Local PSF mask */
- memset(psf->maskloc, 0, npix*sizeof(double));
-
-/* Grab the context vector */
- ndim = psf->poly->ndim;
- for (i=0; i<ndim; i++)
- {
- ttypeconv(psf->context[i], &pos[i], psf->contexttyp[i],T_DOUBLE);
- pos[i] = (pos[i] - psf->contextoffset[i]) / psf->contextscale[i];
- }
- poly_func(psf->poly, pos);
-
- basis = psf->poly->basis;
-
- ppc = psf->maskcomp;
-/* Sum each component */
- for (n = (psf->maskdim>2?psf->masksize[2]:1); n--;)
- {
- pl = psf->maskloc;
- fac = *(basis++);
- for (p=npix; p--;)
- *(pl++) += fac**(ppc++);
- }
-
- return;
- }
-
-
-/*****************************compute_gradient*********************************/
-
-double *compute_gradient(double *weight,int width, int height,
- double *masks,double *maskx,double *masky
- ,double *m)
-{
- int x,y;
- double *w,*ps,*px,*py;
-
- /*------ copy of the (weighted) PSF, with outer ring set to zero */
- ps = masks;
- w = weight;
- for (y=0; y<height; y++)
- for (x=0; x<width; x++, ps++, w++)
- *(m++) = y?(y>=(height-1)?0:(x?(x>=(width-1)?0:*ps**w):0)):0;
- /*------ (weighted) PSF gradient in x (kernel for first moment in x) */
- ps = masks;
- px = maskx;
- w = weight;
- for (y=0; y<height; y++)
- for (x=0; x<width; x++, ps++, w++)
- *(m++) = ((*px++) = (x?(x>=(width-1)?0:*(ps+1)-*(ps-1)):0))**w/2;
- /*------ (weighted) PSF gradient in y (kernel for first moment in y) */
- ps = masks;
- py = masky;
- w = weight;
- for (y=0; y<height; y++)
- for (x=0; x<width; x++, ps++, w++)
- *(m++) = (*(py++)=(y?(y>=(height-1)?0:*(ps+width)-*(ps-width)):0))
- **w/2;
- return m;
-}
-
-/*****************************compute_gradient_phot*****************************
-****/
-
-double *compute_gradient_phot(double *pweight,int width, int height,
- double *pmasks,double *pm)
-
-{
- int x,y;
- double *pw,*pps;
-
- /*------ copy of the (weighted) PSF, with outer ring set to zero */
- pps = pmasks;
- pw = pweight;
- for (y=0; y<height; y++)
- for (x=0; x<width; x++, pps++, pw++)
- *(pm++) = y?(y>=(height-1)?0:(x?(x>=(width-1)?0:*pps**pw):0)):0;
-
- return pm;
-}
-
-/**************************compute_pos********************************/
-
-void compute_pos(int *pnpsf,int *pconvflag,int *pnpsfflag,double radmin2,
- double radmax2,double r2,double *sol,double *flux
- ,double *deltax,double *deltay,double *pdx,double *pdy)
-{
- int j,k,convflag,npsfflag,npsf;
- double dx,dy;
-
- dx=*pdx;
- dy=*pdy;
- convflag=*pconvflag;
- npsfflag=*pnpsfflag;
- npsf=*pnpsf;
- for (j=0; j<npsf; j++)
- {
- flux[j] = sol[j*PSF_NA];
- /*------ Update the PSF shifts */
- if (fabs(flux[j])>0.0)
- {
- dx = -sol[j*PSF_NA+1]/((npsf>1?2:1)*flux[j]);
- dy = -sol[j*PSF_NA+2]/((npsf>1?2:1)*flux[j]);
- }
-
- deltax[j] += dx;
- deltay[j] += dy;
- /*------ Continue until all PSFs have come to a complete stop */
- if ((dx*dx+dy*dy) > radmin2)
- convflag = 1;
- }
- for (j=0; j<npsf; j++)
- {
- /*------ Exit if too much decentering or negative flux */
- for (k=j+1; k<npsf; k++)
- {
- dx = deltax[j]-deltax[k];
- dy = deltay[j]-deltay[k];
- if (dx*dx+dy*dy<r2/4.0)
- {
- flux[j] = -BIG;
- break;
- }
- }
- if (flux[j]<0.0
- || (deltax[j]*deltax[j] + deltay[j]*deltay[j]) > radmax2)
- {
- npsfflag = 0;
- convflag = 0;
- npsf--;
- break;
- }
- }
- *pdx=dx;
- *pdy=dy;
- *pconvflag=convflag;
- *pnpsfflag= npsfflag;
- *pnpsf=npsf;
- return;
-}
-
-/**************************compute_pos_phot********************************/
-
-void compute_pos_phot(int *pnpsf,double *sol,double *flux)
-{
- int j,npsf;
- npsf=*pnpsf;
- for (j=0; j<npsf; j++)
- {
- flux[j] = sol[j];
- }
- *pnpsf=npsf;
- return;
-}
-
-
-/************************************compute_poserr*****************************
-*********/
-
-void compute_poserr( int j,double *var,double *sol,obj2struct *obj2,double *x2,
- double *y2,double *xy)
-{
- double vara,covab,varb;
-
- /*------ Variances and covariance along x and y */
- vara = *(var += PSF_NA+1);
- covab = *(++var);
- varb = *(var += PSF_NA);
- var += PSF_NA+1;
- obj2->poserrmx2_psf = (vara*x2[j]*x2[j]+varb*xy[j]*xy[j]
- +2*covab*x2[j]*xy[j])/(sol[0]*sol[0]);
- obj2->poserrmy2_psf = (varb*y2[j]*y2[j]+vara*xy[j]*xy[j]
- +2*covab*y2[j]*xy[j])/(sol[0]*sol[0]);
- obj2->poserrmxy_psf = (vara*x2[j]*xy[j]+varb*y2[j]*xy[j]
- +covab*(x2[j]*y2[j]+xy[j]*xy[j]))
- /(sol[0]*sol[0]);
-
- /*------ If requested, translate variances to major and minor error axes... */
- if (FLAG(obj2.poserra_psf))
- {
- double pmx2,pmy2,temp,theta;
-
- if (fabs(temp=obj2->poserrmx2_psf-obj2->poserrmy2_psf) > 0.0)
- theta = atan2(2.0 * obj2->poserrmxy_psf,temp) / 2.0;
- else
- theta = PI/4.0;
-
- temp = sqrt(0.25*temp*temp+obj2->poserrmxy_psf*obj2->poserrmxy_psf);
- pmy2 = pmx2 = 0.5*(obj2->poserrmx2_psf+obj2->poserrmy2_psf);
- pmx2+=temp;
- pmy2-=temp;
-
- obj2->poserra_psf = (float)sqrt(pmx2);
- obj2->poserrb_psf = (float)sqrt(pmy2);
- obj2->poserrtheta_psf = theta*180.0/PI;
- }
-
- /*------ ...Or ellipse parameters */
- if (FLAG(obj2.poserr_cxx))
- {
- double xm2,ym2, xym, temp;
-
- xm2 = obj2->poserrmx2_psf;
- ym2 = obj2->poserrmy2_psf;
- xym = obj2->poserrmxy_psf;
- obj2->poserrcxx_psf = (float)(ym2/(temp=xm2*ym2-xym*xym));
- obj2->poserrcyy_psf = (float)(xm2/temp);
- obj2->poserrcxy_psf = (float)(-2*xym/temp);
- }
- return;
-}
-
-
-/******************************** svdfit ************************************/
-/*
-General least-square fit A.x = b, based on Singular Value Decomposition (SVD).
-Loosely adapted from Numerical Recipes in C, 2nd Ed. (p. 671).
-Note: the a and v matrices are transposed with respect to the N.R. convention.
-*/
-void svdfit(double *a, double *b, int m, int n, double *sol,
- double *vmat, double *wmat)
- {
-#define MAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\
- (maxarg1) : (maxarg2))
-#define PYTHAG(a,b) ((at=fabs(a)) > (bt=fabs(b)) ? \
- (ct=bt/at,at*sqrt(1.0+ct*ct)) \
- : (bt ? (ct=at/bt,bt*sqrt(1.0+ct*ct)): 0.0))
-#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
-#define TOL 1.0e-11
-
- int flag,i,its,j,jj,k,l,nm,mmi,nml;
- double c,f,h,s,x,y,z,
- anorm, g, scale,
- at,bt,ct,maxarg1,maxarg2,
- thresh, wmax,
- *w,*ap,*ap0,*ap1,*ap10,*rv1p,*vp,*vp0,*vp1,*vp10,
- *bp,*tmpp, *rv1,*tmp;
-
- anorm = g = scale = 0.0;
- if (m < n)
- error(EXIT_FAILURE, "*Error*: Not enough rows for solving the system ",
- "in svdfit()");
-
- QMALLOC(rv1, double, n);
- QMALLOC(tmp, double, n);
- l = nm = nml = 0; /* To avoid gcc -Wall warnings */
- for (i=0;i<n;i++)
- {
- l = i+1;
- nml = n-l;
- rv1[i] = scale*g;
- g = s = scale = 0.0;
- if ((mmi = m - i) > 0)
- {
- ap = ap0 = a+i*(m+1);
- for (k=mmi;k--;)
- scale += fabs(*(ap++));
- if (scale)
- {
- for (ap=ap0,k=mmi; k--; ap++)
- {
- *ap /= scale;
- s += *ap**ap;
- }
- f = *ap0;
- g = -SIGN(sqrt(s),f);
- h = f*g-s;
- *ap0 = f-g;
- ap10 = a+l*m+i;
- for (j=nml;j--; ap10+=m)
- {
- for (s=0.0,ap=ap0,ap1=ap10,k=mmi; k--;)
- s += *(ap1++)**(ap++);
- f = s/h;
- for (ap=ap0,ap1=ap10,k=mmi; k--;)
- *(ap1++) += f**(ap++);
- }
- for (ap=ap0,k=mmi; k--;)
- *(ap++) *= scale;
- }
- }
- wmat[i] = scale*g;
- g = s = scale = 0.0;
- if (i < m && i+1 != n)
- {
- ap = ap0 = a+i+m*l;
- for (k=nml;k--; ap+=m)
- scale += fabs(*ap);
- if (scale)
- {
- for (ap=ap0,k=nml;k--; ap+=m)
- {
- *ap /= scale;
- s += *ap**ap;
- }
- f=*ap0;
- g = -SIGN(sqrt(s),f);
- h=f*g-s;
- *ap0=f-g;
- rv1p = rv1+l;
- for (ap=ap0,k=nml;k--; ap+=m)
- *(rv1p++) = *ap/h;
- ap10 = a+l+m*l;
- for (j=m-l; j--; ap10++)
- {
- for (s=0.0,ap=ap0,ap1=ap10,k=nml; k--; ap+=m,ap1+=m)
- s += *ap1**ap;
- rv1p = rv1+l;
- for (ap1=ap10,k=nml;k--; ap1+=m)
- *ap1 += s**(rv1p++);
- }
- for (ap=ap0,k=nml;k--; ap+=m)
- *ap *= scale;
- }
- }
- anorm=MAX(anorm,(fabs(wmat[i])+fabs(rv1[i])));
- }
-
- for (i=n-1;i>=0;i--)
- {
- if (i < n-1)
- {
- if (g)
- {
- ap0 = a+l*m+i;
- vp0 = vmat+i*n+l;
- vp10 = vmat+l*n+l;
- g *= *ap0;
- for (ap=ap0,vp=vp0,j=nml; j--; ap+=m)
- *(vp++) = *ap/g;
- for (j=nml; j--; vp10+=n)
- {
- for (s=0.0,ap=ap0,vp1=vp10,k=nml; k--; ap+=m)
- s += *ap**(vp1++);
- for (vp=vp0,vp1=vp10,k=nml; k--;)
- *(vp1++) += s**(vp++);
- }
- }
- vp = vmat+l*n+i;
- vp1 = vmat+i*n+l;
- for (j=nml; j--; vp+=n)
- *vp = *(vp1++) = 0.0;
- }
- vmat[i*n+i]=1.0;
- g=rv1[i];
- l=i;
- nml = n-l;
- }
-
- for (i=(m<n?m:n); --i>=0;)
- {
- l=i+1;
- nml = n-l;
- mmi=m-i;
- g=wmat[i];
- ap0 = a+i*m+i;
- ap10 = ap0 + m;
- for (ap=ap10,j=nml;j--;ap+=m)
- *ap=0.0;
- if (g)
- {
- g=1.0/g;
- for (j=nml;j--; ap10+=m)
- {
- for (s=0.0,ap=ap0,ap1=ap10,k=mmi; --k;)
- s += *(++ap)**(++ap1);
- f = (s/(*ap0))*g;
- for (ap=ap0,ap1=ap10,k=mmi;k--;)
- *(ap1++) += f**(ap++);
- }
- for (ap=ap0,j=mmi;j--;)
- *(ap++) *= g;
- }
- else
- for (ap=ap0,j=mmi;j--;)
- *(ap++)=0.0;
- ++(*ap0);
- }
-
- for (k=n; --k>=0;)
- {
- for (its=0;its<100;its++)
- {
- flag=1;
- for (l=k;l>=0;l--)
- {
- nm=l-1;
- if (fabs(rv1[l])+anorm == anorm)
- {
- flag=0;
- break;
- }
- if (fabs(wmat[nm])+anorm == anorm)
- break;
- }
- if (flag)
- {
- c=0.0;
- s=1.0;
- ap0 = a+nm*m;
- ap10 = a+l*m;
- for (i=l; i<=k; i++,ap10+=m)
- {
- f=s*rv1[i];
- if (fabs(f)+anorm == anorm)
- break;
- g=wmat[i];
- h=PYTHAG(f,g);
- wmat[i]=h;
- h=1.0/h;
- c=g*h;
- s=(-f*h);
- for (ap=ap0,ap1=ap10,j=m; j--;)
- {
- z = *ap1;
- y = *ap;
- *(ap++) = y*c+z*s;
- *(ap1++) = z*c-y*s;
- }
- }
- }
- z=wmat[k];
- if (l == k)
- {
- if (z < 0.0)
- {
- wmat[k] = -z;
- vp = vmat+k*n;
- for (j=n; j--; vp++)
- *vp = (-*vp);
- }
- break;
- }
- if (its == 99)
- error(EXIT_FAILURE, "*Error*: No convergence in 100 SVD iterations ",
- "in svdfit()");
- x=wmat[l];
- nm=k-1;
- y=wmat[nm];
- g=rv1[nm];
- h=rv1[k];
- f=((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y);
- g=PYTHAG(f,1.0);
- f=((x-z)*(x+z)+h*((y/(f+SIGN(g,f)))-h))/x;
- c=s=1.0;
- ap10 = a+l*m;
- vp10 = vmat+l*n;
- for (j=l;j<=nm;j++,ap10+=m,vp10+=n)
- {
- i=j+1;
- g=rv1[i];
- y=wmat[i];
- h=s*g;
- g=c*g;
- z=PYTHAG(f,h);
- rv1[j]=z;
- c=f/z;
- s=h/z;
- f=x*c+g*s;
- g=g*c-x*s;
- h=y*s;
- y=y*c;
- for (vp=(vp1=vp10)+n,jj=n; jj--;)
- {
- z = *vp;
- x = *vp1;
- *(vp1++) = x*c+z*s;
- *(vp++) = z*c-x*s;
- }
- z=PYTHAG(f,h);
- wmat[j]=z;
- if (z)
- {
- z=1.0/z;
- c=f*z;
- s=h*z;
- }
- f=c*g+s*y;
- x=c*y-s*g;
- for (ap=(ap1=ap10)+m,jj=m; jj--;)
- {
- z = *ap;
- y = *ap1;
- *(ap1++) = y*c+z*s;
- *(ap++) = z*c-y*s;
- }
- }
- rv1[l]=0.0;
- rv1[k]=f;
- wmat[k]=x;
- }
- }
-
- wmax=0.0;
- w = wmat;
- for (j=n;j--; w++)
- if (*w > wmax)
- wmax=*w;
- thresh=TOL*wmax;
- w = wmat;
- for (j=n;j--; w++)
- if (*w < thresh)
- *w = 0.0;
-
- w = wmat;
- ap = a;
- tmpp = tmp;
- for (j=n; j--; w++)
- {
- s=0.0;
- if (*w)
- {
- bp = b;
- for (i=m; i--;)
- s += *(ap++)**(bp++);
- s /= *w;
- }
- else
- ap += m;
- *(tmpp++) = s;
- }
-
- vp0 = vmat;
- for (j=0; j<n; j++,vp0++)
- {
- s=0.0;
- tmpp = tmp;
- for (vp=vp0,jj=n; jj--; vp+=n)
- s += *vp**(tmpp++);
- sol[j]=s;
- }
-
-/* Free temporary arrays */
- free(tmp);
- free(rv1);
-
- return;
- }
-
-#undef SIGN
-#undef MAX
-#undef PYTHAG
-#undef TOL
-
-/******************************** svdvar ************************************/
-/*
-Computation of the covariance matrix from the SVD vmat and wmat matrices.A
-dapted from Numerical Recipes in C, 2nd Ed. (p. 679).
-*/
-void svdvar(double *v, double *w, int n, double *cov)
- {
- static double wti[PSF_NTOT];
- double sum;
- int i,j,k;
-
- for (i=0; i<n; i++)
- wti[i] = w[i]? 1.0/(w[i]*w[i]) : 0.0;
-
- for (i=0; i<n; i++)
- for (j=0; j<=i; j++)
- {
- for (sum=0.0,k=0; k<n; k++)
- sum += v[k*n+i]*v[k*n+j]*wti[k];
- cov[j*n+i] = cov[i*n+j] = sum;
- }
-
- return;
- }
-
diff --git a/sextractor/src/psf.h b/sextractor/src/psf.h
deleted file mode 100644
index 5fe73e6..0000000
--- a/sextractor/src/psf.h
+++ /dev/null
@@ -1,130 +0,0 @@
- /*
- psf.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Authors: E.BERTIN (IAP)
-* P.DELORME (LAOG)
-*
-* Contents: Include file for psffit.c.
-*
-* Last modify: 12/01/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define PSF_MAXSHIFT 20.0 /* Max shift from initial guess (pixels)*/
-#define PSF_MINSHIFT 1e-3 /* Min shift from previous guess (pixels)*/
-#define PSF_NITER 20 /* Maximum number of iterations in fit */
-#define PSF_NA 3 /* Number of fitted parameters per component */
-#define PSF_NTOT (PSF_NA*PSF_NPSFMAX) /* Number of fitted parameters*/
-#define PSF_DOUBLETOT ((PSF_NA+1)*PSF_NPSFMAX)/* Nb of fitted parameters */
-#define PC_NITER 1 /* Maximum number of iterations in PC fit */
-
-/* NOTES:
-One must have: PSF_MAXSHIFT > 0.0
- PSF_NPSF >= 1
- PSF_NITER >= 1
-*/
-
-/*--------------------------- structure definitions -------------------------*/
-
-typedef struct code
- {
- float *pc;
- float **param;
- int *parammod;
- int ncode;
- int nparam;
- } codestruct;
-
-typedef struct pc
- {
- char name[MAXCHAR]; /* PC filename */
- int npc; /* Number of Principal Components */
- int maskdim; /* Dimensionality of the tabulated data */
- int *masksize; /* PC mask dimensions */
- int masknpix; /* Total number of involved PC pixels */
- float *maskcomp; /* Convolved pix data (principal components) */
- int omaskdim; /* Dimensionality of the tabulated data */
- int *omasksize; /* PC mask dimensions */
- int omasknpix; /* Total number of involved PC pixels */
- float *omaskcomp; /* Original pix data (principal components) */
- double *maskcurr; /* Current model */
- double *mx2,*my2,*mxy; /* 2nd order moments for each component */
- double *flux; /* Flux of each component */
- double *bt; /* B/T for each component */
- codestruct *code;
- } pcstruct;
-
-typedef struct
- {
- char name[MAXCHAR]; /* Name of the file containing the PSF data */
- int maskdim; /* Dimensionality of the tabulated data */
- int *masksize; /* PSF mask dimensions */
- int masknpix; /* Total number of involved PSF pixels */
- float *maskcomp; /* Complete pix. data (PSF components) */
- double *maskloc; /* Local PSF */
- double **context; /* Contexts */
- t_type *contexttyp; /* Context types */
- char **contextname; /* Array of context key-names */
- double *contextoffset; /* Offset to apply to context data */
- double *contextscale; /* Scaling to apply to context data */
- struct poly *poly; /* Polynom describing the PSF variations */
- pcstruct *pc; /* PC components */
- double fwhm; /* Typical PSF FWHM */
- float pixstep; /* PSF sampling step */
- } psfstruct;
-
-typedef struct
- {
- int niter; /* Number of iterations required */
- int npsf; /* Number of fitted stars for this detection */
- float *x,*y; /* Position derived from the PSF-fitting */
- float *flux; /* Flux derived from the PSF-fitting */
- } psfitstruct;
-
-/*----------------------------- Global variables ----------------------------*/
-psfstruct *psf,*ppsf,*thepsf;
-psfitstruct *thepsfit,*ppsfit,*psfit;
-PIXTYPE *checkmask;
-
-/*-------------------------------- functions --------------------------------*/
-extern void compute_pos(int *pnpsf,int *pconvflag,int *pnpsfflag,
- double radmin2, double radmax2,double r2, double *sol,
- double *flux , double *deltax,double *deltay,
- double *pdx,double *pdy),
- compute_pos_phot(int *pnpsf,double *sol,double *flux),
- compute_poserr(int j,double *var,double *sol,obj2struct *obj2,
- double *x2, double *y2,double *xy),
- psf_build(psfstruct *psf),
- psf_end(psfstruct *psf, psfitstruct *psfit),
- psf_init(psfstruct *psf),
- svdfit(double *a, double *b, int m, int n, double *sol,
- double *vmat, double *wmat),
- svdvar(double *vmat, double *wmat, int n, double *covmat);
-
-extern double *compute_gradient (double *weight,int width, int height,
- double *masks, double *maskx, double *masky,
- double *mat),
- *compute_gradient_phot(double *weight,int width, int height,
- double *masks, double *pm);
-
-extern psfstruct *psf_load(char *filename);
-
-extern void pc_end(pcstruct *pc),
- pc_fit(psfstruct *psf, double *data, double *weight,
- int width, int height, int ix, int iy, double dx, double dy,
- int npc, float backrms),
- double_psf_fit(psfstruct *psf, picstruct *field,
- picstruct *wfield, objstruct *obj,
- psfstruct *dpsf, picstruct *dfield, picstruct *dwfield),
- psf_fit(psfstruct *psf, picstruct *field, picstruct *wfield,
- objstruct *obj),
- psf_readcontext(psfstruct *psf, picstruct *field);
-
-extern pcstruct *pc_load(catstruct *cat);
diff --git a/sextractor/src/readimage.c b/sextractor/src/readimage.c
deleted file mode 100644
index 8c59f3a..0000000
--- a/sextractor/src/readimage.c
+++ /dev/null
@@ -1,872 +0,0 @@
-/*
- readimage.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions for input of image data.
-*
-* Last modify: 13/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "wcs/wcs.h"
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "check.h"
-#include "field.h"
-#include "fits/fitscat.h"
-#include "interpolate.h"
-#include "back.h"
-#include "astrom.h"
-#include "weight.h"
-#include "wcs/tnx.h"
-
-/******************************* loadstrip ***********************************/
-/*
-Load a new strip of pixel data into the buffer.
-*/
-void *loadstrip(picstruct *field, picstruct *wfield)
-
- {
- checkstruct *check;
- int y, w, flags, interpflag;
- PIXTYPE *data, *wdata, *rmsdata;
-
- w = field->width;
- flags = field->flags;
- interpflag = (wfield && wfield->interp_flag);
- wdata = NULL; /* To avoid gcc -Wall warnings */
-
- if (!field->y)
- {
-/*- First strip */
- int nbpix;
-
- nbpix = w*field->stripheight;
-
- if (flags ^ FLAG_FIELD)
- {
-/*---- Allocate space for the frame-buffer */
- if (!(field->strip=(PIXTYPE *)malloc(field->stripheight*field->width
- *sizeof(PIXTYPE))))
- error(EXIT_FAILURE,"Not enough memory for the image buffer of ",
- field->rfilename);
-
- data = field->strip;
-/*---- We assume weight data have been read just before */
- if (interpflag)
- wdata = wfield->strip;
- if (flags & BACKRMS_FIELD)
- for (y=0, rmsdata=data; y<field->stripheight; y++, rmsdata += w)
- backrmsline(field, y, rmsdata);
- else if (flags & INTERP_FIELD)
- copydata(field, 0, nbpix);
- else
- readdata(field, data, nbpix);
- if (flags & (WEIGHT_FIELD|RMS_FIELD|BACKRMS_FIELD|VAR_FIELD))
- weight_to_var(field, data, nbpix);
- if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_IDENTICAL]))
- writecheck(check, data, nbpix);
- for (y=0; y<field->stripheight; y++, data += w)
- {
-/*------ This is the only place where one can pick-up safely the current bkg */
- if (flags & (MEASURE_FIELD|DETECT_FIELD))
- subbackline(field, y, data);
-/*------ Go to interpolation process */
- if (interpflag)
- {
- interpolate(field,wfield, data, wdata);
- wdata += w;
- }
-/*------ Check-image stuff */
- if (prefs.check_flag)
- {
- if (flags & MEASURE_FIELD)
- {
- if ((check = prefs.check[CHECK_BACKGROUND]))
- writecheck(check, field->backline, w);
- if ((check = prefs.check[CHECK_SUBTRACTED]))
- writecheck(check, data, w);
- if ((check = prefs.check[CHECK_APERTURES]))
- writecheck(check, data, w);
- if ((check = prefs.check[CHECK_SUBPSFPROTOS]))
- writecheck(check, data, w);
- if ((check = prefs.check[CHECK_SUBPCPROTOS]))
- writecheck(check, data, w);
- }
- if ((flags&DETECT_FIELD) && (check=prefs.check[CHECK_BACKRMS]))
- {
- backrmsline(field, y, (PIXTYPE *)check->pix);
- writecheck(check, check->pix, w);
- }
- }
- }
- }
- else
- {
- if (!(field->fstrip=(FLAGTYPE *)malloc(field->stripheight*field->width
- *sizeof(FLAGTYPE))))
- error(EXIT_FAILURE,"Not enough memory for the flag buffer of ",
- field->rfilename);
- readidata(field, field->fstrip, nbpix);
- }
-
- field->ymax = field->stripheight;
- if (field->ymax < field->height)
- field->stripysclim = field->stripheight - field->stripmargin;
- }
- else
- {
-/*- other strips */
- if (flags ^ FLAG_FIELD)
- {
- data = field->strip + field->stripylim*w;
-/*---- We assume weight data have been read just before */
- if (interpflag)
- wdata = wfield->strip + field->stripylim*w;
-
-/*---- copy to Check-image the "oldest" line before it is replaced */
- if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_SUBOBJECTS]))
- writecheck(check, data, w);
-
- if (flags & BACKRMS_FIELD)
- backrmsline(field, field->ymax, data);
- else if (flags & INTERP_FIELD)
- copydata(field, field->stripylim*w, w);
- else
- readdata(field, data, w);
- if (flags & (WEIGHT_FIELD|RMS_FIELD|BACKRMS_FIELD|VAR_FIELD))
- weight_to_var(field, data, w);
-
- if ((flags & MEASURE_FIELD) && (check=prefs.check[CHECK_IDENTICAL]))
- writecheck(check, data, w);
-/*---- Interpolate and subtract the background at current line */
- if (flags & (MEASURE_FIELD|DETECT_FIELD))
- subbackline(field, field->ymax, data);
- if (interpflag)
- interpolate(field,wfield, data, wdata);
-/*---- Check-image stuff */
- if (prefs.check_flag)
- {
- if (flags & MEASURE_FIELD)
- {
- if ((check = prefs.check[CHECK_BACKGROUND]))
- writecheck(check, field->backline, w);
- if ((check = prefs.check[CHECK_SUBTRACTED]))
- writecheck(check, data, w);
- if ((check = prefs.check[CHECK_APERTURES]))
- writecheck(check, data, w);
- if ((check = prefs.check[CHECK_SUBPSFPROTOS]))
- writecheck(check, data, w);
- if ((check = prefs.check[CHECK_SUBPCPROTOS]))
- writecheck(check, data, w);
- }
- if ((flags&DETECT_FIELD) && (check=prefs.check[CHECK_BACKRMS]))
- {
- backrmsline(field, field->ymax, (PIXTYPE *)check->pix);
- writecheck(check, check->pix, w);
- }
- }
- }
- else
- readidata(field, field->fstrip + field->stripylim*w, w);
-
- field->stripylim = (++field->ymin)%field->stripheight;
- if ((++field->ymax)<field->height)
- field->stripysclim = (++field->stripysclim)%field->stripheight;
- }
-
- return (flags ^ FLAG_FIELD)?
- (void *)(field->strip + field->stripy*w)
- : (void *)(field->fstrip + field->stripy*w);
- }
-
-
-/******************************** copydata **********************************/
-/*
-Copy image data from one field to the other.
-*/
-void copydata(picstruct *field, int offset, int size)
- {
- memcpy(field->strip+offset, field->reffield->strip+offset,
- size*sizeof(PIXTYPE));
- return;
- }
-
-
-/******************************** readdata **********************************/
-/*
-read and convert input data stream in PIXTYPE (float) format.
-*/
-void readdata(picstruct *field, PIXTYPE *ptr, int size)
- {
- static char bufdata0[DATA_BUFSIZE];
- char *bufdata;
- short val16;
- int i, bowl, spoonful, npix, curval, dval;
- PIXTYPE bs,bz;
-
- bs = (PIXTYPE)field->bscale;
- bz = (PIXTYPE)field->bzero;
- switch(field->compress_type)
- {
-/*-- Uncompressed image */
- case ICOMPRESS_NONE:
- bowl = DATA_BUFSIZE/field->bytepix;
- spoonful = size<bowl?size:bowl;
- for(; size>0; size -= spoonful)
- {
- if (spoonful>size)
- spoonful = size;
- bufdata = bufdata0;
- QFREAD(bufdata, spoonful*field->bytepix, field->file,field->filename);
- switch(field->bitpix)
- {
- case BP_BYTE:
- if (field->bitsgn)
- for (i=spoonful; i--;)
- *(ptr++) = *(bufdata++)*bs + bz;
- else
- for (i=spoonful; i--;)
- *(ptr++) = *((unsigned char *)bufdata++)*bs + bz;
- break;
-
- case BP_SHORT:
- if (bswapflag)
- swapbytes(bufdata, 2, spoonful);
- if (field->bitsgn)
- for (i=spoonful; i--; bufdata += sizeof(short))
- *(ptr++) = *((short *)bufdata)*bs + bz;
- else
- for (i=spoonful; i--; bufdata += sizeof(USHORT))
- *(ptr++) = *((USHORT *)bufdata)*bs + bz;
- break;
-
- case BP_LONG:
- if (bswapflag)
- swapbytes(bufdata, 4, spoonful);
- if (field->bitsgn)
- for (i=spoonful; i--; bufdata += sizeof(LONG))
- *(ptr++) = *((LONG *)bufdata)*bs + bz;
- else
- for (i=spoonful; i--; bufdata += sizeof(ULONG))
- *(ptr++) = *((ULONG *)bufdata)*bs + bz;
- break;
-
- case BP_FLOAT:
- if (bswapflag)
- swapbytes(bufdata, 4, spoonful);
- for (i=spoonful; i--; bufdata += sizeof(float))
- *(ptr++) = *((float *)bufdata)*bs + bz;
- break;
-
- case BP_DOUBLE:
- if (bswapflag)
- swapbytes(bufdata, 8, spoonful);
- for (i=spoonful; i--; bufdata += sizeof(double))
- *(ptr++) = *((double *)bufdata)*bs + bz;
- break;
-
- default:
- error(EXIT_FAILURE,"*FATAL ERROR*: unknown BITPIX type in ",
- "readdata()");
- break;
- }
- }
- break;
-
-/*-- Compressed image */
- case ICOMPRESS_BASEBYTE:
- bufdata = field->compress_bufptr;
- curval = field->compress_curval;
- npix = field->compress_npix;
- while (size--)
- {
- if (!(npix--))
- {
- if (curval != field->compress_checkval)
- error(EXIT_FAILURE, "*Error*: invalid BASEBYTE checksum in ",
- field->filename);
- bufdata = field->compress_buf;
- QFREAD(bufdata, FBSIZE, field->file, field->filename);
- curval = 0;
- if (bswapflag)
- swapbytes(bufdata, 4, 1);
- field->compress_checkval = *((int *)bufdata);
- bufdata += 4;
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- npix = (int)(*((short *)bufdata))-1;
- bufdata+=2;
- }
- if ((dval=(int)*(bufdata++))==-128)
- {
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- memcpy(&val16, bufdata, 2);
- dval = (int)val16;
- if (dval==-32768)
- {
- bufdata += 2;
- if (bswapflag)
- swapbytes(bufdata, 4, 1);
- memcpy(&dval,bufdata,4);
- bufdata += 4;
- }
- else
- bufdata += 2;
- }
- *(ptr++) = dval*bs + bz;
- curval += dval;
- }
- field->compress_curval = curval;
- field->compress_bufptr = bufdata;
- field->compress_npix = npix;
- break;
-
- case ICOMPRESS_PREVPIX:
- bufdata = field->compress_bufptr;
- curval = field->compress_curval;
- npix = field->compress_npix;
- while (size--)
- {
- if (!(npix--))
- {
- if (curval != field->compress_checkval)
- error(EXIT_FAILURE, "*Error*: invalid PREV_PIX checksum in ",
- field->filename);
- bufdata = field->compress_buf;
- QFREAD(bufdata, FBSIZE, field->file, field->filename);
- if (bswapflag)
- swapbytes(bufdata, 2, 3);
- curval = (int)*(short *)bufdata;
- npix = (int)*(short *)(bufdata+=2)-1;
- field->compress_checkval = (int)(*(short *)(bufdata+=2));
- bufdata+=4;
- }
- if ((dval=(int)*(bufdata++))==-128)
- {
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- memcpy(&val16, bufdata, 2);
- curval = (int)val16;
- bufdata += 2;
- }
- else
- curval += dval;
- *(ptr++) = curval*bs + bz;
- }
- field->compress_curval = curval;
- field->compress_bufptr = bufdata;
- field->compress_npix = npix;
- break;
-
- default:
- error(EXIT_FAILURE,"*Internal Error*: unknown compression mode in ",
- "readdata()");
- }
-
- return;
- }
-
-
-/******************************** readidata *********************************/
-/*
-read and convert input data stream in FLAGTYPE (unsigned int) format.
-*/
-void readidata(picstruct *field, FLAGTYPE *ptr, int size)
- {
- static char bufdata0[DATA_BUFSIZE];
- char *bufdata;
- short val16;
- int i, bowl, spoonful, npix, curval, dval;
-
- switch(field->compress_type)
- {
-/*-- Uncompressed image */
- case ICOMPRESS_NONE:
- bowl = DATA_BUFSIZE/field->bytepix;
- spoonful = size<bowl?size:bowl;
- for(; size>0; size -= spoonful)
- {
- if (spoonful>size)
- spoonful = size;
- bufdata = bufdata0;
- QFREAD(bufdata, spoonful*field->bytepix, field->file, field->filename);
- switch(field->bitpix)
- {
- case BP_BYTE:
- for (i=spoonful; i--;)
- *(ptr++) = (FLAGTYPE)*((unsigned char *)bufdata++);
- break;
-
- case BP_SHORT:
- if (bswapflag)
- swapbytes(bufdata, 2, spoonful);
- for (i=spoonful; i--; bufdata += sizeof(USHORT))
- *(ptr++) = (FLAGTYPE)*((USHORT *)bufdata);
- break;
-
- case BP_LONG:
- if (bswapflag)
- swapbytes(bufdata, 4, spoonful);
- for (i=spoonful; i--; bufdata += sizeof(ULONG))
- *(ptr++) = (FLAGTYPE)*((ULONG *)bufdata);
- break;
-
- case BP_FLOAT:
- case BP_DOUBLE:
- error(EXIT_FAILURE,"*Error*: I was expecting integers in ",
- field->filename);
- break;
- default:
- error(EXIT_FAILURE,"*FATAL ERROR*: unknown BITPIX type in ",
- "readdata()");
- break;
- }
- }
- break;
-
-/*-- Compressed image */
- case ICOMPRESS_BASEBYTE:
- bufdata = field->compress_bufptr;
- curval = field->compress_curval;
- npix = field->compress_npix;
- while (size--)
- {
- if (!(npix--))
- {
- if (curval != field->compress_checkval)
- error(EXIT_FAILURE, "*Error*: invalid BASEBYTE checksum in ",
- field->filename);
- bufdata = field->compress_buf;
- QFREAD(bufdata, FBSIZE, field->file, field->filename);
- curval = 0;
- if (bswapflag)
- swapbytes(bufdata, 4, 1);
- field->compress_checkval = *((int *)bufdata);
- bufdata += 4;
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- npix = (int)(*((short *)bufdata))-1;
- bufdata+=2;
- }
- if ((dval=(int)*(bufdata++))==-128)
- {
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- memcpy(&val16, bufdata, 2);
- dval = (int)val16;
- if (dval==-32768)
- {
- bufdata += 2;
- if (bswapflag)
- swapbytes(bufdata, 4, 1);
- memcpy(&dval,bufdata,4);
- bufdata += 4;
- }
- else
- bufdata += 2;
- }
- *(ptr++) = (FLAGTYPE)dval;
- curval += dval;
- }
- field->compress_curval = curval;
- field->compress_bufptr = bufdata;
- field->compress_npix = npix;
- break;
-
- case ICOMPRESS_PREVPIX:
- bufdata = field->compress_bufptr;
- curval = field->compress_curval;
- npix = field->compress_npix;
- while (size--)
- {
- if (!(npix--))
- {
- if (curval != field->compress_checkval)
- error(EXIT_FAILURE, "*Error*: invalid PREV_PIX checksum in ",
- field->filename);
- bufdata = field->compress_buf;
- QFREAD(bufdata, FBSIZE, field->file, field->filename);
- if (bswapflag)
- swapbytes(bufdata, 2, 3);
- curval = (int)*(short *)bufdata;
- npix = (int)*(short *)(bufdata+=2)-1;
- field->compress_checkval = (int)(*(short *)(bufdata+=2));
- bufdata+=4;
- }
- if ((dval=(int)*(bufdata++))==-128)
- {
- if (bswapflag)
- swapbytes(bufdata, 2, 1);
- memcpy(&val16, bufdata, 2);
- curval = (int)val16;
- bufdata += 2;
- }
- else
- curval += dval;
- *(ptr++) = (FLAGTYPE)curval;
- }
- field->compress_curval = curval;
- field->compress_bufptr = bufdata;
- field->compress_npix = npix;
- break;
-
- default:
- error(EXIT_FAILURE,"*Internal Error*: unknown compression mode in ",
- "readdata()");
- }
-
- return;
- }
-
-
-/******************************* readimagehead *******************************/
-/*
-extract some data from the FITS-file header
-*/
-void readimagehead(picstruct *field)
- {
- int j,l, n;
- char wstr1[TNX_MAXCHARS], wstr2[TNX_MAXCHARS],
- st[80], str[80],
- *buf, *point;
-
-/* Open the file */
- if (!(field->file = fopen(field->filename, "rb")))
- error(EXIT_FAILURE,"*Error*: cannot open ", field->filename);
-/* Go directly to the right extension */
- if (field->mefpos)
- {
- QFSEEK(field->file, field->mefpos, SEEK_SET, field->filename);
- }
- buf = readfitshead(field->file, field->filename, &n);
- if(FITSTOI("NAXIS ", 0) < 2)
- error(EXIT_FAILURE, field->filename, " does NOT contain 2D-data!");
-
-/*---------------------------- Basic keywords ------------------------------*/
- field->bitpix = FITSTOI("BITPIX ", 0);
- if (field->bitpix != BP_BYTE
- && field->bitpix != BP_SHORT
- && field->bitpix != BP_LONG
- && field->bitpix != BP_FLOAT
- && field->bitpix != BP_DOUBLE)
- error(EXIT_FAILURE, "Sorry, I don't know that kind of data.", "");
-
- field->bytepix = (field->bitpix>0?field->bitpix:-field->bitpix)>>3;
- field->width = FITSTOI("NAXIS1 ", 0);
- field->height = FITSTOI("NAXIS2 ", 0);
- field->npix = (KINGSIZE_T)field->width*field->height;
- field->bscale = FITSTOF("BSCALE ", 1.0);
-
- field->bzero = FITSTOF("BZERO ", 0.0);
- field->bitsgn = FITSTOI("BITSGN ", 1);
- if (field->bitsgn && prefs.fitsunsigned_flag)
- field->bitsgn = 0;
-
- FITSTOS("OBJECT ", field->ident, "Unnamed");
-
-/*----------------------------- Compression --------------------------------*/
- if (fitsread(buf, "IMAGECOD", st, H_STRING, T_STRING)==RETURN_OK)
- {
- if (!strcmp(st, "NONE"))
- field->compress_type = ICOMPRESS_NONE;
- else if (!strcmp(st, "BASEBYTE"))
- field->compress_type = ICOMPRESS_BASEBYTE;
- else if (!strcmp(st, "PREV_PIX"))
- field->compress_type = ICOMPRESS_PREVPIX;
- else
- warning("Compression skipped: unknown IMAGECOD parameter:", st);
- }
-
-/*----------------------------- Astrometry ---------------------------------*/
-/* Presently, astrometry is done only on the measurement and detect images */
- if (field->flags&(MEASURE_FIELD|DETECT_FIELD))
- {
- astromstruct *as;
- double drota, s;
- int naxis;
-
- QCALLOC(as, astromstruct, 1);
- field->astrom = as;
-
- naxis = as->naxis = 2;
- for (l=0; l<naxis; l++)
- {
- sprintf(str, "CTYPE%-3d", l+1);
- FITSTOS(str, str, "");
- strncpy(as->ctype[l], str, 8);
- sprintf(str, "CUNIT%-3d", l+1);
- FITSTOS(str, str, "deg");
- strncpy(as->cunit[l], str, 32);
- sprintf(str, "CRVAL%-3d", l+1);
- as->crval[l] = FITSTOF(str, 0.0);
- sprintf(str, "CRPIX%-3d", l+1);
- as->crpix[l] = FITSTOF(str, 1.0);
- sprintf(str, "CDELT%-3d", l+1);
- as->cdelt[l] = FITSTOF(str, 1.0);
- if (fabs(as->cdelt[l]) < 1/BIG)
- error(EXIT_FAILURE, "*Error*: CDELT parameters out of range in ",
- field->filename);
- }
- if (fitsnfind(buf, "CD1_1", n))
- {
-/*---- If CD keywords exist, use them for the linear mapping terms... */
- for (l=0; l<naxis; l++)
- for (j=0; j<naxis; j++)
- {
- sprintf(str, "CD%d_%d", l+1, j+1);
- as->pc[l*naxis+j] = FITSTOF(str, l==j?1.0:0.0)/as->cdelt[l];
- }
- }
- else if (fitsnfind(buf, "PC001001", n))
-/*---- ...If PC keywords exist, use them for the linear mapping terms... */
- for (l=0; l<naxis; l++)
- for (j=0; j<naxis; j++)
- {
- sprintf(str, "PC%03d%03d", l+1, j+1);
- as->pc[l*naxis+j] = FITSTOF(str, l==j?1.0:0.0);
- }
- else
- {
-/*---- ...otherwise take the obsolete CROTA2 parameter */
- s = as->cdelt[1]/as->cdelt[0];
- drota = FITSTOF("CROTA2 ", 0.0);
- as->pc[3] = as->pc[0] = cos(drota*DEG);
- as->pc[1] = -(as->pc[2] = sin(drota*DEG));
- as->pc[1] *= s;
- as->pc[2] /= s;
- }
-
- QMALLOC(as->wcs, struct wcsprm, 1);
-/*-- Test if the WCS is recognized and a celestial pair is found */
- if (prefs.world_flag
- && !wcsset(as->naxis,(const char(*)[9])as->ctype, as->wcs)
- && as->wcs->flag<999)
- {
- char *pstr;
- double date;
- int biss, dpar[3];
-
- as->wcs_flag = 1;
-/*---- Coordinate reference frame */
-/*---- Search for an observation date expressed in Julian days */
- date = FITSTOF("MJD-OBS ", -1.0);
-/*---- Precession date (defined from Ephemerides du Bureau des Longitudes) */
-/*---- in Julian years from 2000.0 */
- if (date>0.0)
- as->equinox = 2000.0 - (MJD2000 - date)/365.25;
- else
- {
-/*------ Search for an observation date expressed in "civil" format */
- FITSTOS("DATE-OBS", str, "");
- if (*str)
- {
-/*-------- Decode DATE-OBS format: DD/MM/YY or YYYY-MM-DD */
- for (l=0; l<3 && (pstr = strtok(l?NULL:str,"/- ")); l++)
- dpar[l] = atoi(pstr);
- if (l<3 || !dpar[0] || !dpar[1] || !dpar[2])
- {
-/*---------- If DATE-OBS value corrupted or incomplete, assume 2000-1-1 */
- warning("Invalid DATE-OBS value in header: ", str);
- dpar[0] = 2000; dpar[1] = 1; dpar[2] = 1;
- }
- else if (strchr(str, '/') && dpar[0]<32 && dpar[2]<100)
- {
- j = dpar[0];
- dpar[0] = dpar[2]+1900;
- dpar[2] = j;
- }
-
- biss = (dpar[0]%4)?0:1;
-/*-------- Convert date to MJD */
- date = -678956 + (365*dpar[0]+dpar[0]/4) - biss
- + ((dpar[1]>2?((int)((dpar[1]+1)*30.6)-63+biss)
- :((dpar[1]-1)*(63+biss))/2) + dpar[2]);
- as->equinox = 2000.0 - (MJD2000 - date)/365.25;
- }
- else
-/*-------- Well if really no date is found */
- as->equinox = 2000.0;
- }
- if (field->flags&MEASURE_FIELD)
- prefs.epoch = as->equinox;
- FITSTOS("RADECSYS", str, as->equinox<1984.0?
- "FK4": (as->equinox<1999.9999? "FK5" : "ICRS"));
- if (!strcmp(str, "ICRS"))
- {
- as->radecsys = RDSYS_ICRS;
- as->equinox = FITSTOF("EQUINOX ", 2000.0);
- }
- else if (!strcmp(str, "FK5"))
- {
- as->radecsys = RDSYS_FK5;
- as->equinox = FITSTOF("EQUINOX ", FITSTOF("EPOCH ", 2000.0));
- if (field->flags&MEASURE_FIELD)
- sprintf(prefs.coosys, "eq_FK5");
- }
- else if (!strcmp(str, "FK4"))
- {
- if (as->equinox == 2000.0)
- as->equinox = FITSTOF("EQUINOX ", FITSTOF("EPOCH ", 1950.0));
- as->radecsys = RDSYS_FK4;
- warning("FK4 precession formulae not yet implemented:\n",
- " Astrometry may be slightly inaccurate");
- }
- else if (!strcmp(str, "FK4-NO-E"))
- {
- if (as->equinox == 2000.0)
- as->equinox = FITSTOF("EQUINOX ", FITSTOF("EPOCH ", 1950.0));
- as->radecsys = RDSYS_FK4_NO_E;
- warning("FK4 precession formulae not yet implemented:\n",
- " Astrometry may be slightly inaccurate");
- }
- else if (!strcmp(str, "GAPPT"))
- {
- as->radecsys = RDSYS_GAPPT;
- warning("GAPPT reference frame not yet implemented:\n",
- " Astrometry may be slightly inaccurate");
- }
- else
- {
- warning("Using ICRS instead of unknown astrometric reference frame: ",
- str);
- as->radecsys = RDSYS_ICRS;
- as->equinox = FITSTOF("EQUINOX ", 2000.0);
- }
-
-/*---- Projection parameters */
- if (!strcmp(as->wcs->pcode, "TNX"))
- {
-/*---- IRAF's TNX projection: decode these #$!?@#!! WAT parameters */
- if (fitsfind(buf, "WAT?????") != RETURN_ERROR)
- {
-/*-------- First we need to concatenate strings */
- pstr = wstr1;
- sprintf(str, "WAT1_001");
- for (j=2; fitsread(buf,str,pstr,H_STRINGS,T_STRING)==RETURN_OK; j++)
- {
- sprintf(str, "WAT1_%03d", j);
- pstr += strlen(pstr);
- }
- pstr = wstr2;
- sprintf(str, "WAT2_001");
- for (j=2; fitsread(buf,str,pstr,H_STRINGS,T_STRING)==RETURN_OK; j++)
- {
- sprintf(str, "WAT2_%03d", j);
- pstr += strlen(pstr);
- }
-/*-------- LONGPOLE defaulted to 180 deg if not found */
- if ((pstr = strstr(wstr1, "longpole"))
- || (pstr = strstr(wstr2, "longpole")))
- pstr = strpbrk(pstr, "1234567890-+.");
- as->longpole = pstr? atof(pstr) : 999.0;
- as->latpole = 999.0;
-/*-------- RO defaulted to 180/PI if not found */
- if ((pstr = strstr(wstr1, "ro"))
- || (pstr = strstr(wstr2, "ro")))
- pstr = strpbrk(pstr, "1234567890-+.");
- as->r0 = pstr? atof(pstr) : 0.0;
-/*-------- Read the remaining TNX parameters */
- if ((pstr = strstr(wstr1, "lngcor"))
- || (pstr = strstr(wstr2, "lngcor")))
- as->tnx_lngcor = read_tnxaxis(pstr);
- if (!as->tnx_lngcor)
- error(EXIT_FAILURE, "*Error*: incorrect TNX parameters in ",
- field->filename);
- if ((pstr = strstr(wstr1, "latcor"))
- || (pstr = strstr(wstr2, "latcor")))
- as->tnx_latcor = read_tnxaxis(pstr);
- if (!as->tnx_latcor)
- error(EXIT_FAILURE, "*Error*: incorrect TNX parameters in ",
- field->filename);
- }
- }
- else
- {
- as->longpole = FITSTOF("LONGPOLE", 999.0);
- as->latpole = FITSTOF("LATPOLE ", 999.0);
- if (fitsnfind(buf, "PROJP1 ", n))
- for (l=0; l<10; l++)
- {
- sprintf(str, "PROJP%-3d", l);
- as->projp[l] = FITSTOF(str, 0.0);
- }
- }
- }
- else
- {
-/*---- No need to keep memory allocated for a useless WCS structure */
- free(as->wcs);
- as->wcs_flag = 0;
- }
- }
-
-/*---------------------------------------------------------------------------*/
-
- field->fitshead = buf;
- field->fitsheadsize = n*FBSIZE;
-
- return;
- }
-
-
-/******************************* readfitshead ********************************/
-/*
-read data from the FITS-file header
-*/
-char *readfitshead(FILE *file, char *filename, int *nblock)
-
- {
- int n;
- char *buf;
-
- if (!(buf=(char *)malloc((size_t)FBSIZE)))
- error(EXIT_FAILURE, "*Error*: Not enough memory in ", "readfitshead()");
-
-/* Find the number of FITS blocks of the header while reading it */
- QFREAD(buf, FBSIZE, file, filename);
-
- if (strncmp(buf, "SIMPLE ", 8))
- {
-/* Ugly but necessary patch to handle this stupid DeNIS compressed format! */
- if (strncmp(buf, "XTENSION", 8))
- error(EXIT_FAILURE, filename, " is NOT a FITS file!");
-/*
- else
- {
- memset(buf, ' ', 80);
- strncpy(buf,
- "SIMPLE = T / Decompressed by SExtractor", 59);
- }
-*/
- }
-
- for (n=1; !fitsnfind(buf,"END ", n); n++)
- {
- if (!(buf=(char *)realloc(buf, (size_t)(FBSIZE*(n+1)))))
- error(EXIT_FAILURE, "*Error*: Not enough memory in ", "readfitshead()");
- QFREAD(buf+n*FBSIZE, FBSIZE, file, filename);
- }
-
- *nblock = n;
- return buf;
- }
-
-
diff --git a/sextractor/src/refine.c b/sextractor/src/refine.c
deleted file mode 100644
index 4446210..0000000
--- a/sextractor/src/refine.c
+++ /dev/null
@@ -1,340 +0,0 @@
- /*
- refine.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions to refine extraction of objects.
-*
-* Last modify: 27/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "plist.h"
-#include "extract.h"
-
-#ifndef RAND_MAX
-#define RAND_MAX 2147483647
-#endif
-#define NSONMAX 1024 /* max. number per level */
-#define NBRANCH 16 /* starting number per branch */
-
-static objliststruct *objlist;
-static short *son, *ok;
-
-/******************************** parcelout **********************************
-PROTO parcelout(objliststruct *objlistin, objliststruct *objlistout)
-PURPOSE Divide a list of isophotal detections in several parts (deblending).
-INPUT input objlist,
- output objlist,
-OUTPUT RETURN_OK if success, RETURN_FATAL_ERROR otherwise (memory overflow).
-NOTES Even if the object is not deblended, the output objlist threshold is
- recomputed if a variable threshold is used.
-AUTHOR E. Bertin (IAP, Leiden & ESO)
-VERSION 15/03/98
- ***/
-int parcelout(objliststruct *objlistin, objliststruct *objlistout)
-
- {
- objstruct *obj;
- static objliststruct debobjlist, debobjlist2;
- double dthresh, dthresh0, value0;
- int h,i,j,k,l,m,
- xn,
- nbm = NBRANCH,
- out;
-
-
- out = RETURN_OK;
-
- xn = prefs.deblend_nthresh;
-
-/* ---- initialize lists of objects */
-
- debobjlist.obj = debobjlist2.obj = NULL;
- debobjlist.plist = debobjlist2.plist = NULL;
- debobjlist.nobj = debobjlist2.nobj = 0;
- debobjlist.npix = debobjlist2.npix = 0;
- objlistout->thresh = debobjlist2.thresh = objlistin->thresh;
- memset(objlist, 0, (size_t)xn*sizeof(objliststruct));
-
- for (l=0; l<objlistin->nobj && out==RETURN_OK; l++)
- {
- dthresh0 = objlistin->obj[l].dthresh;
-
- objlistout->dthresh = debobjlist2.dthresh = dthresh0;
- if ((out = addobj(l, objlistin, &objlist[0])) == RETURN_FATAL_ERROR)
- goto exit_parcelout;
- if ((out = addobj(l, objlistin, &debobjlist2)) == RETURN_FATAL_ERROR)
- goto exit_parcelout;
- value0 = objlist[0].obj[0].fdflux*prefs.deblend_mincont;
- ok[0] = (short)1;
- for (k=1; k<xn; k++)
- {
-/*------ Calculate threshold */
- dthresh = objlistin->obj[l].fdpeak;
- if (dthresh>0.0)
- {
- if (prefs.detect_type == PHOTO)
- debobjlist.dthresh= dthresh0 + (dthresh-dthresh0) * (double)k/xn;
- else
- debobjlist.dthresh = dthresh0 * pow(dthresh/dthresh0,(double)k/xn);
- }
- else
- debobjlist.dthresh = dthresh0;
-
-/*--------- Build tree (bottom->up) */
- if (objlist[k-1].nobj>=NSONMAX)
- {
- out = RETURN_FATAL_ERROR;
- goto exit_parcelout;
- }
-
- for (i=0; i<objlist[k-1].nobj; i++)
- {
- if ((out=lutz(objlistin,l,&objlist[k-1].obj[i], &debobjlist))
- ==RETURN_FATAL_ERROR)
- goto exit_parcelout;
-
- for (j=h=0; j<debobjlist.nobj; j++)
- if (belong(j, &debobjlist, i, &objlist[k-1]))
- {
- debobjlist.obj[j].dthresh = debobjlist.dthresh;
- m = addobj(j, &debobjlist, &objlist[k]);
- if (m==RETURN_FATAL_ERROR || m>=NSONMAX)
- {
- out = RETURN_FATAL_ERROR;
- goto exit_parcelout;
- }
- if (h>=nbm-1)
- if (!(son = (short *)realloc(son,
- xn*NSONMAX*(nbm+=16)*sizeof(short))))
- {
- out = RETURN_FATAL_ERROR;
- goto exit_parcelout;
- }
- son[k-1+xn*(i+NSONMAX*(h++))] = (short)m;
- ok[k+xn*m] = (short)1;
- }
- son[k-1+xn*(i+NSONMAX*h)] = (short)-1;
- }
- }
-
-/*------- cut the right branches (top->down) */
-
- for (k = xn-2; k>=0; k--)
- {
- obj = objlist[k+1].obj;
- for (i=0; i<objlist[k].nobj; i++)
- {
- for (m=h=0; (j=(int)son[k+xn*(i+NSONMAX*h)])!=-1; h++)
- {
- if (obj[j].fdflux - obj[j].dthresh*obj[j].fdnpix > value0)
- m++;
- ok[k+xn*i] &= ok[k+1+xn*j];
- }
- if (m>1)
- {
- for (h=0; (j=(int)son[k+xn*(i+NSONMAX*h)])!=-1; h++)
- if (ok[k+1+xn*j] && obj[j].fdflux-obj[j].dthresh*obj[j].fdnpix
- > value0)
- {
- objlist[k+1].obj[j].flag |= OBJ_MERGED /* Merge flag on */
- | ((OBJ_ISO_PB|OBJ_APERT_PB|OBJ_OVERFLOW)
- &debobjlist2.obj[0].flag);
- if ((out = addobj(j, &objlist[k+1], &debobjlist2))
- == RETURN_FATAL_ERROR)
- goto exit_parcelout;
- }
- ok[k+xn*i] = (short)0;
- }
- }
- }
-
- if (ok[0])
- out = addobj(0, &debobjlist2, objlistout);
- else
- out = gatherup(&debobjlist2, objlistout);
-
-exit_parcelout:
-
- free(debobjlist2.obj);
- free(debobjlist2.plist);
-
- for (k=0; k<xn; k++)
- {
- free(objlist[k].obj);
- free(objlist[k].plist);
- }
- }
-
- free(debobjlist.obj);
- free(debobjlist.plist);
-
- return out;
- }
-
-/******************************* allocparcelout ******************************/
-/*
-Allocate the memory allocated by global pointers in refine.c
-*/
-void allocparcelout(void)
- {
- QMALLOC(son, short, prefs.deblend_nthresh*NSONMAX*NBRANCH);
- QMALLOC(ok, short, prefs.deblend_nthresh*NSONMAX);
- QMALLOC(objlist, objliststruct, prefs.deblend_nthresh);
-
- return;
- }
-
-/******************************* freeparcelout *******************************/
-/*
-Free the memory allocated by global pointers in refine.c
-*/
-void freeparcelout(void)
- {
- QFREE(son);
- QFREE(ok);
- QFREE(objlist);
- return;
- }
-
-/********************************* gatherup **********************************/
-/*
-Collect faint remaining pixels and allocate them to their most probable
-progenitor.
-*/
-int gatherup(objliststruct *objlistin, objliststruct *objlistout)
-
- {
- char *bmp;
- float *amp, *p, dx,dy, drand, dist, distmin;
- objstruct *objin = objlistin->obj, *objout, *objt;
-
- pliststruct *pixelin = objlistin->plist, *pixelout, *pixt,*pixt2;
-
- int i,k,l, *n, iclst, npix, bmwidth,
- nobj = objlistin->nobj, xs,ys, x,y, out;
-
- out = RETURN_OK;
-
- objlistout->dthresh = objlistin->dthresh;
- objlistout->thresh = objlistin->thresh;
-
- QMALLOC(amp, float, nobj);
- QMALLOC(p, float, nobj);
- QMALLOC(n, int, nobj);
-
- for (i=1; i<nobj; i++)
- preanalyse(i, objlistin, ANALYSE_FULL);
-
- p[0] = 0.0;
- bmwidth = objin->xmax - (xs=objin->xmin) + 1;
- npix = bmwidth * (objin->ymax - (ys=objin->ymin) + 1);
- if (!(bmp = (char *)calloc(1, npix*sizeof(char))))
- {
- bmp = 0;
- out = RETURN_FATAL_ERROR;
- goto exit_gatherup;
- }
-
- for (objt = objin+(i=1); i<nobj; i++, objt++)
- {
-/*-- Now we have passed the deblending section, reset thresholds */
- objt->dthresh = objlistin->dthresh;
- objt->thresh = objlistin->thresh;
-
-/* ------------ flag pixels which are already allocated */
- for (pixt=pixelin+objin[i].firstpix; pixt>=pixelin;
- pixt=pixelin+PLIST(pixt,nextpix))
- bmp[(PLIST(pixt,x)-xs) + (PLIST(pixt,y)-ys)*bmwidth] = '\1';
-
- if ((n[i] = addobj(i, objlistin, objlistout)) == RETURN_FATAL_ERROR)
- {
- out = RETURN_FATAL_ERROR;
- goto exit_gatherup;
- }
- dist = objt->fdnpix/(2*PI*objt->abcor*objt->a*objt->b);
- amp[i] = dist<70.0? objt->thresh*exp(dist) : 4.0*objt->fdpeak;
-
-/* ------------ limitate expansion ! */
- if (amp[i]>4.0*objt->fdpeak)
- amp[i] = 4.0*objt->fdpeak;
- }
-
- objout = objlistout->obj; /* DO NOT MOVE !!! */
-
- if (!(pixelout=(pliststruct *)realloc(objlistout->plist,
- (objlistout->npix + npix)*plistsize)))
- {
- out = RETURN_FATAL_ERROR;
- goto exit_gatherup;
- }
-
- objlistout->plist = pixelout;
- k = objlistout->npix;
- iclst = 0; /* To avoid gcc -Wall warnings */
- for (pixt=pixelin+objin->firstpix; pixt>=pixelin;
- pixt=pixelin+PLIST(pixt,nextpix))
- {
- x = PLIST(pixt,x);
- y = PLIST(pixt,y);
- if (!bmp[(x-xs) + (y-ys)*bmwidth])
- {
- pixt2 = pixelout + (l=(k++*plistsize));
- memcpy(pixt2, pixt, (size_t)plistsize);
- PLIST(pixt2, nextpix) = -1;
- distmin = 1e+31;
- for (objt = objin+(i=1); i<nobj; i++, objt++)
- {
- dx = x - objt->mx;
- dy = y - objt->my;
- dist=0.5*(objt->cxx*dx*dx+objt->cyy*dy*dy+objt->cxy*dx*dy)/objt->abcor;
- p[i] = p[i-1] + (dist<70.0?amp[i]*exp(-dist) : 0.0);
- if (dist<distmin)
- {
- distmin = dist;
- iclst = i;
- }
- }
- if (p[nobj-1] > 1.0e-31)
- {
- drand = p[nobj-1]*rand()/RAND_MAX;
- for (i=1; p[i]<drand; i++);
- }
- else
- i = iclst;
- objout[n[i]].lastpix=PLIST(pixelout+objout[n[i]].lastpix,nextpix)=l;
- }
- }
-
- objlistout->npix = k;
- if (!(objlistout->plist = (pliststruct *)realloc(pixelout,
- objlistout->npix*plistsize)))
- error (-1, "Not enough memory to update pixel list in ", "gatherup()");
-
-exit_gatherup:
-
- free(bmp);
- free(amp);
- free(p);
- free(n);
-
- return out;
- }
-
diff --git a/sextractor/src/retina.c b/sextractor/src/retina.c
deleted file mode 100644
index 14ff941..0000000
--- a/sextractor/src/retina.c
+++ /dev/null
@@ -1,119 +0,0 @@
- /*
- retina.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions dealing with retinal analysis of the data.
-*
-* Last modify: 13/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "fits/fitscat.h"
-#include "bpro.h"
-#include "image.h"
-#include "retina.h"
-
-
-/******************************** readretina *********************************/
-/*
-Return the response of the retina at a given image position.
-*/
-float readretina(picstruct *field, retistruct *retina, float x, float y)
- {
- float *pix, resp, norm;
- int i, ix,iy;
-
- ix = (int)(x+0.499999);
- iy = (int)(y+0.499999);
- if (ix>=0 && ix<field->width && iy>=field->ymin && iy<field->ymax)
- norm = field->strip[ix+(iy%field->stripheight)*field->width];
- else
- norm = retina->minnorm;
- if (norm<retina->minnorm)
- norm = retina->minnorm;
-/* Copy the right pixels to the retina */
- pix = retina->pix;
- copyimage(field, pix, retina->width, retina->height, ix,iy);
- for (i=retina->npix; i--;)
- *(pix++) /= norm;
- *pix = -2.5*log10(norm/retina->minnorm);
- play_bpann(retina->bpann, retina->pix, &resp);
-
- return resp;
- }
-
-
-/********************************** getretina ********************************/
-/*
-Read an ANN retina file.
-*/
-retistruct *getretina(char *filename)
-
- {
-#define FILTEST(x) \
- if (x != RETURN_OK) \
- error(EXIT_FAILURE, "*Error*: RETINA header in ", filename)
-
- retistruct *retina;
- catstruct *fcat;
- tabstruct *ftab;
- int ival;
-
- QMALLOC(retina, retistruct, 1);
-/* We first map the catalog */
- if (!(fcat = read_cat(filename)))
- error(EXIT_FAILURE, "*Error*: retina file not found: ", filename);
-/* Test if the requested table is present */
- if (!(ftab = name_to_tab(fcat, "BP-ANN", 0)))
- error(EXIT_FAILURE, "*Error*: no BP-ANN info found in ", filename);
- FILTEST(fitsread(ftab->headbuf, "BPTYPE ", gstr,H_STRING,T_STRING));
- if (strcmp(gstr, "RETINA_2D"))
- error(EXIT_FAILURE, "*Error*: not a suitable retina in ", filename);
- FILTEST(fitsread(ftab->headbuf, "RENAXIS ", &ival ,H_INT, T_LONG));
- if (ival != 2)
- error(EXIT_FAILURE, "*Error*: not a 2D retina in ", filename);
- FILTEST(fitsread(ftab->headbuf, "RENAXIS1", &retina->width ,H_INT, T_LONG));
- FILTEST(fitsread(ftab->headbuf, "RENAXIS2", &retina->height ,H_INT, T_LONG));
- retina->npix = retina->width*retina->height;
- FILTEST(fitsread(ftab->headbuf, "RENORM ",&retina->minnorm,H_FLOAT,T_FLOAT));
- retina->bpann = loadtab_bpann(ftab, filename);
- QMALLOC(retina->pix, float, retina->bpann->nn[0]);
-
- close_cat(fcat);
- free_cat(&fcat,1);
-
- return retina;
- }
-
-
-/********************************** endretina ********************************/
-/*
-Free a retina structure.
-*/
-void endretina(retistruct *retina)
-
- {
- free(retina->pix);
- free_bpann(retina->bpann);
- free(retina);
-
- return;
- }
-
diff --git a/sextractor/src/retina.h b/sextractor/src/retina.h
deleted file mode 100644
index c95c25c..0000000
--- a/sextractor/src/retina.h
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- retina.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP & Leiden Sterrewacht.
-*
-* Contents: include file related to retina.c.
-*
-* Last modify: 07/12/96
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-/*------------------------------- structures --------------------------------*/
-
-typedef struct structreti
- {
-/*---- convolution */
- float *pix; /* Pointer to the copy of the pixel array */
- int width, height; /* x,y size of the mask */
- int npix; /* Number of pixels in the retina */
- float minnorm; /* Minimum normalisation factor */
- struct structbpann *bpann; /* The neural network */
- } retistruct;
-
-retistruct *theretina;
-
-/*------------------------------- functions ---------------------------------*/
-
-retistruct *getretina(char *filename);
-float readretina(picstruct *, retistruct *, float, float);
-void endretina(retistruct *retina);
-
diff --git a/sextractor/src/scan.c b/sextractor/src/scan.c
deleted file mode 100644
index 7987c7f..0000000
--- a/sextractor/src/scan.c
+++ /dev/null
@@ -1,954 +0,0 @@
- /*
- scan.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: functions for extraction of connected pixels from
-* a pixmap.
-*
-* Last modify: 29/11/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "back.h"
-#include "check.h"
-#include "clean.h"
-#include "extract.h"
-#include "filter.h"
-#include "image.h"
-#include "plist.h"
-
-/****************************** scanimage ************************************
-PROTO void scanimage(picstruct *field, picstruct *dfield, picstruct *ffield,
- picstruct *wfield, picstruct *dwfield)
-PURPOSE Scan of the large pixmap(s). Main loop and heart of the program.
-INPUT Measurement field pointer,
- Detection field pointer,
- Flag field pointer,
- Measurement weight-map field pointer,
- Detection weight-map field pointer,
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 29/11/2005
- ***/
-void scanimage(picstruct *field, picstruct *dfield, picstruct **pffield,
- int nffield, picstruct *wfield, picstruct *dwfield)
-
- {
- static infostruct curpixinfo, *info, *store,
- initinfo, freeinfo, *victim;
- picstruct *ffield;
- checkstruct *check;
- objliststruct objlist;
- objstruct *cleanobj;
- pliststruct *pixel, *pixt;
- picstruct *cfield, *cdwfield;
-
- char *marker, newmarker, *blankpad, *bpt,*bpt0;
- int co, i,j, flag, luflag,pstop, xl,xl2,yl, cn,
- nposize, stacksize, w, h, blankh, maxpixnb,
- varthreshflag;
- short trunflag;
- PIXTYPE thresh, relthresh, cdnewsymbol, cdvar,
- *scan,*dscan,*cdscan,*dwscan,*cdwscan,*cdwscanp,
- *scant, *wscan,*wscanp;
- FLAGTYPE *pfscan[MAXFLAG];
- status cs, ps, *psstack;
- int *start, *end, ymax;
-
-/* Avoid gcc -Wall warnings */
- scan = dscan = cdscan = cdwscan = cdwscanp = wscan = wscanp = NULL;
- victim = NULL; /* Avoid gcc -Wall warnings */
- blankh = 0; /* Avoid gcc -Wall warnings */
-/*----- Beginning of the main loop: Initialisations */
- thecat.ntotal = thecat.ndetect = 0;
-
-/* cfield is the detection field in any case */
- cfield = dfield? dfield:field;
-
-/* cdwfield is the detection weight-field if available */
- cdwfield = dwfield? dwfield:(prefs.dweight_flag?wfield:NULL);
-
-/* If WEIGHTing and no absolute thresholding, activate threshold scaling */
- varthreshflag = (cdwfield && prefs.thresh_type[0]!=THRESH_ABSOLUTE);
- relthresh = varthreshflag ? prefs.dthresh[0] : 0.0;/* To avoid gcc warnings*/
- w = cfield->width;
- h = cfield->height;
- objlist.dthresh = cfield->dthresh;
- objlist.thresh = cfield->thresh;
- cfield->yblank = 1;
- field->y = field->stripy = 0;
- field->ymin = field->stripylim = 0;
- field->stripysclim = 0;
- if (dfield)
- {
- dfield->y = dfield->stripy = 0;
- dfield->ymin = dfield->stripylim = 0;
- dfield->stripysclim = 0;
- }
- if (nffield)
- for (i=0; i<nffield; i++)
- {
- ffield = pffield[i];
- ffield->y = ffield->stripy = 0;
- ffield->ymin = ffield->stripylim = 0;
- ffield->stripysclim = 0;
- }
- if (wfield)
- {
- wfield->y = wfield->stripy = 0;
- wfield->ymin = wfield->stripylim = 0;
- wfield->stripysclim = 0;
- }
- if (dwfield)
- {
- dwfield->y = dwfield->stripy = 0;
- dwfield->ymin = dwfield->stripylim = 0;
- dwfield->stripysclim = 0;
- }
-
-/*Allocate memory for buffers */
- stacksize = w+1;
- QMALLOC(info, infostruct, stacksize);
- QMALLOC(store, infostruct, stacksize);
- QMALLOC(marker, char, stacksize);
- QMALLOC(dumscan, PIXTYPE, stacksize);
- QMALLOC(psstack, status, stacksize);
- QMALLOC(start, int, stacksize);
- QMALLOC(end, int, stacksize);
- blankpad = bpt = NULL;
- lutzalloc(w,h);
- allocparcelout();
- if (prefs.filter_flag)
- {
- QMALLOC(cdscan, PIXTYPE, stacksize);
- if (cdwfield)
- {
- QCALLOC(cdwscan, PIXTYPE, stacksize);
- if (PLISTEXIST(wflag))
- {
- QMALLOC(cdwscanp, PIXTYPE, stacksize);
- }
- }
-/*-- One needs a buffer to protect filtering if source-blanking applies */
- if (prefs.blank_flag)
- {
- blankh = thefilter->convh/2+1;
- QMALLOC(blankpad, char, w*blankh);
- cfield->yblank -= blankh;
- if (dfield)
- field->yblank = cfield->yblank;
- bpt = blankpad;
- }
- }
-
-/* Some initializations */
-
- thresh = objlist.dthresh;
- initinfo.pixnb = 0;
- initinfo.flag = 0;
- initinfo.firstpix = initinfo.lastpix = -1;
-
- for (xl=0; xl<stacksize; xl++)
- {
- marker[xl] = 0 ;
- dumscan[xl] = -BIG ;
- }
-
- co = pstop = 0;
- objlist.nobj = 1;
- curpixinfo.pixnb = 1;
-
-/* Init cleaning procedure */
- initclean();
-
-/*----- Allocate memory for the pixel list */
- init_plist();
-
- if (!(pixel = objlist.plist = malloc(nposize=prefs.mem_pixstack*plistsize)))
- error(EXIT_FAILURE, "Not enough memory to store the pixel stack:\n",
- " Try to decrease MEMORY_PIXSTACK");
-
-/*----- at the beginning, "free" object fills the whole pixel list */
- freeinfo.firstpix = 0;
- freeinfo.lastpix = nposize-plistsize;
- pixt = pixel;
- for (i=plistsize; i<nposize; i += plistsize, pixt += plistsize)
- PLIST(pixt, nextpix) = i;
- PLIST(pixt, nextpix) = -1;
-
-/*----- Here we go */
- for (yl=0; yl<=h;)
- {
- ps = COMPLETE;
- cs = NONOBJECT;
- if (yl==h)
- {
-/*---- Need an empty line for Lutz' algorithm to end gracely */
- if (prefs.filter_flag)
- {
- free(cdscan);
- if (cdwfield)
- {
- free(cdwscan);
- if (PLISTEXIST(wflag))
- free(cdwscanp);
- }
- }
- cdwscan = cdwscanp = cdscan = dumscan;
- }
- else
- {
- if (nffield)
- for (i=0; i<nffield; i++)
- {
- ffield = pffield[i];
- pfscan[i] = (ffield->stripy==ffield->stripysclim)?
- (FLAGTYPE *)loadstrip(ffield, (picstruct *)NULL)
- : &ffield->fstrip[ffield->stripy*ffield->width];
- }
- if (wfield)
- {
-/*------ Copy the previous weight line to track bad pixel limits */
- wscan = (wfield->stripy==wfield->stripysclim)?
- (PIXTYPE *)loadstrip(wfield, (picstruct *)NULL)
- : &wfield->strip[wfield->stripy*wfield->width];
- if (yl && PLISTEXIST(wflag))
- wscanp = &wfield->strip[((yl-1)%wfield->stripheight)*wfield->width];
- }
- else
- wscan = NULL;
- scan = (field->stripy==field->stripysclim)?
- (PIXTYPE *)loadstrip(field, wfield)
- : &field->strip[field->stripy*field->width];
- if (dwfield)
- dwscan = (dwfield->stripy==dwfield->stripysclim)?
- (PIXTYPE *)loadstrip(dwfield,
- dfield?(picstruct *)NULL:dwfield)
- : &dwfield->strip[dwfield->stripy*dwfield->width];
- else
- dwscan = wscan;
- if (dfield)
- dscan = (dfield->stripy==dfield->stripysclim)?
- (PIXTYPE *)loadstrip(dfield, dwfield)
- : &dfield->strip[dfield->stripy*dfield->width];
- else
- dscan = scan;
-
- if (PLISTEXIST(wflag) && cdwfield)
-/*------ Copy the previous filtered weight line to track bad pixel limits */
- memcpy(cdwscanp, cdwscan, wfield->width*sizeof(PIXTYPE));
- if (prefs.filter_flag)
- {
- filter(cfield, cdscan);
- if (cdwfield)
- filter(cdwfield, cdwscan);
- }
- else
- {
- cdscan = dscan;
- cdwscan = dwscan;
- }
-
- if ((check=prefs.check[CHECK_FILTERED]))
- writecheck(check, cdscan, w);
- }
-
- trunflag = (yl==0 || yl==h-1)? OBJ_TRUNC:0;
-
- for (xl=0; xl<=w; xl++)
- {
- if (xl == w)
- cdnewsymbol = -BIG;
- else
- cdnewsymbol = cdscan[xl];
-
- newmarker = marker[xl];
- marker[xl] = 0;
-
- curpixinfo.flag = trunflag;
- if (varthreshflag)
- thresh = relthresh*sqrt(cdvar = ((xl==w || yl==h)? 0.0:cdwscan[xl]));
- luflag = cdnewsymbol > thresh?1:0;
-
- if (luflag)
- {
- if (xl==0 || xl==w-1)
- curpixinfo.flag |= OBJ_TRUNC;
- pixt = pixel + (cn=freeinfo.firstpix);
- freeinfo.firstpix = PLIST(pixt, nextpix);
-
-/*------- Running out of pixels, the largest object becomes a "victim" ------*/
-
- if (freeinfo.firstpix==freeinfo.lastpix)
- {
- sprintf(gstr, "%d,%d", xl+1, yl+1);
- warning("Pixel stack overflow at position ", gstr);
- maxpixnb = 0;
- for (i=0; i<=w; i++)
- if (store[i].pixnb>maxpixnb)
- if (marker[i]=='S' || (newmarker=='S' && i==xl))
- {
- flag = 0;
- if (i<xl)
- for (j=0; j<=co; j++)
- flag |= (start[j]==i);
- if (!flag)
- maxpixnb = (victim = &store[i])->pixnb;
- }
- for (j=1; j<=co; j++)
- if (info[j].pixnb>maxpixnb)
- maxpixnb = (victim = &info[j])->pixnb;
-
- if (!maxpixnb)
- error(EXIT_FAILURE, "*Fatal Error*: something is badly bugged in ",
- "scanimage()!");
- if (maxpixnb <= 1)
- error(EXIT_FAILURE, "Pixel stack overflow in ", "scanimage()");
- freeinfo.firstpix = PLIST(pixel+victim->firstpix, nextpix);
- PLIST(pixel+victim->lastpix, nextpix) = freeinfo.lastpix;
- PLIST(pixel+(victim->lastpix=victim->firstpix), nextpix) = -1;
- victim->pixnb = 1;
- victim->flag |= OBJ_OVERFLOW;
- }
-
-/*---------------------------------------------------------------------------*/
- curpixinfo.lastpix = curpixinfo.firstpix = cn;
- PLIST(pixt, nextpix) = -1;
- PLIST(pixt, x) = xl;
- PLIST(pixt, y) = yl;
- PLIST(pixt, value) = scan[xl];
- if (PLISTEXIST(dvalue))
- PLISTPIX(pixt, dvalue) = dscan[xl];
- if (PLISTEXIST(cdvalue))
- PLISTPIX(pixt, cdvalue) = cdnewsymbol;
- if (PLISTEXIST(flag))
- for (i=0; i<nffield; i++)
- PLISTFLAG(pixt, flag[i]) = pfscan[i][xl];
- if (PLISTEXIST(wflag) && wscan)
- {
- PLISTFLAG(pixt, wflag) = 0;
- if (xl>0)
- {
- if (wscan[xl-1] >= BIG)
- PLISTFLAG(pixt, wflag) |= OBJ_WEIGHTZERO;
- if (cdwscan[xl-1] >= BIG)
- PLISTFLAG(pixt, wflag) = OBJ_DWEIGHTZERO;
- }
- PLISTFLAG(pixt, wflag) = 0;
- if (xl<w-1)
- {
- if (wscan[xl+1] >= BIG)
- PLISTFLAG(pixt, wflag) |= OBJ_WEIGHTZERO;
- if (cdwscan[xl+1] >= BIG)
- PLISTFLAG(pixt, wflag) = OBJ_DWEIGHTZERO;
- }
- if (yl>0)
- {
- if (wscanp[xl] >= BIG)
- PLISTFLAG(pixt, wflag) |= OBJ_WEIGHTZERO;
- if (cdwscanp[xl] >= BIG)
- PLISTFLAG(pixt, wflag) = OBJ_DWEIGHTZERO;
- }
- }
- if (PLISTEXIST(dthresh))
- PLISTPIX(pixt, dthresh) = thresh;
- if (PLISTEXIST(var))
- PLISTPIX(pixt, var) = wscan[xl];
-
- if (cs != OBJECT)
-/*------------------------------- Start Segment -----------------------------*/
-
- {
- cs = OBJECT;
- if (ps == OBJECT)
- {
- if (start[co] == UNKNOWN)
- {
- marker[xl] = 'S';
- start[co] = xl;
- }
- else
- marker[xl] = 's';
- }
- else
- {
- psstack[pstop++] = ps;
- marker[xl] = 'S';
- start[++co] = xl;
- ps = COMPLETE;
- info[co] = initinfo;
- }
- }
-
-/*---------------------------------------------------------------------------*/
- }
-
- if (newmarker)
-
-/*---------------------------- Process New Marker ---------------------------*/
-
- {
- if (newmarker == 'S')
- {
- psstack[pstop++] = ps;
- if (cs == NONOBJECT)
- {
- psstack[pstop++] = COMPLETE;
- info[++co] = store[xl];
- start[co] = UNKNOWN;
- }
- else
- update (&info[co],&store[xl], pixel);
- ps = OBJECT;
- }
- else if (newmarker == 's')
- {
- if ((cs == OBJECT) && (ps == COMPLETE))
- {
- pstop--;
- xl2 = start[co];
- update (&info[co-1],&info[co], pixel);
- if (start[--co] == UNKNOWN)
- start[co] = xl2;
- else
- marker[xl2] = 's';
- }
- ps = OBJECT;
- }
- else if (newmarker == 'f')
- ps = INCOMPLETE;
- else if (newmarker == 'F')
- {
- ps = psstack[--pstop];
- if ((cs == NONOBJECT) && (ps == COMPLETE))
- {
- if (start[co] == UNKNOWN)
- {
- if ((int)info[co].pixnb >= prefs.ext_minarea)
- {
- sortit(field, dfield, wfield, cdwfield, &info[co], &objlist,
- cdwscan, wscan);
- }
-/* ------------------------------------ free the chain-list */
-
- PLIST(pixel+info[co].lastpix, nextpix) = freeinfo.firstpix;
- freeinfo.firstpix = info[co].firstpix;
- }
- else
- {
- marker[end[co]] = 'F';
- store[start[co]] = info[co];
- }
- co--;
- ps = psstack[--pstop];
- }
- }
- }
-/*---------------------------------------------------------------------------*/
-
- if (luflag)
- update (&info[co],&curpixinfo, pixel);
- else
- {
- if (cs == OBJECT)
-/*-------------------------------- End Segment ------------------------------*/
- {
- cs = NONOBJECT;
- if (ps != COMPLETE)
- {
- marker[xl] = 'f';
- end[co] = xl;
- }
- else
- {
- ps = psstack[--pstop];
- marker[xl] = 'F';
- store[start[co]] = info[co];
- co--;
- }
- }
- }
-
- if (prefs.blank_flag && xl<w)
- {
- if (prefs.filter_flag)
- *(bpt++) = (luflag)?1:0;
- else if (luflag)
- dscan[xl] = -BIG;
- if (dfield && luflag)
- scan[xl] = -BIG;
- }
-/*--------------------- End of the loop over the x's -----------------------*/
- }
-
-/* Detected pixel removal at the end of each line */
- if (prefs.blank_flag && yl<h)
- {
- if (prefs.filter_flag)
- {
- bpt = bpt0 = blankpad + w*((yl+1)%blankh);
- if (cfield->yblank >= 0)
- {
- scant = &PIX(cfield, 0, cfield->yblank);
- for (i=w; i--; scant++)
- if (*(bpt++))
- *scant = -BIG;
- if (dfield)
- {
- bpt = bpt0;
- scant = &PIX(field, 0, cfield->yblank);
- for (i=w; i--; scant++)
- if (*(bpt++))
- *scant = -BIG;
- }
- bpt = bpt0;
- }
- }
- cfield->yblank++;
- if (dfield)
- field->yblank = cfield->yblank;
- }
-
-/*-- Prepare markers for the next line */
- yl++;
- field->stripy = (field->y=yl)%field->stripheight;
- if (dfield)
- dfield->stripy = (dfield->y=yl)%dfield->stripheight;
- if (nffield)
- for (i=0; i<nffield; i++)
- {
- ffield = pffield[i];
- ffield->stripy = (ffield->y=yl)%ffield->stripheight;
- }
- if (wfield)
- wfield->stripy = (wfield->y=yl)%wfield->stripheight;
- if (dwfield)
- dwfield->stripy = (dwfield->y=yl)%dwfield->stripheight;
-
-/*-- Remove objects close to the ymin limit if ymin is ready to increase */
- if (cfield->stripy==cfield->stripysclim)
- {
- cleanobj = cleanobjlist->obj+cleanobjlist->nobj-1;
- for (i=cleanobjlist->nobj; i--; cleanobj--)
- {
- if (cleanobj->ycmin <= cfield->ymin)
- {
-/*-------- Warn if there is a possibility for any aperture to be truncated */
- if ((ymax=cleanobj->ycmax) > cfield->ymax)
- {
- sprintf(gstr, "Object at position %.0f,%.0f ",
- cleanobj->mx+1, cleanobj->my+1);
- QWARNING(gstr, "may have some apertures truncated:\n"
- " You might want to increase MEMORY_BUFSIZE");
- }
- else if (ymax>cfield->yblank && prefs.blank_flag)
- {
- sprintf(gstr, "Object at position %.0f,%.0f ",
- cleanobj->mx+1, cleanobj->my+1);
- QWARNING(gstr, "may have some unBLANKed neighbours:\n"
- " You might want to increase MEMORY_PIXSTACK");
- }
- endobject(field, dfield, wfield, cdwfield, i, cleanobjlist);
- subcleanobj(i);
- cleanobj = cleanobjlist->obj+i; /* realloc in subcleanobj() */
- }
- }
- }
-
- if (!((yl+1)%16))
- NPRINTF(OUTPUT, "\33[1M> Line:%5d "
- "Objects: %8d detected / %8d sextracted\n\33[1A",
- yl+1, thecat.ndetect, thecat.ntotal);
-/*--------------------- End of the loop over the y's -----------------------*/
- }
-
-/* Removal or the remaining pixels */
- if (prefs.blank_flag && prefs.filter_flag && (cfield->yblank >= 0))
- for (j=blankh-1; j--; yl++)
- {
- bpt = bpt0 = blankpad + w*(yl%blankh);
- scant = &PIX(cfield, 0, cfield->yblank);
- for (i=w; i--; scant++)
- if (*(bpt++))
- *scant = -BIG;
- if (dfield)
- {
- bpt = bpt0;
- scant = &PIX(field, 0, cfield->yblank);
- for (i=w; i--; scant++)
- if (*(bpt++))
- *scant = -BIG;
- }
- cfield->yblank++;
- if (dfield)
- field->yblank = cfield->yblank;
- }
-
-/* Now that all "detected" pixels have been removed, analyse detections */
- for (j=cleanobjlist->nobj; j--;)
- {
- endobject(field, dfield, wfield, cdwfield, 0, cleanobjlist);
- subcleanobj(0);
- }
-
- endclean();
-
-/*Free memory */
- freeparcelout();
- free(pixel);
- lutzfree();
- free(info);
- free(store);
- free(marker);
- free(dumscan);
- free(psstack);
- free(start);
- free(end);
- if (prefs.blank_flag && prefs.filter_flag)
- free(blankpad);
-
- return;
- }
-
-
-/********************************* update ************************************/
-/*
-update object's properties each time one of its pixels is scanned by lutz()
-*/
-void update(infostruct *infoptr1, infostruct *infoptr2, pliststruct *pixel)
-
- {
- infoptr1->pixnb += infoptr2->pixnb;
- infoptr1->flag |= infoptr2->flag;
- if (infoptr1->firstpix == -1)
- {
- infoptr1->firstpix = infoptr2->firstpix;
- infoptr1->lastpix = infoptr2->lastpix;
- }
- else if (infoptr2->lastpix != -1)
- {
- PLIST(pixel+infoptr1->lastpix, nextpix) = infoptr2->firstpix;
- infoptr1->lastpix = infoptr2->lastpix;
- }
-
- return;
- }
-
-/********************************* sortit ************************************/
-/*
-build the object structure.
-*/
-void sortit(picstruct *field, picstruct *dfield, picstruct *wfield,
- picstruct *dwfield, infostruct *info, objliststruct *objlist,
- PIXTYPE *cdwscan, PIXTYPE *wscan)
-
- {
- picstruct *cfield;
- objliststruct objlistout, *objlist2;
- static objstruct obj;
- objstruct *cobj;
- pliststruct *pixel;
- int i,j,n;
-
- cfield = dfield? dfield: field;
-
- pixel = objlist->plist;
- objlistout.obj = NULL;
- objlistout.plist = NULL;
- objlistout.nobj = objlistout.npix = 0;
-
-/*----- Allocate memory to store object data */
-
- objlist->obj = &obj;
- objlist->nobj = 1;
-
- memset(&obj, 0, (size_t)sizeof(objstruct));
- objlist->npix = info->pixnb;
- obj.firstpix = info->firstpix;
- obj.lastpix = info->lastpix;
- obj.flag = info->flag;
- obj.dthresh = objlist->dthresh;
- obj.thresh = objlist->thresh;
-
- preanalyse(0, objlist, ANALYSE_FAST);
-
-/*----- Check if the current strip contains the lower isophote... */
- if ((int)obj.ymin < cfield->ymin)
- obj.flag |= OBJ_ISO_PB;
-
- if (!(obj.flag & OBJ_OVERFLOW) && (createsubmap(objlist, 0) == RETURN_OK))
- {
- if (parcelout(objlist, &objlistout) == RETURN_OK)
- objlist2 = &objlistout;
- else
- {
- objlist2 = objlist;
- for (i=0; i<objlist2->nobj; i++)
- objlist2->obj[i].flag |= OBJ_DOVERFLOW;
- sprintf(gstr, "%.0f,%.0f", obj.mx+1, obj.my+1);
- warning("Deblending overflow for detection at ", gstr);
- }
- free(obj.submap);
- }
- else
- objlist2 = objlist;
-
- for (i=0; i<objlist2->nobj; i++)
- {
- preanalyse(i, objlist2, ANALYSE_FULL|ANALYSE_ROBUST);
- analyse(field, dfield, i, objlist2);
- cobj = objlist2->obj + i;
- if (prefs.blank_flag)
- {
- if (createblank(objlist2,i) != RETURN_OK)
- {
-/*------ Not enough mem. for the BLANK vignet: flag the object now */
- cobj->flag |= OBJ_OVERFLOW;
- cobj->blank = cobj->dblank = NULL;
- sprintf(gstr, "%.0f,%.0f", cobj->mx+1, cobj->my+1);
- warning("Memory overflow during masking for detection at ", gstr);
- }
- }
-
- if ((n=cleanobjlist->nobj) >= prefs.clean_stacksize)
- {
- objstruct *cleanobj;
- int ymin, ymax, victim=0;
-
- ymin = 2000000000; /* No image is expected to be that tall ! */
- cleanobj = cleanobjlist->obj;
- for (j=0; j<n; j++, cleanobj++)
- if (cleanobj->ycmax < ymin)
- {
- victim = j;
- ymin = cleanobj->ycmax;
- }
-
-/*---- Warn if there is a possibility for any aperture to be truncated */
- if (field->ymax < field->height)
- {
- cleanobj = &cleanobjlist->obj[victim];
- if ((ymax=cleanobj->ycmax) > field->ymax)
- {
- sprintf(gstr, "Object at position %.0f,%.0f ",
- cleanobj->mx+1, cleanobj->my+1);
- QWARNING(gstr, "may have some apertures truncated:\n"
- " You might want to increase MEMORY_OBJSTACK");
- }
- else if (ymax>field->yblank && prefs.blank_flag)
- {
- sprintf(gstr, "Object at position %.0f,%.0f ",
- cleanobj->mx+1, cleanobj->my+1);
- QWARNING(gstr, "may have some unBLANKed neighbours\n"
- " You might want to increase MEMORY_OBJSTACK");
- }
- }
-
- endobject(field, dfield, wfield, dwfield, victim, cleanobjlist);
- subcleanobj(victim);
- }
-
-/* Only add the object if it is not swallowed by cleaning */
- if (!prefs.clean_flag || clean(field, dfield, i, objlist2))
- addcleanobj(cobj);
- }
-
- free(objlistout.plist);
- free(objlistout.obj);
-
- return;
- }
-
-
-/******************************** preanalyse *********************************
-PROTO void preanalyse(int no, objliststruct *objlist, int analyse_type)
-PURPOSE Compute basic image parameters from the pixel-list for each detection.
-INPUT objlist number,
- objlist pointer,
- analysis switch flag.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP & Leiden & ESO)
-VERSION 28/11/2003
- ***/
-void preanalyse(int no, objliststruct *objlist, int analyse_type)
-
- {
- objstruct *obj = &objlist->obj[no];
- pliststruct *pixel = objlist->plist, *pixt;
- PIXTYPE peak, cpeak, val, cval, minthresh, thresht;
- double thresh,thresh2, t1t2,darea,
- mx,my, mx2,my2,mxy, rv, tv,
- xm,ym, xm2,ym2,xym,
- temp,temp2, theta,pmx2,pmy2;
- int x, y, xmin,xmax, ymin,ymax,area2, fdnpix, dnpix;
-
-
-/*----- initialize stacks and bounds */
- thresh = obj->dthresh;
- if (PLISTEXIST(dthresh))
- minthresh = BIG;
- else
- minthresh = 0.0;
- fdnpix = dnpix = 0;
- rv = 0.0;
- peak = cpeak = -BIG;
- ymin = xmin = 2*MAXPICSIZE; /* to be really sure!! */
- ymax = xmax = 0;
-
-/*----- integrate results */
- for (pixt=pixel+obj->firstpix; pixt>=pixel; pixt=pixel+PLIST(pixt,nextpix))
- {
- x = PLIST(pixt, x);
- y = PLIST(pixt, y);
- val=PLISTPIX(pixt, dvalue);
- if (cpeak < (cval=PLISTPIX(pixt, cdvalue)))
- cpeak = cval;
- if (PLISTEXIST(dthresh) && (thresht=PLISTPIX(pixt, dthresh))<minthresh)
- minthresh = thresht;
- if (peak < val)
- peak = val;
- rv += cval;
- if (xmin > x)
- xmin = x;
- if (xmax < x)
- xmax = x;
- if (ymin > y)
- ymin = y;
- if (ymax < y)
- ymax = y;
- fdnpix++;
- }
-
- if (PLISTEXIST(dthresh))
- obj->dthresh = thresh = minthresh;
-
-/* copy some data to "obj" structure */
-
- obj->fdnpix = (LONG)fdnpix;
- obj->fdflux = (float)rv;
- obj->fdpeak = cpeak;
- obj->dpeak = peak;
- obj->xmin = xmin;
- obj->xmax = xmax;
- obj->ymin = ymin;
- obj->ymax = ymax;
-
- if (analyse_type & ANALYSE_FULL)
- {
- mx = my = tv = 0.0;
- mx2 = my2 = mxy = 0.0;
- thresh2 = (thresh + peak)/2.0;
- area2 = 0;
- for (pixt=pixel+obj->firstpix; pixt>=pixel; pixt=pixel+PLIST(pixt,nextpix))
- {
- x = PLIST(pixt,x)-xmin; /* avoid roundoff errors on big images */
- y = PLIST(pixt,y)-ymin; /* avoid roundoff errors on big images */
- cval = PLISTPIX(pixt, cdvalue);
- tv += (val = PLISTPIX(pixt, dvalue));
- if (val>thresh)
- dnpix++;
- if (val > thresh2)
- area2++;
- mx += cval * x;
- my += cval * y;
- mx2 += cval * x*x;
- my2 += cval * y*y;
- mxy += cval * x*y;
- }
-
-/*----- compute object's properties */
- xm = mx / rv; /* mean x */
- ym = my / rv; /* mean y */
-
-/*-- In case of blending, use previous barycenters */
- if ((analyse_type&ANALYSE_ROBUST) && (obj->flag&OBJ_MERGED))
- {
- double xn,yn;
-
- xn = obj->mx-xmin;
- yn = obj->my-ymin;
- xm2 = mx2 / rv + xn*xn - 2*xm*xn;
- ym2 = my2 / rv + yn*yn - 2*ym*yn;
- xym = mxy / rv + xn*yn - xm*yn - xn*ym;
- xm = xn;
- ym = yn;
- }
- else
- {
- xm2 = mx2 / rv - xm * xm; /* variance of x */
- ym2 = my2 / rv - ym * ym; /* variance of y */
- xym = mxy / rv - xm * ym; /* covariance */
- }
-
-/* Handle fully correlated x/y (which cause a singularity...) */
- if ((temp2=xm2*ym2-xym*xym)<0.00694)
- {
- xm2 += 0.0833333;
- ym2 += 0.0833333;
- temp2 = xm2*ym2-xym*xym;
- obj->singuflag = 1;
- }
- else
- obj->singuflag = 0;
-
- if ((fabs(temp=xm2-ym2)) > 0.0)
- theta = atan2(2.0 * xym,temp) / 2.0;
- else
- theta = PI/4.0;
-
- temp = sqrt(0.25*temp*temp+xym*xym);
- pmy2 = pmx2 = 0.5*(xm2+ym2);
- pmx2+=temp;
- pmy2-=temp;
-
- obj->dnpix = (obj->flag & OBJ_OVERFLOW)? obj->fdnpix:(LONG)dnpix;
- obj->dflux = tv;
- obj->mx = xm+xmin; /* add back xmin */
- obj->my = ym+ymin; /* add back ymin */
- obj->mx2 = xm2;
- obj->my2 = ym2;
- obj->mxy = xym;
- obj->a = (float)sqrt(pmx2);
- obj->b = (float)sqrt(pmy2);
- obj->theta = theta*180.0/PI;
-
- obj->cxx = (float)(ym2/temp2);
- obj->cyy = (float)(xm2/temp2);
- obj->cxy = (float)(-2*xym/temp2);
-
- darea = (double)area2 - dnpix;
- t1t2 = thresh/thresh2;
- if (t1t2>0.0 && !prefs.dweight_flag)
- {
- obj->abcor = (darea<0.0?darea:-1.0)/(2*PI*log(t1t2<1.0?t1t2:0.99)
- *obj->a*obj->b);
- if (obj->abcor>1.0)
- obj->abcor = 1.0;
- }
- else
- obj->abcor = 1.0;
- }
-
- return;
- }
-
diff --git a/sextractor/src/sexhead.h b/sextractor/src/sexhead.h
deleted file mode 100644
index 9ee0114..0000000
--- a/sextractor/src/sexhead.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- sexhead.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: header structure and templates for catalog data.
-*
-* Last modify: 13/12/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-keystruct headkey[] = {
- {"FITSFILE", "File name of the analysed image",
- thecat.image_name, H_STRING, T_STRING, "%-18s"},
- {"FITSEXT ", "FITS Extension number",
- &thecat.currext, H_INT, T_LONG, "%3d"},
- {"FITSNEXT", "Number of FITS image extensions in file",
- &thecat.next, H_INT, T_LONG, "3d"},
- {"SEXVERS ", "Extraction software",
- thecat.soft_name, H_STRING, T_STRING, "%-18s"},
- {"SEXDATE ", "Extraction date",
- thecat.ext_date, H_STRING, T_STRING, "%-18s"},
- {"SEXTIME ", "Extraction time",
- thecat.ext_time, H_STRING, T_STRING, "%-18s"},
- {"SEXELAPS", "Elapsed time during extraction (s)",
- &thecat.ext_elapsed, H_FLOAT, T_DOUBLE, "%7.1f"},
- {"SEXBKGND", "Median background level (ADU)",
- &thefield1.backmean, H_EXPO, T_FLOAT, "%-13G"},
- {"SEXBKDEV", "Median background RMS (ADU)",
- &thefield1.backsig, H_EXPO, T_FLOAT, "%-13G"},
- {"SEXTHLD ", "Extraction threshold (ADU)",
- &thefield2.dthresh, H_EXPO, T_FLOAT, "%-15G"},
- {"SEXATHLD", "Analysis threshold (ADU)",
- &thefield1.thresh, H_EXPO, T_FLOAT, "%-15G"},
- {"SEXNDET ", "Number of raw detections",
- &thecat.ndetect, H_INT, T_LONG, "%9d"},
- {"SEXNFIN ", "Final number of extracted sources",
- &thecat.ntotal, H_INT, T_LONG, "%9d"},
- {"SEXNPARA", "Number of parameters per source",
- &thecat.nparam, H_INT, T_LONG, "%3d"},
- {"SEXPXSCL", "Pixel scale used for measurements (arcsec)",
- &thefield1.pixscale, H_EXPO, T_DOUBLE, "%-15G"},
- {"SEXSFWHM", "Source FWHM used for measurements (arcsec)",
- &prefs.seeing_fwhm, H_EXPO, T_DOUBLE, "%-13G"},
- {"SEXNNWF ", "S/G classification NNW filename",
- thecat.nnw_name, H_STRING, T_STRING, "%-18s"},
- {"SEXGAIN ", "Gain used (e-/ADU)",
- &prefs.gain, H_EXPO, T_DOUBLE, "%6.2f"},
- {"SEXFLTR ", "Detection filtering activated (flag)",
- &prefs.filter_flag, H_BOOL, T_LONG, "%1s"},
- {"SEXFILTN", "Filter filename",
- thecat.filter_name, H_STRING, T_STRING, "%-18s"},
-/*
- {"SEXDETT ", "Detection type",
- &prefs.detect_type, H_STRING, T_STRING, "%-18s"},
-*/
- {"SEXMINAR", "Minimum area used for detection (pixels)",
- &prefs.ext_minarea, H_INT, T_LONG, "%5d"},
- {"SEXDBLDN", "Number of deblending thresholds",
- &prefs.deblend_nthresh, H_INT, T_LONG, "%3d"},
- {"SEXDBLDC", "Minimum contrast used for deblending",
- &prefs.deblend_mincont, H_FLOAT, T_DOUBLE, "%8f"},
- {"SEXCLN ", "Cleaning activated (flag)",
- &prefs.clean_flag, H_BOOL, T_LONG, "%1s"},
- {"SEXCLNPA", "Cleaning parameter",
- &prefs.clean_param, H_FLOAT, T_DOUBLE, "%5.2f"},
- {"SEXCLNST", "Cleaning stack-size",
- &prefs.clean_stacksize, H_INT, T_LONG, "%6d"},
- {"SEXAPED1", "Fixed photometric aperture #1 (pixels)",
- &prefs.apert[0], H_FLOAT, T_DOUBLE, "%7.1f"},
- {"SEXAPED2", "Fixed photometric aperture #2 (pixels)",
- &prefs.apert[1], H_FLOAT, T_DOUBLE, "%7.1f"},
- {"SEXAPED3", "Fixed photometric aperture #3 (pixels)",
- &prefs.apert[2], H_FLOAT, T_DOUBLE, "%7.1f"},
- {"SEXAPED4", "Fixed photometric aperture #4 (pixels)",
- &prefs.apert[3], H_FLOAT, T_DOUBLE, "%7.1f"},
- {"SEXAUTP1", "Parameter #1 used for automatic magnitudes",
- &prefs.autoparam[0], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXAUTP2", "Parameter #2 used for automatic magnitudes",
- &prefs.autoparam[1], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXPETP1", "Parameter #1 used for Petronsian magnitudes",
- &prefs.autoparam[0], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXPETP2", "Parameter #2 used for Petrosian magnitudes",
- &prefs.autoparam[1], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXSATLV", "Saturation level used for flagging (ADU)",
- &prefs.satur_level, H_EXPO, T_DOUBLE, "%-13G"},
- {"SEXMGZPT", "Zero-point used for magnitudes",
- &prefs.mag_zeropoint, H_FLOAT, T_DOUBLE, "%8.4f"},
- {"SEXMGGAM", "Gamma used for photographic photometry",
- &prefs.mag_gamma, H_FLOAT, T_DOUBLE, "%4.2f"},
- {"SEXBKGSX", "Mesh width used for background mapping (pixels)",
- &thefield1.backw, H_INT, T_LONG, "%5d"},
- {"SEXBKGSY", "Mesh height used for background mapping (pixels)",
- &thefield1.backh, H_INT, T_LONG, "%5d"},
- {"SEXBKGFX", "Mask width used for background map filtering",
- &thefield1.nbackfx, H_INT, T_LONG, "%3d"},
- {"SEXBKGFY", "Mask height used for background map filtering",
- &thefield1.nbackfy, H_INT, T_LONG, "%3d"},
-/*
- {"SEXPBKGT", "Background type for photometry",
- &prefs.pback_type, H_STRING, T_STRING, "-18s"},
-*/
- {"SEXPBKGS", "Thickness used for local background (pixels)",
- &prefs.pback_size, H_INT, T_LONG, "%3d"},
- {"SEXPIXSK", "Pixel stack-size (pixels)",
- &prefs.mem_pixstack, H_INT, T_LONG, "%8d"},
- {"SEXFBUFS", "Image-buffer height (scanlines)",
- &prefs.mem_bufsize, H_INT, T_LONG, "%5d"},
- {"SEXMWSCL", "Measurement-weight re-scaling factor",
- &thewfield1.sigfac, H_EXPO, T_FLOAT, "%-13G"},
- {"SEXDWSCL", "Detection-weight re-scaling factor",
- &thewfield2.sigfac, H_EXPO, T_FLOAT, "%-13G"},
- {""}};
-
diff --git a/sextractor/src/sexhead1.h b/sextractor/src/sexhead1.h
deleted file mode 100644
index 7ec3732..0000000
--- a/sextractor/src/sexhead1.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- sexhead1.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: header (FITS format #1) and templates for catalog data.
-*
-* Last modify: 16/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-
-int idummy;
-double ddummy;
-
-keystruct headkey1[] = {
- {"EPOCH ", "",
- &thefield1.epoch, H_FLOAT, T_DOUBLE, "%7.2f"},
- {"OBJECT ", "",
- thefield1.ident, H_STRING, T_STRING, "%18s"},
- {"ORIGIN ", "",
- "SExtractor", H_STRING, T_STRING, "%18s"},
- {"CRVAL1", "WORLD X COORD. OF REFERENCE PIXEL",
- &ddummy, H_EXPO, T_DOUBLE, "%15G"},
- {"CRVAL2", "WORLD Y COORD. OF REFERENCE PIXEL",
- &ddummy, H_EXPO, T_DOUBLE, "%15G"},
- {"CRPIX1", "IMAGE X COORD. OF REFERENCE PIXEL",
- &idummy, H_INT, T_LONG, "%5d"},
- {"CRPIX2", "IMAGE Y COORD. OF REFERENCE PIXEL",
- &idummy, H_INT, T_LONG, "%5d"},
- {"CDELT1", "WORLD PIXEL STEP ALONG X",
- &ddummy, H_EXPO, T_DOUBLE, "%15G"},
- {"CDELT2", "WORLD PIXEL STEP ALONG Y",
- &ddummy, H_EXPO, T_DOUBLE, "%15G"},
- {"CROTA1", "CCW ANGLE FROM X-IMAGE TO X-WORLD",
- &ddummy, H_EXPO, T_DOUBLE, "%15G"},
- {"CROTA2", "CCW ANGLE FROM Y-IMAGE TO Y-WORLD",
- &ddummy, H_EXPO, T_DOUBLE, "%15G"},
- {"FITSFILE", "File name of the analysed image",
- thecat.image_name, H_STRING, T_STRING, "%-18s"},
- {"FITSEXT ", "FITS Extension number",
- &thecat.currext, H_INT, T_LONG, "%3d"},
- {"FITSNEXT", "Number of FITS image extensions in file",
- &thecat.next, H_INT, T_LONG, "3d"},
- {"SEXIMASX", "IMAGE WIDTH (PIXELS)",
- &thefield1.width, H_INT, T_LONG, "%10d"},
- {"SEXIMASY", "IMAGE HEIGHT (PIXELS)",
- &thefield1.height, H_INT, T_LONG, "%10d"},
- {"SEXSTRSY", "STRIP HEIGHT (LINES)",
- &thefield1.stripheight, H_INT, T_LONG, "%10d"},
- {"SEXIMABP", "FITS IMAGE BITPIX",
- &thefield1.bitpix, H_INT, T_LONG, "%3d"},
- {"SEXPIXS", "PIXEL SCALE (ARCSEC)",
- &thefield1.pixscale, H_EXPO, T_DOUBLE, "%12G"},
- {"SEXSFWHM", "SEEING FWHM (ARCSEC)",
- &prefs.seeing_fwhm, H_EXPO, T_DOUBLE, "%12G"},
- {"SEXNNWF ", "CLASSIFICATION NNW FILENAME",
- thecat.nnw_name, H_STRING, T_STRING, "%18s"},
- {"SEXGAIN ", "GAIN (IN E- PER ADU)",
- &prefs.gain, H_EXPO, T_DOUBLE, "%7.3F"},
- {"SEXBKGND", "MEDIAN BACKGROUND (ADU)",
- &thefield1.backmean, H_EXPO, T_FLOAT, "%12G"},
- {"SEXBKDEV", "MEDIAN RMS (ADU)",
- &thefield1.backsig, H_EXPO, T_FLOAT, "%12G"},
- {"SEXBKTHD", "EXTRACTION THRESHOLD (ADU)",
- &thefield2.thresh, H_EXPO, T_FLOAT, "%12G"},
- {"SEXCONFF", "CONFIGURATION FILENAME",
- thecat.prefs_name, H_STRING, T_STRING, "%18s"},
- {"SEXDETT ", "DETECTION TYPE",
- "CCD", H_STRING, T_STRING, "%s"},
- {"SEXTHLDT", "THRESHOLD TYPE",
- "SIGMA", H_STRING, T_STRING, "%s"},
- {"SEXTHLD ", "THRESHOLD",
- &prefs.dthresh[0], H_EXPO, T_DOUBLE, "%12G"},
- {"SEXMINAR", "EXTRACTION MINIMUM AREA (PIXELS)",
- &prefs.ext_minarea, H_INT, T_LONG, "%6d"},
- {"SEXCONV ", "CONVOLUTION FLAG",
- &prefs.filter_flag, H_BOOL, T_LONG, "%1s"},
- {"SEXCONVN", "CONVOLUTION NORM. FLAG",
- &prefs.filter_flag, H_BOOL, T_LONG, "%1s"},
- {"SEXCONVF", "CONVOLUTION FILENAME",
- thecat.filter_name, H_STRING, T_STRING, "%18s"},
- {"SEXDBLDN", "NUMBER OF SUB-THRESHOLDS",
- &prefs.deblend_nthresh, H_INT, T_LONG, "%3d"},
- {"SEXDBLDC", "CONTRAST PARAMETER",
- &prefs.deblend_mincont, H_FLOAT, T_DOUBLE, "%8f"},
- {"SEXCLN ", "CLEANING FLAG",
- &prefs.clean_flag, H_BOOL, T_LONG, "%1s"},
- {"SEXCLNPA", "CLEANING PARAMETER",
- &prefs.clean_param, H_FLOAT, T_DOUBLE, "%8f"},
- {"SEXCLNST", "CLEANING OBJECT-STACK",
- &prefs.deblend_nthresh, H_INT, T_LONG, "%6d"},
- {"SEXAPERD", "APERTURE DIAMETER (PIXELS)",
- &prefs.apert[0], H_INT, T_LONG, "%7.1f"},
- {"SEXAPEK1", "KRON PARAMETER",
- &prefs.autoparam[0], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXAPEK2", "KRON ANALYSIS RADIUS",
- &prefs.autoparam[0], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXAPEK3", "KRON MINIMUM RADIUS",
- &prefs.autoparam[1], H_FLOAT, T_DOUBLE, "%4.1f"},
- {"SEXSATLV", "SATURATION LEVEL (ADU)",
- &prefs.satur_level, H_EXPO, T_DOUBLE, "%12G"},
- {"SEXMGZPT", "MAGNITUDE ZERO-POINT",
- &prefs.mag_zeropoint, H_FLOAT, T_DOUBLE, "%8.4f"},
- {"SEXMGGAM", "MAGNITUDE GAMMA",
- &prefs.mag_gamma, H_FLOAT, T_DOUBLE, "%4.2f"},
- {"SEXBKGSX", "BACKGROUND MESH WIDTH (PIXELS)",
- &thefield1.backw, H_INT, T_LONG, "%5d"},
- {"SEXBKGSY", "BACKGROUND MESH HEIGHT (PIXELS)",
- &thefield1.backh, H_INT, T_LONG, "%5d"},
- {"SEXBKGFX", "BACKGROUND FILTER WIDTH",
- &thefield1.nbackfx, H_INT, T_LONG, "%3d"},
- {"SEXBKGFY", "BACKGROUND FILTER HEIGHT",
- &thefield1.nbackfy, H_INT, T_LONG, "%3d"},
- {"SEXPBKGT", "PHOTOM BACKGROUND TYPE",
- "GLOBAL", H_STRING, T_STRING, "%s"},
- {"SEXPBKGS", "LOCAL AREA THICKNESS (PIXELS)",
- &prefs.pback_size, H_INT, T_LONG, "%3d"},
- {"SEXPIXSK", "PIXEL STACKSIZE (PIXELS)",
- &prefs.mem_pixstack, H_INT, T_LONG, "%8d"},
- {"SEXFBUFS", "FRAME-BUFFER SIZE (LINES)",
- &prefs.mem_bufsize, H_INT, T_LONG, "%5d"},
- {"SEXISAPR", "ISO-APER RATIO",
- &ddummy, H_FLOAT, T_DOUBLE, "%4.2f"},
- {"SEXNDET ", "NB OF DETECTIONS",
- &thecat.ndetect, H_INT, T_LONG, "%9d"},
- {"SEXNFIN ", "NB OF FINAL EXTRACTED OBJECTS",
- &thecat.ntotal, H_INT, T_LONG, "%9d"},
- {"SEXNPARA", "NB OF PARAMETERS PER OBJECT",
- &thecat.nparam, H_INT, T_LONG, "%3d"},
- {""}};
-
diff --git a/sextractor/src/sexheadsc.h b/sextractor/src/sexheadsc.h
deleted file mode 100644
index 3d9a828..0000000
--- a/sextractor/src/sexheadsc.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- sexheadsc.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, DeNIS/LDAC.
-*
-* Contents: header structure and templates for SkyCat output.
-*
-* Last modify: 02/09/97
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-char skycathead[] = "QueryResult\n\n"
- "# Config entry for original catalog server:\n"
- "serv_type: catalog\n"
- "long_name: SExtractor catalog\n"
- "short_name: SExCat\n"
- "symbol: id diamond %4.1f\n"
- "# End config entry\n\n"
- "id\tra\tdec\tmag";
-
-char skycattail[] = "[EOD]";
-
diff --git a/sextractor/src/som.c b/sextractor/src/som.c
deleted file mode 100644
index e77e29d..0000000
--- a/sextractor/src/som.c
+++ /dev/null
@@ -1,692 +0,0 @@
- /*
- som.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using neural networks.
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Implementation of Kohonen's Self Organizing Map (V3.0).
-*
-* Last modify: 28/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "fits/fitscat.h"
-#include "prefs.h"
-#include "som.h"
-
-/********************************* som_phot **********************************/
-/*
-Perform SOM-fitting on a detected source: returns node number of the
-best-fitting prototype.
-*/
-void som_phot(somstruct *som, float back, float backnoise, float gain,
- float dx0, float dy0, float *vector, float clip)
- {
- float err, errmin, *xnt;
- int i,j,nd,jmin, *nx, *mul;
-
- nd = som->neurdim;
-/* First we compute the error map */
- if (clip!=0.0)
- if (!som_mkweight(som, back, backnoise, gain))
- {
-/*---- If all weights to zero, don't go further! */
- som->stderror = -1.0;
- som->amp = som->sigamp = 0.0;
- if (vector)
- {
- xnt = som->vector;
- for (i=nd; i--;)
- *(vector++) = 99.0;
- }
- return;
- }
-
-/* Use a sound starting point for the gradient search */
-/*
- i = nd-1;
- som->vector[i--] = (dy0+0.5)*som->neursize[i]+0.4999;
- som->vector[i] = (dx0+0.5)*som->neursize[i]+0.4999;
- while (i--)
- som->vector[i] = (som->neursize[i]-1)/2.0;
-*/
- errmin=BIG;
- jmin = 0;
- for (j=0; j<som->nneur; j++)
- {
- if ((err=som_err(som, (float)j, SOM_NODE))<errmin)
- {
- errmin = err;
- jmin = j;
- }
- }
-
- mul = som->neurstep;
- nx = som->neursize;
- xnt = som->vector;
- for (i=nd; i--;)
- *(xnt++) = (float)((jmin/(*(mul++)))%(*(nx++)));
-
-/* Gradient search */
- som_conjgrad(som, 1e-6);
-/* Now perform the true photometry */
- som->stderror = (float)sqrt(som_err(som, 0.0, SOM_PHOTOM));
-
-/* Store final position vector if requested */
- if (vector)
- {
- xnt = som->vector;
- for (i=nd; i--;)
- *(vector++) = *(xnt++);
- }
-
- if (clip>0.0)
- {
-/*-- Clip deviant pixels if requested */
- float *input, *inputw, *proto, diff;
-
- proto = som->proto;
- input = som->input;
- inputw = som->inputw;
- for (i=som->ninput-som->nextrainput;i--; inputw++)
- {
- diff = *(input++)-*(proto++);
- if (*inputw>0.0 && (diff*diff>clip/(*inputw)))
- *inputw /= clip;
- }
- }
-
- return;
- }
-
-
-/****************************** som_mkweight *********************************/
-/*
-Compute weights associated to pixels in a vignet.
-*/
-int som_mkweight(somstruct *som, float back, float backnoise, float gain)
- {
- float *yt, *wt, wstiff, pix, llim,hlim;
- int i, nima, ngood;
-
- yt = som->input;
- wt = som->inputw;
- nima = som->ninput-som->nextrainput;
- llim = -5.0*backnoise;
- hlim = prefs.satur_level-back;
- backnoise *= backnoise;
- ngood = 0;
- for (i=nima; i--;)
- {
- pix = *(yt++);
-/*-- look if pixel is in the "reasonable" range */
- if (pix>llim && pix<hlim)
- {
- *(wt++) = 1/((pix>0.0?pix/gain:0.0)+backnoise);
- ngood++;
- }
- else
- *(wt++) = 0.0;
- }
-
- wstiff = 1/(som->xy_stiff*som->xy_stiff);
- for (i=som->nextrainput; i--;)
- *(wt++) = wstiff;
- return ngood;
- }
-
-
-/********************************** som_err **********************************/
-/*
-Return the reduced RMS error at some (non-integer) position in the SOM.
-1 degree of freedom is left: the amplitude of the prototype.
-*/
-float som_err(somstruct *som, float dist, int flags)
- {
- static float dx[SOM_MAXDIM];
- double s,sx,sxx,sy,syy,sxy,b,err,ds;
- float *psft, *dxt, *wt,*xt,*yt,xi,yi,wi,wxi,wyi, diff,dd;
- int i,j,k,n, nd, *nx, *mult, ix, pos,post, nima;
-
- yt = NULL; /* To avoid gcc -Wall warnings */
- n = nd = pos = 0; /* To avoid gcc -Wall warnings */
-/* Is the requested position lying on a node? */
- if (flags & SOM_NODE)
-/*-- Yes: just use the prototype at that node */
- xt = som->weight+som->ninput*(int)dist;
- else
- {
-/*-- ...No: compute offsets and fractional parts for each dimension */
- nd = som->neurdim;
- nx = som->neursize;
- xt = som->vector;
- if (flags & SOM_LINE)
- yt = som->dvector;
- pos = 0;
- dxt = dx;
- mult = som->neurstep;
-
- for (i=nd; i--; nx++)
- {
- xi = *(xt++);
- if (flags & SOM_LINE)
- xi += dist**(yt++);
- ix = (int)xi;
- if (ix<0)
- ix = 0;
- else if (ix>=*nx-1)
- ix = *nx-2;
- if (ix<0)
- {
- ix = 0;
- *(dxt++) = 0.0;
- }
- else
- *(dxt++) = xi - ix;
- pos += ix**(mult++);
- }
-
- memset(som->proto, 0, som->ninput*sizeof(float));
- n = 1<<nd; /* OK until the SOM has less than 32 dimensions... */
- for (j=0; j<n; j++)
- {
- post = pos;
- dd = 1.0;
- dxt = dx;
- nx = som->neursize;
- mult = som->neurstep;
- for (i=0; i<nd; mult++, nx++)
- {
- if (((1<<(i++)) & j) && *nx>1)
- {
- post += *mult;
- dd *= *(dxt++);
- }
- else
- dd *= (1-*(dxt++));
- }
- psft = som->proto;
- wt = som->weight + som->ninput*post;
- for (i=som->ninput; i--;)
- *(psft++) += dd**(wt++);
- }
- xt = som->proto;
- }
-
- yt = som->input;
- wt = som->inputw;
- nima = som->ninput-som->nextrainput;
-
-/* Test if we need to derive photometry, or just compute the error */
- if (flags & SOM_PHOTOM)
- {
-/*-- Yes: photometry */
- s = sx = sy = sxx = syy = sxy = 0.0;
- for (i=nima; i--;)
- {
- s += (wi = *(wt++));
- sx += (wxi = wi*(xi=*(xt++)));
- sxx += wxi*xi;
- sy += (wyi = wi*(yi=*(yt++)));
- syy += wyi*yi;
- sxy += wxi*yi;
- }
-
-/*-- First, the error from the image-fitting */
- som->amp = b = sxy/sxx;
- err = nima*(b*b*sxx + syy - 2.0*b*sxy)/s;
-/*
- err = (syy - b*sxy)/(nima-1);
-*/
- som->sigamp = sqrt(err*s/(s*sxx-sx*sx));
-
-/*-- Second, the error of non-pixel parameters */
- for (i=som->nextrainput; i--;)
- {
- diff = *(yt++) - *(xt++);
- err += (diff*diff*(double)*(wt++))/(double)som->nextrainput;
- }
- }
- else
- {
-/*-- No: just an estimate of error */
- sxx = sxy = 0.0;
- for (i=nima; i--;)
- {
- sxy += (wxi = *(wt++)*(xi=*(xt++)))**(yt++);
- sxx += wxi*xi;
- }
-
-/*-- First, the error from the image-fitting */
- err = -sxy*sxy/sxx/(nima-1);
-
-/*-- Second, the error of non-pixel parameters */
- for (i=som->nextrainput; i--;)
- {
- diff = *(yt++) - *(xt++);
- err += (diff*diff*(double)*(wt++))/(double)som->nextrainput;
- }
- }
-
-/* Compute error gradients if requested */
- if (flags & SOM_GRADIENT)
- {
- for (k=0; k<nd; k++)
- {
- memset(som->dproto, 0, som->ninput*sizeof(float));
- for (j=0; j<n; j++)
- {
- dd = 1.0;
- post = pos;
- dxt = dx;
- mult = som->neurstep;
- nx = som->neursize;
- for (i=0; i<nd; mult++, dxt++, nx++)
- {
- if (((1<<i) & j) && *nx>1)
- {
- post += *mult;
- if ((i++)!=k)
- dd *= *dxt;
- }
- else
- dd *= ((i++)==k ? (*nx>1?-1.0:0.0) : (1-*dxt));
- }
- psft = som->dproto;
- wt = som->weight + som->ninput*post;
- for (i=som->ninput; i--;)
- *(psft++) += dd**(wt++);
- }
- ds = 0.0;
- psft = som->dproto;
- xt = som->proto;
- yt = som->input;
- wt = som->inputw;
- for (i=nima; i--;)
- ds += *(wt++)*(sxy**(xt++)-sxx**(yt++))**(psft++);
- ds *= 2*sxy/(sxx*sxx)/(nima-1);
- for (i=som->nextrainput; i--;)
- ds += 2**(wt++)**(psft++)*(*(xt++)-*(yt++))/(double)som->nextrainput;
- som->dvector[k] = (float)ds;
- }
- }
-
- return (float)err;
- }
-
-
-/******************************** som_linmin *********************************/
-/*
-Perform minimisation through line-search using two routines from Numerical
-Recipes in C: mnbrak() and brent() (pp. 297 and 301).
-*/
-
-#define SHFT(a,b,c,d) {(a)=(b);(b)=(c);(c)=(d);} /* For line-search */
-#define SIGN(a,b) ((b)>0.0? fabs(a) : -fabs(a)) /* For line-search */
-
-#define GOLD 1.6180340 /* Golden section for line-search */
-#define CGOLD 0.3819660 /* Complement to the golden section */
-#define TINY 1e-20 /* Almost nothing */
-#define GLIMIT 100.0 /* Max. magnification in line-search */
-#define ITMAX 100 /* Max. nb of iter. in line-search */
-#define TOL 1e-1 /* Fract. tolerance in line-search */
-
-float som_linmin(somstruct *som)
- {
- float ax,bx,cx, fa,fb,fc, u,r,q,fu,dum,ulim, qmr, a,b,d,e,etemp,
- fv,fw,fx, p, tol1,tol2,v,w,x,xm, *vt,*dvt;
- int i,iter;
-
-/* Normalize the gradient */
-/*
- dvt = som->dvector;
- for (i=som->neurdim; i--; dvt++)
- dum += *dvt**dvt;
- if (dum>0.0)
- {
- dum = sqrt(dum);
- dvt = som->dvector;
- for (i=som->neurdim; i--;)
- *(dvt++) /= dum;
- }
-*/
- d = 0.0; /* To avoid gcc -Wall warnings */
-/* Begin by bracketing a minimum of the function */
- ax = 0.0; /* Initial guesses */
- bx = 1.0;
- if ((fb=som_err(som, bx, SOM_LINE)) > (fa=som_err(som, ax, SOM_LINE)))
- {
- SHFT(dum, ax, bx, dum);
- SHFT(dum, fb, fa, dum);
- }
- fc = som_err(som, cx = bx+GOLD*(bx-ax), SOM_LINE);
- while (fb > fc)
- {
- r = (bx-ax)*(fb-fc);
- q = (bx-cx)*(fb-fa);
- if (fabs(qmr = q-r)<TINY)
- qmr = qmr>0.0?TINY:-TINY;
- u = bx-((bx-cx)*q - (bx-ax)*r) / (2.0*qmr);
- ulim= bx + GLIMIT*(cx-bx);
- if ((bx-u)*(u-cx) > 0.0)
- {
- if ((fu=som_err(som, u, SOM_LINE)) < fc)
- {
- ax = bx;
- bx = u;
- fa = fb;
- fb = fu;
- break;
- }
- else if (fu > fb)
- {
- cx = u;
- fc = fu;
- break;
- }
- fu = som_err(som, u = cx + GOLD*(cx-bx), SOM_LINE);
- }
- else if ((cx-u)*(u-ulim) > 0.0)
- {
- if ((fu=som_err(som, u, SOM_LINE)) < fc)
- {
- SHFT(bx, cx, u, cx+GOLD*(cx-bx));
- SHFT(fb, fc, fu, som_err(som, u, SOM_LINE));
- }
- }
- else if ((u-ulim)*(ulim-cx) >= 0.0)
- fu = som_err(som, u=ulim, SOM_LINE);
- else
- fu = som_err(som, u = cx + GOLD*(cx-bx), SOM_LINE);
- SHFT(ax, bx, cx, u);
- SHFT(fa, fb, fc, fu);
- }
-
-/* Now we step to Brent's algorithm for finding the minimum */
- e = 0.0;
- a = (ax < cx) ? ax : cx;
- b = (ax > cx) ? ax : cx;
- x = w = v = bx;
- fw = fv = fx = som_err(som, x, SOM_LINE);
- for (iter=ITMAX; iter--;)
- {
- xm = 0.5*(a+b);
- tol2 = 2 * (tol1=TOL*fabs(x)+TINY);
- if (fabs(x-xm) <= (tol2-0.5*(b-a)))
- goto linmin_end;
- if (fabs(e) > tol1)
- {
- r = (x-w) * (fx-fv);
- q = (x-v) * (fx-fw);
- p = (x-v)*q - (x-w)*r;
- q = 2*(q-r);
- if (q > 0.0)
- p = -p;
- q = fabs(q);
- etemp = e;
- e = d;
- if (fabs(p) >= fabs(0.5*q*etemp) || p <= q*(a-x) || p >= q*(b-x))
- d = CGOLD*(e=(x >= xm ? a-x : b-x));
- else
- {
- d = p/q;
- u = x+d;
- if (u-a < tol2 || b-u < tol2)
- d = SIGN(tol1,xm-x);
- }
- }
- else
- d = CGOLD*(e=(x >= xm ? a-x : b-x));
- u = (fabs(d) >= tol1 ? x+d : x+SIGN(tol1,d));
- if ((fu=som_err(som, u, SOM_LINE)) <= fx)
- {
- if (u >= x)
- a = x;
- else
- b = x;
- SHFT(v, w, x, u);
- SHFT(fv, fw, fx, fu);
- }
- else
- {
- if (u < x)
- a = u;
- else
- b = u;
- if (fu <= fw || w == x)
- {
- v = w;
- w = u;
- fv = fw;
- fw = fu;
- }
- else if (fu <= fv || v == x || v == w)
- {
- v = u;
- fv = fu;
- }
- }
- }
-
- warning("Too many iterations in ", "som_linmin()");
-
-/* Finally we set the SOM vector to the new minimum */
-linmin_end:
- vt = som->vector;
- dvt = som->dvector;
- for (i=som->neurdim; i--;)
- *(vt++) += x**(dvt++);
-
- return fx;
- }
-
-#undef SHFT
-#undef SIGN
-#undef GOLD
-#undef CGOLD
-#undef TINY
-#undef GLIMIT
-#undef ITMAX
-#undef TOL
-
-/******************************** som_conjgrad *******************************/
-/*
-Perform Polak-Ribiere minimization (adapted from Numerical Recipes in C,p.432).
-*/
-
-#define ITMAX 100
-#define EPS 1.0e-10
-
-void som_conjgrad(somstruct *som, float ftol)
- {
- static float g[SOM_MAXDIM], h[SOM_MAXDIM];
- int j, nd, its;
- float *xi, *xit,*gt,*ht,tmp,tmp2,
- gg,gam,fp,fret,dgg;
-
- nd = som->neurdim;
- xi = som->dvector;
- fp = som_err(som, 0.0, SOM_GRADIENT);
- gt = g;
- xit = xi;
- ht = h;
- for (j=nd;j--;)
- tmp = -*xit, *(xit++) = *(ht++)= *(gt++) = tmp;
- for (its=ITMAX;its--;)
- {
- fret = som_linmin(som);
- if (2.0*fabs(fret-fp) <= ftol*(fabs(fret)+fabs(fp)+EPS))
- return;
- fp=som_err(som, 0.0, SOM_GRADIENT);
- dgg=gg=0.0;
- gt = g;
- xit = xi;
- for (j=nd;j--; xit++)
- {
- gg += *gt**gt;
- dgg += (*xit+*(gt++))**xit;
- }
- if (gg == 0.0)
- return;
- gam=dgg/gg;
- gt = g;
- xit = xi;
- ht = h;
- for (j=nd;j--;)
- tmp = -*xit,tmp2 = *ht, *(xit++) = *(ht++) = (*(gt++) = tmp) + gam*tmp2;
- }
- warning("Too many iterations during SOM-Fitting","");
- }
-
-#undef ITMAX
-#undef EPS
-
-/********************************* som_end ***********************************/
-/*
-Terminate SOM.
-*/
-void som_end(somstruct *som)
- {
-/* Free memory*/
- free(som->weight);
- free(som->input);
- free(som->inputw);
- free(som->proto);
- free(som->dproto);
- free(som->vector);
- free(som->dvector);
- free(som->freq);
- free(som->inputsize);
- free(som->neursize);
- free(som->neurstep);
- free(som);
-
-/* locals */
-
- return;
- }
-
-
-/********************************* som_load **********************************/
-/*
-Read the SOM weights in a FITS file.
-*/
-somstruct *som_load(char *filename)
- {
- somstruct *som;
- catstruct *cat;
- tabstruct *tab;
- keystruct *key;
- char *head, str[80];
- int i;
-
-/* Open the cat (well it is not a "cat", but simply a FITS file */
- if (!(cat = read_cat(filename)))
- error(EXIT_FAILURE, "*Error*: SOM file not found: ", filename);
-
- if (!(tab = name_to_tab(cat, "SOM", 0)))
- error(EXIT_FAILURE, "*Error*: SOM table not found in catalog ",
- filename);
-
-/* OK, we now allocate memory for the SOM structure itself */
- QCALLOC(som, somstruct, 1);
-
-/* Load important scalars (which are stored as FITS keywords) */
- head = tab->headbuf;
-
-/* Dimensionality of the input */
- if (fitsread(head, "INPNAXIS", &som->inputdim, H_INT, T_LONG) != RETURN_OK)
- goto headerror;
- if (som->inputdim>INPUT_MAXDIM)
- {
- sprintf(str, "%d", INPUT_MAXDIM);
- error(EXIT_FAILURE, "*Error*: This package is presently limited to inputs"
- "with dimensionality less or equal to ", str);
- }
- QMALLOC(som->inputsize, int, INPUT_MAXDIM);
- for (i=0; i<INPUT_MAXDIM; i++)
- som->inputsize[i] = 1;
- som->ninput = 1;
- for (i=0; i<som->inputdim; i++)
- {
- sprintf(str, "INPAXIS%1d", i+1);
- if (fitsread(head, str, &som->inputsize[i], H_INT,T_LONG) != RETURN_OK)
- goto headerror;
- som->ninput *= som->inputsize[i];
- }
-
- if (fitsread(head,"INPNEXTR",&som->nextrainput,H_INT,T_LONG) != RETURN_OK)
- som->nextrainput = 0;
- som->ninput += som->nextrainput;
-
-/* Dimensionality of the SOM */
- if (fitsread(head, "SOMNAXIS", &som->neurdim, H_INT, T_LONG) != RETURN_OK)
- goto headerror;
- QMALLOC(som->neursize, int, som->neurdim);
- QMALLOC(som->neurstep, int, som->neurdim);
- QCALLOC(som->vector, float, som->neurdim);
- QCALLOC(som->dvector, float, som->neurdim);
- for (i=0; i<som->neurdim; i++)
- som->neursize[i] = 1;
- som->nneur = 1;
- for (i=0; i<som->neurdim; i++)
- {
- sprintf(str, "SOMAXIS%1d", i+1);
- if (fitsread(head, str, &som->neursize[i], H_INT,T_LONG) != RETURN_OK)
- goto headerror;
- som->neurstep[i] = som->nneur;
- som->nneur *= som->neursize[i];
- }
-
-/* Other scalars */
- if (fitsread(head, "SOMLRATE", &som->learnrate,H_FLOAT,T_FLOAT) != RETURN_OK)
- goto headerror;
- som->clearnrate = som->learnrate;
- if (fitsread(head, "SOMKERNW", &som->kernw, H_FLOAT,T_FLOAT) != RETURN_OK)
- goto headerror;
- som->ckernw = som->kernw;
- if (fitsread(head, "SOMNPASS", &som->ntrain , H_INT, T_LONG) != RETURN_OK)
- goto headerror;
- if (fitsread(head, "SOMNSWEE", &som->nsweep , H_INT, T_LONG) != RETURN_OK)
- goto headerror;
-
- som->nweight = som->nneur*som->ninput;
- QMALLOC(som->weight, float, som->nneur*som->ninput);
- QMALLOC(som->input, float, som->ninput);
- QMALLOC(som->inputw, float, som->ninput);
- QMALLOC(som->proto, float, som->ninput);
- QMALLOC(som->dproto, float, som->ninput);
- QCALLOC(som->freq, int, som->nneur);
-/* Locals */
-
-/* Load the weight vector */
- key = read_key(tab, "WEIGHTS");
- som->weight = key->ptr;
-
-/* But don't touch my arrays!! */
- blank_keys(tab);
- free_cat(&cat, 1);
-
- return som;
-
-headerror:
- error(EXIT_FAILURE, "*Error*: Incorrect or obsolete SOM data in ", filename);
- return NULL;
- }
-
-
diff --git a/sextractor/src/som.h b/sextractor/src/som.h
deleted file mode 100644
index eba1ea4..0000000
--- a/sextractor/src/som.h
+++ /dev/null
@@ -1,79 +0,0 @@
- /*
- som.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using neural networks.
-*
-* Author: E.BERTIN, IAP & Leiden observatory.
-*
-* Contents: Include for Kohonen's Self Organizing Map (V2.0).
-*
-* Last modify: 17/12/97
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*--------------------------------- constants ------------------------------*/
-
-#define INPUT_MAXDIM 9 /* Maximum dimensionality of input */
-#define SOM_MAXDIM 6 /* Maximum dimensionality of the SOM */
-
-/*------------------------------- SOM flags --------------------------------*/
-
-#define SOM_NODE 0x01 /* Compute at some exact node pos */
-#define SOM_PHOTOM 0x02 /* Do photometry */
-#define SOM_GRADIENT 0x04 /* Compute interpolated SOM gradient */
-#define SOM_LINE 0x08 /* Proceed along a specific line */
-
-/*--------------------------- structure definitions -------------------------*/
-
-typedef struct
- {
- int inputdim; /* Dimensionality of input vector */
- int *inputsize; /* Dimensions of the input vector */
- int ninput; /* Total number of inputs */
- int nextrainput; /* Number of extra inputs */
- int neurdim; /* Dimensionality of the SOM */
- int *neursize; /* Dimensions of the SOM */
- int nneur; /* Total number of neurons */
- int *neurstep; /* Stepping through the SOM */
- float *weight; /* Weights */
- int nweight; /* Total number of weights */
- float *input; /* Input data */
- float *inputw; /* Input data weighting */
- float *proto; /* Current composite prototype */
- float *dproto; /* Current composite gradients */
- float *vector; /* Current SOM coordinates */
- float *dvector; /* Current SOM search direction */
- float learnrate, clearnrate; /* Starting and current learn. rates */
- float learndecay; /* Learning decay rate */
- float kernw, ckernw; /* Starting and current kernel width */
- float kernwdecay; /* Kernel width decay rate */
- float xy_stiff; /* Stiffness of the X/Y mapping */
- int *freq; /* Number of winning times per node */
- int ntrain; /* # of training examples so far */
- int nsweep; /* # of sweeps through the whole set */
- float amp, sigamp; /* Best fitting amplitude and error */
- float stderror; /* Global reduced error */
- } somstruct;
-
-somstruct *thesom;
-
-/*---------------------------------- protos --------------------------------*/
-
-extern somstruct *som_load(char *filename);
-
-extern float som_err(somstruct *som, float dist, int flag),
- som_linmin(somstruct *som);
-
-extern int som_mkweight(somstruct *som,float back,float backnoise,
- float gain);
-
-extern void som_conjgrad(somstruct *som, float ftol),
- som_end(somstruct *som),
- som_phot(somstruct *som, float back,float backnoise,
- float gain, float dx, float dy,
- float *vector, float clip),
- som_start(somstruct *som, float *context,
- int ncontext, float x, float y);
diff --git a/sextractor/src/types.h b/sextractor/src/types.h
deleted file mode 100644
index bf1667c..0000000
--- a/sextractor/src/types.h
+++ /dev/null
@@ -1,413 +0,0 @@
- /*
- types.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: global type definitions.
-*
-* Last modify: 12/01/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#include <stdio.h>
-
-#ifndef _FITSCAT_H_
-#include "fits/fitscat.h"
-#endif
-
-/*-------------------------------- flags ------------------------------------*/
-
-#define OBJ_CROWDED 0x0001
-#define OBJ_MERGED 0x0002
-#define OBJ_SATUR 0x0004
-#define OBJ_TRUNC 0x0008
-#define OBJ_APERT_PB 0x0010
-#define OBJ_ISO_PB 0x0020
-#define OBJ_DOVERFLOW 0x0040
-#define OBJ_OVERFLOW 0x0080
-
-/*----------------------------- weight flags --------------------------------*/
-
-#define OBJ_WEIGHTZERO 0x0001
-#define OBJ_DWEIGHTZERO 0x0002
-
-/*---------------------------- preanalyse flags -----------------------------*/
-
-#define ANALYSE_FAST 0
-#define ANALYSE_FULL 1
-#define ANALYSE_ROBUST 2
-
-/*--------------------------------- typedefs --------------------------------*/
-typedef unsigned char BYTE; /* a byte */
-typedef unsigned short USHORT; /* 0 to 65535 integers */
-typedef unsigned int FLAGTYPE; /* flag type */
-typedef char pliststruct; /* Dummy type for plist */
-
-typedef int LONG;
-typedef unsigned int ULONG;
-
-typedef enum {BACK_RELATIVE, BACK_ABSOLUTE}
- backenum; /* BACK_TYPE */
-
-typedef enum {CHECK_NONE, CHECK_IDENTICAL, CHECK_BACKGROUND,
- CHECK_BACKRMS, CHECK_MINIBACKGROUND, CHECK_MINIBACKRMS,
- CHECK_SUBTRACTED, CHECK_FILTERED, CHECK_OBJECTS, CHECK_APERTURES,
- CHECK_SEGMENTATION, CHECK_ASSOC, CHECK_SUBOBJECTS,
- CHECK_SUBPSFPROTOS, CHECK_PSFPROTOS,
- CHECK_SUBPCPROTOS, CHECK_PCPROTOS, CHECK_PCOPROTOS,
- CHECK_MAPSOM} checkenum;
- /* CHECK_IMAGE type */
-
-typedef enum {WEIGHT_NONE, WEIGHT_FROMBACK, WEIGHT_FROMRMSMAP,
- WEIGHT_FROMVARMAP, WEIGHT_FROMWEIGHTMAP, WEIGHT_FROMINTERP}
- weightenum; /* WEIGHT_IMAGE type */
-
-/*--------------------------------- objects ---------------------------------*/
-/* I: "PIXEL" parameters */
-
-typedef struct
- {
-/* ---- basic parameters */
- int number; /* ID */
- int fdnpix; /* nb of extracted pix */
- int dnpix; /* nb of pix above thresh */
- int npix; /* "" in measured frame */
- float fdflux; /* integrated ext. flux */
- float dflux; /* integrated det. flux */
- float flux; /* integrated mes. flux */
- float fluxerr; /* integrated variance */
- float flux_prof; /* PROFILE flux*/
- float fluxerr_prof; /* PROFILE flux variance */
- PIXTYPE fdpeak; /* peak intensity (ADU) */
- PIXTYPE dpeak; /* peak intensity (ADU) */
- PIXTYPE peak; /* peak intensity (ADU) */
-/* ---- astrometric data */
- int peakx,peaky; /* pos of brightest pix */
- double mx, my; /* barycenter */
- double poserr_mx2, poserr_my2,
- poserr_mxy; /* Error ellips moments */
-/* ---- morphological data */
- int xmin,xmax,ymin,ymax,ycmin,ycmax;/* x,y limits */
- PIXTYPE *blank, *dblank; /* BLANKing sub-images */
- int *submap; /* Pixel-index sub-map */
- int subx,suby, subw,subh; /* sub-image pos. and size */
- short flag; /* extraction flags */
- BYTE wflag; /* weighted extraction flags */
- FLAGTYPE imaflag[MAXFLAG]; /* flags from FLAG-images */
- BYTE singuflag; /* flags for singularities */
- int imanflag[MAXFLAG]; /* number of MOST flags */
- double mx2,my2,mxy; /* variances and covariance */
- float a, b, theta, abcor; /* moments and angle */
- float cxx,cyy,cxy; /* ellipse parameters */
- int firstpix; /* ptr to first pixel */
- int lastpix; /* ptr to last pixel */
- float bkg, dbkg, sigbkg; /* Background stats (ADU) */
- float thresh; /* measur. threshold (ADU) */
- float dthresh; /* detect. threshold (ADU) */
- float mthresh; /* max. threshold (ADU) */
- int iso[NISO]; /* isophotal areas */
- float fwhm; /* IMAGE FWHM */
- } objstruct;
-
-/* II: "BLIND" parameters */
-typedef struct
- {
-/* ---- photometric data */
- float flux_iso; /* ISO integrated flux */
- float fluxerr_iso; /* RMS error on ISO flux */
- float mag_iso; /* ISO mag */
- float magerr_iso; /* ISO mag uncertainty */
- float flux_isocor; /* ISOCOR integrated flux */
- float fluxerr_isocor; /* RMS error on ISOCOR flux */
- float mag_isocor; /* ISOCOR mag */
- float magerr_isocor; /* ISOCOR mag uncertainty */
- float kronfactor; /* kron parameter */
- float flux_auto; /* AUTO integrated flux */
- float fluxerr_auto; /* RMS error on AUTO flux */
- float mag_auto; /* AUTO mag */
- float magerr_auto; /* AUTO mag uncertainty */
- float petrofactor; /* kron parameter */
- float flux_petro; /* AUTO integrated flux */
- float fluxerr_petro; /* RMS error on AUTO flux */
- float mag_petro; /* AUTO mag */
- float magerr_petro; /* AUTO mag uncertainty */
- float flux_best; /* BEST integrated flux */
- float fluxerr_best; /* RMS error on BEST flux */
- float mag_best; /* BEST mag */
- float magerr_best; /* BEST mag uncertainty */
- float *flux_aper; /* APER flux vector */
- float *fluxerr_aper; /* APER flux error vector */
- float *mag_aper; /* APER magnitude vector */
- float *magerr_aper; /* APER mag error vector */
- float flux_prof; /* PROFILE flux*/
- float fluxerr_prof; /* PROFILE flux error */
- float mag_prof; /* PROFILE magnitude */
- float magerr_prof; /* PROFILE magnitude error */
- float flux_win; /* WINdowed flux*/
- float fluxerr_win; /* WINdowed flux error */
- float mag_win; /* WINdowed magnitude */
- float magerr_win; /* WINdowed magnitude error */
-/* ---- astrometric data */
- double posx,posy; /* "FITS" pos. in pixels */
- double mamaposx,mamaposy; /* "MAMA" pos. in pixels */
- float sposx,sposy; /* single precision pos. */
- float poserr_a, poserr_b,
- poserr_theta; /* Error ellips parameters */
- float poserr_cxx, poserr_cyy,
- poserr_cxy; /* pos. error ellipse */
- double poserr_mx2w, poserr_my2w,
- poserr_mxyw; /* WORLD error moments */
- float poserr_aw, poserr_bw,
- poserr_thetaw; /* WORLD error parameters */
- float poserr_thetas; /* native error pos. angle */
- float poserr_theta2000; /* J2000 error pos. angle */
- float poserr_theta1950; /* B1950 error pos. angle */
- float poserr_cxxw, poserr_cyyw,
- poserr_cxyw; /* WORLD error ellipse */
- double mx2w,my2w,mxyw; /* WORLD var. and covar. */
- double peakxw, peakyw; /* WORLD of brightest pix */
- double mxw, myw; /* WORLD barycenters */
- double alphas, deltas; /* native alpha, delta */
- float thetas; /* native position angle E/N*/
- double peakalphas, peakdeltas; /* native for brightest pix */
- double peakalpha2000, peakdelta2000; /* J2000 for brightest pix */
- double peakalpha1950, peakdelta1950; /* B1950 for brightest pix */
- double alpha2000, delta2000; /* J2000 alpha, delta */
- float theta2000; /* J2000 position angle E/N */
- double alpha1950, delta1950; /* B1950 alpha, delta */
- float theta1950; /* B1950 position angle E/N */
- float aw, bw; /* WORLD ellipse size */
- float thetaw; /* WORLD position angle */
- float cxxw,cyyw,cxyw; /* WORLD ellipse parameters */
- float npixw, fdnpixw; /* WORLD isophotal areas */
- float threshmu; /* det. surface brightnees */
- float maxmu; /* max. surface brightnees */
- float elong; /* elongation */
- float ellip; /* ellipticity */
- float polar; /* Kaiser's "polarization" */
- float polarw; /* WORLD "polarization" */
- float sprob; /* Stellarity index */
- float fwhmw; /* WORLD FWHM */
- float *assoc; /* ASSOCiated data */
- int assoc_number; /* nb of ASSOCiated objects */
- float *vignet; /* Pixel data */
- float *vigshift; /* (Shifted) pixel data */
-
-/* Windowed measurements */
- double winpos_x,winpos_y; /* Windowed barycenter */
- double winposerr_mx2, winposerr_my2,
- winposerr_mxy; /* Error ellips moments */
- float winposerr_a, winposerr_b,
- winposerr_theta; /* Error ellips parameters */
- float winposerr_cxx, winposerr_cyy,
- winposerr_cxy; /* pos. error ellipse */
- double winposerr_mx2w, winposerr_my2w,
- winposerr_mxyw; /* WORLD error moments */
- float winposerr_aw, winposerr_bw,
- winposerr_thetaw; /* WORLD error parameters */
- float winposerr_thetas; /* native error pos. angle */
- float winposerr_theta2000; /* J2000 error pos. angle */
- float winposerr_theta1950; /* B1950 error pos. angle */
- float winposerr_cxxw, winposerr_cyyw,
- winposerr_cxyw; /* WORLD error ellipse */
- double win_mx2, win_my2,
- win_mxy; /* Windowed moments */
- float win_a, win_b,
- win_theta; /* Windowed ellipse parameters*/
- float win_polar; /* Windowed "polarization" */
- float win_cxx, win_cyy,
- win_cxy; /* Windowed ellipse parameters*/
- double win_mx2w, win_my2w,
- win_mxyw; /* WORLD windowed moments */
- float win_aw, win_bw,
- win_thetaw; /* WORLD ellipse parameters */
- float win_polarw; /* WORLD WIN "polarization" */
- float win_thetas; /* native error pos. angle */
- float win_theta2000; /* J2000 error pos. angle */
- float win_theta1950; /* B1950 error pos. angle */
- float win_cxxw, win_cyyw,
- win_cxyw; /* WORLD ellipse parameters */
- double winpos_xw, winpos_yw; /* WORLD coordinates */
- double winpos_alphas, winpos_deltas; /* native alpha, delta */
- double winpos_alpha2000, winpos_delta2000; /* J2000 alpha, delta */
- double winpos_alpha1950, winpos_delta1950; /* B1950 alpha, delta */
- short winpos_niter; /* Number of WIN iterations */
- short win_flag; /* 1:x2<0 2:xy=x2 4:flux<0 */
-
- /* ---- SOM fitting */
- float flux_somfit; /* Fitted amplitude */
- float fluxerr_somfit; /* RMS error on SOM flux */
- float mag_somfit; /* Magnitude from SOM fit */
- float magerr_somfit; /* Mag. err. from SOM fit */
- float stderr_somfit; /* Fitting reduced error */
- float *vector_somfit; /* SOM fit vector position */
-/* ---- Growth curves and stuff */
- float *flux_growth; /* Cumulated growth_curve */
- float flux_growthstep; /* Growth-curve step */
- float *mag_growth; /* Cumulated growth_curve */
- float mag_growthstep; /* Growth-curve step */
- float *flux_radius; /* f-light-radii */
- float hl_radius; /* Scalar half-light radius */
-/* ---- PSF-fitting */
- float *flux_psf; /* Flux from PSF-fitting */
- float *fluxerr_psf; /* RMS error on PSF flux */
- float *mag_psf; /* Mag from PSF-fitting */
- float *magerr_psf; /* RMS mag from PSF-fitting */
- float *x_psf, *y_psf; /* Coords from PSF-fitting */
- short niter_psf; /* # of PSF-fitting iterat. */
- short npsf; /* # of fitted PSFs */
- float chi2_psf; /* Red. chi2 of PSF-fitting */
- double xw_psf, yw_psf; /* WORLD coords */
- double alphas_psf, deltas_psf; /* native alpha, delta */
- double alpha2000_psf, delta2000_psf; /* J2000 alpha, delta */
- double alpha1950_psf, delta1950_psf; /* B1950 alpha, delta */
- double poserrmx2_psf, poserrmy2_psf,
- poserrmxy_psf; /* Error ellips moments */
- float poserra_psf, poserrb_psf,
- poserrtheta_psf; /* Error ellips parameters */
- float poserrcxx_psf, poserrcyy_psf,
- poserrcxy_psf; /* pos. error ellipse */
- double poserrmx2w_psf, poserrmy2w_psf,
- poserrmxyw_psf; /* WORLD error moments */
- float poserraw_psf, poserrbw_psf,
- poserrthetaw_psf; /* WORLD error parameters */
- float poserrthetas_psf; /* native error pos. angle */
- float poserrtheta2000_psf; /* J2000 error pos. angle */
- float poserrtheta1950_psf; /* B1950 error pos. angle */
- float poserrcxxw_psf, poserrcyyw_psf,
- poserrcxyw_psf; /* WORLD error ellipse */
-/* ---- PC-fitting */
- double mx2_pc,my2_pc,mxy_pc; /* PC 2nd-order parameters */
- float a_pc,b_pc,theta_pc; /* PC shape parameters */
- float *vector_pc; /* Principal components */
- float gdposang; /* Gal. disk position angle */
- float gdscale; /* Gal. disk scalelength */
- float gdaspect; /* Gal. disk aspect-ratio */
- float gde1,gde2; /* Gal. disk ellipticities */
- float gbratio; /* Galaxy B/T */
- float gbposang; /* Gal. bulge position angle */
- float gbscale; /* Gal. bulge scalelength */
- float gbaspect; /* Gal. bulge aspect-ratio */
- float gbe1,gbe2; /* Gal. bulge ellipticities */
- float flux_galfit; /* Galaxy tot. flux from fit */
- float fluxerr_galfit; /* RMS error on galfit flux */
- float mag_galfit; /* Galaxy tot. mag from fit */
- float magerr_galfit; /* RMS error on galfit mag */
-/* ---- MEF */
- short ext_number; /* FITS extension number */
- } obj2struct;
-
-/*----------------------------- lists of objects ----------------------------*/
-typedef struct
- {
- int nobj; /* number of objects in list */
- objstruct *obj; /* pointer to the object array */
- int npix; /* number of pixels in pixel-list */
- pliststruct *plist; /* pointer to the pixel-list */
- PIXTYPE dthresh; /* detection threshold */
- PIXTYPE thresh; /* analysis threshold */
- } objliststruct;
-
-
-/*----------------------------- image parameters ----------------------------*/
-typedef struct pic
- {
- char filename[MAXCHAR]; /* pointer to the image filename */
- char *rfilename; /* pointer to the reduced image name */
- char ident[MAXCHAR]; /* field identifier (read from FITS)*/
- char rident[MAXCHAR]; /* field identifier (relative) */
- FILE *file; /* pointer the image file structure */
- char *fitshead; /* pointer to the FITS header */
- int fitsheadsize; /* FITS header size */
-/* ---- main image parameters */
- int bitpix, bytepix; /* nb of bits and bytes per pixel */
- int bitsgn; /* non-zero if signed integer data */
- int width, height; /* x,y size of the field */
- KINGSIZE_T npix; /* total number of pixels */
- double bscale, bzero; /* FITS scale and offset */
- double ngamma; /* normalized photo gamma */
- int nlevels; /* nb of quantification levels */
- float pixmin, pixmax; /* min and max values in frame */
- int y; /* y current position in field */
- int ymin; /* y limit (lowest accessible) */
- int ymax; /* y limit (highest accessible+1) */
- int yblank; /* y blanking limit (highest+1) */
- PIXTYPE *strip; /* pointer to the image buffer */
- FLAGTYPE *fstrip; /* pointer to the FLAG buffer */
- int stripheight; /* height of a strip (in lines) */
- int stripmargin; /* number of lines in margin */
- int stripstep; /* number of lines at each read */
- int stripy; /* y position in buffer */
- int stripylim; /* y limit in buffer */
- int stripysclim; /* y scroll limit in buffer */
-/* ---- image (de-)compression */
- enum {ICOMPRESS_NONE, ICOMPRESS_BASEBYTE, ICOMPRESS_PREVPIX}
- compress_type; /* image compression type */
- char *compress_buf; /* de-compression buffer */
- char *compress_bufptr; /* present pixel in buffer */
- int compress_curval; /* current pixel or checksum value */
- int compress_checkval; /* foreseen pixel or checksum value */
- int compress_npix; /* remaining pixels in buffer */
-/* ---- basic astrometric parameters */
- double pixscale; /* pixel size in arcsec.pix-1 */
- double epoch; /* epoch of coordinates */
-/* ---- background parameters */
- float *back; /* ptr to the background map in mem */
- float *dback; /* ptr to the background deriv. map */
- float *sigma; /* ptr to the sigma map */
- float *dsigma; /* Ptr to the sigma deriv. map */
- int backw, backh; /* x,y size of a bkgnd mesh */
- int nbackp; /* total nb of pixels per bkgnd mesh */
- int nbackx, nbacky; /* x,y number of bkgnd meshes */
- int nback; /* total number of bkgnd meshes */
- int nbackfx, nbackfy; /* x,y size of bkgnd filtering mask */
- float backmean; /* median bkgnd value in image */
- float backsig; /* median bkgnd rms in image */
- float sigfac; /* scaling RMS factor (for WEIGHTs) */
- PIXTYPE *backline; /* current interpolated bkgnd line */
- PIXTYPE dthresh; /* detection threshold */
- PIXTYPE thresh; /* analysis threshold */
- backenum back_type; /* Background type */
-/* ---- astrometric parameters */
- struct structastrom *astrom; /* astrometric data */
- struct structassoc *assoc; /* ptr to the assoc-list */
- int flags; /* flags defining the field type */
-/* ---- image interpolation */
- int interp_flag; /* interpolation for this field? */
- PIXTYPE *interp_backup; /* backup line for interpolation */
- PIXTYPE weight_thresh; /* interpolation threshold */
- int *interp_ytimeoutbuf; /* interpolation timeout line buffer */
- int interp_xtimeout; /* interpolation timeout value in x */
- int interp_ytimeout; /* interpolation timeout value in y */
- struct pic *reffield; /* pointer to a reference field */
- OFF_T mefpos; /* Position in a MEF file */
- } picstruct;
-
-
-/*-------------------------------- catalog ---------------------------------*/
-
-typedef struct
- {
- int ndetect; /* nb of detections */
- int ntotal; /* Total object nb */
- int nparam; /* Nb of parameters */
-/*----- Misc. strings defining the extraction */
- char prefs_name[MAXCHAR]; /* Prefs filename*/
- char image_name[MAXCHAR]; /* image filename*/
- char psf_name[MAXCHAR]; /* PSF filename*/
- char nnw_name[MAXCHAR]; /* NNW name */
- char filter_name[MAXCHAR]; /* Filter name */
- char soft_name[MAXCHAR]; /* Sextractor version*/
-/*----- time */
- char ext_date[16],ext_time[16]; /* date and time */
- double ext_elapsed; /* processing time */
-/*----- MEF */
- int currext; /* current extension */
- int next; /* Nb of extensions */
- } sexcatstruct;
-
diff --git a/sextractor/src/wcs/Makefile.am b/sextractor/src/wcs/Makefile.am
deleted file mode 100644
index 1884b2e..0000000
--- a/sextractor/src/wcs/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-# Program Makefile for the WCS library
-# Copyright (C) 2002 Emmanuel Bertin.
-noinst_LIBRARIES = libwcs_c.a
-libwcs_c_a_SOURCES = cel.c lin.c poly.c proj.c sph.c tnx.c wcs.c \
- wcstrig.c \
- cel.h lin.h poly.h proj.h sph.h tnx.h wcs.h \
- wcsmath.h wcstrig.h
diff --git a/sextractor/src/wcs/Makefile.in b/sextractor/src/wcs/Makefile.in
deleted file mode 100644
index 44372dc..0000000
--- a/sextractor/src/wcs/Makefile.in
+++ /dev/null
@@ -1,477 +0,0 @@
-# Makefile.in generated by automake 1.12.2 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2012 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-subdir = src/wcs
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/autoconf/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acx_prog_cc_optim.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-libwcs_c_a_AR = $(AR) $(ARFLAGS)
-libwcs_c_a_LIBADD =
-am_libwcs_c_a_OBJECTS = cel.$(OBJEXT) lin.$(OBJEXT) poly.$(OBJEXT) \
- proj.$(OBJEXT) sph.$(OBJEXT) tnx.$(OBJEXT) wcs.$(OBJEXT) \
- wcstrig.$(OBJEXT)
-libwcs_c_a_OBJECTS = $(am_libwcs_c_a_OBJECTS)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libwcs_c_a_SOURCES)
-DIST_SOURCES = $(libwcs_c_a_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DATE2 = @DATE2@
-DATE3 = @DATE3@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGER = @PACKAGER@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-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@
-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_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-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_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# Program Makefile for the WCS library
-# Copyright (C) 2002 Emmanuel Bertin.
-noinst_LIBRARIES = libwcs_c.a
-libwcs_c_a_SOURCES = cel.c lin.c poly.c proj.c sph.c tnx.c wcs.c \
- wcstrig.c \
- cel.h lin.h poly.h proj.h sph.h tnx.h wcs.h \
- wcsmath.h wcstrig.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/wcs/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/wcs/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libwcs_c.a: $(libwcs_c_a_OBJECTS) $(libwcs_c_a_DEPENDENCIES) $(EXTRA_libwcs_c_a_DEPENDENCIES)
- -rm -f libwcs_c.a
- $(libwcs_c_a_AR) libwcs_c.a $(libwcs_c_a_OBJECTS) $(libwcs_c_a_LIBADD)
- $(RANLIB) libwcs_c.a
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cel.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lin.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/poly.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/proj.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sph.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tnx.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wcs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wcstrig.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- set x; \
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- 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; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-
-cscopelist: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS) $(LISP)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-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)'; \
- 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; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-noinstLIBRARIES cscopelist ctags distclean \
- distclean-compile distclean-generic distclean-tags 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-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am
-
-
-# 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.
-.NOEXPORT:
diff --git a/sextractor/src/wcs/cel.c b/sextractor/src/wcs/cel.c
deleted file mode 100644
index 91c95ec..0000000
--- a/sextractor/src/wcs/cel.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-*=============================================================================
-*
-* C routines which implement the FITS World Coordinate System (WCS)
-* convention.
-*
-* Summary of routines
-* -------------------
-* These routines are provided as drivers for the lower level spherical
-* coordinate transformation and projection routines. There are separate
-* driver routines for the forward, celfwd(), and reverse, celrev(),
-* transformations.
-*
-* An initialization routine, celset(), computes intermediate values from
-* the transformation parameters but need not be called explicitly - see the
-* explanation of cel.flag below.
-*
-*
-* Initialization routine; celset()
-* --------------------------------
-* Initializes members of a celprm data structure which hold intermediate
-* values. Note that this routine need not be called directly; it will be
-* invoked by celfwd() and celrev() if the "flag" structure member is
-* anything other than a predefined magic value.
-*
-* Given:
-* pcode[4] const char
-* WCS projection code (see below).
-*
-* Given and returned:
-* cel celprm* Spherical coordinate transformation parameters
-* (see below).
-* prj prjprm* Projection parameters (usage is described in the
-* prologue to "proj.c").
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid coordinate transformation parameters.
-* 2: Ill-conditioned coordinate transformation
-* parameters.
-*
-* Forward transformation; celfwd()
-* --------------------------------
-* Compute (x,y) coordinates in the plane of projection from celestial
-* coordinates (lng,lat).
-*
-* Given:
-* pcode[4] const char
-* WCS projection code (see below).
-* lng,lat const double
-* Celestial longitude and latitude of the projected
-* point, in degrees.
-*
-* Given and returned:
-* cel celprm* Spherical coordinate transformation parameters
-* (see below).
-*
-* Returned:
-* phi, double* Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-*
-* Given and returned:
-* prj prjprm* Projection parameters (usage is described in the
-* prologue to "proj.c").
-*
-* Returned:
-* x,y double* Projected coordinates, "degrees".
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid coordinate transformation parameters.
-* 2: Invalid projection parameters.
-* 3: Invalid value of (lng,lat).
-*
-* Reverse transformation; celrev()
-* --------------------------------
-* Compute the celestial coordinates (lng,lat) of the point with projected
-* coordinates (x,y).
-*
-* Given:
-* pcode[4] const char
-* WCS projection code (see below).
-* x,y const double
-* Projected coordinates, "degrees".
-*
-* Given and returned:
-* prj prjprm* Projection parameters (usage is described in the
-* prologue to "proj.c").
-*
-* Returned:
-* phi, double* Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-*
-* Given and returned:
-* cel celprm* Spherical coordinate transformation parameters
-* (see below).
-*
-* Returned:
-* lng,lat double* Celestial longitude and latitude of the projected
-* point, in degrees.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid coordinate transformation parameters.
-* 2: Invalid projection parameters.
-* 3: Invalid value of (x,y).
-*
-* Coordinate transformation parameters
-* ------------------------------------
-* The celprm struct consists of the following:
-*
-* int flag
-* The celprm struct contains pointers to the forward and reverse
-* projection routines as well as intermediaries computed from the
-* reference coordinates (see below). Whenever the projection code
-* (pcode) or any of ref[4] are set or changed then this flag must be
-* set to zero to signal the initialization routine, celset(), to
-* redetermine the function pointers and recompute intermediaries.
-* Once this has been done pcode itself is ignored.
-*
-* double ref[4]
-* The first pair of values should be set to the celestial longitude
-* and latitude (usually right ascension and declination) of the
-* reference point of the projection.
-*
-* The second pair of values are the native longitude and latitude of
-* the pole of the celestial coordinate system and correspond to the
-* FITS keywords LONGPOLE and LATPOLE.
-*
-* LONGPOLE defaults to 0 degrees if the celestial latitude of the
-* reference point of the projection is greater than the native
-* latitude, otherwise 180 degrees. (This is the condition for the
-* celestial latitude to increase in the same direction as the native
-* latitude at the reference point.) ref[2] may be set to 999.0 to
-* indicate that the correct default should be substituted.
-*
-* In some circumstances the latitude of the native pole may be
-* determined by the first three values only to within a sign and
-* LATPOLE is used to choose between the two solutions. LATPOLE is
-* set in ref[3] and the solution closest to this value is used to
-* reset ref[3]. It is therefore legitimate, for example, to set
-* ref[3] to 999.0 to choose the more northerly solution - the default
-* if the LATPOLE card is omitted from the FITS header. For the
-* special case where the reference point of the projection is at
-* native latitude zero, its celestial latitude is zero, and
-* LONGPOLE = +/- 90 then the native latitude of the pole is not
-* determined by the first three reference values and LATPOLE
-* specifies it completely.
-*
-* The remaining members of the celprm struct are maintained by the
-* initialization routines and should not be modified. This is done for the
-* sake of efficiency and to allow an arbitrary number of contexts to be
-* maintained simultaneously.
-*
-* double euler[5]
-* Euler angles and associated intermediaries derived from the
-* coordinate reference values.
-* int (*prjfwd)()
-* int (*prjrev)()
-* Pointers to the forward and reverse projection routines.
-*
-*
-* WCS projection codes
-* --------------------
-* Zenithals/azimuthals:
-* AZP: zenithal/azimuthal perspective
-* TAN: gnomonic
-* SIN: synthesis (generalized orthographic)
-* STG: stereographic
-* ARC: zenithal/azimuthal equidistant
-* ZPN: zenithal/azimuthal polynomial
-* ZEA: zenithal/azimuthal equal area
-* AIR: Airy
-* TNX: IRAF's polynomial correction to TAN
-*
-* Cylindricals:
-* CYP: cylindrical perspective
-* CAR: Cartesian
-* MER: Mercator
-* CEA: cylindrical equal area
-*
-* Conics:
-* COP: conic perspective
-* COD: conic equidistant
-* COE: conic equal area
-* COO: conic orthomorphic
-*
-* Polyconics:
-* BON: Bonne
-* PCO: polyconic
-*
-* Pseudo-cylindricals:
-* GLS: Sanson-Flamsteed (global sinusoidal)
-* PAR: parabolic
-* MOL: Mollweide
-*
-* Conventional:
-* AIT: Hammer-Aitoff
-*
-* Quad-cubes:
-* CSC: COBE quadrilateralized spherical cube
-* QSC: quadrilateralized spherical cube
-* TSC: tangential spherical cube
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* IRAF's TNX added by E.Bertin 2000/03/28
-* Filtering of abs(phi)>180 and abs(theta)>90 added by E.Bertin 2000/11/11
-* $Id: cel.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include <string.h>
-#include "wcstrig.h"
-#include "cel.h"
-#include "sph.h"
-#include "tnx.h"
-
-int npcode = 26;
-char pcodes[26][4] =
- {"AZP", "TAN", "SIN", "STG", "ARC", "ZPN", "ZEA", "AIR", "CYP", "CAR",
- "MER", "CEA", "COP", "COD", "COE", "COO", "BON", "PCO", "GLS", "PAR",
- "AIT", "MOL", "CSC", "QSC", "TSC", "TNX"};
-
-/* Map error number to error message for each function. */
-const char *celset_errmsg[] = {
- 0,
- "Invalid coordinate transformation parameters",
- "Ill-conditioned coordinate transformation parameters"};
-
-const char *celfwd_errmsg[] = {
- 0,
- "Invalid coordinate transformation parameters",
- "Invalid projection parameters",
- "Invalid value of (lng,lat)"};
-
-const char *celrev_errmsg[] = {
- 0,
- "Invalid coordinate transformation parameters",
- "Invalid projection parameters",
- "Invalid value of (x,y)"};
-
-
-int celset(pcode, cel, prj)
-
-const char pcode[4];
-struct celprm *cel;
-struct prjprm *prj;
-
-{
- int dophip;
- const double tol = 1.0e-10;
- double clat0, cphip, cthe0, theta0, slat0, sphip, sthe0;
- double latp, latp1, latp2;
- double u, v, x, y, z;
-
- /* Set pointers to the forward and reverse projection routines. */
- if (strcmp(pcode, "AZP") == 0) {
- cel->prjfwd = azpfwd;
- cel->prjrev = azprev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "TAN") == 0) {
- cel->prjfwd = tanfwd;
- cel->prjrev = tanrev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "SIN") == 0) {
- cel->prjfwd = sinfwd;
- cel->prjrev = sinrev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "STG") == 0) {
- cel->prjfwd = stgfwd;
- cel->prjrev = stgrev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "ARC") == 0) {
- cel->prjfwd = arcfwd;
- cel->prjrev = arcrev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "ZPN") == 0) {
- cel->prjfwd = zpnfwd;
- cel->prjrev = zpnrev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "ZEA") == 0) {
- cel->prjfwd = zeafwd;
- cel->prjrev = zearev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "AIR") == 0) {
- cel->prjfwd = airfwd;
- cel->prjrev = airrev;
- theta0 = 90.0;
- } else if (strcmp(pcode, "CYP") == 0) {
- cel->prjfwd = cypfwd;
- cel->prjrev = cyprev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "CAR") == 0) {
- cel->prjfwd = carfwd;
- cel->prjrev = carrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "MER") == 0) {
- cel->prjfwd = merfwd;
- cel->prjrev = merrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "CEA") == 0) {
- cel->prjfwd = ceafwd;
- cel->prjrev = cearev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "COP") == 0) {
- cel->prjfwd = copfwd;
- cel->prjrev = coprev;
- theta0 = prj->p[1];
- } else if (strcmp(pcode, "COD") == 0) {
- cel->prjfwd = codfwd;
- cel->prjrev = codrev;
- theta0 = prj->p[1];
- } else if (strcmp(pcode, "COE") == 0) {
- cel->prjfwd = coefwd;
- cel->prjrev = coerev;
- theta0 = prj->p[1];
- } else if (strcmp(pcode, "COO") == 0) {
- cel->prjfwd = coofwd;
- cel->prjrev = coorev;
- theta0 = prj->p[1];
- } else if (strcmp(pcode, "BON") == 0) {
- cel->prjfwd = bonfwd;
- cel->prjrev = bonrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "PCO") == 0) {
- cel->prjfwd = pcofwd;
- cel->prjrev = pcorev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "GLS") == 0) {
- cel->prjfwd = glsfwd;
- cel->prjrev = glsrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "PAR") == 0) {
- cel->prjfwd = parfwd;
- cel->prjrev = parrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "AIT") == 0) {
- cel->prjfwd = aitfwd;
- cel->prjrev = aitrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "MOL") == 0) {
- cel->prjfwd = molfwd;
- cel->prjrev = molrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "CSC") == 0) {
- cel->prjfwd = cscfwd;
- cel->prjrev = cscrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "QSC") == 0) {
- cel->prjfwd = qscfwd;
- cel->prjrev = qscrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "TSC") == 0) {
- cel->prjfwd = tscfwd;
- cel->prjrev = tscrev;
- theta0 = 0.0;
- } else if (strcmp(pcode, "TNX") == 0) {
- cel->prjfwd = tnxfwd;
- cel->prjrev = tnxrev;
- theta0 = 90.0;
- } else {
- /* Unrecognized projection code. */
- return 1;
- }
-
- /* Set default for native longitude of the celestial pole? */
- dophip = (cel->ref[2] == 999.0);
-
- /* Compute celestial coordinates of the native pole. */
- if (theta0 == 90.0) {
- /* Reference point is at the native pole. */
-
- if (dophip) {
- /* Set default for longitude of the celestial pole. */
- cel->ref[2] = 180.0;
- }
-
- latp = cel->ref[1];
- cel->ref[3] = latp;
-
- cel->euler[0] = cel->ref[0];
- cel->euler[1] = 90.0 - latp;
- } else {
- /* Reference point away from the native pole. */
-
- /* Set default for longitude of the celestial pole. */
- if (dophip) {
- cel->ref[2] = (cel->ref[1] < theta0) ? 180.0 : 0.0;
- }
-
- clat0 = wcs_cosd(cel->ref[1]);
- slat0 = wcs_sind(cel->ref[1]);
- cphip = wcs_cosd(cel->ref[2]);
- sphip = wcs_sind(cel->ref[2]);
- cthe0 = wcs_cosd(theta0);
- sthe0 = wcs_sind(theta0);
-
- x = cthe0*cphip;
- y = sthe0;
- z = sqrt(x*x + y*y);
- if (z == 0.0) {
- if (slat0 != 0.0) {
- return 1;
- }
-
- /* latp determined by LATPOLE in this case. */
- latp = cel->ref[3];
- } else {
- if (fabs(slat0/z) > 1.0) {
- return 1;
- }
-
- u = wcs_atan2d(y,x);
- v = wcs_acosd(slat0/z);
-
- latp1 = u + v;
- if (latp1 > 180.0) {
- latp1 -= 360.0;
- } else if (latp1 < -180.0) {
- latp1 += 360.0;
- }
-
- latp2 = u - v;
- if (latp2 > 180.0) {
- latp2 -= 360.0;
- } else if (latp2 < -180.0) {
- latp2 += 360.0;
- }
-
- if (fabs(cel->ref[3]-latp1) < fabs(cel->ref[3]-latp2)) {
- if (fabs(latp1) < 90.0+tol) {
- latp = latp1;
- } else {
- latp = latp2;
- }
- } else {
- if (fabs(latp2) < 90.0+tol) {
- latp = latp2;
- } else {
- latp = latp1;
- }
- }
-
- cel->ref[3] = latp;
- }
-
- cel->euler[1] = 90.0 - latp;
-
- z = wcs_cosd(latp)*clat0;
- if (fabs(z) < tol) {
- if (fabs(clat0) < tol) {
- /* Celestial pole at the reference point. */
- cel->euler[0] = cel->ref[0];
- cel->euler[1] = 90.0 - theta0;
- } else if (latp > 0.0) {
- /* Celestial pole at the native north pole.*/
- cel->euler[0] = cel->ref[0] + cel->ref[2] - 180.0;
- cel->euler[1] = 0.0;
- } else if (latp < 0.0) {
- /* Celestial pole at the native south pole. */
- cel->euler[0] = cel->ref[0] - cel->ref[2];
- cel->euler[1] = 180.0;
- }
- } else {
- x = (sthe0 - wcs_sind(latp)*slat0)/z;
- y = sphip*cthe0/clat0;
- if (x == 0.0 && y == 0.0) {
- return 1;
- }
- cel->euler[0] = cel->ref[0] - wcs_atan2d(y,x);
- }
-
- /* Make euler[0] the same sign as ref[0]. */
- if (cel->ref[0] >= 0.0) {
- if (cel->euler[0] < 0.0) cel->euler[0] += 360.0;
- } else {
- if (cel->euler[0] > 0.0) cel->euler[0] -= 360.0;
- }
- }
-
- cel->euler[2] = cel->ref[2];
- cel->euler[3] = wcs_cosd(cel->euler[1]);
- cel->euler[4] = wcs_sind(cel->euler[1]);
- cel->flag = CELSET;
-
- /* Check for ill-conditioned parameters. */
- if (fabs(latp) > 90.0+tol) {
- return 2;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int celfwd(pcode, lng, lat, cel, phi, theta, prj, x, y)
-
-const char pcode[4];
-const double lng, lat;
-struct celprm *cel;
-double *phi, *theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- int err;
-
- if (cel->flag != CELSET) {
- if (celset(pcode, cel, prj)) return 1;
- }
-
- /* Compute native coordinates. */
- sphfwd(lng, lat, cel->euler, phi, theta);
-
- /* Apply forward projection. */
- if ((err = cel->prjfwd(*phi, *theta, prj, x, y))) {
- return err == 1 ? 2 : 3;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int celrev(pcode, x, y, prj, phi, theta, cel, lng, lat)
-
-const char pcode[4];
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-struct celprm *cel;
-double *lng, *lat;
-
-{
- int err;
-
- if (cel->flag != CELSET) {
- if(celset(pcode, cel, prj)) return 1;
- }
-
- /* Apply reverse projection. */
- if ((err = cel->prjrev(x, y, prj, phi, theta))) {
- return err == 1 ? 2 : 3;
- }
- if (fabs(*phi)>180.0 || fabs(*theta)>90.0)
- return 2;
-
- /* Compute native coordinates. */
- sphrev(*phi, *theta, cel->euler, lng, lat);
-
- return 0;
-}
diff --git a/sextractor/src/wcs/cel.h b/sextractor/src/wcs/cel.h
deleted file mode 100644
index 1b12a9a..0000000
--- a/sextractor/src/wcs/cel.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: cel.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifndef WCSLIB_CEL
-#define WCSLIB_CEL
-
-#include "proj.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int npcode;
-extern char pcodes[26][4];
-
-struct celprm {
- int flag;
- double ref[4];
- double euler[5];
-
-#if __STDC__ || defined(__cplusplus)
- int (*prjfwd)(const double, const double,
- struct prjprm *,
- double *, double *);
- int (*prjrev)(const double, const double,
- struct prjprm *,
- double *, double *);
-#else
- int (*prjfwd)();
- int (*prjrev)();
-#endif
-};
-
-#if __STDC__ || defined(__cplusplus)
- int celset(const char *, struct celprm *, struct prjprm *);
- int celfwd(const char *,
- const double, const double,
- struct celprm *,
- double *, double *,
- struct prjprm *,
- double *, double *);
- int celrev(const char *,
- const double, const double,
- struct prjprm *,
- double *, double *,
- struct celprm *,
- double *, double *);
-#else
- int celset(), celfwd(), celrev();
-#endif
-
-extern const char *celset_errmsg[];
-extern const char *celfwd_errmsg[];
-extern const char *celrev_errmsg[];
-
-#define CELSET 137
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WCSLIB_CEL */
diff --git a/sextractor/src/wcs/lin.c b/sextractor/src/wcs/lin.c
deleted file mode 100644
index 9c50640..0000000
--- a/sextractor/src/wcs/lin.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-*=============================================================================
-*
-* C routines which implement the FITS World Coordinate System (WCS)
-* convention.
-*
-* Summary of routines
-* -------------------
-* These utility routines apply the linear transformation defined by the WCS
-* FITS header cards. There are separate routines for the image-to-pixel,
-* linfwd(), and pixel-to-image, linrev(), transformations.
-*
-* An initialization routine, linset(), computes intermediate values from
-* the transformation parameters but need not be called explicitly - see the
-* explanation of lin.flag below.
-*
-* An auxiliary matrix inversion routine, matinv(), is included. It uses
-* LU-triangular factorization with scaled partial pivoting.
-*
-*
-* Initialization routine; linset()
-* --------------------------------
-* Initializes members of a linprm data structure which hold intermediate
-* values. Note that this routine need not be called directly; it will be
-* invoked by linfwd() and linrev() if the "flag" structure member is
-* anything other than a predefined magic value.
-*
-* Given and/or returned:
-* lin linprm* Linear transformation parameters (see below).
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Memory allocation error.
-* 2: PC matrix is singular.
-*
-* Forward transformation; linfwd()
-* --------------------------------
-* Compute pixel coordinates from image coordinates. Note that where
-* celestial coordinate systems are concerned the image coordinates
-* correspond to (x,y) in the plane of projection, not celestial (lng,lat).
-*
-* Given:
-* imgcrd const double[]
-* Image (world) coordinate.
-*
-* Given and returned:
-* lin linprm* Linear transformation parameters (see below).
-*
-* Returned:
-* pixcrd d[] Pixel coordinate.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: The transformation is not invertible.
-*
-* Reverse transformation; linrev()
-* --------------------------------
-* Compute image coordinates from pixel coordinates. Note that where
-* celestial coordinate systems are concerned the image coordinates
-* correspond to (x,y) in the plane of projection, not celestial (lng,lat).
-*
-* Given:
-* pixcrd const double[]
-* Pixel coordinate.
-*
-* Given and/or returned:
-* lin linprm* Linear transformation parameters (see below).
-*
-* Returned:
-* imgcrd d[] Image (world) coordinate.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Error.
-*
-* Linear transformation parameters
-* --------------------------------
-* The linprm struct consists of the following:
-*
-* int flag
-* This flag must be set to zero whenever any of the following members
-* are set or modified. This signals the initialization routine,
-* linset(), to recompute intermediaries.
-* int naxis
-* Number of image axes.
-* double *crpix
-* Pointer to the first element of an array of double containing the
-* coordinate reference pixel, CRPIXn.
-* double *pc
-* Pointer to the first element of the PC (pixel coordinate)
-* transformation matrix.
-* double *cdelt
-* Pointer to the first element of an array of double containing the
-* coordinate increments, CDELTn.
-*
-* The remaining members of the linprm struct are maintained by the
-* initialization routine and should not be modified.
-*
-* double *piximg
-* Pointer to the first element of the matrix containing the product
-* of the CDELTn diagonal matrix and the PC matrix.
-* double *imgpix
-* Pointer to the first element of the inverse of the piximg matrix.
-*
-* linset allocates storage for the above arrays using malloc(). Note,
-* however, that these routines do not free this storage so if a linprm
-* variable has itself been malloc'd then these structure members must be
-* explicitly freed before the linprm variable is free'd otherwise a memory
-* leak will result.
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: lin.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include <stdlib.h>
-#include "lin.h"
-
-/* Map error number to error message for each function. */
-const char *linset_errmsg[] = {
- 0,
- "Memory allocation error",
- "PC matrix is singular"};
-
-const char *linfwd_errmsg[] = {
- 0,
- "Memory allocation error",
- "PC matrix is singular"};
-
-const char *linrev_errmsg[] = {
- 0,
- "Memory allocation error",
- "PC matrix is singular"};
-
-int linset(lin)
-
-struct linprm *lin;
-
-{
- int i, ij, j, mem, n;
-
- n = lin->naxis;
-
- /* Allocate memory for internal arrays. */
- mem = n * n * sizeof(double);
- lin->piximg = (double*)malloc(mem);
- if (lin->piximg == (double*)0) return 1;
-
- lin->imgpix = (double*)malloc(mem);
- if (lin->imgpix == (double*)0) {
- free(lin->piximg);
- return 1;
- }
-
- /* Compute the pixel-to-image transformation matrix. */
- for (i = 0, ij = 0; i < n; i++) {
- for (j = 0; j < n; j++, ij++) {
- lin->piximg[ij] = lin->cdelt[i] * lin->pc[ij];
- }
- }
-
- /* Compute the image-to-pixel transformation matrix. */
- if (matinv(n, lin->piximg, lin->imgpix)) return 2;
-
- lin->flag = LINSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int linfwd(imgcrd, lin, pixcrd)
-
-const double imgcrd[];
-struct linprm *lin;
-double pixcrd[];
-
-{
- int i, ij, j, n;
-
- n = lin->naxis;
-
- if (lin->flag != LINSET) {
- if (linset(lin)) return 1;
- }
-
- for (i = 0, ij = 0; i < n; i++) {
- pixcrd[i] = 0.0;
- for (j = 0; j < n; j++, ij++) {
- pixcrd[i] += lin->imgpix[ij] * imgcrd[j];
- }
- }
-
- for (j = 0; j < n; j++) {
- pixcrd[j] += lin->crpix[j];
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int linrev(pixcrd, lin, imgcrd)
-
-const double pixcrd[];
-struct linprm *lin;
-double imgcrd[];
-
-{
- int i, ij, j, n;
- double temp;
-
- n = lin->naxis;
-
- if (lin->flag != LINSET) {
- if (linset(lin)) return 1;
- }
-
- for (i = 0; i < n; i++) {
- imgcrd[i] = 0.0;
- }
-
- for (j = 0; j < n; j++) {
- temp = pixcrd[j] - lin->crpix[j];
- for (i = 0, ij = j; i < n; i++, ij+=n) {
- imgcrd[i] += lin->piximg[ij] * temp;
- }
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int matinv(n, mat, inv)
-
-const int n;
-const double mat[];
-double inv[];
-
-{
- register int i, ij, ik, j, k, kj, pj;
- int itemp, mem, *mxl, *lxm, pivot;
- double colmax, *lu, *rowmax, dtemp;
-
-
- /* Allocate memory for internal arrays. */
- mem = n * sizeof(int);
- if ((mxl = (int*)malloc(mem)) == (int*)0) return 1;
- if ((lxm = (int*)malloc(mem)) == (int*)0) {
- free(mxl);
- return 1;
- }
-
- mem = n * sizeof(double);
- if ((rowmax = (double*)malloc(mem)) == (double*)0) {
- free(mxl);
- free(lxm);
- return 1;
- }
-
- mem *= n;
- if ((lu = (double*)malloc(mem)) == (double*)0) {
- free(mxl);
- free(lxm);
- free(rowmax);
- return 1;
- }
-
-
- /* Initialize arrays. */
- for (i = 0, ij = 0; i < n; i++) {
- /* Vector which records row interchanges. */
- mxl[i] = i;
-
- rowmax[i] = 0.0;
-
- for (j = 0; j < n; j++, ij++) {
- dtemp = fabs(mat[ij]);
- if (dtemp > rowmax[i]) rowmax[i] = dtemp;
-
- lu[ij] = mat[ij];
- }
-
- /* A row of zeroes indicates a singular matrix. */
- if (rowmax[i] == 0.0) {
- free(mxl);
- free(lxm);
- free(rowmax);
- free(lu);
- return 2;
- }
- }
-
-
- /* Form the LU triangular factorization using scaled partial pivoting. */
- for (k = 0; k < n; k++) {
- /* Decide whether to pivot. */
- colmax = fabs(lu[k*n+k]) / rowmax[k];
- pivot = k;
-
- for (i = k+1; i < n; i++) {
- ik = i*n + k;
- dtemp = fabs(lu[ik]) / rowmax[i];
- if (dtemp > colmax) {
- colmax = dtemp;
- pivot = i;
- }
- }
-
- if (pivot > k) {
- /* We must pivot, interchange the rows of the design matrix. */
- for (j = 0, pj = pivot*n, kj = k*n; j < n; j++, pj++, kj++) {
- dtemp = lu[pj];
- lu[pj] = lu[kj];
- lu[kj] = dtemp;
- }
-
- /* Amend the vector of row maxima. */
- dtemp = rowmax[pivot];
- rowmax[pivot] = rowmax[k];
- rowmax[k] = dtemp;
-
- /* Record the interchange for later use. */
- itemp = mxl[pivot];
- mxl[pivot] = mxl[k];
- mxl[k] = itemp;
- }
-
- /* Gaussian elimination. */
- for (i = k+1; i < n; i++) {
- ik = i*n + k;
-
- /* Nothing to do if lu[ik] is zero. */
- if (lu[ik] != 0.0) {
- /* Save the scaling factor. */
- lu[ik] /= lu[k*n+k];
-
- /* Subtract rows. */
- for (j = k+1; j < n; j++) {
- lu[i*n+j] -= lu[ik]*lu[k*n+j];
- }
- }
- }
- }
-
-
- /* mxl[i] records which row of mat corresponds to row i of lu. */
- /* lxm[i] records which row of lu corresponds to row i of mat. */
- for (i = 0; i < n; i++) {
- lxm[mxl[i]] = i;
- }
-
-
- /* Determine the inverse matrix. */
- for (i = 0, ij = 0; i < n; i++) {
- for (j = 0; j < n; j++, ij++) {
- inv[ij] = 0.0;
- }
- }
-
- for (k = 0; k < n; k++) {
- inv[lxm[k]*n+k] = 1.0;
-
- /* Forward substitution. */
- for (i = lxm[k]+1; i < n; i++) {
- for (j = lxm[k]; j < i; j++) {
- inv[i*n+k] -= lu[i*n+j]*inv[j*n+k];
- }
- }
-
- /* Backward substitution. */
- for (i = n-1; i >= 0; i--) {
- for (j = i+1; j < n; j++) {
- inv[i*n+k] -= lu[i*n+j]*inv[j*n+k];
- }
- inv[i*n+k] /= lu[i*n+i];
- }
- }
-
- free(mxl);
- free(lxm);
- free(rowmax);
- free(lu);
-
- return 0;
-}
diff --git a/sextractor/src/wcs/lin.h b/sextractor/src/wcs/lin.h
deleted file mode 100644
index 50e9db6..0000000
--- a/sextractor/src/wcs/lin.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: lin.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifndef WCSLIB_LIN
-#define WCSLIB_LIN
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(__STDC__) && !defined(__cplusplus)
-#ifndef const
-#define const
-#endif
-#endif
-
-struct linprm {
- int flag;
- int naxis;
- double *crpix;
- double *pc;
- double *cdelt;
-
- /* Intermediates. */
- double *piximg;
- double *imgpix;
-};
-
-#if __STDC__ || defined(__cplusplus)
- int linset(struct linprm *);
- int linfwd(const double[], struct linprm *, double[]);
- int linrev(const double[], struct linprm *, double[]);
- int matinv(const int, const double [], double []);
-#else
- int linset(), linfwd(), linrev(), matinv();
-#endif
-
-extern const char *linset_errmsg[];
-extern const char *linfwd_errmsg[];
-extern const char *linrev_errmsg[];
-
-#define LINSET 137
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* WCSLIB_LIN */
diff --git a/sextractor/src/wcs/poly.c b/sextractor/src/wcs/poly.c
deleted file mode 100644
index d8c9a1e..0000000
--- a/sextractor/src/wcs/poly.c
+++ /dev/null
@@ -1,914 +0,0 @@
- /*
- poly.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using Polynomials
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Polynomial fitting
-*
-* Last modify: 08/03/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "poly.h"
-
-
-#define QCALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)calloc((size_t)(nel),sizeof(typ)))) \
- qerror("Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-#define QMALLOC(ptr, typ, nel) \
- {if (!(ptr = (typ *)malloc((size_t)(nel)*sizeof(typ)))) \
- qerror("Not enough memory for ", \
- #ptr " (" #nel " elements) !");;}
-
-/********************************* qerror ************************************/
-/*
-I hope it will never be used!
-*/
-void qerror(char *msg1, char *msg2)
- {
- fprintf(stderr, "\n> %s%s\n\n",msg1,msg2);
- exit(-1);
- }
-
-
-/****** poly_init ************************************************************
-PROTO polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
-PURPOSE Allocate and initialize a polynom structure.
-INPUT 1D array containing the group for each parameter,
- number of dimensions (parameters),
- 1D array with the polynomial degree for each group,
- number of groups.
-OUTPUT polystruct pointer.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 08/03/2003
- ***/
-polystruct *poly_init(int *group, int ndim, int *degree, int ngroup)
- {
- void qerror(char *msg1, char *msg2);
- polystruct *poly;
- char str[512];
- int nd[POLY_MAXDIM];
- int *groupt,
- d,g,n,num,den;
-
- QCALLOC(poly, polystruct, 1);
- if ((poly->ndim=ndim) > POLY_MAXDIM)
- {
- sprintf(str, "The dimensionality of the polynom (%d) exceeds the maximum\n"
- "allowed one (%d)", ndim, POLY_MAXDIM);
- qerror("*Error*: ", str);
- }
-
- if (ndim)
- QMALLOC(poly->group, int, poly->ndim);
- for (groupt=poly->group, d=ndim; d--;)
- *(groupt++) = *(group++)-1;
-
- poly->ngroup = ngroup;
- if (ngroup)
- {
- group = poly->group; /* Forget the original *group */
-
- QMALLOC(poly->degree, int, poly->ngroup);
-
-/*-- Compute the number of context parameters for each group */
- memset(nd, 0, ngroup*sizeof(int));
- for (d=0; d<ndim; d++)
- {
- if ((g=group[d])>=ngroup)
- qerror("*Error*: polynomial GROUP out of range", "");
- nd[g]++;
- }
- }
-
-/* Compute the total number of coefficients */
- poly->ncoeff = 1;
- for (g=0; g<ngroup; g++)
- {
- if ((d=poly->degree[g]=*(degree++))>POLY_MAXDEGREE)
- {
- sprintf(str, "The degree of the polynom (%d) exceeds the maximum\n"
- "allowed one (%d)", poly->degree[g], POLY_MAXDEGREE);
- qerror("*Error*: ", str);
- }
-
-/*-- There are (n+d)!/(n!d!) coeffs per group, that is Prod_(i<=d) (n+i)/i */
- for (num=den=1, n=nd[g]; d; num*=(n+d), den*=d--);
- poly->ncoeff *= num/den;
- }
-
- QMALLOC(poly->basis, double, poly->ncoeff);
- QCALLOC(poly->coeff, double, poly->ncoeff);
-
- return poly;
- }
-
-
-/****** poly_end *************************************************************
-PROTO void poly_end(polystruct *poly)
-PURPOSE Free a polynom structure and everything it contains.
-INPUT polystruct pointer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 09/04/2000
- ***/
-void poly_end(polystruct *poly)
- {
- if (poly)
- {
- free(poly->coeff);
- free(poly->basis);
- free(poly->degree);
- free(poly->group);
- free(poly);
- }
- }
-
-
-/****** poly_func ************************************************************
-PROTO double poly_func(polystruct *poly, double *pos)
-PURPOSE Evaluate a multidimensional polynom.
-INPUT polystruct pointer,
- pointer to the 1D array of input vector data.
-OUTPUT Polynom value.
-NOTES Values of the basis functions are updated in poly->basis.
-AUTHOR E. Bertin (IAP)
-VERSION 03/03/2004
- ***/
-double poly_func(polystruct *poly, double *pos)
- {
- double xpol[POLY_MAXDIM+1];
- double *post, *xpolt, *basis, *coeff, xval;
- long double val;
- int expo[POLY_MAXDIM+1], gexpo[POLY_MAXDIM+1];
- int *expot, *degree,*degreet, *group,*groupt, *gexpot,
- d,g,t, ndim;
-
-/* Prepare the vectors and counters */
- ndim = poly->ndim;
- basis = poly->basis;
- coeff = poly->coeff;
- group = poly->group;
- degree = poly->degree;
- if (ndim)
- {
- for (xpolt=xpol, expot=expo, post=pos, d=ndim; --d;)
- {
- *(++xpolt) = 1.0;
- *(++expot) = 0;
- }
- for (gexpot=gexpo, degreet=degree, g=poly->ngroup; g--;)
- *(gexpot++) = *(degreet++);
- if (gexpo[*group])
- gexpo[*group]--;
- }
-
-/* The constant term is handled separately */
- val = *(coeff++);
- *(basis++) = 1.0;
- *expo = 1;
- *xpol = *pos;
-
-/* Compute the rest of the polynom */
- for (t=poly->ncoeff; --t; )
- {
-/*-- xpol[0] contains the current product of the x^n's */
- val += (*(basis++)=*xpol)**(coeff++);
-/*-- A complex recursion between terms of the polynom speeds up computations */
-/*-- Not too good for roundoff errors (prefer Horner's), but much easier for */
-/*-- multivariate polynomials: this is why we use a long double accumulator */
- post = pos;
- groupt = group;
- expot = expo;
- xpolt = xpol;
- for (d=0; d<ndim; d++, groupt++)
- if (gexpo[*groupt]--)
- {
- ++*(expot++);
- xval = (*(xpolt--) *= *post);
- while (d--)
- *(xpolt--) = xval;
- break;
- }
- else
- {
- gexpo[*groupt] = *expot;
- *(expot++) = 0;
- *(xpolt++) = 1.0;
- post++;
- }
- }
-
- return (double)val;
- }
-
-
-/****** poly_fit *************************************************************
-PROTO double poly_fit(polystruct *poly, double *x, double *y, double *w,
- int ndata, double *extbasis)
-PURPOSE Least-Square fit of a multidimensional polynom to weighted data.
-INPUT polystruct pointer,
- pointer to the (pseudo)2D array of inputs to basis functions,
- pointer to the 1D array of data values,
- pointer to the 1D array of data weights,
- number of data points,
- pointer to a (pseudo)2D array of computed basis function values.
-OUTPUT Chi2 of the fit.
-NOTES If different from NULL, extbasis can be provided to store the
- values of the basis functions. If x==NULL and extbasis!=NULL, the
- precomputed basis functions stored in extbasis are used (which saves
- CPU). If w is NULL, all points are given identical weight.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 08/03/2005
- ***/
-void poly_fit(polystruct *poly, double *x, double *y, double *w, int ndata,
- double *extbasis)
- {
- void qerror(char *msg1, char *msg2);
- double /*offset[POLY_MAXDIM],*/x2[POLY_MAXDIM],
- *alpha,*alphat, *beta,*betat, *basis,*basis1,*basis2, *coeff,
- *extbasist,*xt,
- val,wval,yval;
- int ncoeff, ndim, matsize,
- d,i,j,n;
-
- if (!x && !extbasis)
- qerror("*Internal Error*: One of x or extbasis should be "
- "different from NULL\nin ", "poly_func()");
- ncoeff = poly->ncoeff;
- ndim = poly->ndim;
- matsize = ncoeff*ncoeff;
- basis = poly->basis;
- extbasist = extbasis;
- QCALLOC(alpha, double, matsize);
- QCALLOC(beta, double, ncoeff);
-
-/* Subtract an average offset to maintain precision (droped for now ) */
-/*
- if (x)
- {
- for (d=0; d<ndim; d++)
- offset[d] = 0.0;
- xt = x;
- for (n=ndata; n--;)
- for (d=0; d<ndim; d++)
- offset[d] += *(xt++);
- for (d=0; d<ndim; d++)
- offset[d] /= (double)ndata;
- }
-*/
-/* Build the covariance matrix */
- xt = x;
- for (n=ndata; n--;)
- {
- if (x)
- {
-/*---- If x!=NULL, compute the basis functions */
- for (d=0; d<ndim; d++)
- x2[d] = *(xt++)/* - offset[d]*/;
- poly_func(poly, x2);
-/*---- If, in addition, extbasis is provided, then fill it */
- if (extbasis)
- for (basis1=basis,j=ncoeff; j--;)
- *(extbasist++) = *(basis1++);
- }
- else
-/*---- If x==NULL, then rely on pre-computed basis functions */
- for (basis1=basis,j=ncoeff; j--;)
- *(basis1++) = *(extbasist++);
-
- basis1 = basis;
- wval = w? *(w++) : 1.0;
- yval = *(y++);
- betat = beta;
- alphat = alpha;
- for (j=ncoeff; j--;)
- {
- val = *(basis1++)*wval;
- *(betat++) += val*yval;
- for (basis2=basis,i=ncoeff; i--;)
- *(alphat++) += val**(basis2++);
- }
- }
-
-/* Solve the system */
- poly_solve(alpha,beta,ncoeff);
-
- free(alpha);
-
-/* Now fill the coeff array with the result of the fit */
- betat = beta;
- coeff = poly->coeff;
- for (j=ncoeff; j--;)
- *(coeff++) = *(betat++);
-/*
- poly_addcste(poly, offset);
-*/
- free(beta);
-
- return;
- }
-
-
-/****** poly_addcste *********************************************************
-PROTO void poly_addcste(polystruct *poly, double *cste)
-PURPOSE Modify matrix coefficients to mimick the effect of adding a cst to
- the input of a polynomial.
-INPUT Pointer to the polynomial structure,
- Pointer to the vector of cst.
-OUTPUT -.
-NOTES Requires quadruple-precision. **For the time beeing, this function
- returns completely wrong results!!**
-AUTHOR E. Bertin (IAP)
-VERSION 03/03/2004
- ***/
-void poly_addcste(polystruct *poly, double *cste)
- {
- long double *acoeff;
- double *coeff,*mcoeff,*mcoefft,
- val;
- int *mpowers,*powers,*powerst,*powerst2,
- i,j,n,p, denum, flag, maxdegree, ncoeff, ndim;
-
- ncoeff = poly->ncoeff;
- ndim = poly->ndim;
- maxdegree = 0;
- for (j=0; j<poly->ngroup; j++)
- if (maxdegree < poly->degree[j])
- maxdegree = poly->degree[j];
- maxdegree++; /* Actually we need maxdegree+1 terms */
- QCALLOC(acoeff, long double, ncoeff);
- QCALLOC(mcoeff, double, ndim*maxdegree);
- QCALLOC(mpowers, int, ndim);
- mcoefft = mcoeff; /* To avoid gcc -Wall warnings */
- powerst = powers = poly_powers(poly);
- coeff = poly->coeff;
- for (i=0; i<ncoeff; i++)
- {
- for (j=0; j<ndim; j++)
- {
- mpowers[j] = n = *(powerst++);
- mcoefft = mcoeff+j*maxdegree+n;
- denum = 1;
- val = 1.0;
- for (p=n+1; p--;)
- {
- *(mcoefft--) = val;
- val *= (cste[j]*(n--))/(denum++); /* This is C_n^p X^(n-p) */
- }
- }
-/*-- Update all valid coefficients */
- powerst2 = powers;
- for (p=0; p<ncoeff; p++)
- {
-/*---- Check that this combination of powers is included in the series above */
- flag = 0;
- for (j=0; j<ndim; j++)
- if (mpowers[j] < powerst2[j])
- {
- flag = 1;
- powerst2 += ndim;
- break;
- }
- if (flag == 1)
- continue;
- val = 1.0;
- mcoefft = mcoeff;
- for (j=ndim; j--; mcoefft += maxdegree)
- val *= mcoefft[*(powerst2++)];
- acoeff[i] += val*coeff[p];
-/*
-printf("%g \n", val);
-*/
- }
- }
-
-/* Add the new coefficients to the previous ones */
-
- for (i=0; i<ncoeff; i++)
-{
-/*
-printf("%g %g\n", coeff[i], (double)acoeff[i]);
-*/
- coeff[i] = (double)acoeff[i];
-}
-
- free(acoeff);
- free(mcoeff);
- free(mpowers);
- free(powers);
-
- return;
- }
-
-/****** poly_solve ************************************************************
-PROTO void poly_solve(double *a, double *b, int n)
-PURPOSE Solve a system of linear equations, using Cholesky decomposition or
- SVD (if the former fails due to hidden correlation between variables).
-INPUT Pointer to the (pseudo 2D) matrix of coefficients,
- pointer to the 1D column vector,
- matrix size.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 21/09/2004
- ***/
-void poly_solve(double *a, double *b, int n)
- {
- double *vmat,*wmat;
-
- if (cholsolve(a,b,n))
- {
- QMALLOC(vmat, double, n*n);
- QMALLOC(wmat, double, n);
- svdsolve(a, b, n,n, vmat,wmat);
- free(vmat);
- free(wmat);
- }
-
- return;
- }
-
-/****** cholsolve *************************************************************
-PROTO void cholsolve(double *a, double *b, int n)
-PURPOSE Solve a system of linear equations, using Cholesky decomposition.
-INPUT Pointer to the (pseudo 2D) matrix of coefficients,
- pointer to the 1D column vector,
- matrix size.
-OUTPUT -1 if the matrix is not positive-definite, 0 otherwise.
-NOTES Based on Numerical Recipes, 2nd ed. (Chap 2.9). The matrix of
- coefficients must be symmetric and positive definite.
-AUTHOR E. Bertin (IAP, Leiden observatory & ESO)
-VERSION 28/10/2003
- ***/
-int cholsolve(double *a, double *b, int n)
- {
- void qerror(char *msg1, char *msg2);
- double *p, *x, sum;
- int i,j,k;
-
-/* Allocate memory to store the diagonal elements */
- QMALLOC(p, double, n);
-
-/* Cholesky decomposition */
- for (i=0; i<n; i++)
- for (j=i; j<n; j++)
- {
- for (sum=a[i*n+j],k=i-1; k>=0; k--)
- sum -= a[i*n+k]*a[j*n+k];
- if (i==j)
- {
- if (sum <= 0.0)
- {
- free(p);
- return -1;
- }
- p[i] = sqrt(sum);
- }
- else
- a[j*n+i] = sum/p[i];
- }
-
-/* Solve the system */
- x = b; /* Just to save memory: the solution replaces b */
- for (i=0; i<n; i++)
- {
- for (sum=b[i],k=i-1; k>=0; k--)
- sum -= a[i*n+k]*x[k];
- x[i] = sum/p[i];
- }
-
- for (i=n-1; i>=0; i--)
- {
- for (sum=x[i],k=i+1; k<n; k++)
- sum -= a[k*n+i]*x[k];
- x[i] = sum/p[i];
- }
-
- free(p);
-
- return 0;
- }
-
-
-/****** svdsolve *************************************************************
-PROTO void svdsolve(double *a, double *b, int m, int n, double *vmat,
- double *wmat)
-PURPOSE General least-square fit A.x = b, based on Singular Value
- Decomposition (SVD).
- Loosely adapted from Numerical Recipes in C, 2nd Ed. (p. 671).
-INPUT Pointer to the (pseudo 2D) matrix of coefficients,
- pointer to the 1D column vector (replaced by solution in output),
- number of matrix rows,
- number of matrix columns,
- pointer to the (pseudo 2D) SVD matrix,
- pointer to the diagonal (1D) matrix of singular values.
-OUTPUT -.
-NOTES Loosely adapted from Numerical Recipes in C, 2nd Ed. (p. 671). The a
- and v matrices are transposed with respect to the N.R. convention.
-AUTHOR E. Bertin (IAP)
-VERSION 26/12/2003
- ***/
-void svdsolve(double *a, double *b, int m, int n, double *vmat, double *wmat)
- {
-#define MAX(a,b) (maxarg1=(a),maxarg2=(b),(maxarg1) > (maxarg2) ?\
- (maxarg1) : (maxarg2))
-#define PYTHAG(a,b) ((at=fabs(a)) > (bt=fabs(b)) ? \
- (ct=bt/at,at*sqrt(1.0+ct*ct)) \
- : (bt ? (ct=at/bt,bt*sqrt(1.0+ct*ct)): 0.0))
-#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
-#define TOL 1.0e-11
- void qerror(char *msg1, char *msg2);
-
- int flag,i,its,j,jj,k,l,mmi,nm, nml;
- double *w,*ap,*ap0,*ap1,*ap10,*rv1p,*vp,*vp0,*vp1,*vp10,
- *bp,*tmpp, *rv1,*tmp, *sol,
- c,f,h,s,x,y,z,
- anorm, g, scale,
- at,bt,ct,maxarg1,maxarg2,
- thresh, wmax;
-
- anorm = g = scale = 0.0;
- if (m < n)
- qerror("*Error*: Not enough rows for solving the system ", "in svdfit()");
-
- sol = b; /* The solution overwrites the input column matrix */
- QMALLOC(rv1, double, n);
- QMALLOC(tmp, double, n);
- l = nm = nml = 0; /* To avoid gcc -Wall warnings */
- for (i=0;i<n;i++)
- {
- l = i+1;
- nml = n-l;
- rv1[i] = scale*g;
- g = s = scale = 0.0;
- if ((mmi = m - i) > 0)
- {
- ap = ap0 = a+i*(m+1);
- for (k=mmi;k--;)
- scale += fabs(*(ap++));
- if (scale)
- {
- for (ap=ap0,k=mmi; k--; ap++)
- {
- *ap /= scale;
- s += *ap**ap;
- }
- f = *ap0;
- g = -SIGN(sqrt(s),f);
- h = f*g-s;
- *ap0 = f-g;
- ap10 = a+l*m+i;
- for (j=nml;j--; ap10+=m)
- {
- for (s=0.0,ap=ap0,ap1=ap10,k=mmi; k--;)
- s += *(ap1++)**(ap++);
- f = s/h;
- for (ap=ap0,ap1=ap10,k=mmi; k--;)
- *(ap1++) += f**(ap++);
- }
- for (ap=ap0,k=mmi; k--;)
- *(ap++) *= scale;
- }
- }
- wmat[i] = scale*g;
- g = s = scale = 0.0;
- if (i < m && i+1 != n)
- {
- ap = ap0 = a+i+m*l;
- for (k=nml;k--; ap+=m)
- scale += fabs(*ap);
- if (scale)
- {
- for (ap=ap0,k=nml;k--; ap+=m)
- {
- *ap /= scale;
- s += *ap**ap;
- }
- f=*ap0;
- g = -SIGN(sqrt(s),f);
- h=f*g-s;
- *ap0=f-g;
- rv1p = rv1+l;
- for (ap=ap0,k=nml;k--; ap+=m)
- *(rv1p++) = *ap/h;
- ap10 = a+l+m*l;
- for (j=m-l; j--; ap10++)
- {
- for (s=0.0,ap=ap0,ap1=ap10,k=nml; k--; ap+=m,ap1+=m)
- s += *ap1**ap;
- rv1p = rv1+l;
- for (ap1=ap10,k=nml;k--; ap1+=m)
- *ap1 += s**(rv1p++);
- }
- for (ap=ap0,k=nml;k--; ap+=m)
- *ap *= scale;
- }
- }
- anorm=MAX(anorm,(fabs(wmat[i])+fabs(rv1[i])));
- }
-
- for (i=n-1;i>=0;i--)
- {
- if (i < n-1)
- {
- if (g)
- {
- ap0 = a+l*m+i;
- vp0 = vmat+i*n+l;
- vp10 = vmat+l*n+l;
- g *= *ap0;
- for (ap=ap0,vp=vp0,j=nml; j--; ap+=m)
- *(vp++) = *ap/g;
- for (j=nml; j--; vp10+=n)
- {
- for (s=0.0,ap=ap0,vp1=vp10,k=nml; k--; ap+=m)
- s += *ap**(vp1++);
- for (vp=vp0,vp1=vp10,k=nml; k--;)
- *(vp1++) += s**(vp++);
- }
- }
- vp = vmat+l*n+i;
- vp1 = vmat+i*n+l;
- for (j=nml; j--; vp+=n)
- *vp = *(vp1++) = 0.0;
- }
- vmat[i*n+i]=1.0;
- g=rv1[i];
- l=i;
- nml = n-l;
- }
-
- for (i=(m<n?m:n); --i>=0;)
- {
- l=i+1;
- nml = n-l;
- mmi=m-i;
- g=wmat[i];
- ap0 = a+i*m+i;
- ap10 = ap0 + m;
- for (ap=ap10,j=nml;j--;ap+=m)
- *ap=0.0;
- if (g)
- {
- g=1.0/g;
- for (j=nml;j--; ap10+=m)
- {
- for (s=0.0,ap=ap0,ap1=ap10,k=mmi; --k;)
- s += *(++ap)**(++ap1);
- f = (s/(*ap0))*g;
- for (ap=ap0,ap1=ap10,k=mmi;k--;)
- *(ap1++) += f**(ap++);
- }
- for (ap=ap0,j=mmi;j--;)
- *(ap++) *= g;
- }
- else
- for (ap=ap0,j=mmi;j--;)
- *(ap++)=0.0;
- ++(*ap0);
- }
-
- for (k=n; --k>=0;)
- {
- for (its=0;its<100;its++)
- {
- flag=1;
- for (l=k;l>=0;l--)
- {
- nm=l-1;
- if (fabs(rv1[l])+anorm == anorm)
- {
- flag=0;
- break;
- }
- if (fabs(wmat[nm])+anorm == anorm)
- break;
- }
- if (flag)
- {
- c=0.0;
- s=1.0;
- ap0 = a+nm*m;
- ap10 = a+l*m;
- for (i=l; i<=k; i++,ap10+=m)
- {
- f=s*rv1[i];
- if (fabs(f)+anorm == anorm)
- break;
- g=wmat[i];
- h=PYTHAG(f,g);
- wmat[i]=h;
- h=1.0/h;
- c=g*h;
- s=(-f*h);
- for (ap=ap0,ap1=ap10,j=m; j--;)
- {
- z = *ap1;
- y = *ap;
- *(ap++) = y*c+z*s;
- *(ap1++) = z*c-y*s;
- }
- }
- }
- z=wmat[k];
- if (l == k)
- {
- if (z < 0.0)
- {
- wmat[k] = -z;
- vp = vmat+k*n;
- for (j=n; j--; vp++)
- *vp = (-*vp);
- }
- break;
- }
- if (its == 99)
- qerror("*Error*: No convergence in 100 SVD iterations ",
- "in svdfit()");
- x=wmat[l];
- nm=k-1;
- y=wmat[nm];
- g=rv1[nm];
- h=rv1[k];
- f=((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y);
- g=PYTHAG(f,1.0);
- f=((x-z)*(x+z)+h*((y/(f+SIGN(g,f)))-h))/x;
- c=s=1.0;
- ap10 = a+l*m;
- vp10 = vmat+l*n;
- for (j=l;j<=nm;j++,ap10+=m,vp10+=n)
- {
- i=j+1;
- g=rv1[i];
- y=wmat[i];
- h=s*g;
- g=c*g;
- z=PYTHAG(f,h);
- rv1[j]=z;
- c=f/z;
- s=h/z;
- f=x*c+g*s;
- g=g*c-x*s;
- h=y*s;
- y=y*c;
- for (vp=(vp1=vp10)+n,jj=n; jj--;)
- {
- z = *vp;
- x = *vp1;
- *(vp1++) = x*c+z*s;
- *(vp++) = z*c-x*s;
- }
- z=PYTHAG(f,h);
- wmat[j]=z;
- if (z)
- {
- z=1.0/z;
- c=f*z;
- s=h*z;
- }
- f=c*g+s*y;
- x=c*y-s*g;
- for (ap=(ap1=ap10)+m,jj=m; jj--;)
- {
- z = *ap;
- y = *ap1;
- *(ap1++) = y*c+z*s;
- *(ap++) = z*c-y*s;
- }
- }
- rv1[l]=0.0;
- rv1[k]=f;
- wmat[k]=x;
- }
- }
-
- wmax=0.0;
- w = wmat;
- for (j=n;j--; w++)
- if (*w > wmax)
- wmax=*w;
- thresh=TOL*wmax;
- w = wmat;
- for (j=n;j--; w++)
- if (*w < thresh)
- *w = 0.0;
-
- w = wmat;
- ap = a;
- tmpp = tmp;
- for (j=n; j--; w++)
- {
- s=0.0;
- if (*w)
- {
- bp = b;
- for (i=m; i--;)
- s += *(ap++)**(bp++);
- s /= *w;
- }
- else
- ap += m;
- *(tmpp++) = s;
- }
-
- vp0 = vmat;
- for (j=0; j<n; j++,vp0++)
- {
- s=0.0;
- tmpp = tmp;
- for (vp=vp0,jj=n; jj--; vp+=n)
- s += *vp**(tmpp++);
- sol[j]=s;
- }
-/* Free temporary arrays */
- free(tmp);
- free(rv1);
-
- return;
- }
-
-#undef SIGN
-#undef MAX
-#undef PYTHAG
-#undef TOL
-
-/****** poly_powers ***********************************************************
-PROTO int *poly_powers(polystruct *poly)
-PURPOSE Return an array of powers of polynom terms
-INPUT polystruct pointer,
-OUTPUT Pointer to an array of polynom powers (int *), (ncoeff*ndim numbers).
-NOTES The returned pointer is mallocated.
-AUTHOR E. Bertin (IAP)
-VERSION 23/10/2003
- ***/
-int *poly_powers(polystruct *poly)
- {
- int expo[POLY_MAXDIM+1], gexpo[POLY_MAXDIM+1];
- int *expot, *degree,*degreet, *group,*groupt, *gexpot,
- *powers, *powerst,
- d,g,t, ndim;
-
-/* Prepare the vectors and counters */
- ndim = poly->ndim;
- group = poly->group;
- degree = poly->degree;
- QMALLOC(powers, int, ndim*poly->ncoeff);
- if (ndim)
- {
- for (expot=expo, d=ndim; --d;)
- *(++expot) = 0;
- for (gexpot=gexpo, degreet=degree, g=poly->ngroup; g--;)
- *(gexpot++) = *(degreet++);
- if (gexpo[*group])
- gexpo[*group]--;
- }
-
-/* The constant term is handled separately */
- powerst = powers;
- for (d=0; d<ndim; d++)
- *(powerst++) = 0;
- *expo = 1;
-
-/* Compute the rest of the polynom */
- for (t=poly->ncoeff; --t; )
- {
- for (d=0; d<ndim; d++)
- *(powerst++) = expo[d];
-/*-- A complex recursion between terms of the polynom speeds up computations */
- groupt = group;
- expot = expo;
- for (d=0; d<ndim; d++, groupt++)
- if (gexpo[*groupt]--)
- {
- ++*(expot++);
- break;
- }
- else
- {
- gexpo[*groupt] = *expot;
- *(expot++) = 0;
- }
- }
-
- return powers;
- }
-
diff --git a/sextractor/src/wcs/poly.h b/sextractor/src/wcs/poly.h
deleted file mode 100644
index db81aa6..0000000
--- a/sextractor/src/wcs/poly.h
+++ /dev/null
@@ -1,58 +0,0 @@
- /*
- poly.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: A program using polynomial fits
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Include for poly.c
-*
-* Last modify: 03/03/2004
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifndef _POLY_H_
-#define _POLY_H_
-
-/*--------------------------------- constants -------------------------------*/
-
-#define POLY_MAXDIM 4 /* Max dimensionality of polynom */
-#define POLY_MAXDEGREE 10 /* Max degree of the polynom */
-
-/*---------------------------------- macros ---------------------------------*/
-
-/*--------------------------- structure definitions -------------------------*/
-
-typedef struct poly
- {
- double *basis; /* Current values of the basis functions */
- double *coeff; /* Polynom coefficients */
- int ncoeff; /* Number of coefficients */
- int *group; /* Groups */
- int ndim; /* dimensionality of the polynom */
- int *degree; /* Degree in each group */
- int ngroup; /* Number of different groups */
- } polystruct;
-
-/*---------------------------------- protos --------------------------------*/
-
-extern polystruct *poly_init(int *group,int ndim,int *degree,int ngroup);
-
-extern double poly_func(polystruct *poly, double *pos);
-
-extern int cholsolve(double *a, double *b, int n),
- *poly_powers(polystruct *poly);
-
-extern void poly_addcste(polystruct *poly, double *cste),
- poly_end(polystruct *poly),
- poly_fit(polystruct *poly, double *x, double *y,
- double *w, int ndata, double *extbasis),
- poly_solve(double *a, double *b, int n),
- svdsolve(double *a, double *b, int m, int n,
- double *vmat, double *wmat);
-
-#endif
-
diff --git a/sextractor/src/wcs/proj.c b/sextractor/src/wcs/proj.c
deleted file mode 100644
index bca39a2..0000000
--- a/sextractor/src/wcs/proj.c
+++ /dev/null
@@ -1,3808 +0,0 @@
-/*============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-*=============================================================================
-*
-* C implementation of the spherical map projections recognized by the FITS
-* "World Coordinate System" (WCS) convention.
-*
-* Summary of routines
-* -------------------
-* Each projection is implemented via separate functions for the forward,
-* *fwd(), and reverse, *rev(), transformation.
-*
-* Initialization routines, *set(), compute intermediate values from the
-* projection parameters but need not be called explicitly - see the
-* explanation of prj.flag below.
-*
-* azpset azpfwd azprev AZP: zenithal/azimuthal perspective
-* tanset tanfwd tanrev TAN: gnomonic
-* sinset sinfwd sinrev SIN: orthographic/synthesis
-* stgset stgfwd stgrev STG: stereographic
-* arcset arcfwd arcrev ARC: zenithal/azimuthal equidistant
-* zpnset zpnfwd zpnrev ZPN: zenithal/azimuthal polynomial
-* zeaset zeafwd zearev ZEA: zenithal/azimuthal equal area
-* airset airfwd airrev AIR: Airy
-* cypset cypfwd cyprev CYP: cylindrical perspective
-* carset carfwd carrev CAR: Cartesian
-* merset merfwd merrev MER: Mercator
-* ceaset ceafwd cearev CEA: cylindrical equal area
-* copset copfwd coprev COP: conic perspective
-* codset codfwd codrev COD: conic equidistant
-* coeset coefwd coerev COE: conic equal area
-* cooset coofwd coorev COO: conic orthomorphic
-* bonset bonfwd bonrev BON: Bonne
-* pcoset pcofwd pcorev PCO: polyconic
-* glsset glsfwd glsrev GLS: Sanson-Flamsteed (global sinusoidal)
-* parset parfwd parrev PAR: parabolic
-* aitset aitfwd aitrev AIT: Hammer-Aitoff
-* molset molfwd molrev MOL: Mollweide
-* cscset cscfwd cscrev CSC: COBE quadrilateralized spherical cube
-* qscset qscfwd qscrev QSC: quadrilateralized spherical cube
-* tscset tscfwd tscrev TSC: tangential spherical cube
-* tnxset tnxfwd tnxrev TNX: IRAF's gnomonic
-*
-*
-* Initialization routine; *set()
-* ------------------------------
-* Initializes members of a prjprm data structure which hold intermediate
-* values. Note that this routine need not be called directly; it will be
-* invoked by prjfwd() and prjrev() if the "flag" structure member is
-* anything other than a predefined magic value.
-*
-* Given and/or returned:
-* prj prjprm* Projection parameters (see below).
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid projection parameters.
-*
-* Forward transformation; *fwd()
-* -----------------------------
-* Compute (x,y) coordinates in the plane of projection from native spherical
-* coordinates (phi,theta).
-*
-* Given:
-* phi, const double
-* theta Longitude and latitude of the projected point in
-* native spherical coordinates, in degrees.
-*
-* Given and returned:
-* prj prjprm* Projection parameters (see below).
-*
-* Returned:
-* x,y double* Projected coordinates.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid projection parameters.
-* 2: Invalid value of (phi,theta).
-*
-* Reverse transformation; *rev()
-* -----------------------------
-* Compute native spherical coordinates (phi,theta) from (x,y) coordinates in
-* the plane of projection.
-*
-* Given:
-* x,y const double
-* Projected coordinates.
-*
-* Given and returned:
-* prj prjprm* Projection parameters (see below).
-*
-* Returned:
-* phi, double* Longitude and latitude of the projected point in
-* theta native spherical coordinates, in degrees.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid projection parameters.
-* 2: Invalid value of (x,y).
-*
-* Projection parameters
-* ---------------------
-* The prjprm struct consists of the following:
-*
-* int flag
-* This flag must be set to zero whenever any of p[10] or r0 are set
-* or changed. This signals the initialization routine to recompute
-* intermediaries. flag may also be set to -1 to disable strict bounds
-* checking for the AZP, TAN, SIN, ZPN, and COP projections.
-* double r0
-* r0; The radius of the generating sphere for the projection, a linear
-* scaling parameter. If this is zero, it will be reset to the default
-* value of 180/pi (the value for FITS WCS).
-* double p[10]
-* The first 10 elements contain projection parameters which correspond
-* to the PROJPn keywords in FITS, so p[0] is PROJP0, and p[9] is
-* PROJP9. Many projections use p[1] (PROJP1) and some also use p[2]
-* (PROJP2). ZPN is the only projection which uses any of the others.
-*
-* The remaining members of the prjprm struct are maintained by the
-* initialization routines and should not be modified. This is done for the
-* sake of efficiency and to allow an arbitrary number of contexts to be
-* maintained simultaneously.
-*
-* int n
-* double w[10]
-* Intermediate values derived from the projection parameters.
-*
-* Usage of the p[] array as it applies to each projection is described in
-* the prologue to each trio of projection routines.
-*
-* Argument checking
-* -----------------
-* Forward routines:
-*
-* The values of phi and theta (the native longitude and latitude)
-* normally lie in the range [-180,180] for phi, and [-90,90] for theta.
-* However, all forward projections will accept any value of phi and will
-* not normalize it.
-*
-* The forward projection routines do not explicitly check that theta lies
-* within the range [-90,90]. They do check for any value of theta which
-* produces an invalid argument to the projection equations (e.g. leading
-* to division by zero). The forward routines for AZP, TAN, SIN, ZPN, and
-* COP also return error 2 if (phi,theta) corresponds to the overlapped
-* (far) side of the projection but also return the corresponding value of
-* (x,y). This strict bounds checking may be relaxed by setting prj->flag
-* to -1 (rather than 0) when these projections are initialized.
-*
-* Reverse routines:
-*
-* Error checking on the projected coordinates (x,y) is limited to that
-* required to ascertain whether a solution exists. Where a solution does
-* exist no check is made that the value of phi and theta obtained lie
-* within the ranges [-180,180] for phi, and [-90,90] for theta.
-*
-* Accuracy
-* --------
-* Closure to a precision of at least 1E-10 degree of longitude and latitude
-* has been verified for typical projection parameters on the 1 degree grid
-* of native longitude and latitude (to within 5 degrees of any latitude
-* where the projection may diverge).
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* IRAF's TNX added by E.Bertin 2000/08/23
-* $Id: proj.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include "poly.h"
-#include "proj.h"
-#include "tnx.h"
-#include "wcsmath.h"
-#include "wcstrig.h"
-
-/* Map error number to error message for each function. */
-const char *prjset_errmsg[] = {
- 0,
- "Invalid projection parameters"};
-
-const char *prjfwd_errmsg[] = {
- 0,
- "Invalid projection parameters",
- "Invalid value of (phi,theta)"};
-
-const char *prjrev_errmsg[] = {
- 0,
- "Invalid projection parameters",
- "Invalid value of (x,y)"};
-
-#define wcs_copysign(X, Y) ((Y) < 0.0 ? -fabs(X) : fabs(X))
-
-/*============================================================================
-* AZP: zenithal/azimuthal perspective projection.
-*
-* Given:
-* prj->p[1] AZP distance parameter, mu in units of r0.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(mu+1)
-* prj->w[1] 1/prj->w[0]
-* prj->w[2] Boundary parameter, -mu for |mu| <= 1,
-* -1/mu for |mu| >= 1.
-*===========================================================================*/
-
-int azpset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- prj->w[0] = prj->r0*(prj->p[1] + 1.0);
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
- if (fabs(prj->p[1]) <= 1.0) {
- prj->w[2] = -prj->p[1];
- } else {
- prj->w[2] = -1.0/prj->p[1];
- }
-
- if (prj->flag == -1) {
- prj->flag = -PRJSET;
- } else {
- prj->flag = PRJSET;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int azpfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double r, s, sthe;
-
- if (abs(prj->flag) != PRJSET) {
- if (azpset(prj)) return 1;
- }
-
- sthe = wcs_sind(theta);
-
- s = prj->p[1] + sthe;
- if (s == 0.0) {
- return 2;
- }
-
- r = prj->w[0]*wcs_cosd(theta)/s;
- *x = r*wcs_sind(phi);
- *y = -r*wcs_cosd(phi);
-
- if (prj->flag == PRJSET && sthe < prj->w[2]) {
- return 2;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int azprev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double r, rho, s;
- const double tol = 1.0e-13;
-
- if (abs(prj->flag) != PRJSET) {
- if (azpset(prj)) return 1;
- }
-
- r = sqrt(x*x + y*y);
- if (r == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(x, -y);
- }
-
- rho = r*prj->w[1];
- s = rho*prj->p[1]/sqrt(rho*rho+1.0);
- if (fabs(s) > 1.0) {
- if (fabs(s) > 1.0+tol) {
- return 2;
- }
- *theta = wcs_atan2d(1.0,rho) - wcs_copysign(90.0,s);
- } else {
- *theta = wcs_atan2d(1.0,rho) - wcs_asind(s);
- }
-
- return 0;
-}
-
-/*============================================================================
-* TAN: gnomonic projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-*===========================================================================*/
-
-int tanset(prj)
-
-struct prjprm *prj;
-
-{
- int k;
-
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- if (prj->flag == -1) {
- prj->flag = -PRJSET;
- } else {
- prj->flag = PRJSET;
- }
-
- for (k = 99; k >= 0 && prj->p[k] == 0.0 && prj->p[k+100] == 0.0; k--);
- if (k < 0)
- k = 0;
-
- prj->n = k;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int tanfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double r, s, xp[2];
-
- if (abs(prj->flag) != PRJSET) {
- if(tanset(prj)) return 1;
- }
-
- s = wcs_sind(theta);
- if (s == 0.0) return 2;
-
- r = prj->r0*wcs_cosd(theta)/s;
- xp[0] = r*wcs_sind(phi);
- xp[1] = -r*wcs_cosd(phi);
- *x = prj->inv_x? poly_func(prj->inv_x, xp) : xp[0];
- *y = prj->inv_y? poly_func(prj->inv_y, xp) : xp[1];
-
- if (prj->flag == PRJSET && s < 0.0) {
- return 2;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int tanrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double xp,yp, rp;
-
- if (abs(prj->flag) != PRJSET) {
- if (tanset(prj)) return 1;
- }
-
- if (prj->n)
- raw_to_pv(prj, x,y, &xp, &yp);
- else
- {
- xp = x;
- yp = y;
- }
- rp = sqrt(xp*xp+yp*yp);
- if (rp == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(xp, -yp);
- }
- *theta = wcs_atan2d(prj->r0, rp);
-
- return 0;
-}
-
-/*============================================================================
-* SIN: orthographic/synthesis projection.
-*
-* Given:
-* prj->p[1:2] SIN obliqueness parameters, alpha and beta.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] 1/r0
-* prj->w[1] alpha**2 + beta**2
-* prj->w[2] 2*(alpha**2 + beta**2)
-* prj->w[3] 2*(alpha**2 + beta**2 + 1)
-* prj->w[4] alpha**2 + beta**2 - 1
-*===========================================================================*/
-
-int sinset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- prj->w[0] = 1.0/prj->r0;
- prj->w[1] = prj->p[1]*prj->p[1] + prj->p[2]*prj->p[2];
- prj->w[2] = 2.0*prj->w[1];
- prj->w[3] = prj->w[2] + 2.0;
- prj->w[4] = prj->w[1] - 1.0;
-
- if (prj->flag == -1) {
- prj->flag = -PRJSET;
- } else {
- prj->flag = PRJSET;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int sinfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double cphi, cthe, sphi, t, z;
-
- if (abs(prj->flag) != PRJSET) {
- if (sinset(prj)) return 1;
- }
-
- t = (90.0 - fabs(theta))*D2R;
- if (t < 1.0e-5) {
- if (theta > 0.0) {
- z = -t*t/2.0;
- } else {
- z = -2.0 + t*t/2.0;
- }
- cthe = t;
- } else {
- z = wcs_sind(theta) - 1.0;
- cthe = wcs_cosd(theta);
- }
-
- cphi = wcs_cosd(phi);
- sphi = wcs_sind(phi);
- *x = prj->r0*(cthe*sphi + prj->p[1]*z);
- *y = -prj->r0*(cthe*cphi + prj->p[2]*z);
- /* Validate this solution. */
- if (prj->flag == PRJSET) {
- if (prj->w[1] == 0.0) {
- /* Orthographic projection. */
- if (theta < 0.0) {
- return 2;
- }
- } else {
- /* "Synthesis" projection. */
- t = wcs_atand(prj->p[1]*sphi + prj->p[2]*cphi);
- if (theta < t) {
- return 2;
- }
- }
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int sinrev (x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- const double tol = 1.0e-13;
- double a, b, c, d, r2, sth, sth1, sth2, sxy, x0, xp, y0, yp, z;
-
- if (abs(prj->flag) != PRJSET) {
- if (sinset(prj)) return 1;
- }
-
- /* Compute intermediaries. */
- x0 = x*prj->w[0];
- y0 = y*prj->w[0];
- r2 = x0*x0 + y0*y0;
-
- if (prj->w[1] == 0.0) {
- /* Orthographic projection. */
- if (r2 != 0.0) {
- *phi = wcs_atan2d(x0, -y0);
- } else {
- *phi = 0.0;
- }
-
- if (r2 < 0.5) {
- *theta = wcs_acosd(sqrt(r2));
- } else if (r2 <= 1.0) {
- *theta = wcs_asind(sqrt(1.0 - r2));
- } else {
- return 2;
- }
-
- } else {
- /* "Synthesis" projection. */
- if (r2 < 1.0e-10) {
- /* Use small angle formula. */
- z = -r2/2.0;
- *theta = 90.0 - R2D*sqrt(r2/(1.0 - x0*prj->p[1] + y0*prj->p[2]));
-
- } else {
- sxy = 2.0*(prj->p[1]*x0 - prj->p[2]*y0);
-
- a = prj->w[3];
- b = -(sxy + prj->w[2]);
- c = r2 + sxy + prj->w[4];
- d = b*b - 2.0*a*c;
-
- /* Check for a solution. */
- if (d < 0.0) {
- return 2;
- }
- d = sqrt(d);
-
- /* Choose solution closest to pole. */
- sth1 = (-b + d)/a;
- sth2 = (-b - d)/a;
- sth = (sth1>sth2) ? sth1 : sth2;
- if (sth > 1.0) {
- if (sth-1.0 < tol) {
- sth = 1.0;
- } else {
- sth = (sth1<sth2) ? sth1 : sth2;
- }
- }
- if (sth > 1.0 || sth < -1.0) {
- return 2;
- }
-
- *theta = wcs_asind(sth);
- z = sth - 1.0;
- }
-
- xp = -y0 - prj->p[2]*z;
- yp = x0 - prj->p[1]*z;
- if (xp == 0.0 && yp == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(yp,xp);
- }
- }
-
- return 0;
-}
-
-/*============================================================================
-* STG: stereographic projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] 2*r0
-* prj->w[1] 1/(2*r0)
-*===========================================================================*/
-
-int stgset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 360.0/PI;
- prj->w[1] = PI/360.0;
- } else {
- prj->w[0] = 2.0*prj->r0;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int stgfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double r, s;
-
- if (prj->flag != PRJSET) {
- if (stgset(prj)) return 1;
- }
-
- s = 1.0 + wcs_sind(theta);
- if (s == 0.0) {
- return 2;
- }
-
- r = prj->w[0]*wcs_cosd(theta)/s;
- *x = r*wcs_sind(phi);
- *y = -r*wcs_cosd(phi);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int stgrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double r;
-
- if (prj->flag != PRJSET) {
- if (stgset(prj)) return 1;
- }
-
- r = sqrt(x*x + y*y);
- if (r == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(x, -y);
- }
- *theta = 90.0 - 2.0*wcs_atand(r*prj->w[1]);
-
- return 0;
-}
-
-/*============================================================================
-* ARC: zenithal/azimuthal equidistant projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] (180/pi)/r0
-*===========================================================================*/
-
-int arcset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int arcfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double r;
-
- if (prj->flag != PRJSET) {
- if (arcset(prj)) return 1;
- }
-
- r = prj->w[0]*(90.0 - theta);
- *x = r*wcs_sind(phi);
- *y = -r*wcs_cosd(phi);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int arcrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double r;
-
- if (prj->flag != PRJSET) {
- if (arcset(prj)) return 1;
- }
-
- r = sqrt(x*x + y*y);
- if (r == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(x, -y);
- }
- *theta = 90.0 - r*prj->w[1];
-
- return 0;
-}
-
-/*============================================================================
-* ZPN: zenithal/azimuthal polynomial projection.
-*
-* Given:
-* prj->p[0:99] Polynomial coefficients.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->n Degree of the polynomial, N.
-* prj->w[0] Co-latitude of the first point of inflection (N > 2).
-* prj->w[1] Radius of the first point of inflection (N > 2).
-*===========================================================================*/
-
-int zpnset(prj)
-
-struct prjprm *prj;
-
-{
- int i, j, k;
- double d, d1, d2, r, zd, zd1, zd2;
- const double tol = 1.0e-13;
-
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- /* Find the highest non-zero coefficient. */
- for (k = 99; k >= 0 && prj->p[k] == 0.0; k--);
- if (k < 0) return 1;
-
- prj->n = k;
-
- if (k >= 3) {
- /* Find the point of inflection closest to the pole. */
- zd1 = 0.0;
- d1 = prj->p[1];
- if (d1 <= 0.0) {
- return 1;
- }
-
- /* Find the point where the derivative first goes negative. */
- for (i = 0; i < 180; i++) {
- zd2 = i*D2R;
- d2 = 0.0;
- for (j = k; j > 0; j--) {
- d2 = d2*zd2 + j*prj->p[j];
- }
-
- if (d2 <= 0.0) break;
- zd1 = zd2;
- d1 = d2;
- }
-
- if (i == 180) {
- /* No negative derivative -> no point of inflection. */
- zd = PI;
- } else {
- /* Find where the derivative is zero. */
- for (i = 1; i <= 10; i++) {
- zd = zd1 - d1*(zd2-zd1)/(d2-d1);
-
- d = 0.0;
- for (j = k; j > 0; j--) {
- d = d*zd + j*prj->p[j];
- }
-
- if (fabs(d) < tol) break;
-
- if (d < 0.0) {
- zd2 = zd;
- d2 = d;
- } else {
- zd1 = zd;
- d1 = d;
- }
- }
- }
-
- r = 0.0;
- for (j = k; j >= 0; j--) {
- r = r*zd + prj->p[j];
- }
- prj->w[0] = zd;
- prj->w[1] = r;
- }
-
- if (prj->flag == -1) {
- prj->flag = -PRJSET;
- } else {
- prj->flag = PRJSET;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int zpnfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- int j;
- double r, s;
-
- if (abs(prj->flag) != PRJSET) {
- if (zpnset(prj)) return 1;
- }
-
- s = (90.0 - theta)*D2R;
- r = 0.0;
- for (j = prj->n; j >= 0; j--) {
- r = r*s + prj->p[j];
- }
- r = prj->r0*r;
-
- *x = r*wcs_sind(phi);
- *y = -r*wcs_cosd(phi);
-
- if (prj->flag == PRJSET && s > prj->w[0]) {
- return 2;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int zpnrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- int i, j, k;
- double a, b, c, d, lambda, r, r1, r2, rt, zd, zd1, zd2;
- const double tol = 1.0e-13;
-
- if (abs(prj->flag) != PRJSET) {
- if (zpnset(prj)) return 1;
- }
-
- k = prj->n;
-
- r = sqrt(x*x + y*y)/prj->r0;
-
- if (k < 1) {
- /* Constant - no solution. */
- return 1;
- } else if (k == 1) {
- /* Linear. */
- zd = (r - prj->p[0])/prj->p[1];
- } else if (k == 2) {
- /* Quadratic. */
- a = prj->p[2];
- b = prj->p[1];
- c = prj->p[0] - r;
-
- d = b*b - 4.0*a*c;
- if (d < 0.0) {
- return 2;
- }
- d = sqrt(d);
-
- /* Choose solution closest to pole. */
- zd1 = (-b + d)/(2.0*a);
- zd2 = (-b - d)/(2.0*a);
- zd = (zd1<zd2) ? zd1 : zd2;
- if (zd < -tol) zd = (zd1>zd2) ? zd1 : zd2;
- if (zd < 0.0) {
- if (zd < -tol) {
- return 2;
- }
- zd = 0.0;
- } else if (zd > PI) {
- if (zd > PI+tol) {
- return 2;
- }
- zd = PI;
- }
- } else {
- /* Higher order - solve iteratively. */
- zd1 = 0.0;
- r1 = prj->p[0];
- zd2 = prj->w[0];
- r2 = prj->w[1];
-
- if (r < r1) {
- if (r < r1-tol) {
- return 2;
- }
- zd = zd1;
- } else if (r > r2) {
- if (r > r2+tol) {
- return 2;
- }
- zd = zd2;
- } else {
- /* Disect the interval. */
- for (j = 0; j < 100; j++) {
- lambda = (r2 - r)/(r2 - r1);
- if (lambda < 0.1) {
- lambda = 0.1;
- } else if (lambda > 0.9) {
- lambda = 0.9;
- }
-
- zd = zd2 - lambda*(zd2 - zd1);
-
- rt = 0.0;
- for (i = k; i >= 0; i--) {
- rt = (rt * zd) + prj->p[i];
- }
-
- if (rt < r) {
- if (r-rt < tol) break;
- r1 = rt;
- zd1 = zd;
- } else {
- if (rt-r < tol) break;
- r2 = rt;
- zd2 = zd;
- }
-
- if (fabs(zd2-zd1) < tol) break;
- }
- }
- }
-
- if (r == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(x, -y);
- }
- *theta = 90.0 - zd*R2D;
-
- return 0;
-}
-
-/*============================================================================
-* ZEA: zenithal/azimuthal equal area projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] 2*r0
-* prj->w[1] 1/(2*r0)
-*===========================================================================*/
-
-int zeaset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 360.0/PI;
- prj->w[1] = PI/360.0;
- } else {
- prj->w[0] = 2.0*prj->r0;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int zeafwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double r;
-
- if (prj->flag != PRJSET) {
- if (zeaset(prj)) return 1;
- }
-
- r = prj->w[0]*wcs_sind((90.0 - theta)/2.0);
- *x = r*wcs_sind(phi);
- *y = -r*wcs_cosd(phi);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int zearev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double r, s;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (zeaset(prj)) return 1;
- }
-
- r = sqrt(x*x + y*y);
- if (r == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(x, -y);
- }
-
- s = r*prj->w[1];
- if (fabs(s) > 1.0) {
- if (fabs(r - prj->w[0]) < tol) {
- *theta = -90.0;
- } else {
- return 2;
- }
- } else {
- *theta = 90.0 - 2.0*wcs_asind(s);
- }
-
- return 0;
-}
-
-/*============================================================================
-* AIR: Airy's projection.
-*
-* Given:
-* prj->p[1] Latitude theta_b within which the error is minimized,
-* in degrees.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] 2*r0
-* prj->w[1] ln(cos(xi_b))/tan(xi_b)**2, where xi_b = (90-theta_b)/2
-* prj->w[2] 1/2 - prj->w[1]
-* prj->w[3] 2*r0*prj->w[2]
-* prj->w[4] tol, cutoff for using small angle approximation, in
-* radians.
-* prj->w[5] prj->w[2]*tol
-* prj->w[6] (180/pi)/prj->w[2]
-*===========================================================================*/
-
-int airset(prj)
-
-struct prjprm *prj;
-
-{
- const double tol = 1.0e-4;
- double cxi;
-
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- prj->w[0] = 2.0*prj->r0;
- if (prj->p[1] == 90.0) {
- prj->w[1] = -0.5;
- prj->w[2] = 1.0;
- } else if (prj->p[1] > -90.0) {
- cxi = wcs_cosd((90.0 - prj->p[1])/2.0);
- prj->w[1] = log(cxi)*(cxi*cxi)/(1.0-cxi*cxi);
- prj->w[2] = 0.5 - prj->w[1];
- } else {
- return 1;
- }
-
- prj->w[3] = prj->w[0] * prj->w[2];
- prj->w[4] = tol;
- prj->w[5] = prj->w[2]*tol;
- prj->w[6] = R2D/prj->w[2];
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int airfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double cxi, r, txi, xi;
-
- if (prj->flag != PRJSET) {
- if (airset(prj)) return 1;
- }
-
- if (theta == 90.0) {
- r = 0.0;
- } else if (theta > -90.0) {
- xi = D2R*(90.0 - theta)/2.0;
- if (xi < prj->w[4]) {
- r = xi*prj->w[3];
- } else {
- cxi = wcs_cosd((90.0 - theta)/2.0);
- txi = sqrt(1.0-cxi*cxi)/cxi;
- r = -prj->w[0]*(log(cxi)/txi + prj->w[1]*txi);
- }
- } else {
- return 2;
- }
-
- *x = r*wcs_sind(phi);
- *y = -r*wcs_cosd(phi);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int airrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- int j;
- double cxi, lambda, r, r1, r2, rt, txi, x1, x2, xi;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (airset(prj)) return 1;
- }
-
- r = sqrt(x*x + y*y)/prj->w[0];
-
- if (r == 0.0) {
- xi = 0.0;
- } else if (r < prj->w[5]) {
- xi = r*prj->w[6];
- } else {
- /* Find a solution interval. */
- x1 = 1.0;
- r1 = 0.0;
- for (j = 0; j < 30; j++) {
- x2 = x1/2.0;
- txi = sqrt(1.0-x2*x2)/x2;
- r2 = -(log(x2)/txi + prj->w[1]*txi);
-
- if (r2 >= r) break;
- x1 = x2;
- r1 = r2;
- }
- if (j == 30) return 2;
-
- for (j = 0; j < 100; j++) {
- /* Weighted division of the interval. */
- lambda = (r2-r)/(r2-r1);
- if (lambda < 0.1) {
- lambda = 0.1;
- } else if (lambda > 0.9) {
- lambda = 0.9;
- }
- cxi = x2 - lambda*(x2-x1);
-
- txi = sqrt(1.0-cxi*cxi)/cxi;
- rt = -(log(cxi)/txi + prj->w[1]*txi);
-
- if (rt < r) {
- if (r-rt < tol) break;
- r1 = rt;
- x1 = cxi;
- } else {
- if (rt-r < tol) break;
- r2 = rt;
- x2 = cxi;
- }
- }
- if (j == 100) return 2;
-
- xi = wcs_acosd(cxi);
- }
-
- if (r == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(x, -y);
- }
- *theta = 90.0 - 2.0*xi;
-
- return 0;
-}
-
-/*============================================================================
-* CYP: cylindrical perspective projection.
-*
-* Given:
-* prj->p[1] Distance of point of projection from the centre of the
-* generating sphere, mu, in units of r0.
-* prj->p[2] Radius of the cylinder of projection, lambda, in units
-* of r0.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*lambda*(pi/180)
-* prj->w[1] (180/pi)/(r0*lambda)
-* prj->w[2] r0*(mu + lambda)
-* prj->w[3] 1/(r0*(mu + lambda))
-*===========================================================================*/
-
-int cypset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
-
- prj->w[0] = prj->p[2];
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
-
- prj->w[2] = R2D*(prj->p[1] + prj->p[2]);
- if (prj->w[2] == 0.0) {
- return 1;
- }
-
- prj->w[3] = 1.0/prj->w[2];
- } else {
- prj->w[0] = prj->r0*prj->p[2]*D2R;
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
-
- prj->w[2] = prj->r0*(prj->p[1] + prj->p[2]);
- if (prj->w[2] == 0.0) {
- return 1;
- }
-
- prj->w[3] = 1.0/prj->w[2];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int cypfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double s;
-
- if (prj->flag != PRJSET) {
- if (cypset(prj)) return 1;
- }
-
- s = prj->p[1] + wcs_cosd(theta);
- if (s == 0.0) {
- return 2;
- }
-
- *x = prj->w[0]*phi;
- *y = prj->w[2]*wcs_sind(theta)/s;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int cyprev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double eta;
-
- if (prj->flag != PRJSET) {
- if (cypset(prj)) return 1;
- }
-
- *phi = x*prj->w[1];
- eta = y*prj->w[3];
- *theta = wcs_atan2d(eta,1.0) + wcs_asind(eta*prj->p[1]/sqrt(eta*eta+1.0));
-
- return 0;
-}
-
-/*============================================================================
-* CAR: Cartesian projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] (180/pi)/r0
-*===========================================================================*/
-
-int carset(prj)
-
-struct prjprm *prj;
-
-{
-
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int carfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- if (prj->flag != PRJSET) {
- if (carset(prj)) return 1;
- }
-
- *x = prj->w[0]*phi;
- *y = prj->w[0]*theta;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int carrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- if (prj->flag != PRJSET) {
- if (carset(prj)) return 1;
- }
-
- *phi = prj->w[1]*x;
- *theta = prj->w[1]*y;
-
- return 0;
-}
-
-/*============================================================================
-* MER: Mercator's projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] (180/pi)/r0
-*===========================================================================*/
-
-int merset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int merfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- if (prj->flag != PRJSET) {
- if (merset(prj)) return 1;
- }
-
- if (theta <= -90.0 || theta >= 90.0) {
- return 2;
- }
-
- *x = prj->w[0]*phi;
- *y = prj->r0*log(wcs_tand((90.0+theta)/2.0));
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int merrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- if (prj->flag != PRJSET) {
- if (merset(prj)) return 1;
- }
-
- *phi = x*prj->w[1];
- *theta = 2.0*wcs_atand(exp(y/prj->r0)) - 90.0;
-
- return 0;
-}
-
-/*============================================================================
-* CEA: cylindrical equal area projection.
-*
-* Given:
-* prj->p[1] Square of the cosine of the latitude at which the
-* projection is conformal, lambda.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] (180/pi)/r0
-* prj->w[2] r0/lambda
-* prj->w[3] lambda/r0
-*===========================================================================*/
-
-int ceaset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- if (prj->p[1] <= 0.0 || prj->p[1] > 1.0) {
- return 1;
- }
- prj->w[2] = prj->r0/prj->p[1];
- prj->w[3] = prj->p[1]/prj->r0;
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = R2D/prj->r0;
- if (prj->p[1] <= 0.0 || prj->p[1] > 1.0) {
- return 1;
- }
- prj->w[2] = prj->r0/prj->p[1];
- prj->w[3] = prj->p[1]/prj->r0;
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int ceafwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- if (prj->flag != PRJSET) {
- if (ceaset(prj)) return 1;
- }
-
- *x = prj->w[0]*phi;
- *y = prj->w[2]*wcs_sind(theta);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int cearev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double s;
- const double tol = 1.0e-13;
-
- if (prj->flag != PRJSET) {
- if (ceaset(prj)) return 1;
- }
-
- s = y*prj->w[3];
- if (fabs(s) > 1.0) {
- if (fabs(s) > 1.0+tol) {
- return 2;
- }
- s = copysign(1.0,s);
- }
-
- *phi = x*prj->w[1];
- *theta = wcs_asind(s);
-
- return 0;
-}
-
-/*============================================================================
-* COP: conic perspective projection.
-*
-* Given:
-* prj->p[1] sigma = (theta2+theta1)/2
-* prj->p[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the
-* latitudes of the standard parallels, in degrees.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] C = sin(sigma)
-* prj->w[1] 1/C
-* prj->w[2] Y0 = r0*cos(delta)*cot(sigma)
-* prj->w[3] r0*cos(delta)
-* prj->w[4] 1/(r0*cos(delta)
-* prj->w[5] cot(sigma)
-*===========================================================================*/
-
-int copset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- prj->w[0] = wcs_sind(prj->p[1]);
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
-
- prj->w[3] = prj->r0*wcs_cosd(prj->p[2]);
- if (prj->w[3] == 0.0) {
- return 1;
- }
-
- prj->w[4] = 1.0/prj->w[3];
- prj->w[5] = 1.0/wcs_tand(prj->p[1]);
-
- prj->w[2] = prj->w[3]*prj->w[5];
-
- if (prj->flag == -1) {
- prj->flag = -PRJSET;
- } else {
- prj->flag = PRJSET;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int copfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double a, r, s, t;
-
- if (abs(prj->flag) != PRJSET) {
- if (copset(prj)) return 1;
- }
-
- t = theta - prj->p[1];
- s = wcs_cosd(t);
- if (s == 0.0) {
- return 2;
- }
-
- a = prj->w[0]*phi;
- r = prj->w[2] - prj->w[3]*wcs_sind(t)/s;
-
- *x = r*wcs_sind(a);
- *y = prj->w[2] - r*wcs_cosd(a);
-
- if (prj->flag == PRJSET && r*prj->w[0] < 0.0) {
- return 2;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int coprev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double a, dy, r;
-
- if (abs(prj->flag) != PRJSET) {
- if (copset(prj)) return 1;
- }
-
- dy = prj->w[2] - y;
- r = sqrt(x*x + dy*dy);
- if (prj->p[1] < 0.0) r = -r;
-
- if (r == 0.0) {
- a = 0.0;
- } else {
- a = wcs_atan2d(x/r, dy/r);
- }
-
- *phi = a*prj->w[1];
- *theta = prj->p[1] + wcs_atand(prj->w[5] - r*prj->w[4]);
-
- return 0;
-}
-
-/*============================================================================
-* COD: conic equidistant projection.
-*
-* Given:
-* prj->p[1] sigma = (theta2+theta1)/2
-* prj->p[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the
-* latitudes of the standard parallels, in degrees.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] C = r0*sin(sigma)*sin(delta)/delta
-* prj->w[1] 1/C
-* prj->w[2] Y0 = delta*cot(delta)*cot(sigma)
-* prj->w[3] Y0 + sigma
-*===========================================================================*/
-
-int codset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- if (prj->p[2] == 0.0) {
- prj->w[0] = prj->r0*wcs_sind(prj->p[1])*D2R;
- } else {
- prj->w[0] = prj->r0*wcs_sind(prj->p[1])*wcs_sind(prj->p[2])/prj->p[2];
- }
-
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
- prj->w[2] = prj->r0*wcs_cosd(prj->p[2])*wcs_cosd(prj->p[1])/prj->w[0];
- prj->w[3] = prj->w[2] + prj->p[1];
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int codfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double a, r;
-
- if (prj->flag != PRJSET) {
- if (codset(prj)) return 1;
- }
-
- a = prj->w[0]*phi;
- r = prj->w[3] - theta;
-
- *x = r*wcs_sind(a);
- *y = prj->w[2] - r*wcs_cosd(a);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int codrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double a, dy, r;
-
- if (prj->flag != PRJSET) {
- if (codset(prj)) return 1;
- }
-
- dy = prj->w[2] - y;
- r = sqrt(x*x + dy*dy);
- if (prj->p[1] < 0.0) r = -r;
-
- if (r == 0.0) {
- a = 0.0;
- } else {
- a = wcs_atan2d(x/r, dy/r);
- }
-
- *phi = a*prj->w[1];
- *theta = prj->w[3] - r;
-
- return 0;
-}
-
-/*============================================================================
-* COE: conic equal area projection.
-*
-* Given:
-* prj->p[1] sigma = (theta2+theta1)/2
-* prj->p[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the
-* latitudes of the standard parallels, in degrees.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] C = (sin(theta1) + sin(theta2))/2
-* prj->w[1] 1/C
-* prj->w[2] Y0 = chi*sqrt(psi - 2C*wcs_sind(sigma))
-* prj->w[3] chi = r0/C
-* prj->w[4] psi = 1 + sin(theta1)*sin(theta2)
-* prj->w[5] 2C
-* prj->w[6] (1 + sin(theta1)*sin(theta2))*(r0/C)**2
-* prj->w[7] C/(2*r0**2)
-* prj->w[8] chi*sqrt(psi + 2C)
-*===========================================================================*/
-
-int coeset(prj)
-
-struct prjprm *prj;
-
-{
- double theta1, theta2;
-
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- theta1 = prj->p[1] - prj->p[2];
- theta2 = prj->p[1] + prj->p[2];
-
- prj->w[0] = (wcs_sind(theta1) + wcs_sind(theta2))/2.0;
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
-
- prj->w[3] = prj->r0/prj->w[0];
- prj->w[4] = 1.0 + wcs_sind(theta1)*wcs_sind(theta2);
- prj->w[5] = 2.0*prj->w[0];
- prj->w[6] = prj->w[3]*prj->w[3]*prj->w[4];
- prj->w[7] = 1.0/(2.0*prj->r0*prj->w[3]);
- prj->w[8] = prj->w[3]*sqrt(prj->w[4] + prj->w[5]);
-
- prj->w[2] = prj->w[3]*sqrt(prj->w[4] - prj->w[5]*wcs_sind(prj->p[1]));
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int coefwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double a, r;
-
- if (prj->flag != PRJSET) {
- if (coeset(prj)) return 1;
- }
-
- a = phi*prj->w[0];
- if (theta == -90.0) {
- r = prj->w[8];
- } else {
- r = prj->w[3]*sqrt(prj->w[4] - prj->w[5]*wcs_sind(theta));
- }
-
- *x = r*wcs_sind(a);
- *y = prj->w[2] - r*wcs_cosd(a);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int coerev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double a, dy, r, w;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (coeset(prj)) return 1;
- }
-
- dy = prj->w[2] - y;
- r = sqrt(x*x + dy*dy);
- if (prj->p[1] < 0.0) r = -r;
-
- if (r == 0.0) {
- a = 0.0;
- } else {
- a = wcs_atan2d(x/r, dy/r);
- }
-
- *phi = a*prj->w[1];
- if (fabs(r - prj->w[8]) < tol) {
- *theta = -90.0;
- } else {
- w = (prj->w[6] - r*r)*prj->w[7];
- if (fabs(w) > 1.0) {
- if (fabs(w-1.0) < tol) {
- *theta = 90.0;
- } else if (fabs(w+1.0) < tol) {
- *theta = -90.0;
- } else {
- return 2;
- }
- } else {
- *theta = wcs_asind(w);
- }
- }
-
- return 0;
-}
-
-/*============================================================================
-* COO: conic orthomorphic projection.
-*
-* Given:
-* prj->p[1] sigma = (theta2+theta1)/2
-* prj->p[2] delta = (theta2-theta1)/2, where theta1 and theta2 are the
-* latitudes of the standard parallels, in degrees.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] C = ln(cos(theta2)/cos(theta1))/ln(tan(tau2)/tan(tau1))
-* where tau1 = (90 - theta1)/2
-* tau2 = (90 - theta2)/2
-* prj->w[1] 1/C
-* prj->w[2] Y0 = psi*tan((90-sigma)/2)**C
-* prj->w[3] psi = (r0*cos(theta1)/C)/tan(tau1)**C
-* prj->w[4] 1/psi
-*===========================================================================*/
-
-int cooset(prj)
-
-struct prjprm *prj;
-
-{
- double cos1, cos2, tan1, tan2, theta1, theta2;
-
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- theta1 = prj->p[1] - prj->p[2];
- theta2 = prj->p[1] + prj->p[2];
-
- tan1 = wcs_tand((90.0 - theta1)/2.0);
- cos1 = wcs_cosd(theta1);
-
- if (theta1 == theta2) {
- prj->w[0] = wcs_sind(theta1);
- } else {
- tan2 = wcs_tand((90.0 - theta2)/2.0);
- cos2 = wcs_cosd(theta2);
- prj->w[0] = log(cos2/cos1)/log(tan2/tan1);
- }
- if (prj->w[0] == 0.0) {
- return 1;
- }
-
- prj->w[1] = 1.0/prj->w[0];
-
- prj->w[3] = prj->r0*(cos1/prj->w[0])/pow(tan1,prj->w[0]);
- if (prj->w[3] == 0.0) {
- return 1;
- }
- prj->w[2] = prj->w[3]*pow(wcs_tand((90.0 - prj->p[1])/2.0),prj->w[0]);
- prj->w[4] = 1.0/prj->w[3];
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int coofwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double a, r;
-
- if (prj->flag != PRJSET) {
- if (cooset(prj)) return 1;
- }
-
- a = prj->w[0]*phi;
- if (theta == -90.0) {
- if (prj->w[0] < 0.0) {
- r = 0.0;
- } else {
- return 2;
- }
- } else {
- r = prj->w[3]*pow(wcs_tand((90.0 - theta)/2.0),prj->w[0]);
- }
-
- *x = r*wcs_sind(a);
- *y = prj->w[2] - r*wcs_cosd(a);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int coorev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double a, dy, r;
-
- if (prj->flag != PRJSET) {
- if (cooset(prj)) return 1;
- }
-
- dy = prj->w[2] - y;
- r = sqrt(x*x + dy*dy);
- if (prj->p[1] < 0.0) r = -r;
-
- if (r == 0.0) {
- a = 0.0;
- } else {
- a = wcs_atan2d(x/r, dy/r);
- }
-
- *phi = a*prj->w[1];
- if (r == 0.0) {
- if (prj->w[0] < 0.0) {
- *theta = -90.0;
- } else {
- return 2;
- }
- } else {
- *theta = 90.0 - 2.0*wcs_atand(pow(r*prj->w[4],prj->w[1]));
- }
-
- return 0;
-}
-
-/*============================================================================
-* BON: Bonne's projection.
-*
-* Given:
-* prj->p[1] Bonne conformal latitude, theta1, in degrees.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[1] r0*pi/180
-* prj->w[2] Y0 = r0*cot(theta1) + theta1*pi/180)
-*===========================================================================*/
-
-int bonset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[1] = 1.0;
- prj->w[2] = prj->r0*wcs_cosd(prj->p[1])/wcs_sind(prj->p[1]) + prj->p[1];
- } else {
- prj->w[1] = prj->r0*D2R;
- prj->w[2] = prj->r0*(wcs_cosd(prj->p[1])/wcs_sind(prj->p[1]) + prj->p[1]*D2R);
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int bonfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double a, r;
-
- if (prj->p[1] == 0.0) {
- /* Sanson-Flamsteed. */
- return glsfwd(phi, theta, prj, x, y);
- }
-
- if (prj->flag != PRJSET) {
- if (bonset(prj)) return 1;
- }
-
- r = prj->w[2] - theta*prj->w[1];
- a = prj->r0*phi*wcs_cosd(theta)/r;
-
- *x = r*wcs_sind(a);
- *y = prj->w[2] - r*wcs_cosd(a);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int bonrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double a, dy, costhe, r;
-
- if (prj->p[1] == 0.0) {
- /* Sanson-Flamsteed. */
- return glsrev(x, y, prj, phi, theta);
- }
-
- if (prj->flag != PRJSET) {
- if (bonset(prj)) return 1;
- }
-
- dy = prj->w[2] - y;
- r = sqrt(x*x + dy*dy);
- if (prj->p[1] < 0.0) r = -r;
-
- if (r == 0.0) {
- a = 0.0;
- } else {
- a = wcs_atan2d(x/r, dy/r);
- }
-
- *theta = (prj->w[2] - r)/prj->w[1];
- costhe = wcs_cosd(*theta);
- if (costhe == 0.0) {
- *phi = 0.0;
- } else {
- *phi = a*(r/prj->r0)/wcs_cosd(*theta);
- }
-
- return 0;
-}
-
-/*============================================================================
-* PCO: polyconic projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] 1/r0
-* prj->w[2] 2*r0
-*===========================================================================*/
-
-int pcoset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- prj->w[2] = 360.0/PI;
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = 1.0/prj->w[0];
- prj->w[2] = 2.0*prj->r0;
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int pcofwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double a, costhe, cotthe, sinthe;
-
- if (prj->flag != PRJSET) {
- if (pcoset(prj)) return 1;
- }
-
- costhe = wcs_cosd(theta);
- sinthe = wcs_sind(theta);
- a = phi*sinthe;
-
- if (sinthe == 0.0) {
- *x = prj->w[0]*phi;
- *y = 0.0;
- } else {
- cotthe = costhe/sinthe;
- *x = prj->r0*cotthe*wcs_sind(a);
- *y = prj->r0*(cotthe*(1.0 - wcs_cosd(a)) + theta*D2R);
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int pcorev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- int j;
- double f, fneg, fpos, lambda, tanthe, theneg, thepos, w, xp, xx, ymthe, yp;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (pcoset(prj)) return 1;
- }
-
- w = fabs(y*prj->w[1]);
- if (w < tol) {
- *phi = x*prj->w[1];
- *theta = 0.0;
- } else if (fabs(w-90.0) < tol) {
- *phi = 0.0;
- *theta = wcs_copysign(90.0,y);
- } else {
- /* Iterative solution using weighted division of the interval. */
- if (y > 0.0) {
- thepos = 90.0;
- } else {
- thepos = -90.0;
- }
- theneg = 0.0;
-
- xx = x*x;
- ymthe = y - prj->w[0]*thepos;
- fpos = xx + ymthe*ymthe;
- fneg = -999.0;
-
- for (j = 0; j < 64; j++) {
- if (fneg < -100.0) {
- /* Equal division of the interval. */
- *theta = (thepos+theneg)/2.0;
- } else {
- /* Weighted division of the interval. */
- lambda = fpos/(fpos-fneg);
- if (lambda < 0.1) {
- lambda = 0.1;
- } else if (lambda > 0.9) {
- lambda = 0.9;
- }
- *theta = thepos - lambda*(thepos-theneg);
- }
-
- /* Compute the residue. */
- ymthe = y - prj->w[0]*(*theta);
- tanthe = wcs_tand(*theta);
- f = xx + ymthe*(ymthe - prj->w[2]/tanthe);
-
- /* Check for convergence. */
- if (fabs(f) < tol) break;
- if (fabs(thepos-theneg) < tol) break;
-
- /* Redefine the interval. */
- if (f > 0.0) {
- thepos = *theta;
- fpos = f;
- } else {
- theneg = *theta;
- fneg = f;
- }
- }
-
- xp = prj->r0 - ymthe*tanthe;
- yp = x*tanthe;
- if (xp == 0.0 && yp == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(yp, xp)/wcs_sind(*theta);
- }
- }
-
- return 0;
-}
-
-/*============================================================================
-* GLS: Sanson-Flamsteed ("global sinusoid") projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] (180/pi)/r0
-*===========================================================================*/
-
-int glsset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int glsfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- if (prj->flag != PRJSET) {
- if (glsset(prj)) return 1;
- }
-
- *x = prj->w[0]*phi*wcs_cosd(theta);
- *y = prj->w[0]*theta;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int glsrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double w;
-
- if (prj->flag != PRJSET) {
- if (glsset(prj)) return 1;
- }
-
- w = cos(y/prj->r0);
- if (w == 0.0) {
- *phi = 0.0;
- } else {
- *phi = x*prj->w[1]/cos(y/prj->r0);
- }
- *theta = y*prj->w[1];
-
- return 0;
-}
-
-/*============================================================================
-* PAR: parabolic projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/180)
-* prj->w[1] (180/pi)/r0
-* prj->w[2] pi*r0
-* prj->w[3] 1/(pi*r0)
-*===========================================================================*/
-
-int parset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 1.0;
- prj->w[1] = 1.0;
- prj->w[2] = 180.0;
- prj->w[3] = 1.0/prj->w[2];
- } else {
- prj->w[0] = prj->r0*D2R;
- prj->w[1] = 1.0/prj->w[0];
- prj->w[2] = PI*prj->r0;
- prj->w[3] = 1.0/prj->w[2];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int parfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double s;
-
- if (prj->flag != PRJSET) {
- if (parset(prj)) return 1;
- }
-
- s = wcs_sind(theta/3.0);
- *x = prj->w[0]*phi*(1.0 - 4.0*s*s);
- *y = prj->w[2]*s;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int parrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double s, t;
-
- if (prj->flag != PRJSET) {
- if (parset(prj)) return 1;
- }
-
- s = y*prj->w[3];
- if (s > 1.0 || s < -1.0) {
- return 2;
- }
-
- t = 1.0 - 4.0*s*s;
- if (t == 0.0) {
- if (x == 0.0) {
- *phi = 0.0;
- } else {
- return 2;
- }
- } else {
- *phi = prj->w[1]*x/t;
- }
-
- *theta = 3.0*wcs_asind(s);
-
- return 0;
-}
-
-/*============================================================================
-* AIT: Hammer-Aitoff projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] 2*r0**2
-* prj->w[1] 1/(2*r0)**2
-* prj->w[2] 1/(4*r0)**2
-* prj->w[3] 1/(2*r0)
-*===========================================================================*/
-
-int aitset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- prj->w[0] = 2.0*prj->r0*prj->r0;
- prj->w[1] = 1.0/(2.0*prj->w[0]);
- prj->w[2] = prj->w[1]/4.0;
- prj->w[3] = 1.0/(2.0*prj->r0);
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int aitfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double costhe, w;
-
- if (prj->flag != PRJSET) {
- if (aitset(prj)) return 1;
- }
-
- costhe = wcs_cosd(theta);
- w = sqrt(prj->w[0]/(1.0 + costhe*wcs_cosd(phi/2.0)));
- *x = 2.0*w*costhe*wcs_sind(phi/2.0);
- *y = w*wcs_sind(theta);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int aitrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double s, u, xp, yp, z;
- const double tol = 1.0e-13;
-
- if (prj->flag != PRJSET) {
- if (aitset(prj)) return 1;
- }
-
- u = 1.0 - x*x*prj->w[2] - y*y*prj->w[1];
- if (u < 0.0) {
- if (u < -tol) {
- return 2;
- }
-
- u = 0.0;
- }
-
- z = sqrt(u);
- s = z*y/prj->r0;
- if (fabs(s) > 1.0) {
- if (fabs(s) > 1.0+tol) {
- return 2;
- }
- s = wcs_copysign(1.0,s);
- }
-
- xp = 2.0*z*z - 1.0;
- yp = z*x*prj->w[3];
- if (xp == 0.0 && yp == 0.0) {
- *phi = 0.0;
- } else {
- *phi = 2.0*wcs_atan2d(yp, xp);
- }
- *theta = wcs_asind(s);
-
- return 0;
-}
-
-/*============================================================================
-* MOL: Mollweide's projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] sqrt(2)*r0
-* prj->w[1] sqrt(2)*r0/90
-* prj->w[2] 1/(sqrt(2)*r0)
-* prj->w[3] 90/r0
-*===========================================================================*/
-
-int molset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- prj->w[0] = SQRT2*prj->r0;
- prj->w[1] = prj->w[0]/90.0;
- prj->w[2] = 1.0/prj->w[0];
- prj->w[3] = 90.0/prj->r0;
- prj->w[4] = 2.0/PI;
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int molfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- int j;
- double alpha, resid, u, v, v0, v1;
- const double tol = 1.0e-13;
-
- if (prj->flag != PRJSET) {
- if (molset(prj)) return 1;
- }
-
- if (fabs(theta) == 90.0) {
- *x = 0.0;
- *y = wcs_copysign(prj->w[0],theta);
- } else if (theta == 0.0) {
- *x = prj->w[1]*phi;
- *y = 0.0;
- } else {
- u = PI*wcs_sind(theta);
- v0 = -PI;
- v1 = PI;
- v = u;
- for (j = 0; j < 100; j++) {
- resid = (v - u) + sin(v);
- if (resid < 0.0) {
- if (resid > -tol) break;
- v0 = v;
- } else {
- if (resid < tol) break;
- v1 = v;
- }
- v = (v0 + v1)/2.0;
- }
-
- alpha = v/2.0;
- *x = prj->w[1]*phi*cos(alpha);
- *y = prj->w[0]*sin(alpha);
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int molrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double s, y0, z;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (molset(prj)) return 1;
- }
-
- y0 = y/prj->r0;
- s = 2.0 - y0*y0;
- if (s <= tol) {
- if (s < -tol) {
- return 2;
- }
- s = 0.0;
-
- if (fabs(x) > tol) {
- return 2;
- }
- *phi = 0.0;
- } else {
- s = sqrt(s);
- *phi = prj->w[3]*x/s;
- }
-
- z = y*prj->w[2];
- if (fabs(z) > 1.0) {
- if (fabs(z) > 1.0+tol) {
- return 2;
- }
- z = wcs_copysign(1.0,z) + y0*s/PI;
- } else {
- z = asin(z)*prj->w[4] + y0*s/PI;
- }
-
- if (fabs(z) > 1.0) {
- if (fabs(z) > 1.0+tol) {
- return 2;
- }
- z = wcs_copysign(1.0,z);
- }
-
- *theta = wcs_asind(z);
-
- return 0;
-}
-
-/*============================================================================
-* CSC: COBE quadrilateralized spherical cube projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/4)
-* prj->w[1] (4/pi)/r0
-*===========================================================================*/
-
-int cscset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 45.0;
- prj->w[1] = 1.0/45.0;
- } else {
- prj->w[0] = prj->r0*PI/4.0;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int cscfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- int face;
- double costhe, eta, l, m, n, rho, xi;
- const float tol = 1.0e-7;
-
- float a, a2, a2b2, a4, ab, b, b2, b4, ca2, cb2, x0, xf, y0, yf;
- const float gstar = 1.37484847732;
- const float mm = 0.004869491981;
- const float gamma = -0.13161671474;
- const float omega1 = -0.159596235474;
- const float d0 = 0.0759196200467;
- const float d1 = -0.0217762490699;
- const float c00 = 0.141189631152;
- const float c10 = 0.0809701286525;
- const float c01 = -0.281528535557;
- const float c11 = 0.15384112876;
- const float c20 = -0.178251207466;
- const float c02 = 0.106959469314;
-
- if (prj->flag != PRJSET) {
- if (cscset(prj)) return 1;
- }
-
- costhe = wcs_cosd(theta);
- l = costhe*wcs_cosd(phi);
- m = costhe*wcs_sind(phi);
- n = wcs_sind(theta);
-
- face = 0;
- rho = n;
- if (l > rho) {
- face = 1;
- rho = l;
- }
- if (m > rho) {
- face = 2;
- rho = m;
- }
- if (-l > rho) {
- face = 3;
- rho = -l;
- }
- if (-m > rho) {
- face = 4;
- rho = -m;
- }
- if (-n > rho) {
- face = 5;
- rho = -n;
- }
-
- if (face == 0) {
- xi = m;
- eta = -l;
- x0 = 0.0;
- y0 = 2.0;
- } else if (face == 1) {
- xi = m;
- eta = n;
- x0 = 0.0;
- y0 = 0.0;
- } else if (face == 2) {
- xi = -l;
- eta = n;
- x0 = 2.0;
- y0 = 0.0;
- } else if (face == 3) {
- xi = -m;
- eta = n;
- x0 = 4.0;
- y0 = 0.0;
- } else if (face == 4) {
- xi = l;
- eta = n;
- x0 = 6.0;
- y0 = 0.0;
- } else {
- xi = m;
- eta = l;
- x0 = 0.0;
- y0 = -2.0;
- }
-
- a = xi/rho;
- b = eta/rho;
-
- a2 = a*a;
- b2 = b*b;
- ca2 = 1.0 - a2;
- cb2 = 1.0 - b2;
-
- /* Avoid floating underflows. */
- ab = fabs(a*b);
- a4 = (a2 > 1.0e-16) ? a2*a2 : 0.0;
- b4 = (b2 > 1.0e-16) ? b2*b2 : 0.0;
- a2b2 = (ab > 1.0e-16) ? a2*b2 : 0.0;
-
- xf = a*(a2 + ca2*(gstar + b2*(gamma*ca2 + mm*a2 +
- cb2*(c00 + c10*a2 + c01*b2 + c11*a2b2 + c20*a4 + c02*b4)) +
- a2*(omega1 - ca2*(d0 + d1*a2))));
- yf = b*(b2 + cb2*(gstar + a2*(gamma*cb2 + mm*b2 +
- ca2*(c00 + c10*b2 + c01*a2 + c11*a2b2 + c20*b4 + c02*a4)) +
- b2*(omega1 - cb2*(d0 + d1*b2))));
-
- if (fabs(xf) > 1.0) {
- if (fabs(xf) > 1.0+tol) {
- return 2;
- }
- xf = wcs_copysign(1.0,xf);
- }
- if (fabs(yf) > 1.0) {
- if (fabs(yf) > 1.0+tol) {
- return 2;
- }
- yf = wcs_copysign(1.0,yf);
- }
-
- *x = prj->w[0]*(x0 + xf);
- *y = prj->w[0]*(y0 + yf);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int cscrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- int face;
- double l, m, n;
-
- float a, b, xf, xx, yf, yy, z0, z1, z2, z3, z4, z5, z6;
- const float p00 = -0.27292696;
- const float p10 = -0.07629969;
- const float p20 = -0.22797056;
- const float p30 = 0.54852384;
- const float p40 = -0.62930065;
- const float p50 = 0.25795794;
- const float p60 = 0.02584375;
- const float p01 = -0.02819452;
- const float p11 = -0.01471565;
- const float p21 = 0.48051509;
- const float p31 = -1.74114454;
- const float p41 = 1.71547508;
- const float p51 = -0.53022337;
- const float p02 = 0.27058160;
- const float p12 = -0.56800938;
- const float p22 = 0.30803317;
- const float p32 = 0.98938102;
- const float p42 = -0.83180469;
- const float p03 = -0.60441560;
- const float p13 = 1.50880086;
- const float p23 = -0.93678576;
- const float p33 = 0.08693841;
- const float p04 = 0.93412077;
- const float p14 = -1.41601920;
- const float p24 = 0.33887446;
- const float p05 = -0.63915306;
- const float p15 = 0.52032238;
- const float p06 = 0.14381585;
-
- if (prj->flag != PRJSET) {
- if (cscset(prj)) return 1;
- }
-
- xf = x*prj->w[1];
- yf = y*prj->w[1];
-
- /* Check bounds. */
- if (fabs(xf) <= 1.0) {
- if (fabs(yf) > 3.0) return 2;
- } else {
- if (fabs(xf) > 7.0) return 2;
- if (fabs(yf) > 1.0) return 2;
- }
-
- /* Map negative faces to the other side. */
- if (xf < -1.0) xf += 8.0;
-
- /* Determine the face. */
- if (xf > 5.0) {
- face = 4;
- xf = xf - 6.0;
- } else if (xf > 3.0) {
- face = 3;
- xf = xf - 4.0;
- } else if (xf > 1.0) {
- face = 2;
- xf = xf - 2.0;
- } else if (yf > 1.0) {
- face = 0;
- yf = yf - 2.0;
- } else if (yf < -1.0) {
- face = 5;
- yf = yf + 2.0;
- } else {
- face = 1;
- }
-
- xx = xf*xf;
- yy = yf*yf;
-
- z0 = p00 + xx*(p10 + xx*(p20 + xx*(p30 + xx*(p40 + xx*(p50 + xx*(p60))))));
- z1 = p01 + xx*(p11 + xx*(p21 + xx*(p31 + xx*(p41 + xx*(p51)))));
- z2 = p02 + xx*(p12 + xx*(p22 + xx*(p32 + xx*(p42))));
- z3 = p03 + xx*(p13 + xx*(p23 + xx*(p33)));
- z4 = p04 + xx*(p14 + xx*(p24));
- z5 = p05 + xx*(p15);
- z6 = p06;
-
- a = z0 + yy*(z1 + yy*(z2 + yy*(z3 + yy*(z4 + yy*(z5 + yy*z6)))));
- a = xf + xf*(1.0 - xx)*a;
-
- z0 = p00 + yy*(p10 + yy*(p20 + yy*(p30 + yy*(p40 + yy*(p50 + yy*(p60))))));
- z1 = p01 + yy*(p11 + yy*(p21 + yy*(p31 + yy*(p41 + yy*(p51)))));
- z2 = p02 + yy*(p12 + yy*(p22 + yy*(p32 + yy*(p42))));
- z3 = p03 + yy*(p13 + yy*(p23 + yy*(p33)));
- z4 = p04 + yy*(p14 + yy*(p24));
- z5 = p05 + yy*(p15);
- z6 = p06;
-
- b = z0 + xx*(z1 + xx*(z2 + xx*(z3 + xx*(z4 + xx*(z5 + xx*z6)))));
- b = yf + yf*(1.0 - yy)*b;
-
- if (face == 0) {
- n = 1.0/sqrt(a*a + b*b + 1.0);
- l = -b*n;
- m = a*n;
- } else if (face == 1) {
- l = 1.0/sqrt(a*a + b*b + 1.0);
- m = a*l;
- n = b*l;
- } else if (face == 2) {
- m = 1.0/sqrt(a*a + b*b + 1.0);
- l = -a*m;
- n = b*m;
- } else if (face == 3) {
- l = -1.0/sqrt(a*a + b*b + 1.0);
- m = a*l;
- n = -b*l;
- } else if (face == 4) {
- m = -1.0/sqrt(a*a + b*b + 1.0);
- l = -a*m;
- n = -b*m;
- } else {
- n = -1.0/sqrt(a*a + b*b + 1.0);
- l = -b*n;
- m = -a*n;
- }
-
- if (l == 0.0 && m == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(m, l);
- }
- *theta = wcs_asind(n);
-
- return 0;
-}
-
-/*============================================================================
-* QSC: quadrilaterilized spherical cube projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/4)
-* prj->w[1] (4/pi)/r0
-*===========================================================================*/
-
-int qscset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 45.0;
- prj->w[1] = 1.0/45.0;
- } else {
- prj->w[0] = prj->r0*PI/4.0;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int qscfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- int face;
- double chi, costhe, eta, l, m, n, p, psi, rho, rhu, t, x0, xf, xi, y0, yf;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (qscset(prj)) return 1;
- }
-
- if (fabs(theta) == 90.0) {
- *x = 0.0;
- *y = wcs_copysign(2.0*prj->w[0],theta);
- return 0;
- }
-
- costhe = wcs_cosd(theta);
- l = costhe*wcs_cosd(phi);
- m = costhe*wcs_sind(phi);
- n = wcs_sind(theta);
-
- face = 0;
- rho = n;
- if (l > rho) {
- face = 1;
- rho = l;
- }
- if (m > rho) {
- face = 2;
- rho = m;
- }
- if (-l > rho) {
- face = 3;
- rho = -l;
- }
- if (-m > rho) {
- face = 4;
- rho = -m;
- }
- if (-n > rho) {
- face = 5;
- rho = -n;
- }
-
- rhu = 1.0 - rho;
-
- if (face == 0) {
- xi = m;
- eta = -l;
- if (rhu < 1.0e-8) {
- /* Small angle formula. */
- t = (90.0 - theta)*D2R;
- rhu = t*t/2.0;
- }
- x0 = 0.0;
- y0 = 2.0;
- } else if (face == 1) {
- xi = m;
- eta = n;
- if (rhu < 1.0e-8) {
- /* Small angle formula. */
- t = theta*D2R;
- p = fmod(phi,360.0);
- if (p < -180.0) p += 360.0;
- if (p > 180.0) p -= 360.0;
- p *= D2R;
- rhu = (p*p + t*t)/2.0;
- }
- x0 = 0.0;
- y0 = 0.0;
- } else if (face == 2) {
- xi = -l;
- eta = n;
- if (rhu < 1.0e-8) {
- /* Small angle formula. */
- t = theta*D2R;
- p = fmod(phi,360.0);
- if (p < -180.0) p += 360.0;
- p = (90.0 - p)*D2R;
- rhu = (p*p + t*t)/2.0;
- }
- x0 = 2.0;
- y0 = 0.0;
- } else if (face == 3) {
- xi = -m;
- eta = n;
- if (rhu < 1.0e-8) {
- /* Small angle formula. */
- t = theta*D2R;
- p = fmod(phi,360.0);
- if (p < 0.0) p += 360.0;
- p = (180.0 - p)*D2R;
- rhu = (p*p + t*t)/2.0;
- }
- x0 = 4.0;
- y0 = 0.0;
- } else if (face == 4) {
- xi = l;
- eta = n;
- if (rhu < 1.0e-8) {
- /* Small angle formula. */
- t = theta*D2R;
- p = fmod(phi,360.0);
- if (p > 180.0) p -= 360.0;
- p *= (90.0 + p)*D2R;
- rhu = (p*p + t*t)/2.0;
- }
- x0 = 6;
- y0 = 0.0;
- } else {
- xi = m;
- eta = l;
- if (rhu < 1.0e-8) {
- /* Small angle formula. */
- t = (90.0 + theta)*D2R;
- rhu = t*t/2.0;
- }
- x0 = 0.0;
- y0 = -2;
- }
-
- if (xi == 0.0 && eta == 0.0) {
- xf = 0.0;
- yf = 0.0;
- } else if (-xi >= fabs(eta)) {
- psi = eta/xi;
- chi = 1.0 + psi*psi;
- xf = -sqrt(rhu/(1.0-1.0/sqrt(1.0+chi)));
- yf = (xf/15.0)*(wcs_atand(psi) - wcs_asind(psi/sqrt(chi+chi)));
- } else if (xi >= fabs(eta)) {
- psi = eta/xi;
- chi = 1.0 + psi*psi;
- xf = sqrt(rhu/(1.0-1.0/sqrt(1.0+chi)));
- yf = (xf/15.0)*(wcs_atand(psi) - wcs_asind(psi/sqrt(chi+chi)));
- } else if (-eta > fabs(xi)) {
- psi = xi/eta;
- chi = 1.0 + psi*psi;
- yf = -sqrt(rhu/(1.0-1.0/sqrt(1.0+chi)));
- xf = (yf/15.0)*(wcs_atand(psi) - wcs_asind(psi/sqrt(chi+chi)));
- } else {
- psi = xi/eta;
- chi = 1.0 + psi*psi;
- yf = sqrt(rhu/(1.0-1.0/sqrt(1.0+chi)));
- xf = (yf/15.0)*(wcs_atand(psi) - wcs_asind(psi/sqrt(chi+chi)));
- }
-
- if (fabs(xf) > 1.0) {
- if (fabs(xf) > 1.0+tol) {
- return 2;
- }
- xf = wcs_copysign(1.0,xf);
- }
- if (fabs(yf) > 1.0) {
- if (fabs(yf) > 1.0+tol) {
- return 2;
- }
- yf = wcs_copysign(1.0,yf);
- }
-
- *x = prj->w[0]*(xf + x0);
- *y = prj->w[0]*(yf + y0);
-
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int qscrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- int direct, face;
- double chi, l, m, n, psi, rho, rhu, xf, yf, w;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (qscset(prj)) return 1;
- }
-
- xf = x*prj->w[1];
- yf = y*prj->w[1];
-
- /* Check bounds. */
- if (fabs(xf) <= 1.0) {
- if (fabs(yf) > 3.0) return 2;
- } else {
- if (fabs(xf) > 7.0) return 2;
- if (fabs(yf) > 1.0) return 2;
- }
-
- /* Map negative faces to the other side. */
- if (xf < -1.0) xf += 8.0;
-
- /* Determine the face. */
- if (xf > 5.0) {
- face = 4;
- xf = xf - 6.0;
- } else if (xf > 3.0) {
- face = 3;
- xf = xf - 4.0;
- } else if (xf > 1.0) {
- face = 2;
- xf = xf - 2.0;
- } else if (yf > 1.0) {
- face = 0;
- yf = yf - 2.0;
- } else if (yf < -1.0) {
- face = 5;
- yf = yf + 2.0;
- } else {
- face = 1;
- }
-
- direct = (fabs(xf) > fabs(yf));
- if (direct) {
- if (xf == 0.0) {
- psi = 0.0;
- chi = 1.0;
- rho = 1.0;
- rhu = 0.0;
- } else {
- w = 15.0*yf/xf;
- psi = wcs_sind(w)/(wcs_cosd(w) - SQRT2INV);
- chi = 1.0 + psi*psi;
- rhu = xf*xf*(1.0 - 1.0/sqrt(1.0 + chi));
- rho = 1.0 - rhu;
- }
- } else {
- if (yf == 0.0) {
- psi = 0.0;
- chi = 1.0;
- rho = 1.0;
- rhu = 0.0;
- } else {
- w = 15.0*xf/yf;
- psi = wcs_sind(w)/(wcs_cosd(w) - SQRT2INV);
- chi = 1.0 + psi*psi;
- rhu = yf*yf*(1.0 - 1.0/sqrt(1.0 + chi));
- rho = 1.0 - rhu;
- }
- }
-
- if (rho < -1.0) {
- if (rho < -1.0-tol) {
- return 2;
- }
-
- rho = -1.0;
- rhu = 2.0;
- w = 0.0;
- } else {
- w = sqrt(rhu*(2.0-rhu)/chi);
- }
-
- if (face == 0) {
- n = rho;
- if (direct) {
- m = w;
- if (xf < 0.0) m = -m;
- l = -m*psi;
- } else {
- l = w;
- if (yf > 0.0) l = -l;
- m = -l*psi;
- }
- } else if (face == 1) {
- l = rho;
- if (direct) {
- m = w;
- if (xf < 0.0) m = -m;
- n = m*psi;
- } else {
- n = w;
- if (yf < 0.0) n = -n;
- m = n*psi;
- }
- } else if (face == 2) {
- m = rho;
- if (direct) {
- l = w;
- if (xf > 0.0) l = -l;
- n = -l*psi;
- } else {
- n = w;
- if (yf < 0.0) n = -n;
- l = -n*psi;
- }
- } else if (face == 3) {
- l = -rho;
- if (direct) {
- m = w;
- if (xf > 0.0) m = -m;
- n = -m*psi;
- } else {
- n = w;
- if (yf < 0.0) n = -n;
- m = -n*psi;
- }
- } else if (face == 4) {
- m = -rho;
- if (direct) {
- l = w;
- if (xf < 0.0) l = -l;
- n = l*psi;
- } else {
- n = w;
- if (yf < 0.0) n = -n;
- l = n*psi;
- }
- } else {
- n = -rho;
- if (direct) {
- m = w;
- if (xf < 0.0) m = -m;
- l = m*psi;
- } else {
- l = w;
- if (yf < 0.0) l = -l;
- m = l*psi;
- }
- }
-
- if (l == 0.0 && m == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(m, l);
- }
- *theta = wcs_asind(n);
-
- return 0;
-}
-
-/*============================================================================
-* TSC: tangential spherical cube projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-* prj->w[0] r0*(pi/4)
-* prj->w[1] (4/pi)/r0
-*===========================================================================*/
-
-int tscset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) {
- prj->r0 = R2D;
- prj->w[0] = 45.0;
- prj->w[1] = 1.0/45.0;
- } else {
- prj->w[0] = prj->r0*PI/4.0;
- prj->w[1] = 1.0/prj->w[0];
- }
-
- prj->flag = PRJSET;
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int tscfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- int face;
- double costhe, l, m, n, rho, x0, xf, y0, yf;
- const double tol = 1.0e-12;
-
- if (prj->flag != PRJSET) {
- if (tscset(prj)) return 1;
- }
-
- costhe = wcs_cosd(theta);
- l = costhe*wcs_cosd(phi);
- m = costhe*wcs_sind(phi);
- n = wcs_sind(theta);
-
- face = 0;
- rho = n;
- if (l > rho) {
- face = 1;
- rho = l;
- }
- if (m > rho) {
- face = 2;
- rho = m;
- }
- if (-l > rho) {
- face = 3;
- rho = -l;
- }
- if (-m > rho) {
- face = 4;
- rho = -m;
- }
- if (-n > rho) {
- face = 5;
- rho = -n;
- }
-
- if (face == 0) {
- xf = m/rho;
- yf = -l/rho;
- x0 = 0.0;
- y0 = 2.0;
- } else if (face == 1) {
- xf = m/rho;
- yf = n/rho;
- x0 = 0.0;
- y0 = 0.0;
- } else if (face == 2) {
- xf = -l/rho;
- yf = n/rho;
- x0 = 2.0;
- y0 = 0.0;
- } else if (face == 3) {
- xf = -m/rho;
- yf = n/rho;
- x0 = 4.0;
- y0 = 0.0;
- } else if (face == 4) {
- xf = l/rho;
- yf = n/rho;
- x0 = 6.0;
- y0 = 0.0;
- } else {
- xf = m/rho;
- yf = l/rho;
- x0 = 0.0;
- y0 = -2.0;
- }
-
- if (fabs(xf) > 1.0) {
- if (fabs(xf) > 1.0+tol) {
- return 2;
- }
- xf = wcs_copysign(1.0,xf);
- }
- if (fabs(yf) > 1.0) {
- if (fabs(yf) > 1.0+tol) {
- return 2;
- }
- yf = wcs_copysign(1.0,yf);
- }
-
- *x = prj->w[0]*(xf + x0);
- *y = prj->w[0]*(yf + y0);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int tscrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double l, m, n, xf, yf;
-
- if (prj->flag != PRJSET) {
- if (tscset(prj)) return 1;
- }
-
- xf = x*prj->w[1];
- yf = y*prj->w[1];
-
- /* Check bounds. */
- if (fabs(xf) <= 1.0) {
- if (fabs(yf) > 3.0) return 2;
- } else {
- if (fabs(xf) > 7.0) return 2;
- if (fabs(yf) > 1.0) return 2;
- }
-
- /* Map negative faces to the other side. */
- if (xf < -1.0) xf += 8.0;
-
- /* Determine the face. */
- if (xf > 5.0) {
- /* face = 4 */
- xf = xf - 6.0;
- m = -1.0/sqrt(1.0 + xf*xf + yf*yf);
- l = -m*xf;
- n = -m*yf;
- } else if (xf > 3.0) {
- /* face = 3 */
- xf = xf - 4.0;
- l = -1.0/sqrt(1.0 + xf*xf + yf*yf);
- m = l*xf;
- n = -l*yf;
- } else if (xf > 1.0) {
- /* face = 2 */
- xf = xf - 2.0;
- m = 1.0/sqrt(1.0 + xf*xf + yf*yf);
- l = -m*xf;
- n = m*yf;
- } else if (yf > 1.0) {
- /* face = 0 */
- yf = yf - 2.0;
- n = 1.0/sqrt(1.0 + xf*xf + yf*yf);
- l = -n*yf;
- m = n*xf;
- } else if (yf < -1.0) {
- /* face = 5 */
- yf = yf + 2.0;
- n = -1.0/sqrt(1.0 + xf*xf + yf*yf);
- l = -n*yf;
- m = -n*xf;
- } else {
- /* face = 1 */
- l = 1.0/sqrt(1.0 + xf*xf + yf*yf);
- m = l*xf;
- n = l*yf;
- }
-
- if (l == 0.0 && m == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(m, l);
- }
- *theta = wcs_asind(n);
-
- return 0;
-}
-
-
-/*============================================================================
-* TNX: IRAF's gnomonic projection.
-*
-* Given and/or returned:
-* prj->r0 r0; reset to 180/pi if 0.
-*===========================================================================*/
-
-int tnxset(prj)
-
-struct prjprm *prj;
-
-{
- if (prj->r0 == 0.0) prj->r0 = R2D;
-
- if (prj->flag == -1) {
- prj->flag = -PRJSET;
- } else {
- prj->flag = PRJSET;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int tnxfwd(phi, theta, prj, x, y)
-
-const double phi, theta;
-struct prjprm *prj;
-double *x, *y;
-
-{
- double r, s, xp[2];
-
- if (abs(prj->flag) != PRJSET) {
- if(tnxset(prj)) return 1;
- }
-
- s = wcs_sind(theta);
- if (s == 0.0) return 2;
-
- r = prj->r0*wcs_cosd(theta)/s;
- xp[0] = r*wcs_sind(phi);
- xp[1] = -r*wcs_cosd(phi);
- *x = prj->inv_x? poly_func(prj->inv_x, xp) : xp[0];
- *y = prj->inv_y? poly_func(prj->inv_y, xp) : xp[1];
-
- if (prj->flag == PRJSET && s < 0.0) {
- return 2;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int tnxrev(x, y, prj, phi, theta)
-
-const double x, y;
-struct prjprm *prj;
-double *phi, *theta;
-
-{
- double rp,xp,yp;
-
- if (abs(prj->flag) != PRJSET) {
- if (tanset(prj)) return 1;
- }
-
- xp = x+raw_to_tnxaxis(prj->tnx_lngcor, x, y);
- yp = y+raw_to_tnxaxis(prj->tnx_latcor, x, y);
- if ((rp = sqrt(xp*xp+yp*yp)) == 0.0) {
- *phi = 0.0;
- } else {
- *phi = wcs_atan2d(xp, -yp);
- }
- *theta = wcs_atan2d(prj->r0, rp);
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int raw_to_pv(struct prjprm *prj, double x, double y, double *xo, double *yo)
-
-{
- int k;
- double *a,*b,
- r,r3,r5,r7,xy,x2,x3,x4,x5,x6,x7,y2,y3,y4,y5,y6,y7,xp,yp;
-
- if (abs(prj->flag) != PRJSET) {
- if (tanset(prj)) return 1;
- }
-
- k=prj->n;
- a = prj->p; /* Longitude */
- b = prj->p+100; /* Latitude */
- xp = *(a++);
- xp += *(a++)*x;
- yp = *(b++);
- yp += *(b++)*y;
- if (!--k) goto poly_end;
- xp += *(a++)*y;
- yp += *(b++)*x;
- if (!--k) goto poly_end;
- r = sqrt(x*x + y*y);
- xp += *(a++)*r;
- yp += *(b++)*r;
- if (!--k) goto poly_end;
- xp += *(a++)*(x2=x*x);
- yp += *(b++)*(y2=y*y);
- if (!--k) goto poly_end;
- xp += *(a++)*(xy=x*y);
- yp += *(b++)*xy;
- if (!--k) goto poly_end;
- xp += *(a++)*y2;
- yp += *(b++)*x2;
- if (!--k) goto poly_end;
- xp += *(a++)*(x3=x*x2);
- yp += *(b++)*(y3=y*y2);
- if (!--k) goto poly_end;
- xp += *(a++)*x2*y;
- yp += *(b++)*y2*x;
- if (!--k) goto poly_end;
- xp += *(a++)*x*y2;
- yp += *(b++)*y*x2;
- if (!--k) goto poly_end;
- xp += *(a++)*y3;
- yp += *(b++)*x3;
- if (!--k) goto poly_end;
- xp += *(a++)*(r3=r*r*r);
- yp += *(b++)*r3;
- if (!--k) goto poly_end;
- xp += *(a++)*(x4=x2*x2);
- yp += *(b++)*(y4=y2*y2);
- if (!--k) goto poly_end;
- xp += *(a++)*x3*y;
- yp += *(b++)*y3*x;
- if (!--k) goto poly_end;
- xp += *(a++)*x2*y2;
- yp += *(b++)*x2*y2;
- if (!--k) goto poly_end;
- xp += *(a++)*x*y3;
- yp += *(b++)*y*x3;
- if (!--k) goto poly_end;
- xp += *(a++)*y4;
- yp += *(b++)*x4;
- if (!--k) goto poly_end;
- xp += *(a++)*(x5=x4*x);
- yp += *(b++)*(y5=y4*y);
- if (!--k) goto poly_end;
- xp += *(a++)*x4*y;
- yp += *(b++)*y4*x;
- if (!--k) goto poly_end;
- xp += *(a++)*x3*y2;
- yp += *(b++)*y3*x2;
- if (!--k) goto poly_end;
- xp += *(a++)*x2*y3;
- yp += *(b++)*y2*x3;
- if (!--k) goto poly_end;
- xp += *(a++)*x*y4;
- yp += *(b++)*y*x4;
- if (!--k) goto poly_end;
- xp += *(a++)*y5;
- yp += *(b++)*x5;
- if (!--k) goto poly_end;
- xp += *(a++)*(r5=r3*r*r);
- yp += *(b++)*r5;
- if (!--k) goto poly_end;
- xp += *(a++)*(x6=x5*x);
- yp += *(b++)*(y6=y5*y);
- if (!--k) goto poly_end;
- xp += *(a++)*x5*y;
- yp += *(b++)*y5*x;
- if (!--k) goto poly_end;
- xp += *(a++)*x4*y2;
- yp += *(b++)*y4*x2;
- if (!--k) goto poly_end;
- xp += *(a++)*x3*y3;
- yp += *(b++)*y3*x3;
- if (!--k) goto poly_end;
- xp += *(a++)*x2*y4;
- yp += *(b++)*y4*x2;
- if (!--k) goto poly_end;
- xp += *(a++)*x*y5;
- yp += *(b++)*y*x5;
- if (!--k) goto poly_end;
- xp += *(a++)*y6;
- yp += *(b++)*x6;
- if (!--k) goto poly_end;
- xp += *(a++)*(x7=x6*x);
- yp += *(b++)*(y7=y6*y);
- if (!--k) goto poly_end;
- xp += *(a++)*x6*y;
- yp += *(b++)*y6*x;
- if (!--k) goto poly_end;
- xp += *(a++)*x5*y2;
- yp += *(b++)*y5*x2;
- if (!--k) goto poly_end;
- xp += *(a++)*x4*y3;
- yp += *(b++)*y4*x3;
- if (!--k) goto poly_end;
- xp += *(a++)*x3*y4;
- yp += *(b++)*y3*x4;
- if (!--k) goto poly_end;
- xp += *(a++)*x2*y5;
- yp += *(b++)*y2*x5;
- if (!--k) goto poly_end;
- xp += *(a++)*x*y6;
- yp += *(b++)*y*x6;
- if (!--k) goto poly_end;
- xp += *(a++)*y7;
- yp += *(b++)*x7;
- if (!--k) goto poly_end;
- xp += *a*(r7=r5*r*r);
- yp += *b*r7;
-
-poly_end:
-
- *xo = xp;
- *yo = yp;
-
- return 0;
-}
-
diff --git a/sextractor/src/wcs/proj.h b/sextractor/src/wcs/proj.h
deleted file mode 100644
index 8a41375..0000000
--- a/sextractor/src/wcs/proj.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* IRAF's TNX added by E.Bertin 2000/03/28
-* $Id: proj.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifndef WCSLIB_PROJ
-#define WCSLIB_PROJ
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct prjprm {
- int flag;
- int n;
- double r0;
- double p[200];
- double w[10];
- struct tnxaxis *tnx_latcor;
- struct tnxaxis *tnx_lngcor;
- struct poly *inv_x;
- struct poly *inv_y;
-};
-
-#if __STDC__ || defined(__cplusplus)
- int azpset(struct prjprm *);
- int azpfwd(const double, const double, struct prjprm *, double *, double *);
- int azprev(const double, const double, struct prjprm *, double *, double *);
- int tanset(struct prjprm *);
- int tanfwd(const double, const double, struct prjprm *, double *, double *);
- int tanrev(const double, const double, struct prjprm *, double *, double *);
- int sinset(struct prjprm *);
- int sinfwd(const double, const double, struct prjprm *, double *, double *);
- int sinrev(const double, const double, struct prjprm *, double *, double *);
- int stgset(struct prjprm *);
- int stgfwd(const double, const double, struct prjprm *, double *, double *);
- int stgrev(const double, const double, struct prjprm *, double *, double *);
- int arcset(struct prjprm *);
- int arcfwd(const double, const double, struct prjprm *, double *, double *);
- int arcrev(const double, const double, struct prjprm *, double *, double *);
- int zpnset(struct prjprm *);
- int zpnfwd(const double, const double, struct prjprm *, double *, double *);
- int zpnrev(const double, const double, struct prjprm *, double *, double *);
- int zeaset(struct prjprm *);
- int zeafwd(const double, const double, struct prjprm *, double *, double *);
- int zearev(const double, const double, struct prjprm *, double *, double *);
- int airset(struct prjprm *);
- int airfwd(const double, const double, struct prjprm *, double *, double *);
- int airrev(const double, const double, struct prjprm *, double *, double *);
- int cypset(struct prjprm *);
- int cypfwd(const double, const double, struct prjprm *, double *, double *);
- int cyprev(const double, const double, struct prjprm *, double *, double *);
- int carset(struct prjprm *);
- int carfwd(const double, const double, struct prjprm *, double *, double *);
- int carrev(const double, const double, struct prjprm *, double *, double *);
- int merset(struct prjprm *);
- int merfwd(const double, const double, struct prjprm *, double *, double *);
- int merrev(const double, const double, struct prjprm *, double *, double *);
- int ceaset(struct prjprm *);
- int ceafwd(const double, const double, struct prjprm *, double *, double *);
- int cearev(const double, const double, struct prjprm *, double *, double *);
- int copset(struct prjprm *);
- int copfwd(const double, const double, struct prjprm *, double *, double *);
- int coprev(const double, const double, struct prjprm *, double *, double *);
- int codset(struct prjprm *);
- int codfwd(const double, const double, struct prjprm *, double *, double *);
- int codrev(const double, const double, struct prjprm *, double *, double *);
- int coeset(struct prjprm *);
- int coefwd(const double, const double, struct prjprm *, double *, double *);
- int coerev(const double, const double, struct prjprm *, double *, double *);
- int cooset(struct prjprm *);
- int coofwd(const double, const double, struct prjprm *, double *, double *);
- int coorev(const double, const double, struct prjprm *, double *, double *);
- int bonset(struct prjprm *);
- int bonfwd(const double, const double, struct prjprm *, double *, double *);
- int bonrev(const double, const double, struct prjprm *, double *, double *);
- int pcoset(struct prjprm *);
- int pcofwd(const double, const double, struct prjprm *, double *, double *);
- int pcorev(const double, const double, struct prjprm *, double *, double *);
- int glsset(struct prjprm *);
- int glsfwd(const double, const double, struct prjprm *, double *, double *);
- int glsrev(const double, const double, struct prjprm *, double *, double *);
- int parset(struct prjprm *);
- int parfwd(const double, const double, struct prjprm *, double *, double *);
- int parrev(const double, const double, struct prjprm *, double *, double *);
- int aitset(struct prjprm *);
- int aitfwd(const double, const double, struct prjprm *, double *, double *);
- int aitrev(const double, const double, struct prjprm *, double *, double *);
- int molset(struct prjprm *);
- int molfwd(const double, const double, struct prjprm *, double *, double *);
- int molrev(const double, const double, struct prjprm *, double *, double *);
- int cscset(struct prjprm *);
- int cscfwd(const double, const double, struct prjprm *, double *, double *);
- int cscrev(const double, const double, struct prjprm *, double *, double *);
- int qscset(struct prjprm *);
- int qscfwd(const double, const double, struct prjprm *, double *, double *);
- int qscrev(const double, const double, struct prjprm *, double *, double *);
- int tscset(struct prjprm *);
- int tscfwd(const double, const double, struct prjprm *, double *, double *);
- int tscrev(const double, const double, struct prjprm *, double *, double *);
- int tnxset(struct prjprm *);
- int tnxfwd(const double, const double, struct prjprm *, double *, double *);
- int tnxrev(const double, const double, struct prjprm *, double *, double *);
- int raw_to_pv(struct prjprm *, double, double, double *, double *);
-#else
- int azpset(), azpfwd(), azprev();
- int tanset(), tanfwd(), tanrev();
- int sinset(), sinfwd(), sinrev();
- int stgset(), stgfwd(), stgrev();
- int arcset(), arcfwd(), arcrev();
- int zpnset(), zpnfwd(), zpnrev();
- int zeaset(), zeafwd(), zearev();
- int airset(), airfwd(), airrev();
- int cypset(), cypfwd(), cyprev();
- int carset(), carfwd(), carrev();
- int merset(), merfwd(), merrev();
- int ceaset(), ceafwd(), cearev();
- int copset(), copfwd(), coprev();
- int codset(), codfwd(), codrev();
- int coeset(), coefwd(), coerev();
- int cooset(), coofwd(), coorev();
- int bonset(), bonfwd(), bonrev();
- int pcoset(), pcofwd(), pcorev();
- int glsset(), glsfwd(), glsrev();
- int parset(), parfwd(), parrev();
- int aitset(), aitfwd(), aitrev();
- int molset(), molfwd(), molrev();
- int cscset(), cscfwd(), cscrev();
- int qscset(), qscfwd(), qscrev();
- int tscset(), tscfwd(), tscrev();
- int tnxset(), tnxfwd(), tnxrev();
-#endif
-/*
-extern const char *prjset_errmsg[];
-extern const char *prjfwd_errmsg[];
-extern const char *prjrev_errmsg[];
-*/
-#define PRJSET 137
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* WCSLIB_PROJ */
diff --git a/sextractor/src/wcs/sph.c b/sextractor/src/wcs/sph.c
deleted file mode 100644
index 972ea52..0000000
--- a/sextractor/src/wcs/sph.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-*=============================================================================
-*
-* C routines for the spherical coordinate transformations used by the FITS
-* "World Coordinate System" (WCS) convention.
-*
-* Summary of routines
-* -------------------
-* The spherical coordinate transformations are implemented via separate
-* functions for the transformation in each direction.
-*
-* Forward transformation; sphfwd()
-* --------------------------------
-* Transform celestial coordinates to the native coordinates of a projection.
-*
-* Given:
-* lng,lat double Celestial longitude and latitude, in degrees.
-* eul[5] double Euler angles for the transformation:
-* 0: Celestial longitude of the native pole, in
-* degrees.
-* 1: Celestial colatitude of the native pole, or
-* native colatitude of the celestial pole, in
-* degrees.
-* 2: Native longitude of the celestial pole, in
-* degrees.
-* 3: cos(eul[1])
-* 4: sin(eul[1])
-*
-* Returned:
-* phi, double Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-*
-* Reverse transformation; sphrev()
-* --------------------------------
-* Transform native coordinates of a projection to celestial coordinates.
-*
-* Given:
-* phi, double Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-* eul[5] double Euler angles for the transformation:
-* 0: Celestial longitude of the native pole, in
-* degrees.
-* 1: Celestial colatitude of the native pole, or
-* native colatitude of the celestial pole, in
-* degrees.
-* 2: Native longitude of the celestial pole, in
-* degrees.
-* 3: cos(eul[1])
-* 4: sin(eul[1])
-*
-* Returned:
-* lng,lat double Celestial longitude and latitude, in degrees.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: sph.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include "wcstrig.h"
-#include "sph.h"
-
-#ifndef __STDC__
-#ifndef const
-#define const
-#endif
-#endif
-
-#define wcs_copysign(X, Y) ((Y) < 0.0 ? -fabs(X) : fabs(X))
-
-const double tol = 1.0e-5;
-
-int sphfwd (lng, lat, eul, phi, theta)
-
-const double lat, lng, eul[5];
-double *phi, *theta;
-
-{
- double coslat, coslng, dlng, dphi, sinlat, sinlng, x, y, z;
-
- coslat = wcs_cosd(lat);
- sinlat = wcs_sind(lat);
-
- dlng = lng - eul[0];
- coslng = wcs_cosd(dlng);
- sinlng = wcs_sind(dlng);
-
- /* Compute the native longitude. */
- x = sinlat*eul[4] - coslat*eul[3]*coslng;
- if (fabs(x) < tol) {
- /* Rearrange formula to reduce roundoff errors. */
- x = -wcs_cosd(lat+eul[1]) + coslat*eul[3]*(1.0 - coslng);
- }
- y = -coslat*sinlng;
- if (x != 0.0 || y != 0.0) {
- dphi = wcs_atan2d(y, x);
- } else {
- /* Change of origin of longitude. */
- dphi = dlng - 180.0;
- }
- *phi = eul[2] + dphi;
-
- /* Normalize the native longitude. */
- if (*phi > 180.0) {
- *phi -= 360.0;
- } else if (*phi < -180.0) {
- *phi += 360.0;
- }
-
- /* Compute the native latitude. */
- if (fmod(dlng,180.0) == 0.0) {
- *theta = lat + coslng*eul[1];
- if (*theta > 90.0) *theta = 180.0 - *theta;
- if (*theta < -90.0) *theta = -180.0 - *theta;
- } else {
- z = sinlat*eul[3] + coslat*eul[4]*coslng;
- if (fabs(z) > 0.99) {
- /* Use an alternative formula for greater numerical accuracy. */
- *theta = wcs_copysign(wcs_acosd(sqrt(x*x+y*y)), z);
- } else {
- *theta = wcs_asind(z);
- }
- }
-
- return 0;
-}
-
-/*-----------------------------------------------------------------------*/
-
-int sphrev (phi, theta, eul, lng, lat)
-
-const double phi, theta, eul[5];
-double *lng, *lat;
-
-{
- double cosphi, costhe, dlng, dphi, sinphi, sinthe, x, y, z;
-
- costhe = wcs_cosd(theta);
- sinthe = wcs_sind(theta);
-
- dphi = phi - eul[2];
- cosphi = wcs_cosd(dphi);
- sinphi = wcs_sind(dphi);
-
- /* Compute the celestial longitude. */
- x = sinthe*eul[4] - costhe*eul[3]*cosphi;
- if (fabs(x) < tol) {
- /* Rearrange formula to reduce roundoff errors. */
- x = -wcs_cosd(theta+eul[1]) + costhe*eul[3]*(1.0 - cosphi);
- }
- y = -costhe*sinphi;
- if (x != 0.0 || y != 0.0) {
- dlng = wcs_atan2d(y, x);
- } else {
- /* Change of origin of longitude. */
- dlng = dphi + 180.0;
- }
- *lng = eul[0] + dlng;
-
- /* Normalize the celestial longitude. */
- if (eul[0] >= 0.0) {
- if (*lng < 0.0) *lng += 360.0;
- } else {
- if (*lng > 0.0) *lng -= 360.0;
- }
-
- if (*lng > 360.0) {
- *lng -= 360.0;
- } else if (*lng < -360.0) {
- *lng += 360.0;
- }
-
- /* Compute the celestial latitude. */
- if (fmod(dphi,180.0) == 0.0) {
- *lat = theta + cosphi*eul[1];
- if (*lat > 90.0) *lat = 180.0 - *lat;
- if (*lat < -90.0) *lat = -180.0 - *lat;
- } else {
- z = sinthe*eul[3] + costhe*eul[4]*cosphi;
- if (fabs(z) > 0.99) {
- /* Use an alternative formula for greater numerical accuracy. */
- *lat = wcs_copysign(wcs_acosd(sqrt(x*x+y*y)), z);
- } else {
- *lat = wcs_asind(z);
- }
- }
-
- return 0;
-}
diff --git a/sextractor/src/wcs/sph.h b/sextractor/src/wcs/sph.h
deleted file mode 100644
index eb097fb..0000000
--- a/sextractor/src/wcs/sph.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: sph.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifndef WCSLIB_SPH
-#define WCSLIB_SPH
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if __STDC__ || defined(__cplusplus)
- int sphfwd(const double, const double,
- const double [],
- double *, double *);
- int sphrev(const double, const double,
- const double [],
- double *, double *);
-#else
- int sphfwd(), sphrev();
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WCSLIB_SPH */
diff --git a/sextractor/src/wcs/tnx.c b/sextractor/src/wcs/tnx.c
deleted file mode 100644
index de74106..0000000
--- a/sextractor/src/wcs/tnx.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- tnx.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: WCSlib
-*
-* Author: E.BERTIN (IAP), based on D.Mink (SAO) WCSTools
-*
-* Contents: Handle TNX astrometric format (from IRAF).
-*
-*
-* Last modify: 04/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "tnx.h"
-
-/******* read_tnxaxis *********************************************************
-PROTO tnxaxisstruct *read_tnxaxis(char *tnxstr)
-PURPOSE Read a TNX axis mapping structure.
-INPUT String containing the TNX info.
-OUTPUT TNXAXIS structure if OK, or NULL in case of error.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 04/07/2006
- ***/
-
-tnxaxisstruct *read_tnxaxis(char *tnxstr)
-
- {
- tnxaxisstruct *tnxaxis;
- char *pstr, *ptr;
- double min, max;
- int i, order;
-
- if ((pstr=strpbrk(tnxstr, "1234567890-+.")))
- {
- if (!(tnxaxis=malloc(sizeof(tnxaxisstruct))))
- return NULL;
- tnxaxis->type = (int)(atof(strtok_r(pstr, " ", &ptr))+0.5);
- tnxaxis->xorder = (pstr=strtok_r(NULL, " ", &ptr))?
- (int)(atof(pstr)+0.5) : 0;
- tnxaxis->yorder = (pstr=strtok_r(NULL, " ", &ptr))?
- (int)(atof(pstr)+0.5) : 0;
- tnxaxis->xterms = (pstr=strtok_r(NULL, " ", &ptr))?
- (int)(atof(pstr)+0.5) : 0;
- min = (pstr=strtok_r(NULL, " ", &ptr))? atof(pstr) : 0.0;
- max = (pstr=strtok_r(NULL, " ", &ptr))? atof(pstr) : 0.0;
- if (max <= min)
- return NULL;
- tnxaxis->xrange = 2.0 / (max - min);
- tnxaxis->xmaxmin = - (max + min) / 2.0;
- min = (pstr=strtok_r(NULL, " ", &ptr))? atof(pstr) : 0.0;
- max = (pstr=strtok_r(NULL, " ", &ptr))? atof(pstr) : 0.0;
- if (max <= min)
- return NULL;
- tnxaxis->yrange = 2.0 / (max - min);
- tnxaxis->ymaxmin = - (max + min) / 2.0;
- switch (tnxaxis->xterms)
- {
- case TNX_XNONE:
- tnxaxis->ncoeff = tnxaxis->xorder + tnxaxis->yorder - 1;
- break;
- case TNX_XHALF:
- order = tnxaxis->xorder<tnxaxis->yorder?
- tnxaxis->xorder : tnxaxis->yorder;
- tnxaxis->ncoeff = tnxaxis->xorder*tnxaxis->yorder - order*(order-1)/2;
- break;
- case TNX_XFULL:
- tnxaxis->ncoeff = tnxaxis->xorder * tnxaxis->yorder;
- break;
- default:
- return NULL;
- }
-/*-- Now read the mapping coefficients */
- if (!(tnxaxis->coeff=malloc(tnxaxis->ncoeff*sizeof(double))))
- return NULL;
- for (i=0; i<tnxaxis->ncoeff && (pstr=strtok_r(NULL, " ", &ptr)); i++)
- tnxaxis->coeff[i] = atof(pstr);
- if (i!=tnxaxis->ncoeff)
- return NULL;
- if (!(tnxaxis->xbasis=malloc(tnxaxis->xorder*sizeof(double))))
- return NULL;
- if (!(tnxaxis->ybasis=malloc(tnxaxis->yorder*sizeof(double))))
- return NULL;
- return tnxaxis;
- }
- else
- return NULL;
- }
-
-
-/******* copy_tnxaxis *********************************************************
-PROTO tnxaxisstruct *copy_tnxaxis(tnxaxisstruct *axis)
-PURPOSE Copy a TNX axis mapping structure.
-INPUT TNXAXIS structure pointer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 28/11/2003
- ***/
-
-tnxaxisstruct *copy_tnxaxis(tnxaxisstruct *axis)
-
- {
- tnxaxisstruct *tnxaxis;
- int i;
-
- if (axis)
- {
- if (!axis->ncoeff)
- return NULL;
- if (!(tnxaxis=malloc(sizeof(tnxaxisstruct))))
- return NULL;
- *tnxaxis = *axis;
- if (!(tnxaxis->coeff=malloc(tnxaxis->ncoeff*sizeof(double))))
- return NULL;
- for (i=0; i<tnxaxis->ncoeff; i++)
- tnxaxis->coeff[i] = axis->coeff[i];
- if (!(tnxaxis->xbasis=malloc(tnxaxis->xorder*sizeof(double))))
- return NULL;
- for (i=0; i<tnxaxis->xorder; i++)
- tnxaxis->xbasis[i] = axis->xbasis[i];
- if (!(tnxaxis->ybasis=malloc(tnxaxis->yorder*sizeof(double))))
- return NULL;
- for (i=0; i<tnxaxis->yorder; i++)
- tnxaxis->ybasis[i] = axis->ybasis[i];
- return tnxaxis;
- }
-
- return NULL;
- }
-
-
-/******* free_tnxaxis *********************************************************
-PROTO void free_tnxaxis(tnxaxisstruct *axis)
-PURPOSE Free a TNX axis mapping structure.
-INPUT TNXAXIS structure pointer.
-OUTPUT -.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 09/04/2000
- ***/
-
-void free_tnxaxis(tnxaxisstruct *axis)
-
- {
- if (axis)
- {
-
- free(axis->coeff);
- free(axis->xbasis);
- free(axis->ybasis);
- free(axis);
- }
-
- return;
- }
-
-
-/******* raw_to_tnxaxis *******************************************************
-PROTO double raw_to_tnxaxis(tnxaxisstruct *axis, double x, double y)
-PURPOSE Compute the correction value on a TNX axis at current position.
-INPUT TNXAXIS structure pointer,
- x coordinate,
- y coordinate.
-OUTPUT Value on the TNXaxis.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 11/04/2000
- ***/
-
-double raw_to_tnxaxis(tnxaxisstruct *axis, double x, double y)
-
- {
- double *xbasis, *ybasis,*coeff,
- norm, accum, val;
- int i, j, xorder,xorder0,yorder,maxorder,xterms;
-
- xbasis = axis->xbasis;
- ybasis = axis->ybasis;
- xorder = axis->xorder;
- yorder = axis->yorder;
- xterms = axis->xterms;
-
- switch (axis->type)
- {
- case TNX_CHEBYSHEV:
- xbasis[0] = 1.0;
- if (xorder > 1)
- {
- xbasis[1] = norm = (x + axis->xmaxmin)*axis->xrange;
- if (xorder > 2)
- for (i = 2; i < xorder; i++)
- xbasis[i] = 2.0*norm*xbasis[i-1] - xbasis[i-2];
- }
- ybasis[0] = 1.0;
- if (yorder > 1)
- {
- ybasis[1] = norm = (y + axis->ymaxmin)*axis->yrange;
- if (yorder > 2)
- for (i = 2; i < yorder; i++)
- ybasis[i] = 2.0*norm*xbasis[i-1] - ybasis[i-2];
- }
- break;
-
- case TNX_LEGENDRE:
- xbasis[0] = 1.0;
- if (xorder > 1)
- {
- xbasis[1] = norm = (x + axis->xmaxmin)*axis->xrange;
- if (xorder > 2)
- for (i = 2; (j=i) < xorder; i++)
- xbasis[i] = ((2.0*j - 3.0) * norm * xbasis[i-1] -
- (j - 2.0) * xbasis[i-2]) / (j - 1.0);
- }
- ybasis[0] = 1.0;
- if (yorder > 1)
- {
- ybasis[1] = norm = (y + axis->ymaxmin)*axis->yrange;
- if (yorder > 2)
- for (i = 2; (j=i) < xorder; i++)
- ybasis[i] = ((2.0*j - 3.0) * norm * ybasis[i-1] -
- (j - 2.0) * ybasis[i-2]) / (j - 1.0);
- }
- break;
-
- case TNX_POLYNOMIAL:
- xbasis[0] = 1.0;
- if (xorder > 1)
- {
- xbasis[1] = x;
- if (xorder > 2)
- for (i = 2; i < xorder; i++)
- xbasis[i] = x * xbasis[i-1];
- }
- ybasis[0] = 1.0;
- if (yorder > 1)
- {
- ybasis[1] = y;
- if (yorder > 2)
- for (i = 2; i < yorder; i++)
- ybasis[i] = y * ybasis[i-1];
- }
- break;
-
- default:
- return 0.0;
- }
-
-/* Loop over y basis functions */
- maxorder = xorder > yorder ? xorder : yorder;
- xorder0 = xorder;
- coeff = axis->coeff;
- val = 0.0;
- for (i = 0; i<yorder; i++)
- {
-/*-- Loop over the x basis functions */
- accum = 0.0;
- xbasis = axis->xbasis;
- for (j = xorder; j--;)
- accum += *(coeff++) * *(xbasis++);
- val += accum**(ybasis++);
-
-/*-- Elements of the coefficient vector where neither k = 1 or i = 1
- are not calculated if sf->xterms = no. */
- if (xterms == TNX_XNONE)
- xorder = 1;
- else if (xterms == TNX_XHALF && (i + 1 + xorder0) > maxorder)
- xorder--;
- }
-
- return val;
- }
-
-
diff --git a/sextractor/src/wcs/tnx.h b/sextractor/src/wcs/tnx.h
deleted file mode 100644
index a9dee5a..0000000
--- a/sextractor/src/wcs/tnx.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- tnx.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: WCSlib
-*
-* Author: E.BERTIN (IAP), based on D.Mink (SAO) WCSTools
-*
-* Contents: Include to handle TNX astrometric format (from IRAF).
-*
-*
-* Last modify: 28/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifndef _TNX_H_
-#define _TNX_H_
-
-/*-------------------------------- macros -----------------------------------*/
-
-#define TNX_MAXCHARS 2048 /* Maximum FITS "WAT" string length */
-
-/* TNX permitted types of surfaces */
-#define TNX_CHEBYSHEV 1
-#define TNX_LEGENDRE 2
-#define TNX_POLYNOMIAL 3
-
-/* TNX cross-terms flags */
-#define TNX_XNONE 0 /* no x-terms (old no) */
-#define TNX_XFULL 1 /* full x-terms (new yes) */
-#define TNX_XHALF 2 /* half x-terms (new) */
-
-/*----------------------------- Internal constants --------------------------*/
-
-/*------------------------------- structures --------------------------------*/
-
-typedef struct tnxaxis
- {
- int type; /* Projection correction type */
- int xorder,yorder; /* Polynomial orders */
- int xterms; /* Well... */
- int ncoeff; /* Number of polynom coefficients */
- double xrange,yrange; /* Coordinate ranges */
- double xmaxmin,ymaxmin; /* Well... */
- double *coeff; /* Polynom coefficients */
- double *xbasis,*ybasis; /* Basis function values */
- } tnxaxisstruct;
-
-/*------------------------------- functions ---------------------------------*/
-
-tnxaxisstruct *copy_tnxaxis(tnxaxisstruct *axis),
- *read_tnxaxis(char *tnxstr);
-
-double raw_to_tnxaxis(tnxaxisstruct *axis, double x, double y);
-
-void free_tnxaxis(tnxaxisstruct *axis);
-
-#endif
-
diff --git a/sextractor/src/wcs/wcs.c b/sextractor/src/wcs/wcs.c
deleted file mode 100644
index 1217d0c..0000000
--- a/sextractor/src/wcs/wcs.c
+++ /dev/null
@@ -1,1271 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-*=============================================================================
-*
-* C routines which implement the FITS World Coordinate System (WCS)
-* convention.
-*
-* Summary of routines
-* -------------------
-* wcsfwd() and wcsrev() are high level driver routines for the WCS linear
-* transformation, spherical coordinate transformation, and spherical
-* projection routines.
-*
-* Given either the celestial longitude or latitude plus an element of the
-* pixel coordinate a hybrid routine, wcsmix(), iteratively solves for the
-* unknown elements.
-*
-* An initialization routine, wcsset(), computes indices from the ctype
-* array but need not be called explicitly - see the explanation of
-* wcs.flag below.
-*
-*
-* Initialization routine; wcsset()
-* --------------------------------
-* Initializes elements of a wcsprm data structure which holds indices into
-* the coordinate arrays. Note that this routine need not be called directly;
-* it will be invoked by wcsfwd() and wcsrev() if the "flag" structure member
-* is anything other than a predefined magic value.
-*
-* Given:
-* naxis const int
-* Number of image axes.
-* ctype[][9]
-* const char
-* Coordinate axis types corresponding to the FITS
-* CTYPEn header cards.
-*
-* Returned:
-* wcs wcsprm* Indices for the celestial coordinates obtained
-* by parsing the ctype[] array (see below).
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Inconsistent or unrecognized coordinate axis
-* types.
-*
-*
-* Forward transformation; wcsfwd()
-* --------------------------------
-* Compute the pixel coordinate for given world coordinates.
-*
-* Given:
-* ctype[][9]
-* const char
-* Coordinate axis types corresponding to the FITS
-* CTYPEn header cards.
-*
-* Given or returned:
-* wcs wcsprm* Indices for the celestial coordinates obtained
-* by parsing the ctype[] array (see below).
-*
-* Given:
-* world const double[]
-* World coordinates. world[wcs->lng] and
-* world[wcs->lat] are the celestial longitude and
-* latitude, in degrees.
-*
-* Given:
-* crval const double[]
-* Coordinate reference values corresponding to the FITS
-* CRVALn header cards.
-*
-* Given and returned:
-* cel celprm* Spherical coordinate transformation parameters (usage
-* is described in the prologue to "cel.c").
-*
-* Returned:
-* phi, double* Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-*
-* Given and returned:
-* prj prjprm* Projection parameters (usage is described in the
-* prologue to "proj.c").
-*
-* Returned:
-* imgcrd double[] Image coordinate. imgcrd[wcs->lng] and
-* imgcrd[wcs->lat] are the projected x-, and
-* y-coordinates, in "degrees". For quadcube
-* projections with a CUBEFACE axis the face number is
-* also returned in imgcrd[wcs->cubeface].
-*
-* Given and returned:
-* lin linprm* Linear transformation parameters (usage is described
-* in the prologue to "lin.c").
-*
-* Returned:
-* pixcrd double[] Pixel coordinate.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid coordinate transformation parameters.
-* 2: Invalid projection parameters.
-* 3: Invalid world coordinate.
-* 4: Invalid linear transformation parameters.
-*
-*
-* Reverse transformation; wcsrev()
-* --------------------------------
-* Compute world coordinates for a given pixel coordinate.
-*
-* Given:
-* ctype[][9]
-* const char
-* Coordinate axis types corresponding to the FITS
-* CTYPEn header cards.
-*
-* Given or returned:
-* wcs wcsprm* Indices for the celestial coordinates obtained
-* by parsing the ctype[] array (see below).
-*
-* Given:
-* pixcrd const double[]
-* Pixel coordinate.
-*
-* Given and returned:
-* lin linprm* Linear transformation parameters (usage is described
-* in the prologue to "lin.c").
-*
-* Returned:
-* imgcrd double[] Image coordinate. imgcrd[wcs->lng] and
-* imgcrd[wcs->lat] are the projected x-, and
-* y-coordinates, in "degrees".
-*
-* Given and returned:
-* prj prjprm* Projection parameters (usage is described in the
-* prologue to "proj.c").
-*
-* Returned:
-* phi, double* Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-*
-* Given:
-* crval const double[]
-* Coordinate reference values corresponding to the FITS
-* CRVALn header cards.
-*
-* Given and returned:
-* cel celprm* Spherical coordinate transformation parameters
-* (usage is described in the prologue to "cel.c").
-*
-* Returned:
-* world double[] World coordinates. world[wcs->lng] and
-* world[wcs->lat] are the celestial longitude and
-* latitude, in degrees.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid coordinate transformation parameters.
-* 2: Invalid projection parameters.
-* 3: Invalid pixel coordinate.
-* 4: Invalid linear transformation parameters.
-*
-*
-* Hybrid transformation; wcsmix()
-* -------------------------------
-* Given either the celestial longitude or latitude plus an element of the
-* pixel coordinate solve for the remaining elements by iterating on the
-* unknown celestial coordinate element using wcsfwd().
-*
-* Given:
-* ctype[][9]
-* const char
-* Coordinate axis types corresponding to the FITS
-* CTYPEn header cards.
-*
-* Given or returned:
-* wcs wcsprm* Indices for the celestial coordinates obtained
-* by parsing the ctype[] array (see below).
-*
-* Given:
-* mixpix const int
-* Which element of the pixel coordinate is given.
-* mixcel const int
-* Which element of the celestial coordinate is
-* given:
-* 1: Celestial longitude is given in
-* world[wcs->lng], latitude returned in
-* world[wcs->lat].
-* 2: Celestial latitude is given in
-* world[wcs->lat], longitude returned in
-* world[wcs->lng].
-* vspan[2] const double
-* Solution interval for the celestial coordinate, in
-* degrees.
-* vstep const double
-* Step size for solution search, in degrees. If zero,
-* a sensible, although perhaps non-optimal default will
-* be used.
-* viter int
-* If a solution is not found then the step size will be
-* halved and the search recommenced. viter controls
-* how many times the step size is halved. The allowed
-* range is 5 - 10.
-*
-* Given and returned:
-* world double[] World coordinates. world[wcs->lng] and
-* world[wcs->lat] are the celestial longitude and
-* latitude, in degrees. Which is given and which
-* returned depends on the value of mixcel. All other
-* elements are given.
-*
-* Given:
-* crval const double[]
-* Coordinate reference values corresponding to the FITS
-* CRVALn header cards.
-*
-* Given and returned:
-* cel celprm* Spherical coordinate transformation parameters
-* (usage is described in the prologue to "cel.c").
-*
-* Returned:
-* phi, double* Longitude and latitude in the native coordinate
-* theta system of the projection, in degrees.
-*
-* Given and returned:
-* prj prjprm* Projection parameters (usage is described in the
-* prologue to "proj.c").
-*
-* Returned:
-* imgcrd double[] Image coordinate. imgcrd[wcs->lng] and
-* imgcrd[wcs->lat] are the projected x-, and
-* y-coordinates, in "degrees".
-*
-* Given and returned:
-* lin linprm* Linear transformation parameters (usage is described
-* in the prologue to "lin.c").
-*
-* Given and returned:
-* pixcrd double[] Pixel coordinate. The element indicated by mixpix is
-* given and the remaining elements are returned.
-*
-* Function return value:
-* int Error status
-* 0: Success.
-* 1: Invalid coordinate transformation parameters.
-* 2: Invalid projection parameters.
-* 3: Coordinate transformation error.
-* 4: Invalid linear transformation parameters.
-* 5: No solution found in the specified interval.
-*
-*
-* Notes
-* -----
-* 1) The CTYPEn must in be upper case and there must be 0 or 1 pair of
-* matched celestial axis types. The ctype[][9] should be padded with
-* blanks on the right and null-terminated.
-*
-* 2) Elements of the crval[] array which correspond to celestial axes are
-* ignored, the reference coordinate values in cel->ref[0] and
-* cel->ref[1] are the ones used.
-*
-* 3) These functions recognize the NCP projection and convert it to the
-* equivalent SIN projection.
-*
-* 4) The quadcube projections (CSC, QSC, TSC) may be represented in FITS in
-* either of two ways:
-*
-* a) The six faces may be laid out in one plane and numbered as
-* follows:
-*
-* 0
-*
-* 4 3 2 1 4 3 2
-*
-* 5
-*
-* Faces 2, 3 and 4 may appear on one side or the other (or both).
-* The forward routines map faces 2, 3 and 4 to the left but the
-* inverse routines accept them on either side.
-*
-* b) The "COBE" convention in which the six faces are stored in a
-* three-dimensional structure using a "CUBEFACE" axis indexed from
-* 0 to 5 as above.
-*
-* These routines support both methods; wcsset() determines which is
-* being used by the presence or absence of a CUBEFACE axis in ctype[].
-* wcsfwd() and wcsrev() translate the CUBEFACE axis representation to
-* the single plane representation understood by the lower-level WCSLIB
-* projection routines.
-*
-*
-* WCS indexing parameters
-* -----------------------
-* The wcsprm struct consists of the following:
-*
-* int flag
-* The wcsprm struct contains indexes and other information derived
-* from the CTYPEn. Whenever any of the ctype[] are set or changed
-* this flag must be set to zero to signal the initialization routine,
-* wcsset() to redetermine the indices. The flag is set to 999 if
-* there is no celestial axis pair in the CTYPEn.
-*
-* char pcode[4]
-* The WCS projection code.
-*
-* char lngtyp[5], lattyp[5]
-* WCS celestial axis types.
-*
-* int lng,lat
-* Indices into the imgcrd[], and world[] arrays as described above.
-* These may also serve as indices for the celestial longitude and
-* latitude axes in the pixcrd[] array provided that the PC matrix
-* does not transpose axes.
-*
-* int cubeface
-* Index into the pixcrd[] array for the CUBEFACE axis. This is
-* optionally used for the quadcube projections where each cube face is
-* stored on a separate axis.
-*
-*
-* wcsmix() algorithm
-* ------------------
-* Initially the specified solution interval is checked to see if it's a
-* "crossing" interval. If it isn't, a search is made for a crossing
-* solution by iterating on the unknown celestial coordinate starting at
-* the upper limit of the solution interval and decrementing by the
-* specified step size. A crossing is indicated if the trial value of the
-* pixel coordinate steps through the value specified. If a crossing
-* interval is found then the solution is determined by a modified form of
-* "regula falsi" division of the crossing interval. If no crossing
-* interval was found within the specified solution interval then a search
-* is made for a "non-crossing" solution as may arise from a point of
-* tangency. The process is complicated by having to make allowance for
-* the discontinuities that occur in all map projections.
-*
-* Once one solution has been determined others may be found by subsequent
-* invokations of wcsmix() with suitably restricted solution intervals.
-*
-* Note the circumstance which arises when the solution point lies at a
-* native pole of a projection in which the pole is represented as a
-* finite curve, for example the zenithals and conics. In such cases two
-* or more valid solutions may exist but WCSMIX only ever returns one.
-*
-* Because of its generality wcsmix() is very compute-intensive. For
-* compute-limited applications more efficient special-case solvers could
-* be written for simple projections, for example non-oblique cylindrical
-* projections.
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: wcs.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include "stdio.h"
-#include "string.h"
-#include "wcsmath.h"
-#include "wcstrig.h"
-#include "sph.h"
-#include "wcs.h"
-
-/* Map error number to error message for each function. */
-const char *wcsset_errmsg[] = {
- 0,
- "Inconsistent or unrecognized coordinate axis types"};
-
-const char *wcsfwd_errmsg[] = {
- 0,
- "Invalid coordinate transformation parameters",
- "Invalid projection parameters",
- "Invalid world coordinate",
- "Invalid linear transformation parameters"};
-
-const char *wcsrev_errmsg[] = {
- 0,
- "Invalid coordinate transformation parameters",
- "Invalid projection parameters",
- "Invalid pixel coordinate",
- "Invalid linear transformation parameters"};
-
-const char *wcsmix_errmsg[] = {
- 0,
- "Invalid coordinate transformation parameters",
- "Invalid projection parameters",
- "Coordinate transformation error",
- "Invalid linear transformation parameters",
- "No solution found in the specified interval"};
-
-
-#define wcs_signbit(X) ((X) < 0.0 ? 1 : 0)
-
-int wcsset (naxis, ctype, wcs)
-
-const int naxis;
-const char ctype[][9];
-struct wcsprm *wcs;
-
-{
- int j, k, *ndx;
- char requir[9];
-
- strcpy(wcs->pcode, "");
- strcpy(requir, "");
- wcs->lng = -1;
- ndx = &wcs->lng; /* to satisfy gcc -Wall */
- wcs->lat = -1;
- wcs->cubeface = -1;
-
- for (j = 0; j < naxis; j++) {
- if (ctype[j][4] != '-') {
- if (strcmp(ctype[j], "CUBEFACE") == 0) {
- if (wcs->cubeface == -1) {
- wcs->cubeface = j;
- } else {
- /* Multiple CUBEFACE axes! */
- return 1;
- }
- }
- continue;
- }
-
- /* Got an axis qualifier, is it a recognized WCS projection? */
- for (k = 0; k < npcode; k++) {
- if (strncmp(&ctype[j][5], pcodes[k], 3) == 0) break;
- }
-
- if (k == npcode) {
- /* Allow NCP to pass (will be converted to SIN later). */
- if (strncmp(&ctype[j][5], "NCP", 3)) continue;
- }
-
- /* Parse the celestial axis type. */
- if (strcmp(wcs->pcode, "") == 0) {
- sprintf(wcs->pcode, "%.3s", &ctype[j][5]);
-
- if (strncmp(ctype[j], "RA--", 4) == 0) {
- wcs->lng = j;
- strcpy(wcs->lngtyp, "RA");
- strcpy(wcs->lattyp, "DEC");
- ndx = &wcs->lat;
- sprintf(requir, "DEC--%s", wcs->pcode);
- } else if (strncmp(ctype[j], "DEC-", 4) == 0) {
- wcs->lat = j;
- strcpy(wcs->lngtyp, "RA");
- strcpy(wcs->lattyp, "DEC");
- ndx = &wcs->lng;
- sprintf(requir, "RA---%s", wcs->pcode);
- } else if (strncmp(&ctype[j][1], "LON", 3) == 0) {
- wcs->lng = j;
- sprintf(wcs->lngtyp, "%cLON", ctype[j][0]);
- sprintf(wcs->lattyp, "%cLAT", ctype[j][0]);
- ndx = &wcs->lat;
- sprintf(requir, "%s-%s", wcs->lattyp, wcs->pcode);
- } else if (strncmp(&ctype[j][1], "LAT", 3) == 0) {
- wcs->lat = j;
- sprintf(wcs->lngtyp, "%cLON", ctype[j][0]);
- sprintf(wcs->lattyp, "%cLAT", ctype[j][0]);
- ndx = &wcs->lng;
- sprintf(requir, "%s-%s", wcs->lngtyp, wcs->pcode);
- } else {
- /* Unrecognized celestial type. */
- return 1;
- }
- } else {
- if (strncmp(ctype[j], requir, 8) != 0) {
- /* Inconsistent projection types. */
- return 1;
- }
-
- *ndx = j;
- strcpy(requir, "");
- }
- }
-
- if (strcmp(requir, "")) {
- /* Unmatched celestial axis. */
- return 1;
- }
-
- if (strcmp(wcs->pcode, "")) {
- wcs->flag = WCSSET;
- } else {
- /* Signal for no celestial axis pair. */
- wcs->flag = 999;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int wcsfwd(ctype, wcs, world, crval, cel, phi, theta, prj, imgcrd, lin,
- pixcrd)
-
-const char ctype[][9];
-struct wcsprm* wcs;
-const double world[];
-const double crval[];
-struct celprm *cel;
-double *phi, *theta;
-struct prjprm *prj;
-double imgcrd[];
-struct linprm *lin;
-double pixcrd[];
-
-{
- int err, j;
- double offset;
-
- /* Initialize if required. */
- if (wcs->flag != WCSSET) {
- if (wcsset(lin->naxis, ctype, wcs)) return 1;
- }
-
- /* Convert to relative physical coordinates. */
- for (j = 0; j < lin->naxis; j++) {
- if (j == wcs->lng) continue;
- if (j == wcs->lat) continue;
- imgcrd[j] = world[j] - crval[j];
- }
-
- if (wcs->flag != 999) {
- /* Compute projected coordinates. */
- if (strcmp(wcs->pcode, "NCP") == 0) {
- /* Convert NCP to SIN. */
- if (cel->ref[2] == 0.0) {
- return 2;
- }
- strcpy(wcs->pcode, "SIN");
- prj->p[1] = 0.0;
- prj->p[2] = wcs_cosd(cel->ref[2])/wcs_sind(cel->ref[2]);
- prj->flag = 0;
- }
-
- if ((err = celfwd(wcs->pcode, world[wcs->lng], world[wcs->lat], cel,
- phi, theta, prj, &imgcrd[wcs->lng], &imgcrd[wcs->lat]))) {
- return err;
- }
-
- /* Do we have a CUBEFACE axis? */
- if (wcs->cubeface != -1) {
- /* Separation between faces. */
- if (prj->r0 == 0.0) {
- offset = 90.0;
- } else {
- offset = prj->r0*PI/2.0;
- }
-
- /* Stack faces in a cube. */
- if (imgcrd[wcs->lat] < -0.5*offset) {
- imgcrd[wcs->lat] += offset;
- imgcrd[wcs->cubeface] = 5.0;
- } else if (imgcrd[wcs->lat] > 0.5*offset) {
- imgcrd[wcs->lat] -= offset;
- imgcrd[wcs->cubeface] = 0.0;
- } else if (imgcrd[wcs->lng] > 2.5*offset) {
- imgcrd[wcs->lng] -= 3.0*offset;
- imgcrd[wcs->cubeface] = 4.0;
- } else if (imgcrd[wcs->lng] > 1.5*offset) {
- imgcrd[wcs->lng] -= 2.0*offset;
- imgcrd[wcs->cubeface] = 3.0;
- } else if (imgcrd[wcs->lng] > 0.5*offset) {
- imgcrd[wcs->lng] -= offset;
- imgcrd[wcs->cubeface] = 2.0;
- } else {
- imgcrd[wcs->cubeface] = 1.0;
- }
- }
- }
-
- /* Apply forward linear transformation. */
- if (linfwd(imgcrd, lin, pixcrd)) {
- return 4;
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int wcsrev(ctype, wcs, pixcrd, lin, imgcrd, prj, phi, theta, crval, cel,
- world)
-
-const char ctype[][9];
-struct wcsprm *wcs;
-const double pixcrd[];
-struct linprm *lin;
-double imgcrd[];
-struct prjprm *prj;
-double *phi, *theta;
-const double crval[];
-struct celprm *cel;
-double world[];
-
-{
- int err, face, j;
- double offset;
-
- /* Initialize if required. */
- if (wcs->flag != WCSSET) {
- if (wcsset(lin->naxis, ctype, wcs)) return 1;
- }
-
- /* Apply reverse linear transformation. */
- if (linrev(pixcrd, lin, imgcrd)) {
- return 4;
- }
-
- /* Convert to world coordinates. */
- for (j = 0; j < lin->naxis; j++) {
- if (j == wcs->lng) continue;
- if (j == wcs->lat) continue;
- world[j] = imgcrd[j] + crval[j];
- }
-
-
- if (wcs->flag != 999) {
- /* Do we have a CUBEFACE axis? */
- if (wcs->cubeface != -1) {
- face = (int)(imgcrd[wcs->cubeface] + 0.5);
- if (fabs(imgcrd[wcs->cubeface]-face) > 1e-10) {
- return 3;
- }
-
- /* Separation between faces. */
- if (prj->r0 == 0.0) {
- offset = 90.0;
- } else {
- offset = prj->r0*PI/2.0;
- }
-
- /* Lay out faces in a plane. */
- switch (face) {
- case 0:
- imgcrd[wcs->lat] += offset;
- break;
- case 1:
- break;
- case 2:
- imgcrd[wcs->lng] += offset;
- break;
- case 3:
- imgcrd[wcs->lng] += offset*2;
- break;
- case 4:
- imgcrd[wcs->lng] += offset*3;
- break;
- case 5:
- imgcrd[wcs->lat] -= offset;
- break;
- default:
- return 3;
- }
- }
-
- /* Compute celestial coordinates. */
- if (strcmp(wcs->pcode, "NCP") == 0) {
- /* Convert NCP to SIN. */
- if (cel->ref[2] == 0.0) {
- return 2;
- }
-
- strcpy(wcs->pcode, "SIN");
- prj->p[1] = 0.0;
- prj->p[2] = wcs_cosd(cel->ref[2])/wcs_sind(cel->ref[2]);
- prj->flag = 0;
- }
-
- if ((err = celrev(wcs->pcode, imgcrd[wcs->lng], imgcrd[wcs->lat], prj,
- phi, theta, cel, &world[wcs->lng], &world[wcs->lat]))) {
- return err;
- }
- }
-
- return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-
-int wcsmix(ctype, wcs, mixpix, mixcel, vspan, vstep, viter, world, crval, cel,
- phi, theta, prj, imgcrd, lin, pixcrd)
-
-const char ctype[][9];
-struct wcsprm *wcs;
-const int mixpix, mixcel;
-const double vspan[2], vstep;
-int viter;
-double world[];
-const double crval[];
-struct celprm *cel;
-double *phi, *theta;
-struct prjprm *prj;
-double imgcrd[];
-struct linprm *lin;
-double pixcrd[];
-
-{
- const int niter = 60;
- int crossed, err, istep, iter, j, k, nstep, retry;
- const double tol = 1.0e-10;
- double lambda, span[2], step;
- double pixmix;
- double lng, lng0, lng0m, lng1, lng1m;
- double lat, lat0, lat0m, lat1, lat1m;
- double d, d0, d0m, d1, d1m, dx;
- double dabs, dmin, lmin;
- double phi0, phi1;
- struct celprm cel0;
-
- /* Check vspan. */
- if (vspan[0] <= vspan[1]) {
- span[0] = vspan[0];
- span[1] = vspan[1];
- } else {
- /* Swap them. */
- span[0] = vspan[1];
- span[1] = vspan[0];
- }
-
- /* Check vstep. */
- step = fabs(vstep);
- if (step == 0.0) {
- step = (span[1] - span[0])/10.0;
- if (step > 1.0 || step == 0.0) step = 1.0;
- }
-
- /* Check viter. */
- nstep = viter;
- if (nstep < 5) {
- nstep = 5;
- } else if (nstep > 10) {
- nstep = 10;
- }
-
- /* Given pixel element. */
- pixmix = pixcrd[mixpix];
-
- dx = 0.0; /* to satisfy gcc -Wall */
- /* Iterate on the step size. */
- for (istep = 0; istep <= nstep; istep++) {
- if (istep) step /= 2.0;
-
- /* Iterate on the sky coordinate between the specified range. */
- if (mixcel == 1) {
- /* Celestial longitude is given. */
-
- /* Check whether the solution interval is a crossing interval. */
- lat0 = span[0];
- world[wcs->lat] = lat0;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = pixcrd[mixpix] - pixmix;
-
- dabs = fabs(d0);
- if (dabs < tol) return 0;
-
- lat1 = span[1];
- world[wcs->lat] = lat1;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d1 = pixcrd[mixpix] - pixmix;
-
- dabs = fabs(d1);
- if (dabs < tol) return 0;
-
- lmin = lat1;
- dmin = dabs;
-
- /* Check for a crossing point. */
- if (wcs_signbit(d0) != wcs_signbit(d1)) {
- crossed = 1;
- dx = d1;
- } else {
- crossed = 0;
- lat0 = span[1];
- }
-
- for (retry = 0; retry < 4; retry++) {
- /* Refine the solution interval. */
- while (lat0 > span[0]) {
- lat0 -= step;
- if (lat0 < span[0]) lat0 = span[0];
- world[wcs->lat] = lat0;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- dabs = fabs(d0);
- if (dabs < tol) return 0;
-
- /* Record the point of closest approach. */
- if (dabs < dmin) {
- lmin = lat0;
- dmin = dabs;
- }
-
- /* Check for a crossing point. */
- if (wcs_signbit(d0) != wcs_signbit(d1)) {
- crossed = 2;
- dx = d0;
- break;
- }
-
- /* Advance to the next subinterval. */
- lat1 = lat0;
- d1 = d0;
- }
-
- if (crossed) {
- /* A crossing point was found. */
- for (iter = 0; iter < niter; iter++) {
- /* Use regula falsi division of the interval. */
- lambda = d0/(d0-d1);
- if (lambda < 0.1) {
- lambda = 0.1;
- } else if (lambda > 0.9) {
- lambda = 0.9;
- }
-
- lat = lat0 + lambda*(lat1 - lat0);
- world[wcs->lat] = lat;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- dabs = fabs(d);
- if (dabs < tol) return 0;
-
- /* Record the point of closest approach. */
- if (dabs < dmin) {
- lmin = lat;
- dmin = dabs;
- }
-
- if (wcs_signbit(d0) == wcs_signbit(d)) {
- lat0 = lat;
- d0 = d;
- } else {
- lat1 = lat;
- d1 = d;
- }
- }
-
- /* No convergence, must have been a discontinuity. */
- if (crossed == 1) lat0 = span[1];
- lat1 = lat0;
- d1 = dx;
- crossed = 0;
-
- } else {
- /* No crossing point; look for a tangent point. */
- if (lmin == span[0]) break;
- if (lmin == span[1]) break;
-
- lat = lmin;
- lat0 = lat - step;
- if (lat0 < span[0]) lat0 = span[0];
- lat1 = lat + step;
- if (lat1 > span[1]) lat1 = span[1];
-
- world[wcs->lat] = lat0;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = fabs(pixcrd[mixpix] - pixmix);
-
- d = dmin;
-
- world[wcs->lat] = lat1;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d1 = fabs(pixcrd[mixpix] - pixmix);
-
- for (iter = 0; iter < niter; iter++) {
- lat0m = (lat0 + lat)/2.0;
- world[wcs->lat] = lat0m;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d0m = fabs(pixcrd[mixpix] - pixmix);
-
- if (d0m < tol) return 0;
-
- lat1m = (lat1 + lat)/2.0;
- world[wcs->lat] = lat1m;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d1m = fabs(pixcrd[mixpix] - pixmix);
-
- if (d1m < tol) return 0;
-
- if (d0m < d && d0m <= d1m) {
- lat1 = lat;
- d1 = d;
- lat = lat0m;
- d = d0m;
- } else if (d1m < d) {
- lat0 = lat;
- d0 = d;
- lat = lat1m;
- d = d1m;
- } else {
- lat0 = lat0m;
- d0 = d0m;
- lat1 = lat1m;
- d1 = d1m;
- }
- }
- }
- }
-
- } else {
- /* Celestial latitude is given. */
-
- /* Check whether the solution interval is a crossing interval. */
- lng0 = span[0];
- world[wcs->lng] = lng0;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = pixcrd[mixpix] - pixmix;
-
- dabs = fabs(d0);
- if (dabs < tol) return 0;
-
- lng1 = span[1];
- world[wcs->lng] = lng1;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d1 = pixcrd[mixpix] - pixmix;
-
- dabs = fabs(d1);
- if (dabs < tol) return 0;
- lmin = lng1;
- dmin = dabs;
-
- /* Check for a crossing point. */
- if (wcs_signbit(d0) != wcs_signbit(d1)) {
- crossed = 1;
- dx = d1;
- } else {
- crossed = 0;
- lng0 = span[1];
- }
-
- for (retry = 0; retry < 4; retry++) {
- /* Refine the solution interval. */
- while (lng0 > span[0]) {
- lng0 -= step;
- if (lng0 < span[0]) lng0 = span[0];
- world[wcs->lng] = lng0;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- dabs = fabs(d0);
- if (dabs < tol) return 0;
-
- /* Record the point of closest approach. */
- if (dabs < dmin) {
- lmin = lng0;
- dmin = dabs;
- }
-
- /* Check for a crossing point. */
- if (wcs_signbit(d0) != wcs_signbit(d1)) {
- crossed = 2;
- dx = d0;
- break;
- }
-
- /* Advance to the next subinterval. */
- lng1 = lng0;
- d1 = d0;
- }
-
- if (crossed) {
- /* A crossing point was found. */
- for (iter = 0; iter < niter; iter++) {
- /* Use regula falsi division of the interval. */
- lambda = d0/(d0-d1);
- if (lambda < 0.1) {
- lambda = 0.1;
- } else if (lambda > 0.9) {
- lambda = 0.9;
- }
-
- lng = lng0 + lambda*(lng1 - lng0);
- world[wcs->lng] = lng;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- dabs = fabs(d);
- if (dabs < tol) return 0;
-
- /* Record the point of closest approach. */
- if (dabs < dmin) {
- lmin = lng;
- dmin = dabs;
- }
-
- if (wcs_signbit(d0) == wcs_signbit(d)) {
- lng0 = lng;
- d0 = d;
- } else {
- lng1 = lng;
- d1 = d;
- }
- }
-
- /* No convergence, must have been a discontinuity. */
- if (crossed == 1) lng0 = span[1];
- lng1 = lng0;
- d1 = dx;
- crossed = 0;
-
- } else {
- /* No crossing point; look for a tangent point. */
- if (lmin == span[0]) break;
- if (lmin == span[1]) break;
-
- lng = lmin;
- lng0 = lng - step;
- if (lng0 < span[0]) lng0 = span[0];
- lng1 = lng + step;
- if (lng1 > span[1]) lng1 = span[1];
-
- world[wcs->lng] = lng0;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = fabs(pixcrd[mixpix] - pixmix);
-
- d = dmin;
-
- world[wcs->lng] = lng1;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d1 = fabs(pixcrd[mixpix] - pixmix);
-
- for (iter = 0; iter < niter; iter++) {
- lng0m = (lng0 + lng)/2.0;
- world[wcs->lng] = lng0m;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d0m = fabs(pixcrd[mixpix] - pixmix);
-
- if (d0m < tol) return 0;
-
- lng1m = (lng1 + lng)/2.0;
- world[wcs->lng] = lng1m;
- if ((err = wcsfwd(ctype, wcs, world, crval, cel, phi, theta,
- prj, imgcrd, lin, pixcrd))) {
- return err;
- }
- d1m = fabs(pixcrd[mixpix] - pixmix);
-
- if (d1m < tol) return 0;
-
- if (d0m < d && d0m <= d1m) {
- lng1 = lng;
- d1 = d;
- lng = lng0m;
- d = d0m;
- } else if (d1m < d) {
- lng0 = lng;
- d0 = d;
- lng = lng1m;
- d = d1m;
- } else {
- lng0 = lng0m;
- d0 = d0m;
- lng1 = lng1m;
- d1 = d1m;
- }
- }
- }
- }
- }
- }
-
-
- /* Set cel0 to the unity transformation. */
- cel0.flag = CELSET;
- cel0.ref[0] = cel->ref[0];
- cel0.ref[1] = cel->ref[1];
- cel0.ref[2] = cel->ref[2];
- cel0.ref[3] = cel->ref[3];
- cel0.euler[0] = -90.0;
- cel0.euler[1] = 0.0;
- cel0.euler[2] = 90.0;
- cel0.euler[3] = 1.0;
- cel0.euler[4] = 0.0;
- cel0.prjfwd = cel->prjfwd;
- cel0.prjrev = cel->prjrev;
-
- /* No convergence, check for aberrant behaviour at a native pole. */
- *theta = -90.0;
- for (j = 1; j <= 2; j++) {
- /* Could the celestial coordinate element map to a native pole? */
- *theta = -*theta;
- err = sphrev(0.0, *theta, cel->euler, &lng, &lat);
-
- if (mixcel == 1) {
- if (fabs(fmod(world[wcs->lng]-lng,360.0)) > tol) continue;
- if (lat < span[0]) continue;
- if (lat > span[1]) continue;
- world[wcs->lat] = lat;
- } else {
- if (fabs(world[wcs->lat]-lat) > tol) continue;
- if (lng < span[0]) lng += 360.0;
- if (lng > span[1]) lng -= 360.0;
- if (lng < span[0]) continue;
- if (lng > span[1]) continue;
- world[wcs->lng] = lng;
- }
-
- /* Is there a solution for the given pixel coordinate element? */
- lng = world[wcs->lng];
- lat = world[wcs->lat];
-
- /* Feed native coordinates to wcsfwd() with cel0 set to unity. */
- world[wcs->lng] = -180.0;
- world[wcs->lat] = *theta;
- if ((err = wcsfwd(ctype, wcs, world, crval, &cel0, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d0 = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- if (fabs(d0) < tol) {
- /* Recall saved world coordinates. */
- world[wcs->lng] = lng;
- world[wcs->lat] = lat;
- return 0;
- }
-
- /* Search for a crossing interval. */
- phi0 = -180.0;
- for (k = -179; k <= 180; k++) {
- phi1 = (float) k;
- world[wcs->lng] = phi1;
- if ((err = wcsfwd(ctype, wcs, world, crval, &cel0, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d1 = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- dabs = fabs(d1);
- if (dabs < tol) {
- /* Recall saved world coordinates. */
- world[wcs->lng] = lng;
- world[wcs->lat] = lat;
- return 0;
- }
-
- /* Is it a crossing interval? */
- if (wcs_signbit(d0) != wcs_signbit(d1)) break;
-
- phi0 = phi1;
- d0 = d1;
- }
-
- for (iter = 1; iter <= niter; iter++) {
- /* Use regula falsi division of the interval. */
- lambda = d0/(d0-d1);
- if (lambda < 0.1) {
- lambda = 0.1;
- } else if (lambda > 0.9) {
- lambda = 0.9;
- }
-
- world[wcs->lng] = phi0 + lambda*(phi1 - phi0);
- if ((err = wcsfwd(ctype, wcs, world, crval, &cel0, phi, theta, prj,
- imgcrd, lin, pixcrd))) {
- return err;
- }
- d = pixcrd[mixpix] - pixmix;
-
- /* Check for a solution. */
- dabs = fabs(d);
- if (dabs < tol) {
- /* Recall saved world coordinates. */
- world[wcs->lng] = lng;
- world[wcs->lat] = lat;
- return 0;
- }
-
- if (wcs_signbit(d0) == wcs_signbit(d)) {
- phi0 = world[wcs->lng];
- d0 = d;
- } else {
- phi1 = world[wcs->lng];
- d1 = d;
- }
- }
- }
-
-
- /* No solution. */
- return 5;
-
-}
diff --git a/sextractor/src/wcs/wcs.h b/sextractor/src/wcs/wcs.h
deleted file mode 100644
index 0755249..0000000
--- a/sextractor/src/wcs/wcs.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: wcs.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifndef WCSLIB_WCS
-#define WCSLIB_WCS
-
-#include "cel.h"
-#include "lin.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct wcsprm {
- int flag;
- char pcode[4];
- char lngtyp[5], lattyp[5];
- int lng, lat;
- int cubeface;
-};
-
-#if __STDC__ || defined(__cplusplus)
- int wcsset(const int,
- const char[][9],
- struct wcsprm *);
-
- int wcsfwd(const char[][9],
- struct wcsprm *,
- const double[],
- const double[],
- struct celprm *,
- double *,
- double *,
- struct prjprm *,
- double[],
- struct linprm *,
- double[]);
-
- int wcsrev(const char[][9],
- struct wcsprm *,
- const double[],
- struct linprm *,
- double[],
- struct prjprm *,
- double *,
- double *,
- const double[],
- struct celprm *,
- double[]);
-
- int wcsmix(const char[][9],
- struct wcsprm *,
- const int,
- const int,
- const double[],
- const double,
- int,
- double[],
- const double[],
- struct celprm *,
- double *,
- double *,
- struct prjprm *,
- double[],
- struct linprm *,
- double[]);
-
-#else
- int wcsset(), wcsfwd(), wcsrev(), wcsmix();
-#endif
-
-extern const char *wcsset_errmsg[];
-extern const char *wcsfwd_errmsg[];
-extern const char *wcsrev_errmsg[];
-extern const char *wcsmix_errmsg[];
-
-#define WCSSET 137
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* WCSLIB_WCS */
diff --git a/sextractor/src/wcs/wcsmath.h b/sextractor/src/wcs/wcsmath.h
deleted file mode 100644
index ea21936..0000000
--- a/sextractor/src/wcs/wcsmath.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: wcsmath.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-
-#ifndef WCSLIB_MATH
-#define WCSLIB_MATH
-
-#ifdef PI
-#undef PI
-#endif
-
-#ifdef D2R
-#undef D2R
-#endif
-
-#ifdef R2D
-#undef R2D
-#endif
-
-#ifdef SQRT2
-#undef SQRT2
-#endif
-
-#ifdef SQRT2INV
-#undef SQRT2INV
-#endif
-
-#define PI 3.141592653589793238462643
-#define D2R (PI/180.0)
-#define R2D (180.0/PI)
-#define SQRT2 1.4142135623730950488
-#define SQRT2INV (1.0/SQRT2)
-
-#endif /* WCSLIB_MATH */
diff --git a/sextractor/src/wcs/wcstrig.c b/sextractor/src/wcs/wcstrig.c
deleted file mode 100644
index 6fc179d..0000000
--- a/sextractor/src/wcs/wcstrig.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-*=============================================================================
-*
-* The functions defined herein are trigonometric or inverse trigonometric
-* functions which take or return angular arguments in decimal degrees.
-*
-* $Id: wcstrig.c,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*---------------------------------------------------------------------------*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_MATHIMF_H
-#include <mathimf.h>
-#else
-#include <math.h>
-#endif
-#include "wcstrig.h"
-
-#ifndef PI /* EB 02/06/97 */
-#define PI 3.141592653589793238462643
-#endif /* EB 02/06/97 */
-const double d2r = PI / 180.0;
-const double r2d = 180.0 / PI;
-
-#ifndef HAVE_MATHIMF_H
-
-double wcs_cosd(angle)
-
-const double angle;
-
-{
- double resid;
-
- resid = fabs(fmod(angle,360.0));
- if (resid == 0.0) {
- return 1.0;
- } else if (resid == 90.0) {
- return 0.0;
- } else if (resid == 180.0) {
- return -1.0;
- } else if (resid == 270.0) {
- return 0.0;
- }
-
- return cos(angle*d2r);
-}
-
-/*--------------------------------------------------------------------------*/
-
-double wcs_sind(angle)
-
-const double angle;
-
-{
- double resid;
-
- resid = fmod(angle-90.0,360.0);
- if (resid == 0.0) {
- return 1.0;
- } else if (resid == 90.0) {
- return 0.0;
- } else if (resid == 180.0) {
- return -1.0;
- } else if (resid == 270.0) {
- return 0.0;
- }
-
- return sin(angle*d2r);
-}
-
-/*--------------------------------------------------------------------------*/
-
-double wcs_tand(angle)
-
-const double angle;
-
-{
- double resid;
-
- resid = fmod(angle,360.0);
- if (resid == 0.0 || fabs(resid) == 180.0) {
- return 0.0;
- } else if (resid == 45.0 || resid == 225.0) {
- return 1.0;
- } else if (resid == -135.0 || resid == -315.0) {
- return -1.0;
- }
-
- return tan(angle*d2r);
-}
-
-/*--------------------------------------------------------------------------*/
-
-double wcs_acosd(v)
-
-const double v;
-
-{
- if (v >= 1.0) {
- if (v-1.0 < WCSTRIG_TOL) return 0.0;
- } else if (v == 0.0) {
- return 90.0;
- } else if (v <= -1.0) {
- if (v+1.0 > -WCSTRIG_TOL) return 180.0;
- }
-
- return acos(v)*r2d;
-}
-
-/*--------------------------------------------------------------------------*/
-
-double wcs_asind(v)
-
-const double v;
-
-{
- if (v <= -1.0) {
- if (v+1.0 > -WCSTRIG_TOL) return -90.0;
- } else if (v == 0.0) {
- return 0.0;
- } else if (v >= 1.0) {
- if (v-1.0 < WCSTRIG_TOL) return 90.0;
- }
-
- return asin(v)*r2d;
-}
-
-/*--------------------------------------------------------------------------*/
-
-double wcs_atand(v)
-
-const double v;
-
-{
- if (v == -1.0) {
- return -45.0;
- } else if (v == 0.0) {
- return 0.0;
- } else if (v == 1.0) {
- return 45.0;
- }
-
- return atan(v)*r2d;
-}
-
-/*--------------------------------------------------------------------------*/
-
-double wcs_atan2d(y, x)
-
-const double x, y;
-
-{
- if (y == 0.0) {
- if (x >= 0.0) {
- return 0.0;
- } else if (x < 0.0) {
- return 180.0;
- }
- } else if (x == 0.0) {
- if (y > 0.0) {
- return 90.0;
- } else if (y < 0.0) {
- return -90.0;
- }
- }
-
- return atan2(y,x)*r2d;
-}
-
-#endif
diff --git a/sextractor/src/wcs/wcstrig.h b/sextractor/src/wcs/wcstrig.h
deleted file mode 100644
index 69cb9f9..0000000
--- a/sextractor/src/wcs/wcstrig.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*=============================================================================
-*
-* WCSLIB - an implementation of the FITS WCS proposal.
-* Copyright (C) 1995-1999, Mark Calabretta
-*
-* This library is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Library General Public License as published
-* by the Free Software Foundation; either version 2 of the License, or (at
-* your option) any later version.
-*
-* This library is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
-* General Public License for more details.
-*
-* You should have received a copy of the GNU Library General Public License
-* along with this library; if not, write to the Free Software Foundation,
-* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-* Correspondence concerning WCSLIB may be directed to:
-* Internet email: mcalabre at atnf.csiro.au
-* Postal address: Dr. Mark Calabretta,
-* Australia Telescope National Facility,
-* P.O. Box 76,
-* Epping, NSW, 2121,
-* AUSTRALIA
-*
-* Author: Mark Calabretta, Australia Telescope National Facility
-* $Id: wcstrig.h,v 1.1 2007-09-11 09:45:24 jmlarsen Exp $
-*===========================================================================*/
-#ifndef WCSLIB_TRIG
-#define WCSLIB_TRIG
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(__STDC__) && !defined(__cplusplus)
-#ifndef const
-#define const
-#endif
-#endif
-
-#if __STDC__ || defined(__cplusplus)
-#ifdef HAVE_MATHIMF_H
-#define wcs_cosd cosd
-#define wcs_sind sind
-#define wcs_tand tand
-#define wcs_acosd acosd
-#define wcs_asind asind
-#define wcs_atand atand
-#define wcs_atan2d atan2d
-#else
- double wcs_cosd(const double);
- double wcs_sind(const double);
- double wcs_tand(const double);
- double wcs_acosd(const double);
- double wcs_asind(const double);
- double wcs_atand(const double);
- double wcs_atan2d(const double, const double);
-#endif
-#else
- double wcs_cosd();
- double wcs_sind();
- double wcs_tand();
- double wcs_acosd();
- double wcs_asind();
- double wcs_atand();
- double wcs_atan2d();
-#endif
-
-/* Domain tolerance for asin and acos functions. */
-#define WCSTRIG_TOL 1e-10
-#endif /* TRIGD */
-
-#ifdef __cplusplus
-};
-
-#endif /* WCSLIB_TRIG */
diff --git a/sextractor/src/weight.c b/sextractor/src/weight.c
deleted file mode 100644
index 9a0008d..0000000
--- a/sextractor/src/weight.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- weight.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Handling of weight maps.
-*
-* Last modify: 28/11/2003
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "define.h"
-#include "globals.h"
-#include "field.h"
-#include "weight.h"
-
-/******************************* newweight **********************************/
-/*
-Load a weight map and initialize relevant parameters.
-*/
-picstruct *newweight(char *filename, picstruct *reffield,
- weightenum wtype, int nok)
-
- {
- picstruct *wfield;
-
- switch(wtype)
- {
- case WEIGHT_FROMINTERP:
- wfield = inheritfield(reffield, INTERP_FIELD);
- break;
-
- case WEIGHT_FROMBACK:
- wfield = inheritfield(reffield, BACKRMS_FIELD);
- break;
-
- case WEIGHT_FROMRMSMAP:
- wfield = newfield(filename, RMS_FIELD, nok);
- if ((wfield->width!=reffield->width)||(wfield->height!=reffield->height))
- error(EXIT_FAILURE,
- "*Error*: measured frame and weight map have different sizes","");
- wfield->sigfac = 1.0;
- break;
-
- case WEIGHT_FROMVARMAP:
- wfield = newfield(filename, VAR_FIELD, nok);
- if ((wfield->width!=reffield->width)||(wfield->height!=reffield->height))
- error(EXIT_FAILURE,
- "*Error*: measured frame and weight map have different sizes","");
- break;
-
- case WEIGHT_FROMWEIGHTMAP:
- wfield = newfield(filename, WEIGHT_FIELD, nok);
- if ((wfield->width!=reffield->width)||(wfield->height!=reffield->height))
- error(EXIT_FAILURE,
- "*Error*: measured frame and weight map have different sizes","");
- break;
- default:
- wfield = NULL; /* To avoid gcc -Wall warnings */
- error(EXIT_FAILURE,
- "*Internal Error*: Unknown weight-map type in ", "makeit()");
- break;
- }
-
-/* Default normalization factor (will be changed if necessary later) */
- wfield->sigfac = 1.0;
-
- return wfield;
- }
-
-
-/******************************* weight_to_var *******************************/
-/*
-Transform an array of possibily unnormalized weights into a calibrated
-variance map.
-*/
-void weight_to_var(picstruct *wfield, PIXTYPE *data, int npix)
-
- {
- float sigfac2;
- int i;
-
- switch(wfield->flags&(BACKRMS_FIELD|RMS_FIELD|VAR_FIELD|WEIGHT_FIELD))
- {
- case BACKRMS_FIELD:
- case RMS_FIELD:
- for (i=npix; i--; data++)
- if (*data<BIG)
- *data *= *data;
- break;
- case VAR_FIELD:
- sigfac2 = wfield->sigfac*wfield->sigfac;
- for (i=npix; i--;)
- *(data++) *= sigfac2;
- break;
- case WEIGHT_FIELD:
- sigfac2 = wfield->sigfac*wfield->sigfac;
- for (i=npix; i--; data++)
- if (*data > 0.0)
- *data = sigfac2/(*data);
- else
- *data = BIG;
- break;
- default:
- error(EXIT_FAILURE,
- "*Internal Error*: Unknown weight-map type in ", "weight_to_var()");
- break;
- }
-
- return;
- }
-
diff --git a/sextractor/src/weight.h b/sextractor/src/weight.h
deleted file mode 100644
index f379c83..0000000
--- a/sextractor/src/weight.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- weight.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP, Leiden observatory & ESO)
-*
-* Contents: Include file for weight.c.
-*
-* Last modify: 14/12/2002
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*---------------------------------- protos --------------------------------*/
-
-extern picstruct *newweight(char *filename, picstruct *reffield,
- weightenum wtype, int nok);
-
-void weight_to_var(picstruct *wfield, PIXTYPE *data,
- int npix);
-
diff --git a/sextractor/src/winpos.c b/sextractor/src/winpos.c
deleted file mode 100644
index 8b5c053..0000000
--- a/sextractor/src/winpos.c
+++ /dev/null
@@ -1,388 +0,0 @@
- /*
- winpos.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: Compute windowed barycenter
-*
-* Last modify: 22/09/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdlib.h>
-
-#include "define.h"
-#include "globals.h"
-#include "prefs.h"
-#include "winpos.h"
-
-static obj2struct *obj2 = &outobj2;
-
-/****** compute_winpos ********************************************************
-PROTO void compute_winpos(picstruct *field, picstruct *wfield,
- objstruct *obj)
-PURPOSE Compute windowed source barycenter.
-INPUT Picture structure pointer,
- Weight-map structure pointer,
- object structure.
-OUTPUT -.
-NOTES obj->posx and obj->posy are taken as initial centroid guesses.
-AUTHOR E. Bertin (IAP)
-VERSION 22/09/2005
- ***/
-void compute_winpos(picstruct *field, picstruct *wfield, objstruct *obj)
-
- {
- float r2, raper,raper2, rintlim,rintlim2,rextlim2,
- dx,dx1,dy,dy2, sig, pdbkg,
- offsetx,offsety,scalex,scaley,scale2, ngamma, locarea;
- double tv, tv2, pix, var, backnoise2, gain, locpix,
- dxpos,dypos, twosig2, err,err2, emx2,emy2,emxy,
- esum, temp,temp2, mx2, my2,mxy,pmx2, theta, mx,my,
- mx2ph, my2ph;
- int i,x,y, x2,y2, xmin,xmax,ymin,ymax, sx,sy, w,h,
- fymin,fymax, pflag,corrflag, gainflag, errflag,
- momentflag;
- long pos;
- PIXTYPE *strip,*stript, *wstrip,*wstript,
- wthresh = 0.0;
-
- if (wfield)
- wthresh = wfield->weight_thresh;
- wstrip = wstript = NULL;
- w = field->width;
- h = field->stripheight;
- fymin = field->ymin;
- fymax = field->ymax;
- pflag = (prefs.detect_type==PHOTO)? 1:0;
- corrflag = (prefs.mask_type==MASK_CORRECT);
- gainflag = wfield && prefs.weightgain_flag;
- errflag = FLAG(obj2.winposerr_mx2);
- momentflag = FLAG(obj2.win_mx2) | FLAG(obj2.winposerr_mx2);
- var = backnoise2 = field->backsig*field->backsig;
- gain = prefs.gain;
- sig = obj2->hl_radius*2.0/2.35; /* From half-FWHM to sigma */
- twosig2 = 2.0*sig*sig;
-
-/* Integration radius */
- raper = WINPOS_NSIG*sig;
-
-/* For photographic data */
- if (pflag)
- {
- ngamma = field->ngamma;
- pdbkg = exp(obj->dbkg/ngamma);
- }
- else
- {
- ngamma = 0.0;
- pdbkg = 0.0;
- }
- raper2 = raper*raper;
-/* Internal radius of the oversampled annulus (<r-sqrt(2)/2) */
- rintlim = raper - 0.75;
- rintlim2 = (rintlim>0.0)? rintlim*rintlim: 0.0;
-/* External radius of the oversampled annulus (>r+sqrt(2)/2) */
- rextlim2 = (raper + 0.75)*(raper + 0.75);
- scaley = scalex = 1.0/WINPOS_OVERSAMP;
- scale2 = scalex*scaley;
- offsetx = 0.5*(scalex-1.0);
- offsety = 0.5*(scaley-1.0);
-/* Use isophotal centroid as a first guess */
- mx = obj2->posx - 1.0;
- my = obj2->posy - 1.0;
-
- for (i=0; i<WINPOS_NITERMAX; i++)
- {
- xmin = (int)(mx-raper+0.499999);
- xmax = (int)(mx+raper+1.499999);
- ymin = (int)(my-raper+0.499999);
- ymax = (int)(my+raper+1.499999);
- mx2ph = mx*2.0 + 0.49999;
- my2ph = my*2.0 + 0.49999;
-
- if (xmin < 0)
- {
- xmin = 0;
- obj->flag |= OBJ_APERT_PB;
- }
- if (xmax > w)
- {
- xmax = w;
- obj->flag |= OBJ_APERT_PB;
- }
- if (ymin < fymin)
- {
- ymin = fymin;
- obj->flag |= OBJ_APERT_PB;
- }
- if (ymax > fymax)
- {
- ymax = fymax;
- obj->flag |= OBJ_APERT_PB;
- }
-
- tv = esum = emxy = emx2 = emy2 = mx2 = my2 = mxy = 0.0;
- dxpos = dypos = 0.0;
- strip = field->strip;
- wstrip = wstript = NULL; /* To avoid gcc -Wall warnings */
- if (wfield)
- wstrip = wfield->strip;
- for (y=ymin; y<ymax; y++)
- {
- stript = strip + (pos = (y%h)*w + xmin);
- if (wfield)
- wstript = wstrip + pos;
- for (x=xmin; x<xmax; x++, stript++, wstript++)
- {
- dx = x - mx;
- dy = y - my;
- if ((r2=dx*dx+dy*dy)<rextlim2)
- {
- if (WINPOS_OVERSAMP>1 && r2> rintlim2)
- {
- dx += offsetx;
- dy += offsety;
- locarea = 0.0;
- for (sy=WINPOS_OVERSAMP; sy--; dy+=scaley)
- {
- dx1 = dx;
- dy2 = dy*dy;
- for (sx=WINPOS_OVERSAMP; sx--; dx1+=scalex)
- if (dx1*dx1+dy2<raper2)
- locarea += scale2;
- }
- }
- else
- locarea = 1.0;
- locarea *= exp(-r2/twosig2);
-/*-------- Here begin tests for pixel and/or weight overflows. Things are a */
-/*-------- bit intricated to have it running as fast as possible in the most */
-/*-------- common cases */
- if ((pix=*stript)<=-BIG || (wfield && (var=*wstript)>=wthresh))
- {
- if (corrflag
- && (x2=(int)(mx2ph-x))>=0 && x2<w
- && (y2=(int)(my2ph-y))>=fymin && y2<fymax
- && (pix=*(strip + (pos = (y2%h)*w + x2)))>-BIG)
- {
- if (wfield)
- {
- var = *(wstrip + pos);
- if (var>=wthresh)
- pix = var = 0.0;
- }
- }
- else
- {
- pix = 0.0;
- if (wfield)
- var = 0.0;
- }
- }
- if (pflag)
- pix=exp(pix/ngamma);
- dx = x - mx;
- dy = y - my;
- locpix = locarea*pix;
- tv += locpix;
- dxpos += locpix*dx;
- dypos += locpix*dy;
- if (errflag)
- {
- err = var;
- if (pflag)
- err *= locpix*pix/(ngamma*ngamma);
- else if (gain>0.0 && pix>0.0)
- {
- if (gainflag)
- err += pix/gain*var/backnoise2;
- else
- err += pix/gain;
- }
- err2 = locarea*locarea*err;
- esum += err2;
- emx2 += err2*(dx*dx+0.0833); /* Finite pixel size */
- emy2 += err2*(dy*dy+0.0833); /* Finite pixel size */
- emxy += err2*dx*dy;
- }
- if (momentflag)
- {
- mx2 += locpix*dx*dx;
- my2 += locpix*dy*dy;
- mxy += locpix*dx*dy;
- }
- }
- }
- }
-
- if (tv>0.0)
- {
- mx += (dxpos /= tv)*WINPOS_GRADFAC;
- my += (dypos /= tv)*WINPOS_GRADFAC;
- }
- else
- break;
-
-/*-- Stop here if position does not change */
- if (dxpos*dxpos+dypos*dypos < WINPOS_STEPMIN*WINPOS_STEPMIN)
- break;
- }
- mx2 = mx2/tv - dxpos*dxpos;
- my2 = my2/tv - dypos*dypos;
- mxy = mxy/tv - dxpos*dypos;
- obj2->winpos_x = mx + 1.0; /* The dreaded 1.0 FITS offset */
- obj2->winpos_y = my + 1.0; /* The dreaded 1.0 FITS offset */
- obj2->winpos_niter = i+1;
-
-/* WINdowed flux */
- if (FLAG(obj2.flux_win))
- {
- obj2->flux_win = tv;
- obj2->fluxerr_win = sqrt(esum);
- }
- temp2=mx2*my2-mxy*mxy;
- obj2->win_flag = (tv <= 0.0)*4 + (mx2 < 0.0 || my2 < 0.0)*2
- + (temp2<0.0);
- if (obj2->win_flag)
- {
-/*--- Negative values: revert to isophotal estimates */
- if (errflag)
- {
- obj2->winposerr_mx2 = obj->poserr_mx2;
- obj2->winposerr_my2 = obj->poserr_my2;
- obj2->winposerr_mxy = obj->poserr_mxy;
- if (FLAG(obj2.winposerr_a))
- {
- obj2->winposerr_a = obj2->poserr_a;
- obj2->winposerr_b = obj2->poserr_b;
- obj2->winposerr_theta = obj2->poserr_theta;
- }
- if (FLAG(obj2.winposerr_cxx))
- {
- obj2->winposerr_cxx = obj2->poserr_cxx;
- obj2->winposerr_cyy = obj2->poserr_cyy;
- obj2->winposerr_cxy = obj2->poserr_cxy;
- }
- }
- if (momentflag)
- {
- obj2->win_mx2 = obj->mx2;
- obj2->win_my2 = obj->my2;
- obj2->win_mxy = obj->mxy;
- if (FLAG(obj2.win_cxx))
- {
- obj2->win_cxx = obj->cxx;
- obj2->win_cyy = obj->cyy;
- obj2->win_cxy = obj->cxy;
- }
- if (FLAG(obj2.win_a))
- {
- obj2->win_a = obj->a;
- obj2->win_b = obj->b;
- obj2->win_polar = obj2->polar;
- obj2->win_theta = obj->theta;
- }
- }
- }
- else
- {
- if (errflag)
- {
- tv2 = tv*tv;
- emx2 /= tv2;
- emy2 /= tv2;
- emxy /= tv2;
-/*-- Handle fully correlated profiles (which cause a singularity...) */
- esum *= 0.08333/tv2;
- if (obj->singuflag && (emx2*emy2-emxy*emxy) < esum*esum)
- {
- emx2 += esum;
- emy2 += esum;
- }
-
- obj2->winposerr_mx2 = emx2;
- obj2->winposerr_my2 = emy2;
- obj2->winposerr_mxy = emxy;
-/*---- Error ellipse parameters */
- if (FLAG(obj2.winposerr_a))
- {
- double pmx2,pmy2,temp,theta;
-
- if (fabs(temp=emx2-emy2) > 0.0)
- theta = atan2(2.0 * emxy,temp) / 2.0;
- else
- theta = PI/4.0;
-
- temp = sqrt(0.25*temp*temp+ emxy*emxy);
- pmy2 = pmx2 = 0.5*(emx2+emy2);
- pmx2+=temp;
- pmy2-=temp;
-
- obj2->winposerr_a = (float)sqrt(pmx2);
- obj2->winposerr_b = (float)sqrt(pmy2);
- obj2->winposerr_theta = theta*180.0/PI;
- }
-
- if (FLAG(obj2.winposerr_cxx))
- {
- double temp;
-
- obj2->winposerr_cxx = (float)(emy2/(temp=emx2*emy2-emxy*emxy));
- obj2->winposerr_cyy = (float)(emx2/temp);
- obj2->winposerr_cxy = (float)(-2*emxy/temp);
- }
- }
-
- if (momentflag)
- {
-/*-- Handle fully correlated profiles (which cause a singularity...) */
- if ((temp2=mx2*my2-mxy*mxy)<0.00694)
- {
- mx2 += 0.0833333;
- my2 += 0.0833333;
- temp2 = mx2*my2-mxy*mxy;
- }
- obj2->win_mx2 = mx2;
- obj2->win_my2 = my2;
- obj2->win_mxy = mxy;
-
- if (FLAG(obj2.win_cxx))
- {
- obj2->win_cxx = (float)(my2/temp2);
- obj2->win_cyy = (float)(mx2/temp2);
- obj2->win_cxy = (float)(-2*mxy/temp2);
- }
-
- if (FLAG(obj2.win_a))
- {
- if ((fabs(temp=mx2-my2)) > 0.0)
- theta = atan2(2.0 * mxy,temp) / 2.0;
- else
- theta = PI/4.0;
-
- temp = sqrt(0.25*temp*temp+mxy*mxy);
- pmx2 = 0.5*(mx2+my2);
- obj2->win_a = (float)sqrt(pmx2 + temp);
- obj2->win_b = (float)sqrt(pmx2 - temp);
- if (FLAG(obj2.win_polar))
- obj2->win_polar = temp / pmx2;
- obj2->win_theta = theta*180.0/PI;
- }
- }
- }
-
- return;
- }
-
-
diff --git a/sextractor/src/winpos.h b/sextractor/src/winpos.h
deleted file mode 100644
index 940cf21..0000000
--- a/sextractor/src/winpos.h
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- winpos.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN, IAP
-*
-* Contents: Include file for winpos.c.
-*
-* Last modify: 25/08/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-/*----------------------------- Internal constants --------------------------*/
-
-#define WINPOS_NITERMAX 16 /* Maximum number of steps */
-#define WINPOS_NSIG 4 /* Measurement radius */
-#define WINPOS_OVERSAMP 3 /* oversampling in each dimension */
-#define WINPOS_STEPMIN 0.001 /* Minimum change in position for continueing*/
-#define WINPOS_GRADFAC 2.0 /* Gradient descent acceleration factor */
-
-/* NOTES:
-One must have:
- WINPOS_NITERMAX >= 1
- WINPOS_OVERSAMP >= 1
-*/
-
-/*------------------------------- functions ---------------------------------*/
-extern void compute_winpos(picstruct *field, picstruct *wfield,
- objstruct *obj);
diff --git a/sextractor/src/xml.c b/sextractor/src/xml.c
deleted file mode 100644
index bbd4cab..0000000
--- a/sextractor/src/xml.c
+++ /dev/null
@@ -1,799 +0,0 @@
- /*
- xml.c
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SCAMP
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: XML logging.
-*
-* Last modify: 14/07/2006
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "define.h"
-#include "globals.h"
-#include "fits/fitscat.h"
-#include "field.h"
-#include "key.h"
-#include "prefs.h"
-#include "xml.h"
-
-extern time_t thetimet,thetimet2; /* from makeit.c */
-extern pkeystruct key[]; /* from preflist.h */
-extern char keylist[][32]; /* from preflist.h */
-xmlstruct *xmlstack = NULL;
-int nxml=0, nxmlmax=0;
-
-/****** init_xml ************************************************************
-PROTO int init_xml(void)
-PURPOSE Initialize a set of meta-data kept in memory before being written to the
- XML file
-INPUT Number of image extensions.
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 03/07/2006
- ***/
-int init_xml(int next)
- {
- QMALLOC(xmlstack, xmlstruct, next);
- nxml = 0;
- nxmlmax = next;
-
- return EXIT_SUCCESS;
- }
-
-
-/****** end_xml ************************************************************
-PROTO int end_xml(void)
-PURPOSE Free the set of meta-data kept in memory.
-INPUT -.
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 12/07/2006
- ***/
-int end_xml(void)
- {
- free(xmlstack);
-
- return EXIT_SUCCESS;
- }
-
-/****** update_xml ***********************************************************
-PROTO int update_xml(void)
-PURPOSE Update a set of meta-data kept in memory before being written to the
- XML file
-INPUT -.
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 11/07/2006
- ***/
-int update_xml(sexcatstruct *sexcat, picstruct *dfield, picstruct *field,
- picstruct *dwfield, picstruct *wfield)
- {
- xmlstruct *x;
-
- if (nxml >= nxmlmax)
- error(EXIT_FAILURE, "*Internal Error*: too many extensions in XML stack",
- "");
- x = &xmlstack[nxml++];
- x->currext = sexcat->currext;
- x->ndetect = sexcat->ndetect;
- x->ntotal = sexcat->ntotal;
- strcpy(x->ext_date, sexcat->ext_date);
- strcpy(x->ext_time, sexcat->ext_time);
- x->ext_elapsed = sexcat->ext_elapsed;
- strcpy(x->ident[0], dfield->ident);
- strcpy(x->ident[1], field->ident);
- x->backmean[0] = dfield->backmean;
- x->backmean[1] = field->backmean;
- x->backsig[0] = dfield->backsig;
- x->backsig[1] = field->backsig;
- x->sigfac[0] = dfield->sigfac;
- x->sigfac[1] = field->sigfac;
- x->thresh[0] = dfield->dthresh;
- x->thresh[1] = field->thresh;
- x->pixscale[0] = dfield->pixscale;
- x->pixscale[1] = field->pixscale;
- x->epoch[0] = dfield->epoch;
- x->epoch[1] = field->epoch;
-
- return EXIT_SUCCESS;
- }
-
-
-/****** write_xml ************************************************************
-PROTO int write_xml(char *filename)
-PURPOSE Save meta-data to an XML file/stream.
-INPUT XML file name.
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 14/07/2006
- ***/
-int write_xml(char *filename)
- {
- FILE *file;
-
- if (!(file = fopen(prefs.xml_name, "w")))
- return RETURN_ERROR;
-
- write_xml_header(file);
- write_vo_fields(file);
-
- fprintf(file, " <DATA>\n");
- if (prefs.cat_type == FITS_LDAC || prefs.cat_type == FITS_TPX
- || prefs.cat_type == FITS_10)
- fprintf(file,
- " <FITS extnum=\"%d\"><STREAM href=\"%s%s\" /> </FITS>",
- prefs.cat_type == FITS_10? 1:2,
- prefs.cat_name[0] == '/'? "file://" : "file:",
- prefs.cat_name);
- fprintf(file, " </DATA>\n");
- fprintf(file, " </TABLE>\n");
-
- write_xml_meta(file, (char *)NULL);
-
- fprintf(file, "</RESOURCE>\n");
- fprintf(file, "</VOTABLE>\n");
-
- fclose(file);
-
- return RETURN_OK;
- }
-
-
-/****** write_xml_header ******************************************************
-PROTO int write_xml_header(FILE *file)
-PURPOSE Save an XML-VOtable header to an XML file/stream
-INPUT file or stream pointer.
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 14/07/2006
- ***/
-int write_xml_header(FILE *file)
- {
- char *filename, *rfilename;
-
-/* A short, "relative" version of the filename */
- filename = prefs.image_name[prefs.nimage_name>1? 1:0];
- if (!(rfilename = strrchr(filename, '/')))
- rfilename = filename;
- else
- rfilename++;
-
- fprintf(file, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- fprintf(file, "<?xml-stylesheet type=\"text/xsl\" href=\"%s\"?>\n",
- prefs.xsl_name);
- fprintf(file, "<VOTABLE "
- "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
- "xsi:noNamespaceSchemaLocation="
- "\"http://www.ivoa.net/xml/VOTable/v1.1\">\n");
- fprintf(file, "<DESCRIPTION>produced by %s</DESCRIPTION>\n", BANNER);
- fprintf(file, "<!-- VOTable description at "
- "http://www.ivoa.net/Documents/latest/VOT.html -->\n");
- fprintf(file, "<RESOURCE ID=\"%s\" name=\"%s\">\n", BANNER, rfilename);
- fprintf(file, " <DESCRIPTION>Catalog of sources extracted with %s"
- "</DESCRIPTION>\n", BANNER);
- fprintf(file, " <INFO name=\"QUERY_STATUS\" value=\"OK\" />\n");
- fprintf(file, " <COOSYS ID=\"J2000\" equinox=\"J2000\""
- " epoch=\"J%.10g\" system=\"%s\"/>\n", prefs.epoch, prefs.coosys);
- fprintf(file, " <TABLE ID=\"Source_List\" name=\"%s/out\">\n", rfilename);
- fprintf(file,
- " <DESCRIPTION>Table of sources detected in image</DESCRIPTION>\n");
- fprintf(file,
- " <!-- Now comes the definition of each %s parameter -->\n", BANNER);
-
- return RETURN_OK;
- }
-
-
-/****** write_xml_meta ********************************************************
-PROTO int write_xml_meta(FILE *file, char *error)
-PURPOSE Save meta-data to an XML-VOTable file or stream
-INPUT Pointer to the output file (or stream),
- Pointer to an error msg (or NULL).
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 14/07/2006
- ***/
-int write_xml_meta(FILE *file, char *error)
- {
- char *pspath,*psuser, *pshost, *str;
- struct tm *tm;
- int n;
-
-/* Processing date and time if msg error present */
- if (error)
- {
- thetimet2 = time(NULL);
- tm = localtime(&thetimet2);
- sprintf(prefs.sdate_end,"%04d-%02d-%02d",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
- sprintf(prefs.stime_end,"%02d:%02d:%02d",
- tm->tm_hour, tm->tm_min, tm->tm_sec);
- prefs.time_diff = difftime(thetimet2, thetimet);
- }
-
-/* Username */
- psuser = pspath = pshost = NULL;
-#ifdef HAVE_GETENV
- if (!(psuser=getenv("USERNAME"))) /* Cygwin,... */
- psuser = getenv("LOGNAME"); /* Linux,... */
- pspath = getenv("PWD");
- pshost = getenv("HOSTNAME");
-#endif
-
- fprintf(file, " <RESOURCE ID=\"MetaData\" name=\"MetaData\">\n");
- fprintf(file, " <DESCRIPTION>%s meta-data</DESCRIPTION>\n", BANNER);
- fprintf(file, " <INFO name=\"QUERY_STATUS\" value=\"OK\" />\n");
- fprintf(file, " <PARAM name=\"Software\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.title;meta.software\" value=\"%s\"/>\n",
- BANNER);
- fprintf(file, " <PARAM name=\"Version\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.version;meta.software\" value=\"%s\"/>\n",
- MYVERSION);
- fprintf(file, " <PARAM name=\"Soft_URL\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.ref.url;meta.software\" value=\"%s\"/>\n",
- WEBSITE);
- fprintf(file, " <PARAM name=\"Soft_Auth\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.bib.author;meta.software\" value=\"%s\"/>\n",
- "Emmanuel Bertin");
- fprintf(file, " <PARAM name=\"Soft_Ref\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.bib.bibcode;meta.software\" value=\"%s\"/>\n",
- "1996A&AS..117..393B");
- fprintf(file, " <PARAM name=\"NThreads\" datatype=\"int\""
- " ucd=\"meta.number;meta.software\" value=\"%d\"/>\n",
- prefs.nthreads);
- fprintf(file, " <PARAM name=\"Date\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"time.event.end;meta.software\" value=\"%s\"/>\n",
- prefs.sdate_end);
- fprintf(file, " <PARAM name=\"Time\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"time.event.end;meta.software\" value=\"%s\"/>\n",
- prefs.stime_end);
- fprintf(file, " <PARAM name=\"Duration\" datatype=\"float\""
- " ucd=\"time.event;meta.software\" value=\"%.0f\" unit=\"s\"/>\n",
- prefs.time_diff);
-
- fprintf(file, " <PARAM name=\"User\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.curation\" value=\"%s\"/>\n",
- psuser);
- fprintf(file, " <PARAM name=\"Host\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.curation\" value=\"%s\"/>\n",
- pshost);
- fprintf(file, " <PARAM name=\"Path\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset\" value=\"%s\"/>\n",
- pspath);
-
- fprintf(file,
- " <PARAM name=\"Image_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"obs.image;meta.fits\" value=\"%s", prefs.image_name[0]);
- if (prefs.nimage_name>1)
- fprintf(file, ",%s", prefs.image_name[1]);
- fprintf(file, "\"/>\n");
-
- if (error)
- {
- fprintf(file, "\n <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- "!!!!!!!!!!!!!!!!!!!! -->\n");
- fprintf(file, " <!-- !!!!!!!!!!!!!!!!!!!!!! an Error occured"
- " !!!!!!!!!!!!!!!!!!!!! -->\n");
- fprintf(file, " <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- "!!!!!!!!!!!!!!!!!!!! -->\n");
- fprintf(file," <PARAM name=\"Error_Msg\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta\" value=\"%s\"/>\n", error);
- fprintf(file, " <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- "!!!!!!!!!!!!!!!!!!!! -->\n");
- fprintf(file, " <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
- "!!!!!!!!!!!!!!!!!!!! -->\n\n");
- }
-
-/* Meta-data for each extension */
- fprintf(file, " <TABLE ID=\"Extension_Data\" name=\"Extension_Data\">\n");
- fprintf(file, " <DESCRIPTION>Data gathered by %s for every FITS"
- " extension</DESCRIPTION>\n", BANNER);
- fprintf(file, " <!-- NExtensions may be 0"
- " if an error occurred early in the processing -->\n");
- fprintf(file, " <PARAM name=\"NExtensions\" datatype=\"int\""
- " ucd=\"meta.number;meta.dataset\" value=\"%d\"/>\n",
- nxmlmax);
- fprintf(file, " <!-- CurrExtension may differ fromq n_extensions"
- " if an error occurred -->\n");
- fprintf(file, " <PARAM name=\"CurrExtension\" datatype=\"int\""
- " ucd=\"meta.number;meta.dataset\" value=\"%d\"/>\n",
- nxml);
- fprintf(file, " <FIELD name=\"Extension\" datatype=\"int\""
- " ucd=\"meta.record\"/>\n");
- fprintf(file, " <FIELD name=\"Date\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.record;time.event.end\"/>\n");
- fprintf(file, " <FIELD name=\"Time\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.record;time.event.end\"/>\n");
- fprintf(file, " <FIELD name=\"Duration\" datatype=\"float\""
- " ucd=\"meta.record;time.event.end\"/>\n");
- fprintf(file, " <FIELD name=\"NDetect\" datatype=\"int\""
- " ucd=\"meta.number;src.sample\"/>\n");
- fprintf(file, " <FIELD name=\"NSextracted\" datatype=\"int\""
- " ucd=\"meta.number;src.sample\"/>\n");
- fprintf(file, " <FIELD name=\"Image_Ident\" datatype=\"char\""
- " arraysize=\"*\" ucd=\"meta.id;obs\"/>\n");
- fprintf(file, " <FIELD name=\"Background_Mean\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.skyLevel;obs.image;stat.median\""
- " unit=\"ct\"/>\n", prefs.nimage_name);
- fprintf(file, " <FIELD name=\"Background_StDev\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"stat.stdev;obs.image;stat.median\""
- " unit=\"ct\"/>\n", prefs.nimage_name);
- fprintf(file, " <FIELD name=\"Threshold\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.sensitivity;obs.image;stat.median\""
- " unit=\"ct\"/>\n", prefs.nimage_name);
- fprintf(file, " <FIELD name=\"Weight_Scaling\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"arith.factor;obs.image;stat.median\"/>\n",
- prefs.nimage_name);
- fprintf(file, " <FIELD name=\"Pixel_Scale\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.scale;obs.image;stat.mean\""
- " unit=\"arcsec\"/>\n", prefs.nimage_name);
- fprintf(file, " <FIELD name=\"Epoch\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"time.epoch;obs\" unit=\"yr\"/>\n",
- prefs.nimage_name);
- fprintf(file, " <DATA><TABLEDATA>\n");
- for (n=0; n<nxml; n++)
- if (prefs.nimage_name>1)
- fprintf(file, " <TR>\n"
- " <TD>%d</TD><TD>%s</TD><TD>%s</TD><TD>%.0f</TD>"
- "<TD>%d</TD><TD>%d</TD>\n"
- " <TD>%s,%s</TD>\n"
- " <TD>%g %g</TD><TD>%g %g</TD><TD>%g %g</TD>"
- "<TD>%g %g</TD><TD>%g %g</TD>\n"
- " </TR>\n",
- xmlstack[n].currext,
- xmlstack[n].ext_date,
- xmlstack[n].ext_time,
- xmlstack[n].ext_elapsed,
- xmlstack[n].ndetect,
- xmlstack[n].ntotal,
- xmlstack[n].ident[0], xmlstack[n].ident[1],
- xmlstack[n].backmean[0], xmlstack[n].backmean[1],
- xmlstack[n].backsig[0], xmlstack[n].backsig[1],
- xmlstack[n].sigfac[0], xmlstack[n].sigfac[1],
- xmlstack[n].thresh[0], xmlstack[n].thresh[1],
- xmlstack[n].pixscale[0], xmlstack[n].pixscale[1]);
- else
- fprintf(file, " <TR>\n"
- " <TD>%d</TD><TD>%s</TD><TD>%s</TD><TD>%.0f</TD>"
- "<TD>%d</TD><TD>%d</TD>\n"
- " <TD>%s</TD>\n"
- " <TD>%g</TD><TD>%g</TD><TD>%g</TD><TD>%g</TD><TD>%g</TD>\n"
- " </TR>\n",
- xmlstack[n].currext,
- xmlstack[n].ext_date,
- xmlstack[n].ext_time,
- xmlstack[n].ext_elapsed,
- xmlstack[n].ndetect,
- xmlstack[n].ntotal,
- xmlstack[n].ident[0],
- xmlstack[n].backmean[0],
- xmlstack[n].backsig[0],
- xmlstack[n].sigfac[0],
- xmlstack[n].thresh[0],
- xmlstack[n].pixscale[0]);
- fprintf(file, " </TABLEDATA></DATA>\n");
- fprintf(file, " </TABLE>\n");
-
-/* Warnings */
- fprintf(file, " <TABLE ID=\"Warnings\" name=\"Warnings\">\n");
- fprintf(file,
- " <DESCRIPTION>%s warnings (limited to the last %d)</DESCRIPTION>\n",
- BANNER, WARNING_NMAX);
- fprintf(file, " <FIELD name=\"Date\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta;time.event.end\"/>\n");
- fprintf(file, " <FIELD name=\"Time\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta;time.event.end\"/>\n");
- fprintf(file, " <FIELD name=\"Msg\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta\"/>\n");
- fprintf(file, " <DATA><TABLEDATA>\n");
- for (str = warning_history(); *str; str = warning_history())
- fprintf(file, " <TR><TD>%10.10s</TD><TD>%8.8s</TD><TD>%s</TD></TR>\n",
- str, str+11, str+22);
- fprintf(file, " </TABLEDATA></DATA>\n");
- fprintf(file, " </TABLE>\n");
-
-/* Configuration file */
- fprintf(file, " <RESOURCE ID=\"Config\" name=\"Config\">\n");
- fprintf(file, " <DESCRIPTION>%s configuration</DESCRIPTION>\n", BANNER);
- fprintf(file,
- " <PARAM name=\"Command_Line\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"obs.param\" value=\"%s",
- prefs.command_line[0]);
- for (n=1; n<prefs.ncommand_line; n++)
- fprintf(file, " %s", prefs.command_line[n]);
- fprintf(file, "\"/>\n");
- fprintf(file,
- " <PARAM name=\"Prefs_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"obs.param;meta.file\" value=\"%s\"/>\n",
- prefs.prefs_name);
-
- if (!error)
- {
- fprintf(file,
- " <PARAM name=\"Catalog_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta\" value=\"%s\"/>\n",
- key[findkeys("CATALOG_TYPE",keylist,
- FIND_STRICT)].keylist[prefs.cat_type]);
- fprintf(file,
- " <PARAM name=\"Catalog_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset;meta.file\" value=\"%s\"/>\n",
- prefs.cat_name);
- fprintf(file,
- " <PARAM name=\"Parameters_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"obs.param;meta.file\" value=\"%s\"/>\n",
- prefs.param_name);
- fprintf(file,
- " <PARAM name=\"Detect_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;instr.det;obs.param\" value=\"%s\"/>\n",
- key[findkeys("DETECT_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.detect_type]);
- fprintf(file, " <PARAM name=\"Detect_MinArea\" datatype=\"int\""
- " ucd=\"phys.area;obs.param\" value=\"%d\" unit=\"pix2\"/>\n",
- prefs.ext_minarea);
-
- fprintf(file,
- " <PARAM name=\"Thresh_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;instr.sensitivity;obs.param\" value=\"%s",
- key[findkeys("THRESH_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.thresh_type[0]]);
- if (prefs.nthresh_type>1)
- fprintf(file, ",%s", key[findkeys("THRESH_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.thresh_type[1]]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Detect_Thresh\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.sensitivity;obs.param\" value=\"%g",
- prefs.ndthresh, prefs.dthresh[0]);
- if (prefs.ndthresh>1)
- fprintf(file, " %g", prefs.dthresh[1]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Analysis_Thresh\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.sensitivity;obs.param\" value=\"%g",
- prefs.nthresh, prefs.thresh[0]);
- if (prefs.nthresh>1)
- fprintf(file, " %g", prefs.thresh[1]);
- fprintf(file, "\"/>\n");
-
- fprintf(file,
- " <PARAM name=\"Filter\" datatype=\"boolean\""
- " ucd=\"meta.code;obs.param\" value=\"%c\"/>\n",
- prefs.filter_flag? 'T':'F');
- fprintf(file,
- " <PARAM name=\"Filter_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset;meta.file;obs.param\" value=\"%s\"/>\n",
- prefs.filter_name);
-
- if (prefs.nfilter_thresh)
- {
- fprintf(file, " <PARAM name=\"Filter_Thresh\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.sensitivity;obs.param\" value=\"%g",
- prefs.nfilter_thresh, prefs.filter_thresh[0]);
- if (prefs.nfilter_thresh>1)
- fprintf(file, " %g", prefs.filter_thresh[1]);
- fprintf(file, "\"/>\n");
- }
-
- fprintf(file, " <PARAM name=\"Deblend_NThresh\" datatype=\"int\""
- " ucd=\"meta.number;obs.param\" value=\"%d\"/>\n",
- prefs.deblend_nthresh);
- fprintf(file, " <PARAM name=\"Deblend_MinCont\" datatype=\"float\""
- " ucd=\"obs.param;arith.ratio\" value=\"%g\"/>\n",
- prefs.deblend_mincont);
- fprintf(file,
- " <PARAM name=\"Clean\" datatype=\"boolean\""
- " ucd=\"meta.code;obs.param\" value=\"%c\"/>\n",
- prefs.clean_flag? 'T':'F');
- fprintf(file, " <PARAM name=\"Clean_Param\" datatype=\"float\""
- " ucd=\"meta\" value=\"%g\"/>\n",
- prefs.clean_param);
- fprintf(file,
- " <PARAM name=\"Mask_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;obs.param;\" value=\"%s\"/>\n",
- key[findkeys("MASK_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.mask_type]);
-
- fprintf(file,
- " <PARAM name=\"Weight_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;obs.param\" value=\"%s",
- key[findkeys("WEIGHT_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.weight_type[0]]);
- if (prefs.nweight_type>1)
- fprintf(file, ",%s", key[findkeys("WEIGHT_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.weight_type[1]]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Weight_Thresh\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"instr.sensitivity;obs.param\" value=\"%g",
- prefs.nweight_thresh, prefs.weight_thresh[0]);
- if (prefs.nweight_thresh>1)
- fprintf(file, " %g", prefs.weight_thresh[1]);
- fprintf(file, "\"/>\n");
-
- if ((prefs.weight_type[0] != WEIGHT_NONE
- && prefs.weight_type[0] != WEIGHT_FROMBACK)
- || (prefs.weight_type[1] != WEIGHT_NONE
- && prefs.weight_type[1] != WEIGHT_FROMBACK))
- {
- fprintf(file,
- " <PARAM name=\"Weight_Image\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"obs.image;meta.fits;obs.param\" value=\"%s",
- (prefs.weight_type[0] != WEIGHT_NONE
- && prefs.weight_type[0] != WEIGHT_FROMBACK) ?
- prefs.wimage_name[0] : NULL);
- if (prefs.weight_type[1] != WEIGHT_NONE
- && prefs.weight_type[1] != WEIGHT_FROMBACK)
- fprintf(file, ",%s", prefs.wimage_name[1]);
- fprintf(file, "\"/>\n");
- }
-
- fprintf(file,
- " <PARAM name=\"Weight_Gain\" datatype=\"boolean\""
- " ucd=\"meta.code;obs.param\" value=\"%c\"/>\n",
- prefs.weightgain_flag? 'T':'F');
-
- if (prefs.nimaflag)
- {
- fprintf(file,
- " <PARAM name=\"Flag_Image\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"obs.image;meta.fits\" value=\"%s",
- prefs.fimage_name[0]);
- for (n=1; n<prefs.nimaflag; n++)
- fprintf(file, ",%s", prefs.fimage_name[n]);
- fprintf(file, "\"/>\n");
- fprintf(file,
- " <PARAM name=\"Flag_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code\" value=\"%s",
- key[findkeys("FLAG_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.flag_type[0]]);
- for (n=1; n<prefs.nimaflag; n++)
- fprintf(file, ",%s", key[findkeys("FLAG_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.flag_type[n]]);
- fprintf(file, "\"/>\n");
- }
-
- fprintf(file, " <PARAM name=\"Phot_Apertures\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"obs.param\" value=\"%g",
- prefs.naper, prefs.apert[0]);
- for (n=1; n<prefs.naper; n++)
- fprintf(file, " %g", prefs.apert[n]);
- fprintf(file, "\" unit=\"pix\"/>\n");
-
- fprintf(file, " <PARAM name=\"Phot_AutoParams\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"obs.param;phot\" value=\"%g",
- prefs.nautoparam, prefs.autoparam[0]);
- for (n=1; n<prefs.nautoparam; n++)
- fprintf(file, " %g", prefs.autoparam[n]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Phot_PetroParams\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"obs.param;phot\" value=\"%g",
- prefs.npetroparam, prefs.petroparam[0]);
- for (n=1; n<prefs.npetroparam; n++)
- fprintf(file, " %g", prefs.petroparam[n]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Phot_AutoApers\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"obs.param;phot\" value=\"%g",
- prefs.nautoaper, prefs.autoaper[0]);
- for (n=1; n<prefs.nautoaper; n++)
- fprintf(file, " %g", prefs.autoaper[n]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Phot_FluxFrac\" datatype=\"float\""
- " arraysize=\"%d\" ucd=\"arith.factor;obs.param;phot\" value=\"%g",
- prefs.nflux_frac, prefs.flux_frac[0]);
- for (n=1; n<prefs.nflux_frac; n++)
- fprintf(file, " %g", prefs.flux_frac[n]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Satur_Level\" datatype=\"float\""
- " ucd=\"instr.saturation;phot.count;obs.param\" value=\"%g\""
- " unit=\"ct\"/>\n", prefs.satur_level);
- fprintf(file, " <PARAM name=\"Mag_ZeroPoint\" datatype=\"float\""
- " ucd=\"phot.calib;phot.mag;obs.param\" value=\"%g\" unit=\"mag\"/>\n",
- prefs.mag_zeropoint);
- fprintf(file, " <PARAM name=\"Mag_Gamma\" datatype=\"float\""
- " ucd=\"phot.calib;obs.param\" value=\"%g\"/>\n",
- prefs.mag_gamma);
- fprintf(file, " <PARAM name=\"Gain\" datatype=\"float\""
- " ucd=\"instr.param;obs.param\" value=\"%g\"/>\n",
- prefs.gain);
- fprintf(file, " <PARAM name=\"Pixel_Scale\" datatype=\"float\""
- " ucd=\"instr.scale;obs.param\" value=\"%g\" unit=\"arcsec\"/>\n",
- prefs.pixel_scale);
- fprintf(file, " <PARAM name=\"Seeing_FWHM\" datatype=\"float\""
- " ucd=\"instr.det.psf;stat.mean;obs.param\" value=\"%g\""
- " unit=\"pix\"/>\n", prefs.seeing_fwhm);
- fprintf(file,
- " <PARAM name=\"StarNNW_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset;meta.file;obs.param\" value=\"%s\"/>\n",
- prefs.nnw_name);
-
- fprintf(file, " <PARAM name=\"Back_Size\" datatype=\"int\""
- " arraysize=\"%d\" ucd=\"obs.param\" value=\"%d",
- prefs.nbacksize, prefs.backsize[0]);
- for (n=1; n<prefs.nbacksize; n++)
- fprintf(file, " %d", prefs.backsize[n]);
- fprintf(file, "\" unit=\"pix\"/>\n");
-
- fprintf(file, " <PARAM name=\"Back_FilterSize\" datatype=\"int\""
- " arraysize=\"%d\" ucd=\"obs.param\" value=\"%d",
- prefs.nbackfsize, prefs.backfsize[0]);
- for (n=1; n<prefs.nbackfsize; n++)
- fprintf(file, " %d", prefs.backfsize[n]);
- fprintf(file, "\"/>\n");
-
- fprintf(file,
- " <PARAM name=\"BackPhoto_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;obs.param;\" value=\"%s\"/>\n",
- key[findkeys("BACKPHOTO_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.pback_type]);
-
- fprintf(file, " <PARAM name=\"BackPhoto_Thick\" datatype=\"int\""
- " ucd=\"obs.param\" value=\"%d\" unit=\"pix\"/>\n",
- prefs.pback_size);
-
- fprintf(file, " <PARAM name=\"Back_FiltThresh\" datatype=\"float\""
- " ucd=\"phot.count;arith.ratio;obs.param\" value=\"%g\"/>\n",
- prefs.backfthresh);
-
- fprintf(file,
- " <PARAM name=\"CheckImage_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code\" value=\"%s",
- key[findkeys("CHECKIMAGE_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.check_type[0]]);
- for (n=1; n<prefs.ncheck_type; n++)
- fprintf(file,
- ",%s",
- key[findkeys("CHECKIMAGE_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.check_type[n]]);
- fprintf(file, "\"/>\n");
-
- fprintf(file,
- " <PARAM name=\"CheckImage_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.file\" value=\"%s",
- prefs.check_name[0]);
- for (n=1; n<prefs.ncheck_type; n++)
- if (prefs.check_type[n] != CHECK_NONE)
- fprintf(file, ",%s", prefs.check_name[n]);
- fprintf(file, "\"/>\n");
-
- fprintf(file, " <PARAM name=\"Memory_ObjStack\" datatype=\"int\""
- " ucd=\"meta.number;src;obs.param\" value=\"%d\"/>\n",
- prefs.clean_stacksize);
- fprintf(file, " <PARAM name=\"Memory_PixStack\" datatype=\"int\""
- " ucd=\"meta.number;obs.param\" value=\"%d\"/>\n",
- prefs.mem_pixstack);
- fprintf(file, " <PARAM name=\"Memory_BufSize\" datatype=\"int\""
- " ucd=\"meta.number;obs.param\" value=\"%d\"/>\n",
- prefs.mem_bufsize);
-
- fprintf(file,
- " <PARAM name=\"Assoc_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset;meta.file\" value=\"%s\"/>\n",
- prefs.assoc_name);
- if (prefs.nassoc_data)
- {
- fprintf(file, " <PARAM name=\"Assoc_Data\" datatype=\"int\""
- " arraysize=\"%d\" ucd=\"meta.code;obs.param\" value=\"%d",
- prefs.nassoc_data, prefs.assoc_data[0]);
- for (n=1; n<prefs.nassoc_data; n++)
- fprintf(file, " %d", prefs.assoc_data[n]);
- fprintf(file, "\"/>\n");
- }
- if (prefs.nassoc_param)
- {
- fprintf(file, " <PARAM name=\"Assoc_Params\" datatype=\"int\""
- " arraysize=\"%d\" ucd=\"meta.code;obs.param\" value=\"%d",
- prefs.nassoc_param, prefs.assoc_param[0]);
- for (n=1; n<prefs.nassoc_param; n++)
- fprintf(file, " %d", prefs.assoc_param[n]);
- fprintf(file, "\"/>\n");
- }
- fprintf(file, " <PARAM name=\"Assoc_Radius\" datatype=\"float\""
- " ucd=\"phys.size.radius;obs.param\" value=\"%g\" unit=\"pix\"/>\n",
- prefs.assoc_radius);
- fprintf(file,
- " <PARAM name=\"Assoc_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;obs.param\" value=\"%s\"/>\n",
- key[findkeys("ASSOC_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.assoc_type]);
- fprintf(file,
- " <PARAM name=\"AssocSelec_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;obs.param\" value=\"%s\"/>\n",
- key[findkeys("ASSOCSELEC_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.assocselec_type]);
-
- fprintf(file,
- " <PARAM name=\"Verbose_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code\" value=\"%s\"/>\n",
- key[findkeys("VERBOSE_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.verbose_type]);
-
- fprintf(file,
- " <PARAM name=\"FITS_Unsigned\" datatype=\"boolean\""
- " ucd=\"meta.code;obs.param\" value=\"%c\"/>\n",
- prefs.fitsunsigned_flag? 'T':'F');
-
- fprintf(file,
- " <PARAM name=\"PSF_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset;meta.file;obs.param\" value=\"%s\"/>\n",
- prefs.psf_name[0]);
- fprintf(file, " <PARAM name=\"PSF_NMax\" datatype=\"int\""
- " ucd=\"meta.number;obs.param\" value=\"%d\"/>\n",
- prefs.psf_npsfmax);
- fprintf(file,
- " <PARAM name=\"PSFDisplay_Type\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.code;obs.param\" value=\"%s\"/>\n",
- key[findkeys("PSFDISPLAY_TYPE", keylist,
- FIND_STRICT)].keylist[prefs.psfdisplay_type]);
-
- fprintf(file,
- " <PARAM name=\"SOM_Name\" datatype=\"char\" arraysize=\"*\""
- " ucd=\"meta.dataset;meta.file;obs.param\" value=\"%s\"/>\n",
- prefs.som_name);
- }
-
- fprintf(file, " </RESOURCE>\n");
- fprintf(file, " </RESOURCE>\n");
-
- return RETURN_OK;
- }
-
-
-
-
-/****** write_xmlerror ******************************************************
-PROTO int write_xmlerror(char *error)
-PURPOSE Save meta-data to a simplified XML file in case of a catched error
-INPUT a character string.
-OUTPUT RETURN_OK if everything went fine, RETURN_ERROR otherwise.
-NOTES -.
-AUTHOR E. Bertin (IAP)
-VERSION 14/07/2006
- ***/
-void write_xmlerror(char *filename, char *error)
- {
- FILE *file;
-
- if (!(file = fopen(filename, "w")))
- return;
-
- write_xml_header(file);
-
- fprintf(file, " </TABLE>\n");
-
- write_xml_meta(file, error);
-
- fprintf(file, "</RESOURCE>\n");
- fprintf(file, "</VOTABLE>\n");
-
- fclose(file);
-
- return;
- }
-
-
diff --git a/sextractor/src/xml.h b/sextractor/src/xml.h
deleted file mode 100644
index b3514ce..0000000
--- a/sextractor/src/xml.h
+++ /dev/null
@@ -1,65 +0,0 @@
- /*
- xml.h
-
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*
-* Part of: SExtractor
-*
-* Author: E.BERTIN (IAP)
-*
-* Contents: XML logging.
-*
-* Last modify: 14/07/2005
-*
-*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-*/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifndef _FITSCAT_H_
-#include "fits/fitscat.h"
-#endif
-
-/*----------------------------- Internal constants --------------------------*/
-/*
-#define XSL_URL "file:///home/bertin/sources/sex/xsl/sex.xsl"
-*/
-#ifndef XSL_URL
-#define XSL_URL "."
-#endif
-/* Alternate XSLT file at TERAPIX: */
-/* will not work with recent browsers because of security limitations */
-/*
-#define XSL_URL_ALT "http://terapix.iap.fr/cplt/xsl/sex.xsl"
-*/
-/*--------------------------------- typedefs --------------------------------*/
-typedef struct
- {
- int currext;
- int ndetect;
- int ntotal;
- char ext_date[16],ext_time[16]; /* date and time */
- double ext_elapsed; /* processing time */
- char ident[2][MAXCHAR]; /* identifiants */
- float backmean[2]; /* mean background */
- float backsig[2]; /* mean back stddev */
- float sigfac[2]; /* mean weight scaling*/
- float thresh[2]; /* thresholds (ADU) */
- double pixscale[2]; /* pixel scale (deg2) */
- double epoch[2]; /* epoch of coords */
- } xmlstruct;
-
-/*------------------------------- functions ---------------------------------*/
-
-extern int end_xml(void),
- init_xml(int next),
- update_xml(sexcatstruct *sexcat, picstruct *dfield,
- picstruct *field, picstruct *dwfield,
- picstruct *wfield),
- write_xml(char *filename),
- write_xml_header(FILE *file),
- write_xml_meta(FILE *file, char *error);
-
-extern void write_xmlerror(char *filename, char *error);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cpl-plugin-fors.git
More information about the debian-science-commits
mailing list