diff -Nru fitsh-0.9.3/CHANGELOG fitsh-0.9.4/CHANGELOG --- fitsh-0.9.3/CHANGELOG 2019-02-06 07:47:38.000000000 +0000 +++ fitsh-0.9.4/CHANGELOG 2021-01-24 14:31:27.000000000 +0000 @@ -1,6 +1,26 @@ +0.9.4: new features, changes and fixes since FITSH version 0.9.3 +================================================================ + * new: `fitrans` support truncated mean based averaging during shrink + operations (besides simple mean and median) + * new: support for tangential Brown-Conrady optical distortion parameters + up to the 4th order in `grtrans`. + * new: `grtrans` supports a cutoff at a maximum (radial) distance + in the case of celestial projections. + * new: computation of astrometric centroids (i.e. flux-weighted coordinates) + for arbitary (polygonal) apertures. + * new: support of differential photometry for arbitary (polygonal) apertures. + * new: auxiliary task `tvmark` supports setting the region width parameter + from command line. + * new: dhjd() and dbjd() functions returing HJD-JD and BJD-JD differences + are natively supported by `lfit` built-in library. + * fix: missing options from --help and/or --long-help lists are added + * fix: minor bugfixes (possibly unitialized variables, etc.) + * fix: minor fixes in the derivation of the `fitrans` output file names. + * fix: stray source files (wcs.c, wcs.h) have been removed from the + source tree. + 0.9.3: new features, changes and fixes since FITSH version 0.9.2 ================================================================ - * fix: minor `fiphot --help` fixes * new: `grtrans` support fully SO(3) compliant projections, characterized by either RA/DEC/ROLL or quaternions. * fix: fixes in the tensor allocators regarding to the proper diff -Nru fitsh-0.9.3/config.h.in fitsh-0.9.4/config.h.in --- fitsh-0.9.3/config.h.in 2016-09-23 15:45:39.000000000 +0000 +++ fitsh-0.9.4/config.h.in 2021-01-24 14:28:56.000000000 +0000 @@ -4,7 +4,7 @@ #define FITSH_PACKAGE_NAME "fitsh" #define FITSH_VERSION "@FITSH_VERSION@" -#define FITSH_RELEASE_DATE "@FITSH_RELEASE@" +#define FITSH_RELEASE "@FITSH_RELEASE@" #define FITSH_MAINT_RNAME "Pal, Andras" #define FITSH_MAINT_EMAIL "apal@szofi.net" diff -Nru fitsh-0.9.3/configure fitsh-0.9.4/configure --- fitsh-0.9.3/configure 2019-02-06 07:48:51.000000000 +0000 +++ fitsh-0.9.4/configure 2021-01-24 14:29:04.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for fitsh 0.9.3. +# Generated by GNU Autoconf 2.69 for fitsh 0.9.4. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='fitsh' PACKAGE_TARNAME='fitsh' -PACKAGE_VERSION='0.9.3' -PACKAGE_STRING='fitsh 0.9.3' +PACKAGE_VERSION='0.9.4' +PACKAGE_STRING='fitsh 0.9.4' PACKAGE_BUGREPORT='apal@szofi.net' PACKAGE_URL='' @@ -636,6 +636,7 @@ DPKG_DEB DEB_ARCH DEB_VERSION +DL_TARGETS DLLIB DLDYN DLSWC @@ -1265,7 +1266,7 @@ # 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 fitsh 0.9.3 to adapt to many kinds of systems. +\`configure' configures fitsh 0.9.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1327,7 +1328,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of fitsh 0.9.3:";; + short | recursive ) echo "Configuration of fitsh 0.9.4:";; esac cat <<\_ACEOF @@ -1414,7 +1415,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -fitsh configure 0.9.3 +fitsh configure 0.9.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1716,7 +1717,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by fitsh $as_me 0.9.3, which was +It was created by fitsh $as_me 0.9.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2065,7 +2066,7 @@ -RELEASE_DATE=2019.02.06 +RELEASE_DATE=2021.01.24 ############################################################################### @@ -2162,6 +2163,8 @@ ############################################################################### +dynamic_extensions=yes + # our default $(CFLAGS) are: if test -n "$CFLAGS" ; then cflags_default=no @@ -2169,10 +2172,12 @@ HOST=win32 CFLAGS="-Wall -pedantic -O3 -Wno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHOST_WIN32" cflags_default=yes + dynamic_extensions=no elif test "${ac_cv_env_host_alias_value}" == "win64" ; then HOST=win64 CFLAGS="-Wall -pedantic -O3 -Wno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHOST_WIN32 -DHOST_WIN64" cflags_default=yes + dynamic_extensions=no elif test "${CC}" == "tcc"; then CFLAGS="-Wall -pedantic -O3 -Wno-strict-aliasing -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE" cflags_default=yes @@ -2184,7 +2189,6 @@ # some additional: CFLAGS="${CFLAGS} -D_FITSH_SOURCE" -dynamic_extensions=yes # Check whether --enable-dynamic-extensions was given. if test "${enable_dynamic_extensions+set}" = set; then : @@ -5124,6 +5128,7 @@ DLSWC="-dylib -arch $ARCH -macosx_version_min $OSX_VERSION" DLDYN=-dynamic DLLIB=-ldl + DL_TARGETS=linear.dylib { $as_echo "$as_me:${as_lineno-$LINENO}: result: dylib" >&5 $as_echo "dylib" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: OSX linker flags: $DLSWC" >&5 @@ -5192,6 +5197,15 @@ DLLIB=${DLLIB} +if test -n "$DLEXT"; then + DL_TARGETS=linear.$DLEXT +else + DL_TARGETS= +fi + +DL_TARGETS=${DL_TARGETS} + + # Substitution for documentation and distribution management: DEB_VERSION=${DEB_VERSION} @@ -5789,7 +5803,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by fitsh $as_me 0.9.3, which was +This file was extended by fitsh $as_me 0.9.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5842,7 +5856,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -fitsh config.status 0.9.3 +fitsh config.status 0.9.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru fitsh-0.9.3/configure.ac fitsh-0.9.4/configure.ac --- fitsh-0.9.3/configure.ac 2019-02-06 07:48:28.000000000 +0000 +++ fitsh-0.9.4/configure.ac 2021-01-24 12:40:25.000000000 +0000 @@ -1,7 +1,7 @@ # Initialize autoconf: -AC_INIT(fitsh, 0.9.3, apal@szofi.net) +AC_INIT(fitsh, 0.9.4, apal@szofi.net) -RELEASE_DATE=2019.02.06 +RELEASE_DATE=2021.01.24 ############################################################################### @@ -227,6 +227,8 @@ ############################################################################### +dynamic_extensions=yes + # our default $(CFLAGS) are: if test -n "$CFLAGS" ; then cflags_default=no @@ -234,10 +236,12 @@ HOST=win32 CFLAGS="-Wall -pedantic -O3 -Wno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHOST_WIN32" cflags_default=yes + dynamic_extensions=no elif test "${ac_cv_env_host_alias_value}" == "win64" ; then HOST=win64 CFLAGS="-Wall -pedantic -O3 -Wno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHOST_WIN32 -DHOST_WIN64" cflags_default=yes + dynamic_extensions=no elif test "${CC}" == "tcc"; then CFLAGS="-Wall -pedantic -O3 -Wno-strict-aliasing -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE" cflags_default=yes @@ -249,7 +253,6 @@ # some additional: CFLAGS="${CFLAGS} -D_FITSH_SOURCE" -dynamic_extensions=yes AC_ARG_ENABLE(dynamic-extensions, [ --enable-dynamic-extensions `lfit` may use dynamic extensions at run-time (default: yes)], @@ -453,6 +456,7 @@ DLSWC="-dylib -arch $ARCH -macosx_version_min $OSX_VERSION" DLDYN=-dynamic DLLIB=-ldl + DL_TARGETS=linear.dylib AC_MSG_RESULT([dylib]) AC_MSG_NOTICE([OSX linker flags: $DLSWC]) elif test "$HOST" == win32; then @@ -503,6 +507,14 @@ AC_SUBST(DLSWC, ${DLSWC}) AC_SUBST(DLDYN, ${DLDYN}) AC_SUBST(DLLIB, ${DLLIB}) + +if test -n "$DLEXT"; then + DL_TARGETS=linear.$DLEXT +else + DL_TARGETS= +fi + +AC_SUBST(DL_TARGETS, ${DL_TARGETS}) # Substitution for documentation and distribution management: AC_SUBST(DEB_VERSION, ${DEB_VERSION}) diff -Nru fitsh-0.9.3/configure.mingw32 fitsh-0.9.4/configure.mingw32 --- fitsh-0.9.3/configure.mingw32 2016-09-13 18:16:15.000000000 +0000 +++ fitsh-0.9.4/configure.mingw32 2021-01-24 12:31:07.000000000 +0000 @@ -1,6 +1,7 @@ #!/bin/sh -MINGW_BIN_PREFIX=i586-mingw32msvc +#MINGW_BIN_PREFIX=i586-mingw32msvc +MINGW_BIN_PREFIX=i686-w64-mingw32 HOST=win32 CC=${MINGW_BIN_PREFIX}-gcc \ diff -Nru fitsh-0.9.3/debian/changelog fitsh-0.9.4/debian/changelog --- fitsh-0.9.3/debian/changelog 2021-01-22 18:11:51.000000000 +0000 +++ fitsh-0.9.4/debian/changelog 2021-02-05 07:12:03.000000000 +0000 @@ -1,3 +1,9 @@ +fitsh (0.9.4-1) unstable; urgency=medium + + * New upstream + + -- Nilesh Patra Fri, 05 Feb 2021 12:42:03 +0530 + fitsh (0.9.3-2) unstable; urgency=medium * Fix cross-buildability problem diff -Nru fitsh-0.9.3/debian/patches/cross.patch fitsh-0.9.4/debian/patches/cross.patch --- fitsh-0.9.3/debian/patches/cross.patch 2021-01-22 18:11:10.000000000 +0000 +++ fitsh-0.9.4/debian/patches/cross.patch 2021-02-05 06:35:44.000000000 +0000 @@ -4,7 +4,7 @@ Last-Update: 2021-01-22 --- a/configure.ac +++ b/configure.ac -@@ -267,8 +267,11 @@ +@@ -270,8 +270,11 @@ AC_CHECK_PROG(ac_prog_ar,$AR,$AR,false) # check linker: diff -Nru fitsh-0.9.3/debian/patches/series fitsh-0.9.4/debian/patches/series --- fitsh-0.9.3/debian/patches/series 2021-01-22 18:08:28.000000000 +0000 +++ fitsh-0.9.4/debian/patches/series 2021-02-05 07:11:35.000000000 +0000 @@ -1,3 +1,2 @@ hardening.patch -versioned-solib.patch cross.patch diff -Nru fitsh-0.9.3/debian/patches/versioned-solib.patch fitsh-0.9.4/debian/patches/versioned-solib.patch --- fitsh-0.9.3/debian/patches/versioned-solib.patch 2021-01-21 19:26:43.000000000 +0000 +++ fitsh-0.9.4/debian/patches/versioned-solib.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Description: Add version linear.so.0d instead of linear.so (Unversioned SOLIB), in accordance with -https://salsa.debian.org/science-team/ros-geometric-shapes/-/blob/master/debian/patches/0001-Add-Debian-specific-SOVERSION.patch to prevent future ABI changes. -Author: Nilesh Patra -Forwarded: not-needed -Last-Update: 2021-01-22 ---- a/src/Makefile.in -+++ b/src/Makefile.in -@@ -13,7 +13,7 @@ - - CFLARGEFILE= - --DLEXT=@DLEXT@ -+DLEXT=@DLEXT@.0d - DLSWC=@DLSWC@ - DLDYN=@DLDYN@ - DLLIB=@DLLIB@ ---- a/Makefile.in -+++ b/Makefile.in -@@ -38,7 +38,7 @@ - pdfdir = @pdfdir@ - psdir = @psdir@ - --DLEXT = @DLEXT@ -+DLEXT = @DLEXT@.0d - - HELP2MAN = @HELP2MAN@ - ROFF = @ROFF@ diff -Nru fitsh-0.9.3/include/astro/easpec.h fitsh-0.9.4/include/astro/easpec.h --- fitsh-0.9.3/include/astro/easpec.h 2008-07-22 12:07:38.000000000 +0000 +++ fitsh-0.9.4/include/astro/easpec.h 2020-04-08 09:16:47.000000000 +0000 @@ -28,6 +28,12 @@ The corrected time instance is returned. */ double get_heliocentric_julian_date(double jdate,double ra,double dec); +/* get_heiocentric_julian_date_diff(): + Calculates the heliocentric (not barycentric!) difference for the + time instance 'jdate' at the spherical equatorial point ('ra', 'dec'). + The difference HJD-JD is returned. */ +double get_heliocentric_julian_date_diff(double jdate,double ra,double dec); + /* get_heiocentric_julian_date_epoch(): Same as get_heiocentric_julian_date(), but the coordinates 'ra' and 'dec' are for the epoch (in Julian years) 'epoch'. */ @@ -39,6 +45,12 @@ returned. */ double get_barycentric_julian_date(double jdate,double ra,double dec); +/* get_barycentric_julian_date_diff(): + Calculates the barycentric correction for the time instance 'jdate' at the + spherical equatorial point ('ra', 'dec'). The difference BJD-JD is + returned. */ +double get_barycentric_julian_date_diff(double jdate,double ra,double dec); + /* get_annular_parallax_correction(): This function calculates the annular parallax correction (i.e. as it would observed from the Sun), for the celestial object located at @@ -49,4 +61,4 @@ double dis,double *rra,double *rdec); #endif - + diff -Nru fitsh-0.9.3/INSTALL fitsh-0.9.4/INSTALL --- fitsh-0.9.3/INSTALL 2016-09-25 23:44:46.000000000 +0000 +++ fitsh-0.9.4/INSTALL 2021-01-24 14:07:51.000000000 +0000 @@ -9,7 +9,7 @@ `./configure && make && make install` procedure. A more detailed description about the package and the installation -is available on the web page of project, found at http://fitsh.net/. +is available on the web page of project, found at https://fitsh.net/. The ./configure script accepts usual arguments such as --prefix if the `FITSH` is intended to be installed by using a normal user account. @@ -20,10 +20,10 @@ After `./configure && make`, use the target `make deb` to create the *.deb file. This feature requires the `help2man` utility as well as the `dpkg-deb` program to be installed on your system. If the *.deb -file (named something like "fitsh_0.9.3_amd64.deb") is created successfully, +file (named something like "fitsh_0.9.4_amd64.deb") is created successfully, use the `dpkg` command to install it: -`dpkg --install fitsh_0.9.3_amd64.deb` +`dpkg --install fitsh_0.9.4_amd64.deb` Then, you can use any of your favourite *.deb package manager (dpkg, apt, dselect, synaptic, ...) to manage this package. After installing `FITSH` as diff -Nru fitsh-0.9.3/libastro/easpec.c fitsh-0.9.4/libastro/easpec.c --- fitsh-0.9.3/libastro/easpec.c 2009-08-05 11:50:41.000000000 +0000 +++ fitsh-0.9.4/libastro/easpec.c 2020-04-08 09:15:28.000000000 +0000 @@ -72,11 +72,11 @@ *y=d*sina(lst); } -double get_heliocentric_julian_date(double jd,double ra,double dec) +double get_heliocentric_julian_date_diff(double jd,double ra,double dec) { double rx,ry,rz; double nx,ny,nz; - double eps,dis,hjd; + double eps,dis,hjd_diff; get_earth_coords(jd,&rx,&ry,&rz); eps=get_earth_axis_angle(jd); @@ -92,11 +92,21 @@ dis=nx*rx+ny*ry+nz*rz; - hjd=jd + dis * 0.0057755178; + hjd_diff=dis * 0.0057755178; + + return(hjd_diff); +} + +double get_heliocentric_julian_date(double jd,double ra,double dec) +{ + double hjd; + + hjd=jd + get_heliocentric_julian_date_diff(jd,ra,dec); return(hjd); } + double get_heliocentric_julian_date_epoch(double jd,double ra,double dec,double y0) { double rx,ry,rz; @@ -122,7 +132,7 @@ return(hjd); } -double get_barycentric_julian_date(double jd,double ra,double dec) +double get_barycentric_julian_date_diff(double jd,double ra,double dec) { double rx,ry,rz; double nx,ny,nz; @@ -131,7 +141,7 @@ satx,saty,satz, urax,uray,uraz, nepx,nepy,nepz; - double eps,dis,hjd; + double eps,dis,bjd_diff; get_planet_coords(jd,5,&jupx,&jupy,&jupz); get_planet_coords(jd,6,&satx,&saty,&satz); @@ -161,9 +171,19 @@ dis=nx*rx+ny*ry+nz*rz; - hjd=jd + dis * 0.0057755178; + bjd_diff=dis * 0.0057755178; + + return(bjd_diff); +} + +double get_barycentric_julian_date(double jd,double ra,double dec) +{ + double bjd; + + bjd=jd + get_barycentric_julian_date_diff(jd,ra,dec); + + return(bjd); - return(hjd); } int get_annular_parallax_correction(double jd,double ra,double dec,double dis,double *rra,double *rdec) @@ -189,4 +209,5 @@ } /*****************************************************************************/ - + + diff -Nru fitsh-0.9.3/libastro/output.c fitsh-0.9.4/libastro/output.c --- fitsh-0.9.3/libastro/output.c 2009-08-05 11:51:50.000000000 +0000 +++ fitsh-0.9.4/libastro/output.c 2021-01-23 12:56:12.000000000 +0000 @@ -18,7 +18,7 @@ char *strdeg(char *buff,double a,int dl,int prec,int type) { int i,l; - char wb[8]; + char wb[32]; double x; if ( (type&STRDEG_SIGN) && a>=0.0 ) *buff='+',buff++; @@ -46,5 +46,5 @@ } /*****************************************************************************/ - + diff -Nru fitsh-0.9.3/libastro/planets.c fitsh-0.9.4/libastro/planets.c --- fitsh-0.9.3/libastro/planets.c 2009-08-05 11:51:54.000000000 +0000 +++ fitsh-0.9.4/libastro/planets.c 2021-01-23 12:47:28.000000000 +0000 @@ -778,6 +778,10 @@ case 7: case 8: case 9: mm=el-om-oo; /* Default mean anomaly: M=L-\Omega-\omega=L-\varpi */ break; + + default: + mm=0.0; + break; }; e =solve_kepler_equ(mm*M_PI/180.0,ex); diff -Nru fitsh-0.9.3/libfits/fits-common.c fitsh-0.9.4/libfits/fits-common.c --- fitsh-0.9.3/libfits/fits-common.c 2018-07-25 15:22:53.000000000 +0000 +++ fitsh-0.9.4/libfits/fits-common.c 2020-01-04 22:21:42.000000000 +0000 @@ -70,6 +70,16 @@ size_t i,j; void *ret,**pret; +/* + if ( 1 ) + { int i; + fprintf(stderr,"fits_tensor_alloc_arr(): rank=%d",rank); + for ( i=0; ihdrs[i].comment[0] ) - { snprintf(buff,FITS_TAPE_CARDIMAGESIZE+1, + { n=snprintf(buff,FITS_TAPE_CARDIMAGESIZE, "HIERARCH %s = %s / %s",header->hdrs[i].name,val,header->hdrs[i].comment); } else - { snprintf(buff,FITS_TAPE_CARDIMAGESIZE+1, + { n=snprintf(buff,FITS_TAPE_CARDIMAGESIZE+1, "HIERARCH %s = %s",header->hdrs[i].name,val); } + if ( ncurr,&img->curr,sizeof(fitsscale)); /* this also sets ret->sx, ret->sy and ret->data properly */ + /* + fprintf(stderr,"%d [%dx%d]\n",img->dim,img->naxis[0],img->naxis[1]); + */ fits_image_alloc_gen(ret,img->dim,img->naxis); ntot=fits_image_total_pixels(img->dim,img->naxis); idata=fits_image_first_pixel(img->vdata,img->dim); rdata=fits_image_first_pixel(ret->vdata,ret->dim); + /* + fprintf(stderr,"rdata=%p\n",(void *)rdata); + fprintf(stderr,"ret->vdata=%p\n",(void *)ret->vdata); + */ if ( flag ) memcpy(rdata,idata,sizeof(double)*ntot); else memset(rdata,0,sizeof(double)*ntot); } @@ -792,4 +799,5 @@ NASA Goddard Space Flight Center http://fits.gsfc.nasa.gov/fits_documentation.html ******************************************************************************/ - + + diff -Nru fitsh-0.9.3/Makefile.in fitsh-0.9.4/Makefile.in --- fitsh-0.9.3/Makefile.in 2016-09-25 23:51:38.000000000 +0000 +++ fitsh-0.9.4/Makefile.in 2021-01-24 12:03:19.000000000 +0000 @@ -184,7 +184,7 @@ HELP2MAN_LIST=fiarith ficalib ficombine ficonv fiheader fiign fiinfo fiphot firandom fistar fitrans grcollect grmatch grtrans gropt lfit help2man: src - test -d ./doc/help2man || mkdir ./doc/help2man + mkdir -p ./doc/help2man cat ./doc/man.brief | while read b name; do $(HELP2MAN) -n "$$name" -N -h --long-help ./src/$$b > ./doc/help2man/$$b.1; $(GZIP) -f ./doc/help2man/$$b.1; done man: help2man Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fiarith.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fiarith.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/ficalib.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/ficalib.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/ficombine.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/ficombine.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/ficonv.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/ficonv.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fiheader.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fiheader.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fiign.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fiign.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fiinfo.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fiinfo.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fiphot.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fiphot.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/firandom.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/firandom.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fistar.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fistar.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/fitrans.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/fitrans.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/grcollect.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/grcollect.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/grmatch.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/grmatch.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/gropt.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/gropt.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/grtrans.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/grtrans.1.gz differ Binary files /tmp/tmpoj1VHO/p1s7_RZvJt/fitsh-0.9.3/man/lfit.1.gz and /tmp/tmpoj1VHO/XKUKhH9wma/fitsh-0.9.4/man/lfit.1.gz differ diff -Nru fitsh-0.9.3/misc/deb/fitsh.control fitsh-0.9.4/misc/deb/fitsh.control --- fitsh-0.9.3/misc/deb/fitsh.control 2016-09-25 18:58:40.000000000 +0000 +++ fitsh-0.9.4/misc/deb/fitsh.control 2021-01-24 14:08:33.000000000 +0000 @@ -21,7 +21,7 @@ require a little more knowledge of the used shell itself. If you find this program useful in your research, please cite 2012MNRAS.421.1825P as "2012, MNRAS, 421, 1825". See also the web page of the project, found at - http://fitsh.net/. That page gathers information about the program + https://fitsh.net/. That page gathers information about the program (including documentation and examples), this is the primary download source of the package itself, and additionally, serves a public forum for the program users in various topics. Bug reports, comments and ideas are welcomed! diff -Nru fitsh-0.9.3/README fitsh-0.9.4/README --- fitsh-0.9.3/README 2016-09-25 23:44:53.000000000 +0000 +++ fitsh-0.9.4/README 2021-01-24 13:42:03.000000000 +0000 @@ -1,4 +1,4 @@ -FITSH - a software package for astronomical image processing - version 0.9.3 +FITSH - a software package for astronomical image processing - version 0.9.4 **************************************************************************** This software package provides a set of independent binary programs @@ -17,16 +17,16 @@ processing utilities (sort, uniq, paste, ...). For a brief summary about the individual tasks, check the ``Tasks'' -section of the web page of the project, namely at http://fitsh.net/task +section of the web page of the project, namely at https://fitsh.net/task Supported systems and requirements ---------------------------------- Actually, the program has been developed under GNU/Linux (Debian, i386 and amd64), and it also tested and seems to work properly on Sun/SunOS, -PC/NetBSD and Mac/OSX systems as well. The Mac/OSX port has been tested -under the version 10.6.8 (Snow Leopard) with its default GCC -(gcc-4.2.1). +PC/NetBSD and Mac/OSX systems as well. Cross-compilation is also available +for Windows targets (32-bit and 64-bit systems) but with the lack +of support for dynamic extensions. However, please note that the primary development platform of the package is Debian GNU/Linux, thus compilation-time warnings might occur @@ -44,7 +44,7 @@ them into PostScript format if the utilities `help2man` and `groff` are installed properly on the host operating system. -The web page of the project (http://fitsh.net) also displays these +The web page of the project (https://fitsh.net/) also displays these manual pages as well as one can find further, completely working examples. @@ -66,7 +66,7 @@ Bug reports, comments and ideas are welcomed, send these to Andras Pal . See also the web page of the project, found at -http://fitsh.net/. That page gathers information about the program +https://fitsh.net/. That page gathers information about the program (including documentation and examples), this is the primary download source of the package itself, and additionally, serves a public forum for the program users in various topics. @@ -74,13 +74,6 @@ Acknowledgements ----------------- -The current development of the FITSH package is supported by the -Hungarian Academy of Sciences via the grant LP2012-31. Earlier versions -of the code have been developed for the Hungarian-made Automated -Telescope (HAT) project. Further development has supported by the ESA -PECS grant no. PECS 98073. - If you find the FITSH package useful in your research, please cite the paper -2012MNRAS.421.1825P (http://adsabs.harvard.edu/abs/2012MNRAS.421.1825P) +2012MNRAS.421.1825P (https://ui.adsabs.harvard.edu/abs/2012MNRAS.421.1825P) as "P\'al, A. 2012, MNRAS, 421, 1825". - diff -Nru fitsh-0.9.3/src/apphot.c fitsh-0.9.4/src/apphot.c --- fitsh-0.9.3/src/apphot.c 2018-07-12 19:18:49.000000000 +0000 +++ fitsh-0.9.4/src/apphot.c 2020-02-05 15:12:11.000000000 +0000 @@ -823,7 +823,13 @@ xpolypoints[2*k+1]=poly[2*k+1]+cy; } nxpolypoint=polygon_intersection_square(xpolypoints,nppoly,(double)j,(double)i,1.0,1.0); + for ( k=0 ; kheader; snprintf(buff,80,"ficalib: flat: mean=%.1f flat=\"%s\"",flatmean,cd->inputflat); fits_headerset_set_string(header,"FLATCOR",FITS_SH_ADD,buff,NULL); diff -Nru fitsh-0.9.3/src/fiign.c fitsh-0.9.4/src/fiign.c --- fitsh-0.9.3/src/fiign.c 2018-07-23 01:17:01.000000000 +0000 +++ fitsh-0.9.4/src/fiign.c 2021-01-24 12:00:44.000000000 +0000 @@ -235,10 +235,12 @@ fprintf(fw, "Mask conversion and expansion:\n" "\t[--convert ::: [--convert <>:<>:<>:<>] ...]\n" -"\t[-x|--expand ]\n"); +"\t[-x|--expand ]\n" +"\t[-q|--mask-block ::]\n"); + fprintf(fw, "Marking saturated pixels:\n" -"\t[-s |-S ]\n" +"\t[-s |-S ]\n" "\t[--leak-{left-right|lower-upper|any}|--lr|--lu|--an]\n"); fprintf(fw, "General ignorance:\n" @@ -306,6 +308,26 @@ "Expands the mask with the specified size. Applied after all of " "the previous steps were performed. " }, + { "Additional mask layers:", NULL }, + { "-q, --mask-block block::,:,", + "Add a rectangular masked area with the " + "specified mask and with the specified coordinates " + "(,: lower-left corner, ,: upper-right corner, inclusive). " + }, + { "-q, --mask-block circle::,:", + "Add a circular masked area with the " + "specified mask and with the specified cenroid coordinates , " + "and radius . " + }, + { "-q, --mask-block pixel::,", + "Add a masked pixel with the " + "specified mask to the specified coordinates ,." + }, + { "-q, --mask-block line::,:,", + "Add a masked line with the " + "specified mask connecting the points , and ,." + }, + { "Mask names:", NULL }, { "none", "no mask at all" }, diff -Nru fitsh-0.9.3/src/fiphot.c fitsh-0.9.4/src/fiphot.c --- fitsh-0.9.3/src/fiphot.c 2019-02-06 07:47:07.000000000 +0000 +++ fitsh-0.9.4/src/fiphot.c 2021-01-23 23:22:41.000000000 +0000 @@ -901,6 +901,8 @@ for ( j=0 ; jflag=0; @@ -910,9 +912,16 @@ wpf->rbad=0; wpf->rign=0; - ap.r0=aps[j].r0, - ap.ra=aps[j].ra, - ap.da=aps[j].da; + apgeom_type=aps[j].apgeom_type; + + ap.r0=aps[j].r0, + ap.ra=aps[j].ra, + ap.da=aps[j].da; + + ap.r0_poly=aps[j].r0_poly,ap.nr0=aps[j].nr0; + ap.ra_poly=aps[j].ra_poly,ap.nra=aps[j].nra; + ap.da_poly=aps[j].da_poly,ap.nda=aps[j].nda; + for ( k=0,jp=-1 ; kdata,mask,sx,sy,cx,cy,&ap,&bgarea,&bgflux,&bgmedian,&bgsigma,&atot,&abad,NULL); - + else if ( apgeom_type==APGEOM_TYPE_POLYGON ) + r=aperture_photometry_back_polygons(img->data,mask,sx,sy,cx,cy,&ap,&bgarea,&bgflux,&bgmedian,&bgsigma,&atot,&abad,NULL); + else + r=1; if ( r ) { wpf->flag=MASK_NOBACKGROUND; @@ -947,8 +959,16 @@ int rt,rb,ri; if ( xpp->use_biquad ) r=aperture_photometry_flux_biquad(bqc,mask,sx,sy,cx+bx,cy+by,ap.r0,&a,&f,&rt,&rb,&ri,xpp->maskignore,NULL); - else + else if ( apgeom_type==APGEOM_TYPE_CIRCULAR ) r=aperture_photometry_flux_circle(img->data,mask,sx,sy,cx+bx,cy+by,ap.r0,&a,&f,NULL,0.0,&rt,&rb,&ri,xpp->maskignore,NULL,0,NULL); + else if ( apgeom_type==APGEOM_TYPE_POLYGON ) + r=aperture_photometry_flux_polygon(img->data,mask,sx,sy,cx+bx,cy+by,ap.r0_poly,ap.nr0,&a,&f,NULL,0.0,&rt,&rb,&ri,xpp->maskignore,NULL); + else + { r=-1; + a=f=0.0; + rt=rb=ri=0; + } + if ( rt>rtot ) rtot=rt; if ( rb>rbad ) rbad=rb; if ( ri>rign ) rign=ri; @@ -1297,7 +1317,6 @@ fprintf(fw, "Usage:\tfiphot [-h|--help|--long-help|--wiki-help] [--version[-short]]\n" "\t[[-i|--input] |-] [-o|--output |-]\n" -"\t[--output-raw-photometry ]\n" "\t[-V|--verbose] [-C|--comment]\n" "\t-L|--input-list |- [--output-list |-]\n" "\t{[]|-r [] -s [...] [--frame ]}\n"); @@ -1312,10 +1331,6 @@ "\t[--correlation-length ]\n" "\t[-u [--normalize]]\n"); fprintf(fw, -"Photometry on differential images:\n" -"\t[-R|--input-raw-photometry ]\n" -"\t[-K|--input-kernel --normalize-kernel]\n"); - fprintf(fw, "Input and output format parameters:\n" "\t[--col-xy <>,<>] [--col-ap <>[:<>[:<>]]...] [--col-id <>]\n" "\t[--col-mag <> [--col-magerr <>] [--col-color <>]]\n" @@ -1574,7 +1589,7 @@ "deviation (sigma) units." }, { "Photometry on subtracted/convolved images:", NULL }, - { "-R, --input-raw-photometry ", + { "-P, --input-raw-photometry ", "Name of the file containing the coordinate lists and the raw " "photometric information for the reference image." }, { "-K, --input-kernel ", diff -Nru fitsh-0.9.3/src/fiphot-io.c fitsh-0.9.4/src/fiphot-io.c --- fitsh-0.9.3/src/fiphot-io.c 2016-09-23 15:52:37.000000000 +0000 +++ fitsh-0.9.4/src/fiphot-io.c 2021-01-23 13:04:10.000000000 +0000 @@ -23,6 +23,7 @@ #include "magnitude.h" #include "math/poly.h" +#include "str.h" #include "common.h" #include "kernel.h" @@ -30,6 +31,136 @@ /*****************************************************************************/ +static int aperture_definition_create_polygon_regular(double **polypoints,int *npolypoint,double requiv,int nvertex,double alpha) +{ + double *poly,r; + int i; + + r=requiv*sqrt((2*M_PI/(double)nvertex)/sin(2*M_PI/(double)nvertex)); + alpha=alpha*M_PI/180.0; + + poly=(double *)malloc(sizeof(double)*2*nvertex); + for ( i=0 ; iapgeom_type=APGEOM_TYPE_CIRCULAR; + ap->r0=r0; + ap->ra=ra; + ap->da=da; + return(0); + } + else + { int i,n; + char *cmd[8]; + + n=tokenize_char(apdef,cmd,':',63); + if ( n != 3 ) + return(1); + + ap->apgeom_type=APGEOM_TYPE_POLYGON; + + ap->r0_poly=NULL; + ap->ra_poly=NULL; + ap->da_poly=NULL; + ap->nr0=0; + ap->nra=0; + ap->nda=0; + + for ( i=0 ; i<3 ; i++ ) + { double *polypoints; + int npolypoint; + + double requiv,alpha,dx,dy; + int nvertex,r; + + if ( sscanf(cmd[i],"Q[%lg,%d,%lg]",&requiv,&nvertex,&alpha)==3 || sscanf(cmd[i],"regular[%lg,%d,%lg]",&requiv,&nvertex,&alpha)==3 ) + r=aperture_definition_create_polygon_regular(&polypoints,&npolypoint,requiv,nvertex,alpha); + else if ( ( sscanf(cmd[i],"T[%lg,%d,%lg,%lg]",&requiv,&nvertex,&dx,&dy)==4 || sscanf(cmd[i],"trail[%lg,%d,%lg,%lg]",&requiv,&nvertex,&dx,&dy)==4 ) && (nvertex%2)==0 ) + r=aperture_definition_create_polygon_trail(&polypoints,&npolypoint,requiv,nvertex,dx,dy); + else if ( ( memcmp(cmd[i],"P[",2)==0 || memcmp(cmd[i],"polygon[",8)==0 ) && cmd[i][strlen(cmd[i])-1]==']' ) + r=aperture_definition_create_polygon(&polypoints,&npolypoint,cmd[i]); + else + return(1); + + if ( r ) + return(1); + + if ( i==0 ) ap->r0_poly=polypoints,ap->nr0=npolypoint; + else if ( i==1 ) ap->ra_poly=polypoints,ap->nra=npolypoint; + else ap->da_poly=polypoints,ap->nda=npolypoint; + } + + return(0); + + } + +} + +/*****************************************************************************/ + int read_input_star_list(FILE *fr,photstar **rps,int *rnp,colread *col,int zoom) { photstar *ps; @@ -195,10 +326,13 @@ inaps=(apgeom *)malloc(sizeof(apgeom)*n); for ( i=0 ; iapgeom_type=APGEOM_TYPE_CIRCULAR; - ap->r0=r0; - ap->ra=ra; - ap->da=da; - return(0); - } - else - { int i,n; - char *cmd[8]; - - n=tokenize_char(apdef,cmd,':',63); - if ( n != 3 ) - return(1); - - ap->apgeom_type=APGEOM_TYPE_POLYGON; - - ap->r0_poly=NULL; - ap->ra_poly=NULL; - ap->da_poly=NULL; - ap->nr0=0; - ap->nra=0; - ap->nda=0; - - for ( i=0 ; i<3 ; i++ ) - { double *polypoints; - int npolypoint; - - double requiv,alpha,dx,dy; - int nvertex,r; - - if ( sscanf(cmd[i],"Q[%lg,%d,%lg]",&requiv,&nvertex,&alpha)==3 || sscanf(cmd[i],"regular[%lg,%d,%lg]",&requiv,&nvertex,&alpha)==3 ) - r=aperture_definition_create_polygon_regular(&polypoints,&npolypoint,requiv,nvertex,alpha); - else if ( ( sscanf(cmd[i],"T[%lg,%d,%lg,%lg]",&requiv,&nvertex,&dx,&dy)==4 || sscanf(cmd[i],"trail[%lg,%d,%lg,%lg]",&requiv,&nvertex,&dx,&dy)==4 ) && (nvertex%2)==0 ) - r=aperture_definition_create_polygon_trail(&polypoints,&npolypoint,requiv,nvertex,dx,dy); - else if ( ( memcmp(cmd[i],"P[",2)==0 || memcmp(cmd[i],"polygon[",8)==0 ) && cmd[i][strlen(cmd[i])-1]==']' ) - r=aperture_definition_create_polygon(&polypoints,&npolypoint,cmd[i]); - else - return(1); - - if ( r ) - return(1); - - if ( i==0 ) ap->r0_poly=polypoints,ap->nr0=npolypoint; - else if ( i==1 ) ap->ra_poly=polypoints,ap->nra=npolypoint; - else ap->da_poly=polypoints,ap->nda=npolypoint; - } - - return(0); - - } - -} int create_input_ap_data(char *appar,apgeom **rinaps,int *rninap,int zoom) { diff -Nru fitsh-0.9.3/src/fistar-io.c fitsh-0.9.4/src/fistar-io.c --- fitsh-0.9.3/src/fistar-io.c 2017-02-22 11:34:43.000000000 +0000 +++ fitsh-0.9.4/src/fistar-io.c 2020-03-16 21:02:36.000000000 +0000 @@ -549,7 +549,7 @@ int write_stars(FILE *fw,star *stars,int nstar, int *indx,int is_comment,int *oformat,magflux *mf) { - char *opnt,fbuff[16]; + char *opnt,fbuff[32]; star *s; int n,i,j,w,order,ndev,*of,f; int formatlookup[64]; diff -Nru fitsh-0.9.3/src/fitrans.c fitsh-0.9.4/src/fitrans.c --- fitsh-0.9.3/src/fitrans.c 2018-08-14 14:22:50.000000000 +0000 +++ fitsh-0.9.4/src/fitrans.c 2020-10-16 17:25:05.000000000 +0000 @@ -264,6 +264,9 @@ "Shrink the image by the given (integer) factor(s)."}, { "-d, --median", "Use a median-based averaging during the shrinking operation. " }, + { "-v, --truncated-mean ", + "Compute a truncated mean during the shrinking operation by rejecting the " + "number of lower and upper points. " }, { "--optimistic-masking", "Imply some optimism during the shrinking operation: masked pixels " "are ignored during the averaging process and the final mask will " @@ -1261,9 +1264,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +typedef struct + { int mode_median; /* 0: normal mean, 1: median */ + int mode_truncated_mean; /* 0: normal mean: 0<: reject lower & upper points */ + int mode_average_mask; /* handling masks */ + } shrink_mode; + int shrink_image (fitsimage *img,char **mask,fitsimage *outimg,char **outmask, - int ofx,int ofy,int scale_x,int scale_y,int do_median,int do_avg_mode) + int ofx,int ofy,int scale_x,int scale_y,shrink_mode *mode) { int sx,sy,nsx,nsy; int i,j,k,l,ii,jj,m,t; @@ -1277,7 +1286,7 @@ nsy=outimg->sy; if ( sx==0 || sy==0 || nsx==0 || nsy==0 ) return(0); - if ( do_median ) + if ( mode->mode_median || 0mode_truncated_mean ) medarr=(double *)malloc(sizeof(double)*(scale_x*scale_y)); else medarr=NULL; @@ -1292,18 +1301,23 @@ } else if ( medarr != NULL ) { m=0; - if ( do_avg_mode==0 ) + if ( mode->mode_average_mask==0 ) { for ( k=0,t=0 ; kdata[ii+k][jj+l]; - t++; + if ( ! mask[ii+k][jj+l] ) + { medarr[t]=img->data[ii+k][jj+l]; + t++; + } } } outmask[i][j]=m; - outimg->data[i][j]=median(medarr,t)*(double)(scale_x*scale_y); + if ( mode->mode_median ) + outimg->data[i][j]=median(medarr,t)*(double)(scale_x*scale_y); + else if ( 0mode_truncated_mean ) + outimg->data[i][j]=truncated_mean(medarr,t,mode->mode_truncated_mean)*(double)(scale_x*scale_y); } - else if ( do_avg_mode==1 ) + else if ( mode->mode_average_mask==1 ) { for ( k=0,t=0 ; kdata[i][j]=median(medarr,t)*(double)(scale_x*scale_y); + if ( mode->mode_median ) + outimg->data[i][j]=median(medarr,t)*(double)(scale_x*scale_y); + else if ( 0mode_truncated_mean ) + outimg->data[i][j]=truncated_mean(medarr,t,mode->mode_truncated_mean)*(double)(scale_x*scale_y); + } else { outmask[i][j]=MASK_ALL; @@ -1343,7 +1361,7 @@ int interleave_image (fitsimage *img,char **mask,fitsimage *outimg,char **outmask, - int ofx,int ofy,int do_median,int do_avg_mode) + int ofx,int ofy,shrink_mode *mode) { int sx,sy,nsx,nsy; int i,j,k,l,ii,jj,m,t,bwx,bwy; @@ -1387,20 +1405,20 @@ if ( sx<=jj ) continue; medarr[t]=img->data[ii][jj]; - if ( ! do_avg_mode ) + if ( ! mode->mode_average_mask ) m|= mask[ii][jj]; else m|=~mask[ii][jj]; - if ( do_avg_mode && mask[ii][jj] ) + if ( mode->mode_average_mask && mask[ii][jj] ) continue; t++; } } - if ( do_median ) + if ( mode->mode_median ) { outimg->data[i][j]=median(medarr,t); } else { outimg->data[i][j]=mean(medarr,t); } - if ( ! do_avg_mode ) + if ( ! mode->mode_average_mask ) outmask[i][j]=m; else outmask[i][j]=(~m)&MASK_ALL; @@ -1493,7 +1511,8 @@ int main(int argc,char *argv[]) { int i,is_help,is_flip_x,is_flip_y,is_invert,is_shift; - int ofx,ofy,nsx,nsy,frameno,layer,do_median,do_avg_mode; + int ofx,ofy,nsx,nsy,frameno,layer; + shrink_mode sh_mode; char *outimgfile,*inimgfile,*transfile,*transparam; char **inmasklist,*inweightfile; int zoom_ratio,magnify_ratio,shrink_ratio; @@ -1527,7 +1546,11 @@ bqscatt=0; ofx=ofy=is_flip_x=is_flip_y=nsx=nsy=0;int_method=is_invert=0; - do_median=do_avg_mode=0; + + sh_mode.mode_median=0; + sh_mode.mode_truncated_mean=0; + sh_mode.mode_average_mask=0; + frameno=0; smoothparam=NULL; cut_basename=explode_basename=NULL; @@ -1569,8 +1592,9 @@ "--shrink-xy:%d,%d",&sratio_x,&sratio_y, "--interleave-xy:%d,%d",&interleave_x,&interleave_y, "--repetitive-xy:%d,%d",&repetitive_x,&repetitive_y, - "-d|--median:%f",&do_median, - "--optimistic-masking:%SN1f",&do_avg_mode, + "-d|--median:%f",&sh_mode.mode_median, + "-v|--truncated-mean:%d",&sh_mode.mode_truncated_mean, + "--optimistic-masking:%SN1f",&sh_mode.mode_average_mask, "-n|--noise:%f",&bqscatt, "-a|--smooth:%s",&smoothparam, "-f|--offset:%d,%d",&ofx,&ofy, @@ -1827,7 +1851,7 @@ trim_image(&img->i,mask,&outimg->i,outmask,ofx+cx*stepx,ofy+cy*stepy); - sprintf(filename,"xyz-%.3d-%.3d.fits",cx,cy); + sprintf(filename,"%s-%.3d-%.3d.fits",cut_basename,cx,cy); fw=fopenwrite(filename); if ( fw==NULL ) { fprint_error("unable to create output file '%s'",filename); @@ -1996,11 +2020,11 @@ sqjacobi=sqrt(gratio_x*gratio_y); } else if ( 1<=sratio_x || 1<=sratio_y ) - { shrink_image(&img->i,mask,&outimg->i,outmask,ofx,ofy,sratio_x,sratio_y,do_median,do_avg_mode); + { shrink_image(&img->i,mask,&outimg->i,outmask,ofx,ofy,sratio_x,sratio_y,&sh_mode); sqjacobi=1.0/(double)sqrt(sratio_x*sratio_y); } else if ( 0i,mask,&outimg->i,outmask,ofx,ofy,do_median,do_avg_mode); + { interleave_image(&img->i,mask,&outimg->i,outmask,ofx,ofy,&sh_mode); sqjacobi=0.0; } else if ( 0,dec=,roll=\n" -"\t [degrees|radians|scale=],[k1=,k2=,...]]\n" +"\t[--proj [sin|arc|tan],ra=,dec=,[roll=],[max=],\n" +"\t [degrees|radians|scale=],\n" +"\t [k1=,k2=,...,p1=,p2=,...]\n" "\t[--proj [...],qr=,qi=,qj=,qk=]\n" "\t[--col-radec <>,<>|--col-pixel <>,<>]\n"); fprintf(fw, @@ -648,7 +650,7 @@ "result of the composition." }, { "Options for spherical projection and deprojection:", NULL }, - { "--proj, --project [sin|arc|tan],ra=,dec=,[roll=],[qr=,qi=,qj=,=K],[degrees|radians|scale=", + { "--proj, --project [sin|arc|tan],ra=,dec=,[roll=],[max=],[qr=,qi=,qj=,qk=],[degrees|radians|scale=", __extension__ "This set of directives specify the common parameters of " "the spherical projection or deprojection. The \"sin\", \"arc\" " @@ -665,7 +667,13 @@ "Alternatively to the right ascension, declination and roll " "parameterization, one can use quaternion-based pointing here " "by specifying qr, qi, qj, qk for the real, and the three " - "imaginary components, respectively." }, + "imaginary components, respectively." + "By default, this projection tries to compute the projected coordinates " + "for all of the positions presented in the input list. However, it " + "might yield unexpected results in certain cases (e.g. an input list " + "on a nearly full sphere and orthographic projection). One can use the " + "\"max=\" parameter to filter objects " + "beyond this maximum distance. " }, { "--col-radec ,", "Column indices for RA and DEC values. This option implies " "projection." }, @@ -970,6 +978,7 @@ wcs->init.ra0=0.0; wcs->init.de0=0.0; wcs->init.roll0=0.0; + wcs->init.max_distance=0.0; wcs->init.qr0=0.0; wcs->init.qi0=0.0; wcs->init.qj0=0.0; @@ -977,11 +986,17 @@ wcs->init.type=PROJECTION_TAN; wcs->init.order=1; wcs->init.zfactor=M_R2D; /* 180 \over \pi */ - wcs->init.distort.brown_conrady_ncoeff=0; - wcs->init.distort.brown_conrady_coeffs[0]=0.0; - wcs->init.distort.brown_conrady_coeffs[1]=0.0; - wcs->init.distort.brown_conrady_coeffs[2]=0.0; - wcs->init.distort.brown_conrady_coeffs[3]=0.0; + wcs->init.distort.brown_conrady_radial_ncoeff=0; + wcs->init.distort.brown_conrady_radial_coeffs[0]=0.0; + wcs->init.distort.brown_conrady_radial_coeffs[1]=0.0; + wcs->init.distort.brown_conrady_radial_coeffs[2]=0.0; + wcs->init.distort.brown_conrady_radial_coeffs[3]=0.0; + + wcs->init.distort.brown_conrady_tangential_ncoeff=0; + wcs->init.distort.brown_conrady_tangential_coeffs[0]=0.0; + wcs->init.distort.brown_conrady_tangential_coeffs[1]=0.0; + wcs->init.distort.brown_conrady_tangential_coeffs[2]=0.0; + wcs->init.distort.brown_conrady_tangential_coeffs[3]=0.0; is_deg=is_rad=0; radscale=degscale=0.0; @@ -990,6 +1005,7 @@ "ra:%g" ,&wcs->init.ra0, "dec:%g",&wcs->init.de0, "roll:%g",&wcs->init.roll0, + "max:%g",&wcs->init.max_distance, "qr:%g",&wcs->init.qr0, "qi:%g",&wcs->init.qi0, "qj:%g",&wcs->init.qj0, @@ -1001,10 +1017,14 @@ "scale:%g",&radscale, "radscale:%g",&radscale, "degscale:%g",°scale, - "k1:%g",&wcs->init.distort.brown_conrady_coeffs[0], - "k2:%g",&wcs->init.distort.brown_conrady_coeffs[1], - "k3:%g",&wcs->init.distort.brown_conrady_coeffs[2], - "k4:%g",&wcs->init.distort.brown_conrady_coeffs[3], + "k1:%g",&wcs->init.distort.brown_conrady_radial_coeffs[0], + "k2:%g",&wcs->init.distort.brown_conrady_radial_coeffs[1], + "k3:%g",&wcs->init.distort.brown_conrady_radial_coeffs[2], + "k4:%g",&wcs->init.distort.brown_conrady_radial_coeffs[3], + "p1:%g",&wcs->init.distort.brown_conrady_tangential_coeffs[0], + "p2:%g",&wcs->init.distort.brown_conrady_tangential_coeffs[1], + "p3:%g",&wcs->init.distort.brown_conrady_tangential_coeffs[2], + "p4:%g",&wcs->init.distort.brown_conrady_tangential_coeffs[3], "deg|degree|degrees:%f",&is_deg, "rad|radian|radians:%f",&is_rad, NULL); @@ -1032,8 +1052,15 @@ else /* if ( is_deg ) */ wcs->init.zfactor=M_R2D; for ( i=3 ; 0<=i ; i-- ) - { if ( wcs->init.distort.brown_conrady_coeffs[i] != 0.0 ) - { wcs->init.distort.brown_conrady_ncoeff=i+1; + { if ( wcs->init.distort.brown_conrady_radial_coeffs[i] != 0.0 ) + { wcs->init.distort.brown_conrady_radial_ncoeff=i+1; + break; + } + } + + for ( i=3 ; 0<=i ; i-- ) + { if ( wcs->init.distort.brown_conrady_tangential_coeffs[i] != 0.0 ) + { wcs->init.distort.brown_conrady_tangential_ncoeff=i+1; break; } } @@ -1257,7 +1284,7 @@ } else if ( intransfile != NULL ) - { char *rbuff,**cmd,*nstr,**npnt,*cpnt,outformat[8]; + { char *rbuff,**cmd,*nstr,**npnt,*cpnt,outformat[32]; int n,nval,mxc; double x,y,nw,is,id,ik,nx,ny; double *jxx,*jxy,*jyx,*jyy; @@ -1425,8 +1452,8 @@ else if ( wcs != NULL ) { if ( projection_direction ) /* wcs: ra,dec -> x,y or x,y -> ra,dec */ - { double ra,dec; - char *rbuff,**cmd,*nstr,**npnt,*cpnt,outformat[8]; + { double ra,dec,zmin; + char *rbuff,**cmd,*nstr,**npnt,*cpnt,outformat[32]; int n,nval,mxc; double x,y,z; @@ -1461,13 +1488,22 @@ rbuff=NULL;cmd=NULL; sprintf(outformat,"%%%ds ",padsize); + + if ( 0.0init.max_distance ) + zmin=-cos(wcs->init.max_distance*M_PI/180.0); + else + zmin=1.1; + while ( ! feof(fr) ) - { if ( rbuff != NULL ) free(rbuff); + { + if ( rbuff != NULL ) free(rbuff); if ( cmd != NULL ) { free(cmd);cmd=NULL; } + rbuff=freadline(fr); if ( rbuff==NULL ) break; remove_newlines_and_comments(rbuff); cmd=tokenize_spaces_dyn(rbuff); + if ( cmd==NULL ) continue; for ( n=0 ; cmd[n] != NULL ; ) n++; if ( n<=col.refx || n<=col.refy ) continue; @@ -1478,6 +1514,8 @@ if ( ! ( projection_direction-1 ) ) /* ra,dec -> x,y */ { ra=x,dec=y; projection_do_matrix_coord(wcs->init.mproj,ra,dec,&x,&y,&z); + if ( zmin < z ) + continue; projection_do_distortion(wcs->init.type,&wcs->init.distort,&x,&y,&z); /* note the '-' sign here: */ sprintf(npnt[0],"%15.9g",-x*wcs->init.zfactor); diff -Nru fitsh-0.9.3/src/history.c fitsh-0.9.4/src/history.c --- fitsh-0.9.3/src/history.c 2016-09-23 15:51:55.000000000 +0000 +++ fitsh-0.9.4/src/history.c 2021-01-24 14:28:38.000000000 +0000 @@ -18,7 +18,7 @@ int fits_history_export_command_line(fits *img,char *prg,char *vrs,int argc,char *argv[]) { - char buff[64]; + char buff[256]; time_t t; struct tm *tm; @@ -26,7 +26,7 @@ tm=localtime(&t); sprintf(buff,"%s: %s [%s@%s] %.4d.%.2d.%.2d %.2d:%.2d:%.2d (%s)", - prg,vrs,FITSH_VERSION,FITSH_RELEASE_DATE, + prg,vrs,FITSH_VERSION,FITSH_RELEASE, tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday, tm->tm_hour,tm->tm_min,tm->tm_sec, (!daylight?tzname[0]:tzname[1])); diff -Nru fitsh-0.9.3/src/lfit-builtin.c fitsh-0.9.4/src/lfit-builtin.c --- fitsh-0.9.3/src/lfit-builtin.c 2016-09-23 15:40:09.000000000 +0000 +++ fitsh-0.9.4/src/lfit-builtin.c 2020-04-08 09:23:48.000000000 +0000 @@ -636,6 +636,8 @@ #define F_HJD 110 /* hjd(), helocentric JD */ #define F_BJD 111 /* bjd(), barycentric JD */ +#define F_DHJD 112 /* dhjd(), helocentric JD */ +#define F_DBJD 113 /* dbjd(), barycentric JD */ static int funct_f_eoq(double *s) { s-=3; @@ -751,6 +753,7 @@ return(0); } + static int funct_f_hjd(double *s) { s-=3; *s=get_hjd(*s,*(s+1),*(s+2)); @@ -763,6 +766,18 @@ return(0); } +static int funct_f_dhjd(double *s) + { s-=3; + *s=get_diff_hjd(*s,*(s+1),*(s+2)); + return(0); + } + +static int funct_f_dbjd(double *s) + { s-=3; + *s=get_diff_bjd(*s,*(s+1),*(s+2)); + return(0); + } + static int funct_f_elliptic_k(double *s) { s-=1; @@ -803,6 +818,8 @@ static psnfunctinfo pfi_ntiq = { "normalized transit intensity - quadratic limb darkening assumption (arguments: fracional radius, normalized distance, the two limb darkening coefficients)" }; static psnfunctinfo pfi_hjd = { "heliocentric Julian date (arguments: julian day, RA and DEC, in degrees)" }; static psnfunctinfo pfi_bjd = { "barycentric Julian date (arguments: julian day, RA and DEC, in degrees)" }; +static psnfunctinfo pfi_dhjd = { "difference between HJD and JD, i.e. hjd()=jd+dhjd(jd,.,.) (arguments: julian day, RA and DEC, in degrees)" }; +static psnfunctinfo pfi_dbjd = { "difference between BJD and JD, i.e. bjd()=jd+dbjd(jd,.,.) (arguments: julian day, RA and DEC, in degrees)" }; static psnfunctinfo pfi_ell_k = { "complete elliptic integral of the first kind" }; static psnfunctinfo pfi_ell_e = { "complete elliptic integral of the second kind" }; static psnfunctinfo pfi_ell_pi = { "complete elliptic integral of the third kind" }; @@ -821,6 +838,8 @@ { "ntiq_dg2" , T_FN, F_NTIQ_DG2, 0 , 4, 0, 0 , funct_f_ntiq_dg2 , NULL , "ntiq_dg2(#1,#2,#3,#4)", 0, 0 , NULL }, { "hjd" , T_FN, F_HJD , 0 , 3, 0, 0 , funct_f_hjd , NULL , "hjd(#1,#2,#3)" , 0, 0 , &pfi_hjd }, { "bjd" , T_FN, F_BJD , 0 , 3, 0, 0 , funct_f_bjd , NULL , "bjd(#1,#2,#3)" , 0, 0 , &pfi_bjd }, + { "dhjd" , T_FN, F_DHJD , 0 , 3, 0, 0 , funct_f_dhjd , NULL , "dhjd(#1,#2,#3)" , 0, 0 , &pfi_dhjd }, + { "dbjd" , T_FN, F_DBJD , 0 , 3, 0, 0 , funct_f_dbjd , NULL , "dbjd(#1,#2,#3)" , 0, 0 , &pfi_dbjd }, { "ellipticK" , T_FN, F_ELL_K , 0 , 1, 0, 0 , funct_f_elliptic_k , NULL , "ellipticK(#1)" , 0, 0 , &pfi_ell_k }, { "ellipticE" , T_FN, F_ELL_E , 0 , 1, 0, 0 , funct_f_elliptic_e , NULL , "ellipticE(#1)" , 0, 0 , &pfi_ell_e }, { "ellipticPi", T_FN, F_ELL_PI , 0 , 2, 0, 0 , funct_f_elliptic_pi, NULL , "ellipticPi(#1)" , 0, 0 , &pfi_ell_pi }, diff -Nru fitsh-0.9.3/src/lfit.c fitsh-0.9.4/src/lfit.c --- fitsh-0.9.3/src/lfit.c 2016-11-22 14:45:23.000000000 +0000 +++ fitsh-0.9.4/src/lfit.c 2021-01-24 14:28:45.000000000 +0000 @@ -6797,8 +6797,8 @@ return(0); } else if ( is_help<0 ) - { fprintf(stdout,"lfit %s (%s)\n",LFIT_VERSION,LFIT_LASTCHANGE); - fprintf(stdout,"Copyright (C) 1996, 2002, 2004-2008, 2009; Pal, Andras \n"); + { fprintf(stdout,"lfit %s (%s)\n",LFIT_VERSION,FITSH_RELEASE); + fprintf(stdout,"Copyright (C) 1996, 2002, 2004-2008, 2009-2020; Pal, Andras \n"); return(0); } diff -Nru fitsh-0.9.3/src/Makefile.in fitsh-0.9.4/src/Makefile.in --- fitsh-0.9.3/src/Makefile.in 2017-02-22 13:45:02.000000000 +0000 +++ fitsh-0.9.4/src/Makefile.in 2021-01-24 12:38:21.000000000 +0000 @@ -18,11 +18,11 @@ DLDYN=@DLDYN@ DLLIB=@DLLIB@ -TARGETS=fiarith ficalib ficombine ficonv fiheader fiign fiinfo fiphot \ - firandom fistar fitrans \ - grcollect grmatch grtrans gropt \ - lfit linear.$(DLEXT) \ - fic_mpstack +TARGETS = fiarith ficalib ficombine ficonv fiheader fiign fiinfo fiphot +TARGETS += firandom fistar fitrans +TARGETS += grcollect grmatch grtrans gropt +TARGETS += lfit +TARGETS += @DL_TARGETS@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -180,7 +180,8 @@ apphot.o \ tensor.o \ weight-io.o \ - weight-gen.o + weight-gen.o \ + str.o \ MOD_FIPHOT=\ math/intersec/intersec.o \ @@ -648,5 +649,5 @@ $(MAKE) -C link clean $(MAKE) -C math clean $(MAKE) -C psn clean - rm -f *.o *.a $(TARGETS) + rm -f *.o *.a *.exe $(TARGETS) diff -Nru fitsh-0.9.3/src/math/polygon.c fitsh-0.9.4/src/math/polygon.c --- fitsh-0.9.3/src/math/polygon.c 2015-05-27 16:37:26.000000000 +0000 +++ fitsh-0.9.4/src/math/polygon.c 2020-02-05 15:09:35.000000000 +0000 @@ -51,6 +51,30 @@ return(0.0<=a?a:-a); } +int polygon_integrate_linear_monoms(double *poly,int n,double *fcoeff) +{ + double mx,my; + int i; + + fcoeff[0]=0.0; + fcoeff[1]=0.0; + fcoeff[2]=0.0; + + if ( n <= 2 ) + return(0); + + mx=my=0; + + for ( i=0 ; ibrown_conrady_ncoeff ) + if ( dist != NULL && ( 0brown_conrady_radial_ncoeff || 0brown_conrady_tangential_ncoeff ) ) { int i; - double r2,rc,w; - rc=r2=(*rx)*(*rx)+(*ry)*(*ry); + double r2,rc,w,ux,uy,x,y; + x=(*rx); + y=(*ry); + rc=r2=x*x+y*y; w=0.0; - for ( i=0 ; ibrown_conrady_ncoeff ; i++ ) - { w += dist->brown_conrady_coeffs[i]*rc; + for ( i=0 ; ibrown_conrady_radial_ncoeff ; i++ ) + { w += dist->brown_conrady_radial_coeffs[i]*rc; rc = rc * r2; } - *rx=(*rx)*(1+w); - *ry=(*ry)*(1+w); + ux=uy=0.0; + if ( 0brown_conrady_tangential_ncoeff ) + { double p1,p2,p3,p4; + p1=dist->brown_conrady_tangential_coeffs[0]; + p2=dist->brown_conrady_tangential_coeffs[1]; + ux=p1*(r2+2*x*x)+p2*(2*x*y); + uy=p1*(2*x*y)+p2*(r2+2*y*y); + p3=dist->brown_conrady_tangential_coeffs[2]; + p4=dist->brown_conrady_tangential_coeffs[3]; + if ( 2brown_conrady_tangential_ncoeff ) + { ux=ux*(1+p3*r2+p4*r2*r2); + uy=uy*(1+p3*r2+p4*r2*r2); + } + } + *rx=x*(1+w)+ux; + *ry=y*(1+w)+uy; } return(0); } @@ -155,20 +171,20 @@ { double d,m; - if ( dist != NULL && 0brown_conrady_ncoeff ) + if ( dist != NULL && 0brown_conrady_radial_ncoeff ) { int i; double r2,w,q1,q2,q3,q4; double w1,w2,w4,w6,w8,dw; r2=(*rx)*(*rx)+(*ry)*(*ry); - q1=dist->brown_conrady_coeffs[0]*r2; - q2=(1brown_conrady_ncoeff?dist->brown_conrady_coeffs[1]*r2*r2:0.0); - q3=(2brown_conrady_ncoeff?dist->brown_conrady_coeffs[2]*r2*r2*r2:0.0); - q4=(3brown_conrady_ncoeff?dist->brown_conrady_coeffs[3]*r2*r2*r2*r2:0.0); + q1=dist->brown_conrady_radial_coeffs[0]*r2; + q2=(1brown_conrady_radial_ncoeff?dist->brown_conrady_radial_coeffs[1]*r2*r2:0.0); + q3=(2brown_conrady_radial_ncoeff?dist->brown_conrady_radial_coeffs[2]*r2*r2*r2:0.0); + q4=(3brown_conrady_radial_ncoeff?dist->brown_conrady_radial_coeffs[3]*r2*r2*r2*r2:0.0); w=-q1+3*q1*q1-q2; - if ( dist->brown_conrady_ncoeff==1 ) + if ( dist->brown_conrady_radial_ncoeff==1 ) { for ( i=0 ; ibrown_conrady_ncoeff==2 ) + else if ( dist->brown_conrady_radial_ncoeff==2 ) { for ( i=0 ; ibrown_conrady_ncoeff==3 ) + else if ( dist->brown_conrady_radial_ncoeff==3 ) { for ( i=0 ; ibrown_conrady_ncoeff==4 ) + else if ( dist->brown_conrady_radial_ncoeff==4 ) { for ( i=0 ; i\n",FITSH_MAINT_RNAME,FITSH_MAINT_EMAIL); + fprintf(fw,"%s %s (%s)\n",name,FITSH_VERSION,FITSH_RELEASE); + fprintf(fw,"Copyright (C) 1996, 2002, 2004-2008, 2010-2016, 2018-2020; %s <%s>\n",FITSH_MAINT_RNAME,FITSH_MAINT_EMAIL); break; case -2: - fprintf(fw,"%s-%s [fitsh-%s]\n",name,pv,FITSH_VERSION); + fprintf(fw,"%s [fitsh-%s]\n",name,FITSH_VERSION); break; } return(0); @@ -65,7 +65,7 @@ else { longhelp_fprint(fw,help,0,-1); fprintf(fw,"\n"); - fprintf(fw,"Report bugs to <%s>, see also http://fitsh.net/.\n",FITSH_MAINT_EMAIL); + fprintf(fw,"Report bugs to <%s>, see also https://fitsh.net/.\n",FITSH_MAINT_EMAIL); } return(0); diff -Nru fitsh-0.9.3/src/wcs.c fitsh-0.9.4/src/wcs.c --- fitsh-0.9.3/src/wcs.c 2017-01-25 21:01:02.000000000 +0000 +++ fitsh-0.9.4/src/wcs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -/*****************************************************************************/ -/* wcs.c */ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Some functions related to sky coordinate conversions & projections */ -/*****************************************************************************/ - -#include -#include -#include -#include - -#include "wcs.h" - -/*****************************************************************************/ - -int wcs_get_projection_matrix(double ra0,double de0,matrix mproj) -{ - double sr0,sd0,cr0,cd0; - - ra0=M_D2R*ra0; - de0=M_D2R*de0; - - sr0=sin(ra0); - cr0=cos(ra0); - sd0=sin(de0); - cd0=cos(de0); - - mproj[0][0]=+sr0 ,mproj[0][1]=-cr0 ,mproj[0][2]=0.0; - mproj[1][0]=-sd0*cr0,mproj[1][1]=-sd0*sr0,mproj[1][2]=+cd0; - mproj[2][0]=-cd0*cr0,mproj[2][1]=-cd0*sr0,mproj[2][2]=-sd0; - - return(0); -} - -int wcs_get_projected_coords_matrix(matrix mproj,double ra,double de,double *rx,double *ry,double *rz) -{ - double sr,sd,cr,cd,x,y,z; - - ra=M_D2R*ra; - de=M_D2R*de; - - sr=sin(ra); - cr=cos(ra); - sd=sin(de); - cd=cos(de); - - x=cd*cr; - y=cd*sr; - z=sd; - - *rx=mproj[0][0]*x+mproj[0][1]*y+mproj[0][2]*z; - *ry=mproj[1][0]*x+mproj[1][1]*y+mproj[1][2]*z; - *rz=mproj[2][0]*x+mproj[2][1]*y+mproj[2][2]*z; - - return(0); -} - -int wcs_invert_projected_coords_matrix(matrix mproj,double x,double y,double *rra,double *rde) -{ - double z,px,py,pz; - - z=1.0-x*x-y*y; - if ( z<0.0 ) return(1); - else z=-sqrt(z); - - px=mproj[0][0]*x+mproj[1][0]*y+mproj[2][0]*z; - py=mproj[0][1]*x+mproj[1][1]*y+mproj[2][1]*z; - pz=mproj[0][2]*x+mproj[1][2]*y+mproj[2][2]*z; - - *rde=asin(pz)*M_R2D; - *rra=atan2(py,px)*M_R2D; - if ( *rra<0.0 ) *rra+=360.0; - - return(0); -} - -int wcs_project_distort(int type,wcs_distort *dist,double *rx,double *ry,double *rz) -{ - double d,m; - switch ( type ) - { case WCS_TAN: /* gnomonic projection */ - m=1.0/sqrt(1-(*rx)*(*rx)-(*ry)*(*ry)); - *rx=(*rx)*m; - *ry=(*ry)*m; - break; - case WCS_ARC: /* arc projection */ - d=sqrt((*rx)*(*rx)+(*ry)*(*ry)); - if ( d>0.0 && *rz < 0.0 ) m=asin(d)/d; - else if ( d>0.0 ) m=(M_PI-asin(d))/d; - else m=1.0; - *rx=(*rx)*m; - *ry=(*ry)*m; - break; - case WCS_SIN: /* orthographic: do nothing, successfully */ - break; - default: /* unknown projection */ - return(1); - break; - } - return(0); -} - -int wcs_invert_project_distort(int type,wcs_distort *dist,double *rx,double *ry,double *rz) -{ - double d,m; - switch ( type ) - { case WCS_TAN: /* gnomonic projection */ - m=1.0/sqrt(1+(*rx)*(*rx)+(*ry)*(*ry)); - *rx=(*rx)*m; - *ry=(*ry)*m; - break; - case WCS_ARC: /* arc projection */ - d=sqrt((*rx)*(*rx)+(*ry)*(*ry)); - if ( d>0.0 ) m=sin(d)/d; - else m=1.0; - *rx=(*rx)*m; - *ry=(*ry)*m; - break; - case WCS_SIN: /* orthographic: do nothing, successfully */ - break; - default: /* unknown projection */ - return(1); - break; - } - return(0); -} - -int wcs_get_projected_coords(double ra,double de,double ra0,double de0,double *rx,double *ry,double *rz) -{ - double sinda,cosda,sind0,sind,cosd0,cosd; - - ra =M_D2R*(ra-ra0); - de0=M_D2R*de0; - de =M_D2R*de; - - sinda=sin(ra); - cosda=cos(ra); - sind0=sin(de0); - cosd0=cos(de0); - sind =sin(de); - cosd =cos(de); - - *rx=+cosd*sinda; - *ry=-sind0*cosd*cosda+cosd0*sind; - *rz=+cosd0*cosd*cosda+sind0*sind; - - return(0); -} - -/*****************************************************************************/ - diff -Nru fitsh-0.9.3/src/wcs.h fitsh-0.9.4/src/wcs.h --- fitsh-0.9.3/src/wcs.h 2017-01-26 22:43:18.000000000 +0000 +++ fitsh-0.9.4/src/wcs.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/*****************************************************************************/ -/* wcs.h */ -/*****************************************************************************/ - -#ifndef __WCS_H_INCLUDED -#define __WCS_H_INCLUDED 1 - -/*****************************************************************************/ - -#define M_R2D (180.0/M_PI) -#define M_D2R (M_PI/180.0) - -/*****************************************************************************/ - -#define WCS_SIN 0 -#define WCS_ARC 1 -#define WCS_TAN 2 - -typedef double vector[3]; -typedef double matrix[3][3]; - -typedef struct - { double brown_conrady_k1; - double brown_conrady_k2; - double brown_conrady_k3; - double brown_conrady_k4; - } wcs_distort; - -typedef struct - { double ra0,de0; - int type,order; - matrix mproj; - double zfactor; - wcs_distort distort; - } wcsinit; - -typedef struct - { wcsinit init; - double *pixpoly[2]; - double *prjpoly[2]; - double crpix1,crpix2; - double cd11,cd12,cd21,cd22; - double res_prj,res_pix; - } wcsdata; - -int wcs_get_projection_matrix(double ra0,double de0,matrix mproj); -int wcs_get_projected_coords_matrix(matrix mproj, - double ra,double de,double *rx,double *ry,double *rz); -int wcs_invert_projected_coords_matrix(matrix mproj, - double x,double y,double *rra,double *rde); - -int wcs_project_distort(int type,wcs_distort *dist,double *rx,double *ry,double *rz); -int wcs_invert_project_distort(int type,wcs_distort *dist,double *rx,double *ry,double *rz); - -int wcs_get_projected_coords(double ra0,double de0, - double ra,double de,double *rx,double *ry,double *rz); - -/*****************************************************************************/ - -#endif - -/*****************************************************************************/ - diff -Nru fitsh-0.9.3/src/xfunct.c fitsh-0.9.4/src/xfunct.c --- fitsh-0.9.3/src/xfunct.c 2009-08-05 11:46:55.000000000 +0000 +++ fitsh-0.9.4/src/xfunct.c 2020-04-08 09:20:26.000000000 +0000 @@ -74,5 +74,23 @@ return(bjd); } +double get_diff_hjd(double jd,double ra,double dec) +{ + double hjd; + + hjd=get_heliocentric_julian_date_diff(jd,ra,dec); + + return(hjd); +} + +double get_diff_bjd(double jd,double ra,double dec) +{ + double bjd; + + bjd=get_barycentric_julian_date_diff(jd,ra,dec); + + return(bjd); +} + /*****************************************************************************/ diff -Nru fitsh-0.9.3/src/xfunct.h fitsh-0.9.4/src/xfunct.h --- fitsh-0.9.3/src/xfunct.h 2008-10-29 01:04:17.000000000 +0000 +++ fitsh-0.9.4/src/xfunct.h 2020-04-08 09:20:41.000000000 +0000 @@ -30,6 +30,11 @@ /* wrapper to get_barycentric_julian_date(): */ double get_bjd(double jd,double ra,double dec); +/* wrapper to get_heiocentric_julian_date_diff(): */ +double get_diff_hjd(double jd,double ra,double dec); +/* wrapper to get_barycentric_julian_date_diff(): */ +double get_diff_bjd(double jd,double ra,double dec); + /*****************************************************************************/ #endif diff -Nru fitsh-0.9.3/tools/imexam fitsh-0.9.4/tools/imexam --- fitsh-0.9.3/tools/imexam 2018-07-25 21:07:41.000000000 +0000 +++ fitsh-0.9.4/tools/imexam 2020-05-09 10:05:34.000000000 +0000 @@ -242,7 +242,11 @@ : # Otherwise, print some warning: else - echo "$0: unexpected key: ${key}, continuing." >> /dev/stderr + if [ "$key" == "Left" ] || [ "$key" == "Right" ] || [ "$key" == "Up" ] || [ "$key" == "Down" ]; then + : + else + echo "$0: unexpected key: ${key}, continuing." >> /dev/stderr + fi fi # Cleanup (local temporary files) and relax a bit: diff -Nru fitsh-0.9.3/tools/tvmark fitsh-0.9.4/tools/tvmark --- fitsh-0.9.3/tools/tvmark 2018-06-11 17:47:25.000000000 +0000 +++ fitsh-0.9.4/tools/tvmark 2018-10-01 09:19:54.000000000 +0000 @@ -11,8 +11,8 @@ head -n 1 } -TVMARK_VERSION=0.2 -TVMARK_RELEASE=2013.03.02 +TVMARK_VERSION=0.3 +TVMARK_RELEASE=2018.10.01 XPASET=xpaset METHOD=`get_xpa_method` @@ -27,6 +27,7 @@ LD=10 LF="" +WIDTH=1 RAD=4 COLOR="green" LCOLOR="red" @@ -83,6 +84,10 @@ # } shift ;; + -w|--width) + WIDTH="$2" + shift + ;; -c|--color|--colour) [ -n "$2" ] || { print_error "invalid color: '$2'" @@ -119,7 +124,7 @@ echo -e "\t[-x|--col-xy ,] " echo -e "\t[-e|--circle [-r|--radius ]]" echo -e "\t[-q|--square [-s|--size ]]" - echo -e "\t[-c|--color ]" + echo -e "\t[-w|--width ] [-c|--color ]" echo -e "\t[-l|--col-label " echo -e "\t[-f|--label '']" echo -e "\t[-p|--separation " @@ -173,7 +178,7 @@ TMP="" fi -( echo "global color=$COLOR" +( echo "global color=$COLOR width=$WIDTH" echo "image" case $SHAPE in square) @@ -187,7 +192,7 @@ esac if [ $CL -gt 0 ] || [ -n "$LF" ] ; then - echo "global color=$LCOLOR" + echo "global color=$LCOLOR width=$WIDTH" cat $IN | awk -v CX=$CX -v CY=$CY -v CL=$CL -v LF="$LF" -v RAD=$RAD -v LD="$LD" \ '!/^#/{ if ( LF != "" ) diff -Nru fitsh-0.9.3/VERSION fitsh-0.9.4/VERSION --- fitsh-0.9.3/VERSION 2016-09-25 23:44:56.000000000 +0000 +++ fitsh-0.9.4/VERSION 2021-01-24 12:28:35.000000000 +0000 @@ -1 +1 @@ -0.9.3 +0.9.4