Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian Astro Team
astrometry.net
Commits
8ebcaaa8
Commit
8ebcaaa8
authored
Aug 16, 2021
by
Ole Streicher
Browse files
New upstream version 0.85+dfsg
parent
238ce418
Changes
42
Hide whitespace changes
Inline
Side-by-side
.circleci/config.yml
0 → 100644
View file @
8ebcaaa8
version
:
2
jobs
:
build-docker-ubuntu-20-py39
:
docker
:
-
image
:
ubuntu:20.04
steps
:
-
run
:
name
:
CPU info
command
:
cat /proc/cpuinfo
-
run
:
name
:
Ubuntu packages
command
:
|
apt update && apt install -y apt-utils
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends make gcc patch git openssh-client file pkg-config wget curl swig netpbm wcslib-dev wcslib-tools zlib1g-dev libbz2-dev libcairo2-dev libcfitsio-dev libcfitsio-bin libgsl-dev libjpeg-dev libnetpbm10-dev libpng-dev python3.9-dev libpython3.9-dev ca-certificates
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.9 get-pip.py
rm get-pip.py
-
run
:
name
:
Python packages
command
:
|
pip3 install numpy
pip3 install fitsio
-
checkout
-
run
:
name
:
Make
command
:
|
export PYTHON=python3.9
make
make py
make extra
make test
-
run
:
name
:
Tests
command
:
|
export PYTHON=python3.9
(cd util && ./test)
(cd libkd && ./test)
(cd solver && ./test)
(cd plot && ./test)
make install INSTALL_DIR=~/an PYTHON_SCRIPT="/usr/bin/env python3.9"
export PYTHONPATH=${PYTHONPATH}:~/an/lib/python
(cd /tmp && $PYTHON -c "import astrometry.libkd.spherematch")
export PATH=${PATH}:~/an/bin
build-astrometry-index -d 3 -o index-9918.fits -P 18 -S mag -B 0.1 -s 0 -r 1 -I 9918 -M -i demo/tycho2-mag6.fits
echo -e 'add_path .\ninparallel\nindex index-9918.fits' > 99.cfg
solve-field --config 99.cfg demo/apod4.jpg --continue
tablist demo/apod4.match
listhead demo/apod4.wcs
(cd /tmp && $PYTHON -c "import astrometry.util.util; print(dir(astrometry.util.util))")
build-docker-ubuntu-18
:
docker
:
-
image
:
ubuntu:18.04
steps
:
-
run
:
name
:
CPU info
command
:
cat /proc/cpuinfo
-
run
:
name
:
Ubuntu packages
command
:
|
apt update && apt install -y apt-utils
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends make gcc git openssh-client file pkg-config wget curl swig netpbm wcslib-dev wcslib-tools zlib1g-dev libbz2-dev libcairo2-dev libcfitsio-dev libcfitsio-bin libgsl-dev libjpeg-dev libnetpbm10-dev libpng-dev python3 python3-dev python3-pip python3-pil python3-tk python3-setuptools python3-wheel
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
-
run
:
name
:
Python packages
command
:
|
pip3 install numpy
pip3 install fitsio
-
checkout
-
run
:
name
:
Make
command
:
|
make
make py
make extra
make test
-
run
:
name
:
Tests
command
:
|
(cd util && ./test)
(cd libkd && ./test)
(cd solver && ./test)
(cd plot && ./test)
make install INSTALL_DIR=~/an PYTHON_SCRIPT="/usr/bin/env python3"
export PYTHONPATH=${PYTHONPATH}:~/an/lib/python
(cd /tmp && python3 -c "import astrometry.libkd.spherematch")
export PATH=${PATH}:~/an/bin
build-astrometry-index -d 3 -o index-9918.fits -P 18 -S mag -B 0.1 -s 0 -r 1 -I 9918 -M -i demo/tycho2-mag6.fits
echo -e 'add_path .\ninparallel\nindex index-9918.fits' > 99.cfg
solve-field --config 99.cfg demo/apod4.jpg --continue
tablist demo/apod4.match
listhead demo/apod4.wcs
(cd /tmp && python3 -c "import astrometry.util.util; print(dir(astrometry.util.util))")
build-docker-centos-8
:
docker
:
-
image
:
centos:8
steps
:
-
run
:
name
:
CPU info
command
:
cat /proc/cpuinfo
-
run
:
name
:
RPM packages
command
:
|
yum -y install patch gcc make file pkg-config wget curl swig git
yum -y install gsl-devel cairo-devel libpng-devel libjpeg-turbo-devel zlib-devel bzip2-devel swig python36-devel
dnf -y install dnf-plugins-core
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum -y install epel-release
dnf install -y 'dnf-command(config-manager)'
dnf repolist
dnf config-manager --set-enabled powertools
dnf repolist
yum -y install netpbm netpbm-devel netpbm-progs
yum -y install cfitsio cfitsio-devel wcslib wcslib-utils wcslib-devel
ln -s /usr/lib64/libnetpbm.so.11 /usr/local/lib/libnetpbm.so
-
run
:
name
:
Python packages
command
:
|
pip3 install numpy
pip3 install fitsio
-
checkout
-
run
:
name
:
Make
command
:
|
NETPBM_INC=-I/usr/include/netpbm
NETPBM_LIB=-lnetpbm
make
make py
make extra
make test
-
run
:
name
:
Tests
command
:
|
(cd util && ./test)
(cd libkd && ./test)
(cd solver && ./test)
(cd plot && ./test)
make install INSTALL_DIR=~/an PYTHON_SCRIPT="/usr/bin/env python3"
export PYTHONPATH=${PYTHONPATH}:~/an/lib/python
(cd /tmp && python3 -c "import astrometry.libkd.spherematch")
export PATH=${PATH}:~/an/bin
build-astrometry-index -d 3 -o index-9918.fits -P 18 -S mag -B 0.1 -s 0 -r 1 -I 9918 -M -i demo/tycho2-mag6.fits
echo -e 'add_path .\ninparallel\nindex index-9918.fits' > 99.cfg
solve-field --config 99.cfg demo/apod4.jpg --continue
tablist demo/apod4.match
listhead demo/apod4.wcs
workflows
:
version
:
2
build
:
jobs
:
-
"
build-docker-ubuntu-20-py39"
-
"
build-docker-ubuntu-18"
-
"
build-docker-centos-8"
.gitignore
View file @
8ebcaaa8
...
...
@@ -4,11 +4,14 @@
*/deps
*/lib*.a
*/test_*-main.c
**/*.pyc
*/*.pyc
blind/*
__pycache__
solver/allquads
solver/astrometry-engine
solver/augment-xylist
solver/build-astrometry-index
solver/control-program
solver/fits-guess-scale
solver/fitscopy
solver/fitsverify
...
...
@@ -25,6 +28,7 @@ solver/solve-field
solver/query-starkd
solver/tablist
solver/tabmerge
solver/unpermute-stars
solver/test.c
solver/wcs-grab
solver/job.axy
...
...
Changelog
View file @
8ebcaaa8
0.85:
One tiny bit of GPL v2-only code was replaced with a BSD equivalent.
The primary branch on Github has been changed to 'main'.
Minor: an-pnmtofits adds a CTYPE3='RGB' card for the Aladin image
viewer.
0.84:
Minor: change the python 'multiproc' module to handle >2GB pickles.
0.83:
Minor: re-add -K flag to build-astrometry-index to keep RA,Dec columns.
0.82:
Simplify os-features tests by always using our vendored qsort_r.
0.81:
All 'sextractor' command-line args renamed to 'source-extractor'.
...
...
LICENSE
View file @
8ebcaaa8
NOTE: Parts of the code written by the Astrometry.net Team are
licensed under the 3-clause BSD-style license below. HOWEVER, since
this code uses libraries licensed under the GNU GPL (including a
vendored GSL), the whole work must be distributed under the GPL
version 3 or later.
Copyright (c) 2006-2015, Astrometry.net Developers
All rights reserved.
...
...
Makefile
View file @
8ebcaaa8
...
...
@@ -222,7 +222,7 @@ config: util/os-features-config.h util/makefile.os-features
$(MAKE)
-C
util config
.PHONY
:
config
RELEASE_VER
:=
0.8
2
RELEASE_VER
:=
0.8
5
RELEASE_DIR
:=
astrometry.net-
$(RELEASE_VER)
RELEASE_RMDIRS
:=
net
...
...
@@ -237,7 +237,7 @@ release:
(
cd
$(RELEASE_DIR)
/plot
&&
swig
-python
-I
.
-I
../util
-I
../include/astrometry plotstuff.i
)
(
cd
$(RELEASE_DIR)
/sdss
&&
swig
-python
-I
.
cutils.i
)
cat
$(RELEASE_DIR)
/util/makefile.common |
sed
"s/AN_GIT_REVISION .=.*/AN_GIT_REVISION :=
$$
(git describe)/"
|
sed
"s/AN_GIT_DATE .=.*/AN_GIT_DATE :=
$$
(git log -n 1 --format=%cd | sed 's/ /_/g')/"
>
$(RELEASE_DIR)
/util/makefile.common.x
&&
mv
$(RELEASE_DIR)
/util/makefile.common.x
$(RELEASE_DIR)
/util/makefile.common
cat
$(RELEASE_DIR)
/Makefile |
sed
"s/RELEASE_VER := 0.8
2
cat
$(RELEASE_DIR)
/Makefile |
sed
"s/RELEASE_VER := 0.8
5
tar cf
$(RELEASE_DIR)
.tar
$(RELEASE_DIR)
gzip --best -c
$(RELEASE_DIR)
.tar >
$(RELEASE_DIR)
.tar.gz
bzip2 --best
$(RELEASE_DIR)
.tar
...
...
@@ -387,7 +387,8 @@ report:
@
echo
"FLAGS_DEF:
$(FLAGS_DEF)
"
@
echo
"CFLAGS_DEF:
$(CFLAGS_DEF)
"
@
echo
"LDFLAGS_DEF:
$(LDFLAGS_DEF)
"
-
python
-V
@
echo
"PYTHON:
$(PYTHON)
"
-
$(PYTHON)
-V
@
echo
"PYTHONPATH:
$
${PYTHONPATH}
"
@
echo
"PATH:
$
${PATH}
"
@
echo
"pkg-config --cflags cfitsio:"
...
...
README.md
View file @
8ebcaaa8
Astrometry.net
==============
[

](https://travis-ci.org/dstndstn/astrometry.net)
Travis:
[

](https://travis-ci.org/dstndstn/astrometry.net)
CircleCI:
[

](https://circleci.com/gh/dstndstn/astrometry.net)
[

](https://github.com/dstndstn/astrometry.net/tags)
[

](http://www.gnu.org/licenses/gpl-3.0.html)
...
...
@@ -31,8 +32,8 @@ Barron, Christopher Stumm, Michal Kočer (Klet Observatory) and others.
Parts of the code written by the Astrometry.net Team are licensed
under a 3-clause BSD-style license. See the file LICENSE for the full
license text. However, since this code uses libraries licensed under
the GNU GPL, the whole work
is
distributed under the GPL version
3 or
later.
the GNU GPL, the whole work
must be
distributed under the GPL version
3 or
later.
Code development happens at http://github.com/dstndstn/astrometry.net
...
...
__init__.py
View file @
8ebcaaa8
__version__
=
'0.8
1-13-g1d112038
'
__version__
=
'0.8
4-57-g73ae3793
'
doc/build.rst
View file @
8ebcaaa8
...
...
@@ -32,7 +32,7 @@ For full functionality, you will need:
* libjpeg
* libz
* bzip2
* python (
probably >= 2.4; 2.7 or
3.
6
preferred)
* python (3.
x
preferred)
* numpy
* swig (>= 2.0)
* fitsio https://github.com/esheldon/fitsio or astropy http://www.astropy.org/ or pyfits: http://www.stsci.edu/resources/software_hardware/pyfits (version >= 3.1)
...
...
@@ -58,6 +58,13 @@ For example, in Debian 9 (Stretch)::
python-pyfits python-dev zlib1g-dev \
libbz2-dev swig libcfitsio-dev
In Ubunutu 20.04::
$ sudo apt install build-essential curl git file pkg-config swig \
libcairo2-dev libnetpbm10-dev netpbm libpng-dev libjpeg-dev \
zlib1g-dev libbz2-dev libcfitsio-dev wcslib-dev \
python3 python3-pip python3-distutils python3-dev \
python3-numpy python3-scipy python3-pil
As of April 2019, the script doc/install_astrometry_on_linux.sh will install all dependencies along with astrometry.net on Linux, and download 4200/ index files.
...
...
include/astrometry/build-index.h
View file @
8ebcaaa8
...
...
@@ -28,6 +28,9 @@ struct index_params {
int
margin
;
int
UNside
;
// drop RA,Dec from the tagalong table?
anbool
drop_radec
;
// hpquads:
int
Nside
;
...
...
include/astrometry/healpix-utils.h
View file @
8ebcaaa8
...
...
@@ -10,7 +10,13 @@
/**
Returns healpixes that are / may be within range of the given point, resp.
*/
The non-approx versions take radius in *degrees*!
The approx vesions take radius in *unit-sphere distance*!
This makes no sense!
*/
il
*
healpix_rangesearch_xyz
(
const
double
*
xyz
,
double
radius
,
int
Nside
,
il
*
hps
);
il
*
healpix_rangesearch_xyz_approx
(
const
double
*
xyz
,
double
radius
,
int
Nside
,
il
*
hps
);
il
*
healpix_rangesearch_radec_approx
(
double
ra
,
double
dec
,
double
radius
,
int
Nside
,
il
*
hps
);
...
...
include/astrometry/plotgrid.h
View file @
8ebcaaa8
...
...
@@ -57,6 +57,11 @@ void plot_grid_add_label(plot_args_t* pargs, double ra, double dec,
int
plot_grid_find_ra_label_location
(
plot_args_t
*
pargs
,
double
ra
,
double
cdec
,
double
decmin
,
double
decmax
,
int
dirn
,
double
*
pdec
);
int
plot_grid_find_dec_label_location
(
plot_args_t
*
pargs
,
double
dec
,
double
cra
,
double
ramin
,
double
ramax
,
int
dirn
,
double
*
pra
);
// With the current "ralabelstep", how many labels will be added?
int
plot_grid_count_ra_labels
(
plot_args_t
*
pargs
);
// With the current "declabelstep", how many labels will be added?
int
plot_grid_count_dec_labels
(
plot_args_t
*
pargs
);
DECLARE_PLOTTER
(
grid
);
#endif
libkd/an-fls.h
View file @
8ebcaaa8
/**
This file includes code copied from three source files in the Linux kernel
v 2.6.23.1:
- include/asm-generic/bitops/fls.h
- include/asm-i386/bitops.h
- include/asm-x86_64/bitops.h
The second and third files contain this notice:
* Copyright 1992, Linus Torvalds.
And of course the kernel is distributed under the terms of the GPL v2.
/*-
* This file is derived from FreeBSD's sys/libkern/fls.c, with modifications
* by the Astrometry.net team.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef AN_FLS_H
...
...
@@ -17,125 +38,17 @@
#include
<stdint.h>
#include
<assert.h>
/**
* fls - find last (most-significant) bit set
*
* @x: the word to search
*
* This is defined the same way as ffs.
*
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
*/
static
inline
int
an_fls
(
int
x
);
/**
/*
* flsB() = fls() - 1.
*
* Note that x MUST be > 0.
*/
static
inline
uint8_t
an_flsB
(
uint32_t
x
);
/**** Below this line are the implementations for different CPUs. ****/
#if AN_I386
static
inline
int
an_fls
(
int
x
)
{
int
r
;
__asm__
(
"bsrl %1,%0
\n\t
"
"jnz 1f
\n\t
"
"movl $-1,%0
\n
"
"1:"
:
"=r"
(
r
)
:
"rm"
(
x
));
return
r
+
1
;
}
static
inline
uint8_t
an_flsB
(
uint32_t
x
)
{
int
r
;
assert
(
x
);
__asm__
(
"bsrl %1,%0
\n\t
"
"jnz 1f
\n\t
"
"movl $-1,%0
\n
"
"1:"
:
"=r"
(
r
)
:
"rm"
(
x
));
return
r
;
}
#elif AN_X86_64
static
__inline__
int
an_fls
(
int
x
)
{
int
r
;
__asm__
(
"bsrl %1,%0
\n\t
"
"cmovzl %2,%0"
:
"=&r"
(
r
)
:
"rm"
(
x
),
"rm"
(
-
1
));
return
r
+
1
;
}
static
inline
uint8_t
an_flsB
(
uint32_t
x
)
{
int
r
;
assert
(
x
);
__asm__
(
"bsrl %1,%0
\n\t
"
"cmovzl %2,%0"
:
"=&r"
(
r
)
:
"rm"
(
x
),
"rm"
(
-
1
));
return
r
;
}
#else
static
inline
int
an_fls
(
int
x
)
{
int
r
=
32
;
if
(
!
x
)
return
0
;
if
(
!
(
x
&
0xffff0000u
))
{
x
<<=
16
;
r
-=
16
;
}
if
(
!
(
x
&
0xff000000u
))
{
x
<<=
8
;
r
-=
8
;
}
if
(
!
(
x
&
0xf0000000u
))
{
x
<<=
4
;
r
-=
4
;
}
if
(
!
(
x
&
0xc0000000u
))
{
x
<<=
2
;
r
-=
2
;
}
if
(
!
(
x
&
0x80000000u
))
{
x
<<=
1
;
r
-=
1
;
}
return
r
;
}
static
inline
uint8_t
an_flsB
(
uint32_t
x
)
{
int
r
=
31
;
assert
(
x
);
if
(
!
(
x
&
0xffff0000u
))
{
x
<<=
16
;
r
-=
16
;
}
if
(
!
(
x
&
0xff000000u
))
{
x
<<=
8
;
r
-=
8
;
}
if
(
!
(
x
&
0xf0000000u
))
{
x
<<=
4
;
r
-=
4
;
}
if
(
!
(
x
&
0xc0000000u
))
{
x
<<=
2
;
r
-=
2
;
}
if
(
!
(
x
&
0x80000000u
))
{
x
<<=
1
;
r
-=
1
;
}
return
r
;
assert
(
x
>
0
);
uint8_t
bit
;
for
(
bit
=
0
;
x
!=
1
;
bit
++
)
x
=
x
>>
1
;
return
bit
;
}
#endif
#endif
libkd/test_libkd.c
View file @
8ebcaaa8
...
...
@@ -242,10 +242,7 @@ void test_2(CuTest* ct) {
for
(
i
=
0
;
i
<
N
;
i
++
)
{
int
L1
=
node_level
(
i
);
int
L2
=
an_fls
(
i
+
1
)
-
1
;
int
L3
=
an_flsB
(
i
+
1
);
//printf("%i %i %i\n", L1, L2, L3);
CuAssertIntEquals
(
ct
,
L1
,
L2
);
CuAssertIntEquals
(
ct
,
L1
,
L3
);
}
}
...
...
plot/plotgrid.c
View file @
8ebcaaa8
...
...
@@ -24,7 +24,7 @@ void* plot_grid_init(plot_args_t* plotargs) {
plotgrid_t
*
args
=
calloc
(
1
,
sizeof
(
plotgrid_t
));
args
->
dolabel
=
TRUE
;
args
->
raformat
=
strdup
(
"%.2f"
);
args
->
decformat
=
strdup
(
"%.2f"
);
args
->
decformat
=
strdup
(
"%
+
.2f"
);
return
args
;
}
...
...
@@ -219,10 +219,17 @@ int plot_grid_find_ra_label_location(plot_args_t* pargs, double ra, double cdec,
static
int
do_radec_labels
(
plot_args_t
*
pargs
,
plotgrid_t
*
args
,
double
ramin
,
double
ramax
,
double
decmin
,
double
decmax
)
{
double
decmin
,
double
decmax
,
anbool
doplot
,
int
*
count_ra
,
int
*
count_dec
)
{
double
cra
,
cdec
;
double
ra
,
dec
;
if
(
count_ra
)
*
count_ra
=
0
;
if
(
count_dec
)
*
count_dec
=
0
;
args
->
dolabel
=
(
args
->
ralabelstep
>
0
)
||
(
args
->
declabelstep
>
0
);
if
(
!
args
->
dolabel
)
return
0
;
...
...
@@ -257,8 +264,11 @@ static int do_radec_labels(plot_args_t* pargs, plotgrid_t* args,
lra
+=
360
;
if
(
lra
>=
360
)
lra
-=
360
;
//logmsg("Label \"%s\" at (%g,%g)\n", label, ra, dec);
plot_grid_add_label
(
pargs
,
ra
,
dec
,
lra
,
args
->
raformat
);
if
(
count_ra
)
(
*
count_ra
)
++
;
if
(
doplot
)
plot_grid_add_label
(
pargs
,
ra
,
dec
,
lra
,
args
->
raformat
);
}
}
if
(
args
->
declabelstep
>
0
)
{
...
...
@@ -274,13 +284,40 @@ static int do_radec_labels(plot_args_t* pargs, plotgrid_t* args,
if
(
plot_grid_find_dec_label_location
(
pargs
,
dec
,
cra
,
ramin
,
ramax
,
args
->
declabeldir
,
&
ra
))
continue
;
//logmsg("Label Dec=\"%s\" at (%g,%g)\n", label, ra, dec);
plot_grid_add_label
(
pargs
,
ra
,
dec
,
dec
,
args
->
decformat
);
if
(
count_dec
)
(
*
count_dec
)
++
;
if
(
doplot
)
plot_grid_add_label
(
pargs
,
ra
,
dec
,
dec
,
args
->
decformat
);
}
}
return
1
;
}
// With the current "ralabelstep", how many labels will be added?
int
plot_grid_count_ra_labels
(
plot_args_t
*
pargs
)
{
plotgrid_t
*
grid
=
plot_grid_get
(
pargs
);
int
count
;
double
ramin
,
ramax
,
decmin
,
decmax
;
if
(
!
pargs
->
wcs
)
return
-
1
;
// Find image bounds in RA,Dec...
plotstuff_get_radec_bounds
(
pargs
,
50
,
&
ramin
,
&
ramax
,
&
decmin
,
&
decmax
);
do_radec_labels
(
pargs
,
grid
,
ramin
,
ramax
,
decmin
,
decmax
,
FALSE
,
&
count
,
NULL
);
return
count
;
}
// With the current "declabelstep", how many labels will be added?
int
plot_grid_count_dec_labels
(
plot_args_t
*
pargs
)
{
plotgrid_t
*
grid
=
plot_grid_get
(
pargs
);
int
count
;
double
ramin
,
ramax
,
decmin
,
decmax
;
if
(
!
pargs
->
wcs
)
return
-
1
;
// Find image bounds in RA,Dec...
plotstuff_get_radec_bounds
(
pargs
,
50
,
&
ramin
,
&
ramax
,
&
decmin
,
&
decmax
);
do_radec_labels
(
pargs
,
grid
,
ramin
,
ramax
,
decmin
,
decmax
,
FALSE
,
NULL
,
&
count
);
return
count
;
}
void
plot_grid_add_label
(
plot_args_t
*
pargs
,
double
ra
,
double
dec
,
double
lval
,
const
char
*
format
)
{
char
label
[
32
];
...
...
@@ -342,7 +379,8 @@ int plot_grid_plot(const char* command,
}
}
if
(
do_radec_labels
(
pargs
,
args
,
ramin
,
ramax
,
decmin
,
decmax
))
{
if
(
do_radec_labels
(
pargs
,
args
,
ramin
,
ramax
,
decmin
,
decmax
,
TRUE
,
NULL
,
NULL
))
{
plotstuff_plot_stack
(
pargs
,
cairo
);
}
return
0
;
...
...
plot/plotstuff.i
View file @
8ebcaaa8
...
...
@@ -375,6 +375,13 @@ typedef enum cairo_op cairo_operator_t;
return
plotstuff_set_size_wcs
(
self
)
;
}
int
count_ra_labels
()
{
return
plot_grid_count_ra_labels
(
self
)
;
}
int
count_dec_labels
()
{
return
plot_grid_count_dec_labels
(
self
)
;
}
void
loginit
(
int
level
)
{
log_init
(
level
)
;
}
...
...
@@ -425,6 +432,18 @@ typedef enum cairo_op cairo_operator_t;
plotoutline_args
.
__setattr__
=
plotoutline_setattr
%
}
%
extend
plotxy_args
{
void
set_filename
(
const
char
*
fn
)
{
plot_xy_set_filename
(
self
,
fn
)
;
}
}
%
extend
plotradec_args
{
void
set_filename
(
const
char
*
fn
)
{
plot_radec_set_filename
(
self
,
fn
)
;
}
}
%
extend
plotimage_args
{
int
_set_image_from_numpy
(
PyObject
*
arr
)
{
// Pirate array
...
...
plot/plotstuff_c.py
View file @
8ebcaaa8
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.
1
# Version 4.0.
2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
...
...
@@ -123,6 +123,12 @@ class plot_args(object):
def
set_size_from_wcs
(
self
):
return
_plotstuff_c
.
plot_args_set_size_from_wcs
(
self
)
def
count_ra_labels
(
self
):
return
_plotstuff_c
.
plot_args_count_ra_labels
(
self
)
def
count_dec_labels
(
self
):
return
_plotstuff_c
.
plot_args_count_dec_labels
(
self
)
def
loginit
(
self
,
level
):
return
_plotstuff_c
.
plot_args_loginit
(
self
,
level
)
...
...
@@ -726,6 +732,12 @@ def plot_grid_find_ra_label_location(pargs, ra, cdec, decmin, decmax, dirn):
def
plot_grid_find_dec_label_location
(
pargs
,
dec
,
cra
,
ramin
,
ramax
,
dirn
):
return
_plotstuff_c
.
plot_grid_find_dec_label_location
(
pargs
,
dec
,
cra
,
ramin
,
ramax
,
dirn
)
def
plot_grid_count_ra_labels
(
pargs
):
return
_plotstuff_c
.
plot_grid_count_ra_labels
(
pargs
)
def
plot_grid_count_dec_labels
(
pargs
):
return
_plotstuff_c
.
plot_grid_count_dec_labels
(
pargs
)
def
plot_grid_describe
(
p
):
return
_plotstuff_c
.
plot_grid_describe
(
p
)
class
plotindex_args
(
object
):
...
...
@@ -792,6 +804,9 @@ class plotxy_args(object):
xyvals
=
property
(
_plotstuff_c
.
plotxy_args_xyvals_get
,
_plotstuff_c
.
plotxy_args_xyvals_set
)
wcs
=
property
(
_plotstuff_c
.
plotxy_args_wcs_get
,
_plotstuff_c
.
plotxy_args_wcs_set
)
def
set_filename
(
self
,
fn
):
return
_plotstuff_c
.
plotxy_args_set_filename
(
self
,
fn
)
def
__init__
(
self
):
_plotstuff_c
.
plotxy_args_swiginit
(
self
,
_plotstuff_c
.
new_plotxy_args
())
__swig_destroy__
=
_plotstuff_c
.
delete_plotxy_args
...
...
@@ -852,6 +867,9 @@ class plotradec_args(object):
nobjs
=
property
(
_plotstuff_c
.
plotradec_args_nobjs_get
,
_plotstuff_c
.
plotradec_args_nobjs_set
)
radecvals
=
property
(
_plotstuff_c
.
plotradec_args_radecvals_get
,
_plotstuff_c
.
plotradec_args_radecvals_set
)
def
set_filename
(
self
,
fn
):
return
_plotstuff_c
.
plotradec_args_set_filename
(
self
,
fn
)
def
__init__
(
self
):
_plotstuff_c
.
plotradec_args_swiginit
(
self
,
_plotstuff_c
.
new_plotradec_args
())
__swig_destroy__
=
_plotstuff_c
.
delete_plotradec_args
...
...
plot/plotstuff_wrap.c
View file @
8ebcaaa8
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.
1
* Version 4.0.
2
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
...
...
@@ -784,15 +784,19 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject *str)
{
#if PY_VERSION_HEX >= 0x03000000
#if PY_VERSION_HEX >= 0x03030000
return (char *)PyUnicode_AsUTF8(str);
#elif PY_VERSION_HEX >= 0x03000000
char *newstr = 0;
str = PyUnicode_AsUTF8String(str);
if (str) {
char *cstr;
Py_ssize_t len;
PyBytes_AsStringAndSize(str, &cstr, &len);
newstr = (char *) malloc(len+1);
memcpy(newstr, cstr, len+1);
if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
newstr = (char *) malloc(len+1);
if (newstr)
memcpy(newstr, cstr, len+1);
}
Py_XDECREF(str);
}
return newstr;
...
...
@@ -801,10 +805,10 @@ SWIG_Python_str_AsChar(PyObject *str)
#endif
}
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_Python_str_DelForPy3(x)
free( (void*) (x) )
#if PY_VERSION_HEX >=
0x03030000 || PY_VERSION_HEX <
0x03000000
# define SWIG_Python_str_DelForPy3(x)
#else
# define SWIG_Python_str_DelForPy3(x)
# define SWIG_Python_str_DelForPy3(x)
free( (void*) (x) )
#endif
...
...
@@ -1219,6 +1223,19 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
}
}
SWIGINTERN int
SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
int no_kwargs = 1;
if (kwargs) {
assert(PyDict_Check(kwargs));
if (PyDict_Size(kwargs) > 0) {
PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
no_kwargs = 0;
}
}
return no_kwargs;
}
/* A functor is a function object with one single object argument */
#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
...
...
@@ -1732,6 +1749,12 @@ SwigPyObject_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x03040000
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
0, /* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
0, /* tp_print */
#endif
#ifdef COUNT_ALLOCS
0, /* tp_allocs */
0, /* tp_frees */
...
...
@@ -1893,6 +1916,12 @@ SwigPyPacked_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x03040000
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
0, /* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
0, /* tp_print */
#endif
#ifdef COUNT_ALLOCS
0, /* tp_allocs */
0, /* tp_frees */
...
...
@@ -2219,8 +2248,10 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
}
}
#else
PyObject *key = SWIG_This();
PyObject_SetAttr(inst, key, swig_this);
if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
Py_DECREF(inst);
inst = 0;
}
#endif
}
} else {
...
...
@@ -2232,8 +2263,12 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
Py_DECREF(empty_kwargs);
if (inst) {
PyObject_SetAttr(inst, SWIG_This(), swig_this);
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
Py_DECREF(inst);
inst = 0;
} else {
Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
}
}
}
Py_DECREF(empty_args);
...
...
@@ -2250,25 +2285,21 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
return inst;
}
SWIGRUNTIME
void
SWIGRUNTIME
int
SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
{
PyObject *dict;
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
PyObject **dictptr = _PyObject_GetDictPtr(inst);
if (dictptr != NULL) {
dict = *dictptr;
if (dict == NULL) {
dict = PyDict_New();
*dictptr = dict;
}
PyDict_SetItem(dict, SWIG_This(), swig_this);
return;
}
PyObject **dictptr = _PyObject_GetDictPtr(inst);
if (dictptr != NULL) {
PyObject *dict = *dictptr;
if (dict == NULL) {
dict = PyDict_New();
*dictptr = dict;
}
return PyDict_SetItem(dict, SWIG_This(), swig_this);
}
#endif
dict = PyObject_GetAttrString(inst, "__dict__");
PyDict_SetItem(dict, SWIG_This(), swig_this);
Py_DECREF(dict);
return PyObject_SetAttr(inst, SWIG_This(), swig_this);
}
...
...
@@ -2282,7 +2313,8 @@ SWIG_Python_InitShadowInstance(PyObject *args) {
if (sthis) {
SwigPyObject_append((PyObject*) sthis, obj[1]);
} else {
SWIG_Python_SetSwigThis(obj[0], obj[1]);
if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
return NULL;
}
return SWIG_Py_Void();
}
...
...
@@ -2701,7 +2733,7 @@ static swig_module_info swig_module = {swig_types, 44, 0, 0, 0, 0};
#endif
#define SWIG_name "_plotstuff_c"
#define SWIGVERSION 0x04000
1
#define SWIGVERSION 0x04000
2
#define SWIG_VERSION SWIGVERSION
...
...
@@ -2945,9 +2977,11 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
if (alloc)
*alloc = SWIG_NEWOBJ;
#endif
PyBytes_AsStringAndSize(obj, &cstr, &len);
if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
return SWIG_TypeError;
#else
PyString_AsStringAndSize(obj, &cstr, &len);
if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
return SWIG_TypeError;
#endif
if (cptr) {
if (alloc) {
...
...
@@ -3268,6 +3302,12 @@ SWIGINTERN int plot_args_set_wcs_file(struct plot_args *self,char const *fn,int
SWIGINTERN int plot_args_set_size_from_wcs(struct plot_args *self){
return plotstuff_set_size_wcs(self);
}
SWIGINTERN int plot_args_count_ra_labels(struct plot_args *self){
return plot_grid_count_ra_labels(self);
}
SWIGINTERN int plot_args_count_dec_labels(struct plot_args *self){
return plot_grid_count_dec_labels(self);
}
SWIGINTERN void plot_args_loginit(struct plot_args *self,int level){
log_init(level);
}
...
...
@@ -3465,6 +3505,12 @@ SWIGINTERN int plotgrid_args_set_formats(struct plotgrid_args *self,char const *
SWIGINTERN int plotindex_args_add_file(struct plotindex_args *self,char const *fn){
return plot_index_add_file(self, fn);
}
SWIGINTERN void plotxy_args_set_filename(struct plotxy_args *self,char const *fn){
plot_xy_set_filename(self, fn);
}
SWIGINTERN void plotradec_args_set_filename(struct plotradec_args *self,char const *fn){
plot_radec_set_filename(self, fn);
}
SWIGINTERN void annotation_args_add_target(struct annotation_args *self,double ra,double dec,char const *name){
plot_annotations_add_target(self, ra, dec, name);
}
...
...
@@ -5427,6 +5473,52 @@ fail:
}
SWIGINTERN PyObject *_wrap_plot_args_count_ra_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plot_args *arg1 = (struct plot_args *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
int result;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_plot_args, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "plot_args_count_ra_labels" "', argument " "1"" of type '" "struct plot_args *""'");
}
arg1 = (struct plot_args *)(argp1);
result = (int)plot_args_count_ra_labels(arg1);
resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_plot_args_count_dec_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plot_args *arg1 = (struct plot_args *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
int result;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_plot_args, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "plot_args_count_dec_labels" "', argument " "1"" of type '" "struct plot_args *""'");
}
arg1 = (struct plot_args *)(argp1);
result = (int)plot_args_count_dec_labels(arg1);
resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_plot_args_loginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plot_args *arg1 = (struct plot_args *) 0 ;
...
...
@@ -14037,6 +14129,52 @@ fail:
}
SWIGINTERN PyObject *_wrap_plot_grid_count_ra_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
plot_args_t *arg1 = (plot_args_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
int result;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_plot_args, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "plot_grid_count_ra_labels" "', argument " "1"" of type '" "plot_args_t *""'");
}
arg1 = (plot_args_t *)(argp1);
result = (int)plot_grid_count_ra_labels(arg1);
resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_plot_grid_count_dec_labels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
plot_args_t *arg1 = (plot_args_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
int result;
if (!args) SWIG_fail;
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_plot_args, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "plot_grid_count_dec_labels" "', argument " "1"" of type '" "plot_args_t *""'");
}
arg1 = (plot_args_t *)(argp1);
result = (int)plot_grid_count_dec_labels(arg1);
resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_plot_grid_describe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
plotter_t *arg1 = (plotter_t *) 0 ;
...
...
@@ -15353,6 +15491,38 @@ fail:
}
SWIGINTERN PyObject *_wrap_plotxy_args_set_filename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plotxy_args *arg1 = (struct plotxy_args *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
PyObject *swig_obj[2] ;
if (!SWIG_Python_UnpackTuple(args, "plotxy_args_set_filename", 2, 2, swig_obj)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_plotxy_args, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "plotxy_args_set_filename" "', argument " "1"" of type '" "struct plotxy_args *""'");
}
arg1 = (struct plotxy_args *)(argp1);
res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "plotxy_args_set_filename" "', argument " "2"" of type '" "char const *""'");
}
arg2 = (char *)(buf2);
plotxy_args_set_filename(arg1,(char const *)arg2);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return NULL;
}
SWIGINTERN PyObject *_wrap_new_plotxy_args(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plotxy_args *result = 0 ;
...
...
@@ -16246,6 +16416,38 @@ fail:
}
SWIGINTERN PyObject *_wrap_plotradec_args_set_filename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plotradec_args *arg1 = (struct plotradec_args *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
PyObject *swig_obj[2] ;
if (!SWIG_Python_UnpackTuple(args, "plotradec_args_set_filename", 2, 2, swig_obj)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_plotradec_args, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "plotradec_args_set_filename" "', argument " "1"" of type '" "struct plotradec_args *""'");
}
arg1 = (struct plotradec_args *)(argp1);
res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "plotradec_args_set_filename" "', argument " "2"" of type '" "char const *""'");
}
arg2 = (char *)(buf2);
plotradec_args_set_filename(arg1,(char const *)arg2);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return NULL;
}
SWIGINTERN PyObject *_wrap_new_plotradec_args(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
struct plotradec_args *result = 0 ;
...
...
@@ -18890,6 +19092,8 @@ static PyMethodDef SwigMethods[] = {
{ "plot_args_set_image_from_numpy", _wrap_plot_args_set_image_from_numpy, METH_VARARGS, NULL},
{ "plot_args_set_wcs_file", _wrap_plot_args_set_wcs_file, METH_VARARGS, NULL},
{ "plot_args_set_size_from_wcs", _wrap_plot_args_set_size_from_wcs, METH_O, NULL},
{ "plot_args_count_ra_labels", _wrap_plot_args_count_ra_labels, METH_O, NULL},
{ "plot_args_count_dec_labels", _wrap_plot_args_count_dec_labels, METH_O, NULL},
{ "plot_args_loginit", _wrap_plot_args_loginit, METH_VARARGS, NULL},
{ "new_plot_args", _wrap_new_plot_args, METH_NOARGS, NULL},
{ "delete_plot_args", _wrap_delete_plot_args, METH_O, NULL},
...
...
@@ -19170,6 +19374,8 @@ static PyMethodDef SwigMethods[] = {
{ "plot_grid_add_label", _wrap_plot_grid_add_label, METH_VARARGS, NULL},
{ "plot_grid_find_ra_label_location", _wrap_plot_grid_find_ra_label_location, METH_VARARGS, NULL},
{ "plot_grid_find_dec_label_location", _wrap_plot_grid_find_dec_label_location, METH_VARARGS, NULL},
{ "plot_grid_count_ra_labels", _wrap_plot_grid_count_ra_labels, METH_O, NULL},
{ "plot_grid_count_dec_labels", _wrap_plot_grid_count_dec_labels, METH_O, NULL},
{ "plot_grid_describe", _wrap_plot_grid_describe, METH_O, NULL},
{ "plotindex_args_indexes_set", _wrap_plotindex_args_indexes_set, METH_VARARGS, NULL},
{ "plotindex_args_indexes_get", _wrap_plotindex_args_indexes_get, METH_O, NULL},
...
...
@@ -19218,6 +19424,7 @@ static PyMethodDef SwigMethods[] = {
{ "plotxy_args_xyvals_get", _wrap_plotxy_args_xyvals_get, METH_O, NULL},
{ "plotxy_args_wcs_set", _wrap_plotxy_args_wcs_set, METH_VARARGS, NULL},
{ "plotxy_args_wcs_get", _wrap_plotxy_args_wcs_get, METH_O, NULL},
{ "plotxy_args_set_filename", _wrap_plotxy_args_set_filename, METH_VARARGS, NULL},
{ "new_plotxy_args", _wrap_new_plotxy_args, METH_NOARGS, NULL},
{ "delete_plotxy_args", _wrap_delete_plotxy_args, METH_O, NULL},
{ "plotxy_args_swigregister", plotxy_args_swigregister, METH_O, NULL},
...
...
@@ -19250,6 +19457,7 @@ static PyMethodDef SwigMethods[] = {
{ "plotradec_args_nobjs_get", _wrap_plotradec_args_nobjs_get, METH_O, NULL},
{ "plotradec_args_radecvals_set", _wrap_plotradec_args_radecvals_set, METH_VARARGS, NULL},
{ "plotradec_args_radecvals_get", _wrap_plotradec_args_radecvals_get, METH_O, NULL},
{ "plotradec_args_set_filename", _wrap_plotradec_args_set_filename, METH_VARARGS, NULL},
{ "new_plotradec_args", _wrap_new_plotradec_args, METH_NOARGS, NULL},
{ "delete_plotradec_args", _wrap_delete_plotradec_args, METH_O, NULL},
{ "plotradec_args_swigregister", plotradec_args_swigregister, METH_O, NULL},
...
...
@@ -19942,6 +20150,12 @@ extern "C" {
#if PY_VERSION_HEX >= 0x03040000
0, /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
0, /* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
0, /* tp_print */
#endif
#ifdef COUNT_ALLOCS
0, /* tp_allocs */
0, /* tp_frees */
...
...
sdss/Makefile
View file @
8ebcaaa8
...
...
@@ -25,7 +25,7 @@ _cutils$(PYTHON_SO_EXT) cutils.py: cutils.i
INSTALL_PY
:=
__init__.py common.py cutout.py dr7.py dr8.py runList-dr8.par
\
dr9.py fields.py cutout.py runList-dr9.par dr10.py runList-dr10.par
\
sdss_das.py sdss_name.py yanny.py
sdss_das.py sdss_name.py yanny.py
casjobs.py
INSTALL_LIB
:=
cutils.py _cutils
$(PYTHON_SO_EXT)
...
...
sdss/cutils.py
View file @
8ebcaaa8
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.
1
# Version 4.0.
2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
...
...
sdss/cutils_wrap.c
View file @
8ebcaaa8
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 4.0.
1
* Version 4.0.
2
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
...
...
@@ -784,15 +784,19 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
SWIGINTERN
char
*
SWIG_Python_str_AsChar
(
PyObject
*
str
)
{
#if PY_VERSION_HEX >= 0x03000000
#if PY_VERSION_HEX >= 0x03030000
return
(
char
*
)
PyUnicode_AsUTF8
(
str
);
#elif PY_VERSION_HEX >= 0x03000000
char
*
newstr
=
0
;
str
=
PyUnicode_AsUTF8String
(
str
);
if
(
str
)
{
char
*
cstr
;
Py_ssize_t
len
;
PyBytes_AsStringAndSize
(
str
,
&
cstr
,
&
len
);
newstr
=
(
char
*
)
malloc
(
len
+
1
);
memcpy
(
newstr
,
cstr
,
len
+
1
);
if
(
PyBytes_AsStringAndSize
(
str
,
&
cstr
,
&
len
)
!=
-
1
)
{
newstr
=
(
char
*
)
malloc
(
len
+
1
);
if
(
newstr
)
memcpy
(
newstr
,
cstr
,
len
+
1
);
}
Py_XDECREF
(
str
);
}
return
newstr
;
...
...
@@ -801,10 +805,10 @@ SWIG_Python_str_AsChar(PyObject *str)
#endif
}
#if PY_VERSION_HEX >= 0x03000000
# define SWIG_Python_str_DelForPy3(x)
free( (void*) (x) )
#if PY_VERSION_HEX >=
0x03030000 || PY_VERSION_HEX <
0x03000000
# define SWIG_Python_str_DelForPy3(x)
#else
# define SWIG_Python_str_DelForPy3(x)
# define SWIG_Python_str_DelForPy3(x)
free( (void*) (x) )
#endif
...
...
@@ -1219,6 +1223,19 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
}
}
SWIGINTERN
int
SWIG_Python_CheckNoKeywords
(
PyObject
*
kwargs
,
const
char
*
name
)
{
int
no_kwargs
=
1
;
if
(
kwargs
)
{
assert
(
PyDict_Check
(
kwargs
));
if
(
PyDict_Size
(
kwargs
)
>
0
)
{
PyErr_Format
(
PyExc_TypeError
,
"%s() does not take keyword arguments"
,
name
);
no_kwargs
=
0
;
}
}
return
no_kwargs
;
}
/* A functor is a function object with one single object argument */
#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
...
...
@@ -1732,6 +1749,12 @@ SwigPyObject_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x03040000
0
,
/* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
0
,
/* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
0
,
/* tp_print */
#endif
#ifdef COUNT_ALLOCS
0
,
/* tp_allocs */
0
,
/* tp_frees */
...
...
@@ -1893,6 +1916,12 @@ SwigPyPacked_TypeOnce(void) {
#if PY_VERSION_HEX >= 0x03040000
0
,
/* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
0
,
/* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
0
,
/* tp_print */
#endif
#ifdef COUNT_ALLOCS
0
,
/* tp_allocs */
0
,
/* tp_frees */
...
...
@@ -2219,8 +2248,10 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
}
}
#else
PyObject
*
key
=
SWIG_This
();
PyObject_SetAttr
(
inst
,
key
,
swig_this
);
if
(
PyObject_SetAttr
(
inst
,
SWIG_This
(),
swig_this
)
==
-
1
)
{
Py_DECREF
(
inst
);
inst
=
0
;
}
#endif
}
}
else
{
...
...
@@ -2232,8 +2263,12 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
inst
=
((
PyTypeObject
*
)
data
->
newargs
)
->
tp_new
((
PyTypeObject
*
)
data
->
newargs
,
empty_args
,
empty_kwargs
);
Py_DECREF
(
empty_kwargs
);
if
(
inst
)
{
PyObject_SetAttr
(
inst
,
SWIG_This
(),
swig_this
);
Py_TYPE
(
inst
)
->
tp_flags
&=
~
Py_TPFLAGS_VALID_VERSION_TAG
;
if
(
PyObject_SetAttr
(
inst
,
SWIG_This
(),
swig_this
)
==
-
1
)
{
Py_DECREF
(
inst
);
inst
=
0
;
}
else
{
Py_TYPE
(
inst
)
->
tp_flags
&=
~
Py_TPFLAGS_VALID_VERSION_TAG
;
}
}
}
Py_DECREF
(
empty_args
);
...
...
@@ -2250,25 +2285,21 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
return
inst
;
}
SWIGRUNTIME
void
SWIGRUNTIME
int
SWIG_Python_SetSwigThis
(
PyObject
*
inst
,
PyObject
*
swig_this
)
{
PyObject
*
dict
;
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
PyObject
**
dictptr
=
_PyObject_GetDictPtr
(
inst
);
if
(
dictptr
!=
NULL
)
{
dict
=
*
dictptr
;
if
(
dict
==
NULL
)
{
dict
=
PyDict_New
();
*
dictptr
=
dict
;
}
PyDict_SetItem
(
dict
,
SWIG_This
(),
swig_this
);
return
;
}
PyObject
**
dictptr
=
_PyObject_GetDictPtr
(
inst
);
if
(
dictptr
!=
NULL
)
{
PyObject
*
dict
=
*
dictptr
;
if
(
dict
==
NULL
)
{
dict
=
PyDict_New
();
*
dictptr
=
dict
;
}
return
PyDict_SetItem
(
dict
,
SWIG_This
(),
swig_this
);
}
#endif
dict
=
PyObject_GetAttrString
(
inst
,
"__dict__"
);
PyDict_SetItem
(
dict
,
SWIG_This
(),
swig_this
);
Py_DECREF
(
dict
);
return
PyObject_SetAttr
(
inst
,
SWIG_This
(),
swig_this
);
}
...
...
@@ -2282,7 +2313,8 @@ SWIG_Python_InitShadowInstance(PyObject *args) {
if
(
sthis
)
{
SwigPyObject_append
((
PyObject
*
)
sthis
,
obj
[
1
]);
}
else
{
SWIG_Python_SetSwigThis
(
obj
[
0
],
obj
[
1
]);
if
(
SWIG_Python_SetSwigThis
(
obj
[
0
],
obj
[
1
])
!=
0
)
return
NULL
;
}
return
SWIG_Py_Void
();
}
...
...
@@ -2658,7 +2690,7 @@ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
#endif
#define SWIG_name "_cutils"
#define SWIGVERSION 0x04000
1
#define SWIGVERSION 0x04000
2
#define SWIG_VERSION SWIGVERSION
...
...
@@ -3646,6 +3678,12 @@ extern "C" {
#if PY_VERSION_HEX >= 0x03040000
0
,
/* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
0
,
/* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
0
,
/* tp_print */
#endif
#ifdef COUNT_ALLOCS
0
,
/* tp_allocs */
0
,
/* tp_frees */
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment