Commit bec92293 authored by Ole Streicher's avatar Ole Streicher
Browse files

New upstream version 0.91+dfsg

parent 61c8e2b4
......@@ -5,8 +5,6 @@ jobs:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
#docker:
# - image: ubuntu:20.04
steps:
- run:
name: CPU info
......@@ -55,7 +53,54 @@ jobs:
solve-field --config demo/cfg demo/apod5.jpg --continue --no-tweak --objs 60
listhead demo/apod5.wcs
build-docker-ubuntu-22-py310:
docker:
- image: ubuntu:22.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.10-dev libpython3.10-dev ca-certificates
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends python3-pip
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: |
export PYTHON=python3.10
make
make py
make extra
make test
- run:
name: Tests
command: |
export PYTHON=python3.10
(cd util && ./test)
(cd libkd && ./test)
(cd solver && ./test)
(cd plot && ./test)
make install INSTALL_DIR=~/an PYTHON_SCRIPT="/usr/bin/env python3.10"
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))")
solve-field --config demo/cfg demo/apod5.jpg --continue --no-tweak --objs 60
listhead demo/apod5.wcs
build-docker-ubuntu-20-py39:
docker:
......@@ -210,11 +255,125 @@ jobs:
solve-field --config demo/cfg demo/apod5.jpg --continue --no-tweak --objs 60
listhead demo/apod5.wcs
build-docker-centos-7:
docker:
- image: centos:7
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
yum -y install dnf
dnf -y install dnf-plugins-core
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install epel-release
dnf install -y 'dnf-command(config-manager)'
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
solve-field --config demo/cfg demo/apod5.jpg --continue --no-tweak --objs 60
listhead demo/apod5.wcs
build-docker-rocky-85:
docker:
- image: rockylinux:8.5
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 python3-devel
yum -y install gsl-devel cairo-devel libpng-devel libjpeg-turbo-devel zlib-devel bzip2-devel swig
yum -y install netpbm netpbm-progs
yum -y install bzip2
dnf -y install dnf-plugins-core
dnf -y install epel-release
dnf config-manager --set-enabled powertools
dnf -y update
yum -y install netpbm-devel cfitsio-devel 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: |
export NETPBM_INC=-I/usr/include/netpbm
export 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
solve-field --config demo/cfg demo/apod5.jpg --continue --no-tweak --objs 60
listhead demo/apod5.wcs
workflows:
version: 2
build:
jobs:
- "build-docker-ubuntu-22-py310"
- "build-docker-ubuntu-20-py39"
- "build-docker-ubuntu-18"
- "build-docker-centos-8"
- "build-docker-centos-7"
- "build-docker-rocky-85"
- "build-arm-docker-ubuntu-20-py39"
......@@ -222,7 +222,7 @@ config: util/os-features-config.h util/makefile.os-features
$(MAKE) -C util config
.PHONY: config
RELEASE_VER := 0.89
RELEASE_VER := 0.91
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.89
cat $(RELEASE_DIR)/Makefile | sed "s/RELEASE_VER := 0.91
tar cf $(RELEASE_DIR).tar $(RELEASE_DIR)
gzip --best -c $(RELEASE_DIR).tar > $(RELEASE_DIR).tar.gz
bzip2 --best $(RELEASE_DIR).tar
......@@ -352,9 +352,7 @@ clean:
$(MAKE) -C util clean
$(MAKE) -C catalogs clean
-$(MAKE) -C qfits-an clean
-rm __init__.pyc
$(MAKE) -C gsl-an clean
-rm gsl-an/config.h
-rm -f __init__.pyc
$(MAKE) -C libkd clean
$(MAKE) -C solver clean
$(MAKE) -C sdss clean
......
__version__ = '0.88'
__version__ = '0.90-55-gf82142b7'
......@@ -195,7 +195,7 @@ tests: $(ALL_TEST_FILES)
.PHONY: tests
clean:
rm -f $(LIBCAT) $(OBJS) $(ALL_OBJ) $(DEPS) *.dep deps \
rm -f $(LIBCAT) $(OBJS) $(ALL_OBJ) $(DEPS) $(PROGS) *.dep deps \
grab-stellarium-constellations \
openngc-entries.csv openngc-names.csv \
openngc-entries.c openngc-names.c \
......
......@@ -5,7 +5,10 @@
NR==1 { next }
{
# skip entries that are neither NGC not IC
if ($1 !~ /^(IC|NGC)[0-9]*$/) next;
# skip "Dup" entries such as NGC4443.
if ($2 ~ /Dup/) next;
# Is it part of NGC or IC?
isngc = ($1 ~ /^NGC/);
......
......@@ -9,7 +9,10 @@ function printName(name) {
NR==1 { next }
{
# skip entries that are neither NGC not IC
if ($1 !~ /^(IC|NGC)[0-9]*$/) next;
# skip "Dup" entries such as NGC4443.
if ($2 ~ /Dup/) next;
# Is it part of NGC or IC?
isngc = ($1 ~ /^NGC/);
......
......@@ -7,7 +7,8 @@
#include <stdio.h>
#include <assert.h>
#include "tycho2.h"
#include "astrometry/tycho2.h"
#include "astrometry/starutil.h"
static void grab_substring(char* dst, const char* src, int n) {
memset(dst, 0, n+1);
......
......@@ -36,8 +36,9 @@ static void add_columns(fitstable_t* tab, anbool write, anbool full) {
tfits_type i64 = fitscolumn_i64_type();
char* nil = " ";
if (full)
if (full) {
ADDCOL(i64, i64, "ID", nil, srcid);
}
ADDCOL(d, d, "RA", "deg", ra);
ADDCOL(d, d, "DEC", "deg", dec);
......
......@@ -51,7 +51,6 @@ static uint8_t grab_u8(void** v) {
int ucac5_parse_entry(ucac5_entry* entry, const void* encoded, float epoch) {
//const uint32_t* udata = encoded;
uint32_t uval;
void* buf = (void*)encoded;
// RESIST THE URGE TO RE-ORDER THESE, bonehead!
......
......@@ -168,7 +168,8 @@ int main(int argc, char** args) {
hplist = il_new(1);
il_append(hplist, 0);
}
for (int ihp=0; ihp<il_size(hplist); ihp++) {
int ihp;
for (ihp=0; ihp<il_size(hplist); ihp++) {
int hp = il_get(hplist, ihp);
if (!ucacs[hp]) {
char fn[256];
......
......@@ -46,10 +46,10 @@ Ubuntu or Debian-like systems:
$ sudo apt-get install libcairo2-dev libnetpbm10-dev netpbm \
libpng2-dev libjpeg-dev python-numpy \
python-pyfits python-dev zlib1g-dev \
libpng2-dev libjpeg-dev python3-numpy \
python3-dev python3-pip zlib1g-dev \
libbz2-dev swig cfitsio-dev
$ pip install fitsio # or astropy
For example, in Debian 9 (Stretch)::
......@@ -65,6 +65,7 @@ In Ubunutu 20.04::
zlib1g-dev libbz2-dev libcfitsio-dev wcslib-dev \
python3 python3-pip python3-distutils python3-dev \
python3-numpy python3-scipy python3-pil
$ pip install fitsio # or astropy
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.
......@@ -85,6 +86,17 @@ A package can be installed from the `Arch Linux (AUR)
Mac OS X using homebrew:
^^^^^^^^^^^^^^^^^^^^^^^^
First set up homebrew, as described at `Homebrew https://brew.sh/`_.
The "formula" for installing Astrometry.net is called `astrometry-net` and is included in the "core" package
repository, so you just need to
$ brew install astrometry-net
Mac OS X using homebrew (ancient instructions):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
These instructions *Worked For Me* as of September 2012 on OSX 10.8.
First set up homebrew:
......@@ -103,7 +115,6 @@ Install:
$ brew install astrometry-net
Mac OS X using Fink:
^^^^^^^^^^^^^^^^^^^^
......
......@@ -46,4 +46,11 @@ il* healpix_region_search(int seed, il* seeds, int Nside,
int depth);
ll* healpix_region_searchl(int64_t seed, ll* seeds, int Nside,
ll* accepted, ll* rejected,
int (*accept)(int64_t hp, void* token),
void* token,
int depth);
#endif
......@@ -212,6 +212,7 @@ an output resolution "outnside", returns the healpix index at the
output resolution.
*/
void healpix_convert_nside(int hp, int nside, int outnside, int* outhp);
void healpix_convert_nsidel(int64_t hp, int nside, int outnside, int64_t* outhp);
/**
Converts (RA, DEC) coordinates (in radians) to healpix index.
......@@ -274,6 +275,10 @@ void healpix_to_xyz(int hp, int Nside, double dx, double dy,
void healpix_to_xyzarr(int hp, int Nside, double dx, double dy,
double* xyz);
void healpixl_to_xyzarr(int64_t hp, int Nside, double dx, double dy,
double* xyz);
/**
Same as healpix_to_xyz, but returns (RA,DEC) in radians.
*/
......
......@@ -13,24 +13,7 @@
Maps integers to lists of objects.
*/
// FIXME -- would this work better with "bt" for the keys?
struct intmap {
// dense only:
bl** dense;
int ND;
// sparse only:
il* keys;
// list of bl*
pl* lists;
// common:
// list blocksize
int blocksize;
// data size
int datasize;
};
struct intmap;
typedef struct intmap intmap_t;
/**
......@@ -66,5 +49,18 @@ void intmap_append(intmap_t* it, int key, void* pval);
*/
anbool intmap_get_entry(intmap_t* it, int index, int* key, bl** list);
struct longmap;
typedef struct longmap longmap_t;
longmap_t* longmap_new(int datasize, int subblocksize, int blocksize, int Ndense);
void longmap_free(longmap_t* it);
bl* longmap_find(longmap_t* it, int64_t key, anbool create);
void longmap_append(longmap_t* it, int64_t key, void* pval);
anbool longmap_get_entry(longmap_t* it, int index, int64_t* key, bl** list);
#endif
......@@ -13,7 +13,7 @@
#include <stdint.h>
#include "astrometry/starutil.h"
#include "astrometry/an-bool.h"
// 206 bytes of data, but each record is supposed to be terminated
// by \r\n, making...
......
......@@ -24,6 +24,7 @@
#include "dualtree_nearestneighbour.h"
#include "bl.h"
#include "mathutil.h"
#include "errors.h"
typedef struct {
PyObject_HEAD
......@@ -167,8 +168,6 @@ static int KdTree_init(KdObject *self, PyObject *args, PyObject *keywords) {
if (fnbytes == NULL)
return -1;
filename = PyBytes_AsString(fnbytes);
self->kd = kdtree_fits_read(filename, treename, NULL);
Py_DECREF(fnbytes);
#else
if (n == 1) {
if (!PyArg_ParseTuple(args, "s", &filename))
......@@ -177,10 +176,26 @@ static int KdTree_init(KdObject *self, PyObject *args, PyObject *keywords) {
if (!PyArg_ParseTuple(args, "ss", &filename, &treename))
return -1;
}
self->kd = kdtree_fits_read(filename, treename, NULL);
#endif
if (!self->kd)
char* errstr = NULL;
errors_start_logging_to_string();
self->kd = kdtree_fits_read(filename, treename, NULL);
errstr = errors_stop_logging_to_string("\n");
if (!self->kd) {
if (fnbytes && ((errno == ENOENT) || (errno == EACCES) || (errno == EEXIST))) {
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, fnbytes);
Py_DECREF(fnbytes);
return -1;
}
PyErr_SetString(PyExc_ValueError, errstr);
if (fnbytes)
Py_DECREF(fnbytes);
return -1;
}
if (fnbytes)
Py_DECREF(fnbytes);
return 0;
}
......
......@@ -102,20 +102,6 @@ LINK_DIR := $(PY_BASE_LINK_DIR)/plot
PYTHON_EXECS := plotann.py
PYTHON_INSTALL := $(PYTHON_EXECS) __init__.py
install:
@echo Installing in directory '$(INSTALL_DIR)'
$(MKDIR) '$(PY_INSTALL_DIR)'
@for x in $(PYTHON_INSTALL); do \
echo $(CP) $$x '$(PY_INSTALL_DIR)/'$$x; \
$(CP) $$x '$(PY_INSTALL_DIR)/'$$x; \
done
@echo Making symlinks in directory '$(BIN_INSTALL_DIR)'
$(MKDIR) '$(BIN_INSTALL_DIR)'
@for x in $(PYTHON_EXECS); do \
echo ln -f -s '$(LINK_DIR)/'$$x '$(BIN_INSTALL_DIR)/'$$x; \
ln -f -s '$(LINK_DIR)/'$$x '$(BIN_INSTALL_DIR)/'$$x; \
done
PYTHON_EXTRA_INSTALL := plotstuff.py plotstuff_c.py _plotstuff_c$(PYTHON_SO_EXT)
install-extra: $(INSTALL_CAIRO_EXECS)
......@@ -136,6 +122,16 @@ install-extra: $(INSTALL_CAIRO_EXECS)
echo $(CP) $$x '$(PY_INSTALL_DIR)/'$$x; \
$(CP) $$x '$(PY_INSTALL_DIR)/'$$x; \
done
@for x in $(PYTHON_INSTALL); do \
echo $(CP) $$x '$(PY_INSTALL_DIR)/'$$x; \
$(CP) $$x '$(PY_INSTALL_DIR)/'$$x; \
done
@echo Making symlinks in directory '$(BIN_INSTALL_DIR)'
$(MKDIR) '$(BIN_INSTALL_DIR)'
@for x in $(PYTHON_EXECS); do \
echo ln -f -s '$(LINK_DIR)/'$$x '$(BIN_INSTALL_DIR)/'$$x; \
ln -f -s '$(LINK_DIR)/'$$x '$(BIN_INSTALL_DIR)/'$$x; \
done
$(COMMON)/cairoutils.o:
$(MAKE) -C $(COMMON) cairoutils.o
......@@ -227,4 +223,4 @@ clean:
rm -f $(DEPS) $(ALL_OBJ) \
$(NODEP_OBJS) plot-constellations plotquad plotxy \
$(ALL_EXECS) $(GENERATED_FILES) $(ALL_TESTS_CLEAN) \
plotstuff _plotstuff_c$(PYTHON_SO_EXT) *.o *~ *.dep deps
plotstuff _plotstuff_c$(PYTHON_SO_EXT) plotstuff_c.py plotstuff_wrap.c *.o *~ *.dep deps
......@@ -118,7 +118,6 @@ def get_annotations_for_wcs(wcs, opt):
anns.append((T.ra[i], T.dec[i], nm.lower(), names))
if opt.hdcat:
#print 'Matching HD...'
ra,dec,I = match_kdtree_catalog(wcs, opt.hdcat)
for r,d,i in zip(ra,dec,I):
if not wcs.is_inside(r, d):
......
......@@ -718,7 +718,7 @@ static int parse_header_block(const char* buf, qfits_header* hdr, int* found_it)
continue;
key = qfits_getkey_r(line, getkey_buf);
if (!key) {
printf("Skipping un-parseable header line: \"%.80s\"\n", line);
fprintf(stderr, "Skipping un-parseable header line: \"%.80s\"\n", line);
continue;
}
val = qfits_getvalue_r(line, getval_buf);
......
......@@ -314,12 +314,13 @@ void * qfits_memory_malloc(
/* Create swap file with rights: rw-rw-rw- */
swapfileid = ++ qfits_memory_table.file_reg;
fname = qfits_memory_tmpfilename(swapfileid);
swapfd = open(fname, O_RDWR | O_CREAT);
mode_t mod = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
swapfd = open(fname, O_RDWR | O_CREAT, mod);
if (swapfd==-1) {
fprintf(stderr, "qfits_mem: cannot create swap file\n");
exit(-1);
}
fchmod(swapfd, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
fchmod(swapfd, mod);
/* Compute number of passes to insert buffer */
nbufs = size / MEMPAGESZ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment