| 1 | Astrometry.net code release 0.2 |
|---|
| 2 | =============================== |
|---|
| 3 | |
|---|
| 4 | Copyright 2006-2008 Michael Blanton, David W. Hogg, Dustin Lang, Keir |
|---|
| 5 | Mierle and Sam Roweis. |
|---|
| 6 | |
|---|
| 7 | This code is meant as an accompanyment for an upcoming paper and its |
|---|
| 8 | main purpose is to allow reproduction of the results in that paper. |
|---|
| 9 | |
|---|
| 10 | This is research code only and is not intended for scientific use in |
|---|
| 11 | reducing data or other analyses. |
|---|
| 12 | |
|---|
| 13 | This release includes a snapshot of all of the components of our |
|---|
| 14 | current research code, including routines to: |
|---|
| 15 | * Convert raw USNO-B and Tycho2 into FITS format for easier use |
|---|
| 16 | * Uniformize, deduplicate, and cut the FITSified catalogs |
|---|
| 17 | * Build indexes from these cuts |
|---|
| 18 | * Solve the astrometry of images using these indexes |
|---|
| 19 | |
|---|
| 20 | The code includes: |
|---|
| 21 | * A simple but powerful HEALPIX implementation |
|---|
| 22 | * The QFITS library with several modifications |
|---|
| 23 | * libkd, a compact and high-performance kdtree library |
|---|
| 24 | |
|---|
| 25 | In principle, the code in the tarball is sufficient to reproduce our |
|---|
| 26 | entire astrometry system and replicate our blind astrometry results |
|---|
| 27 | (e.g. on the SDSS fields). However, this requires the entire USNO-B |
|---|
| 28 | 1.0 catalogue which is about 80GB in size. For ease of use, we are |
|---|
| 29 | distributing our pre-cooked indexes (about 25 GB total), which are the |
|---|
| 30 | same files we're using for our web service. |
|---|
| 31 | |
|---|
| 32 | INSTALLING |
|---|
| 33 | ---------- |
|---|
| 34 | |
|---|
| 35 | To compile everything and run with full functionality, you will need: |
|---|
| 36 | * gcc |
|---|
| 37 | * cairo |
|---|
| 38 | * netpbm |
|---|
| 39 | * libpng |
|---|
| 40 | * libjpeg |
|---|
| 41 | * python (probably >= 2.4) |
|---|
| 42 | * numpy |
|---|
| 43 | |
|---|
| 44 | -> On Ubuntu or Debian-like systems, the following should suffice: |
|---|
| 45 | |
|---|
| 46 | $ sudo apt-get install libcairo2-dev libnetpbm10-dev netpbm \ |
|---|
| 47 | libpng12-dev libjpeg-dev python-numpy |
|---|
| 48 | |
|---|
| 49 | -> On RHEL, you'll need something like: |
|---|
| 50 | $ sudo yum install cairo.x86_64 cairo-devel.x86_64 netpbm.x86_64 \ |
|---|
| 51 | netpbm-devel.x86_64 fontconfig-devel.x86_64 \ |
|---|
| 52 | libXrender-devel.x86_64 xorg-x11-proto-devel.x86_64 |
|---|
| 53 | |
|---|
| 54 | If you don't have and can't get these libraries, you should still be |
|---|
| 55 | able to compile and use the core parts of the solver, but you will |
|---|
| 56 | miss out on some eye-candy. |
|---|
| 57 | |
|---|
| 58 | Grab the code: |
|---|
| 59 | $ wget http://astrometry.net/downloads/astrometry.net-0.2.tar.bz2 |
|---|
| 60 | $ tar xjf astrometry.net-0.2.tar.bz2 |
|---|
| 61 | $ cd astrometry.net-0.2 |
|---|
| 62 | |
|---|
| 63 | Build the solving system: |
|---|
| 64 | $ make |
|---|
| 65 | |
|---|
| 66 | If you installed the libraries listed above, build the plotting code: |
|---|
| 67 | $ make extra |
|---|
| 68 | |
|---|
| 69 | Install it: |
|---|
| 70 | $ make install |
|---|
| 71 | |
|---|
| 72 | You might see some error message during compilation; see the section |
|---|
| 73 | ERROR MESSAGES below for fixes to common problems. |
|---|
| 74 | |
|---|
| 75 | By default it will be installed in /usr/local/astrometry . |
|---|
| 76 | You can override this by either: |
|---|
| 77 | * editing the top-level Makefile (look for INSTALL_DIR) |
|---|
| 78 | or * defining INSTALL_DIR on the command-line: |
|---|
| 79 | For bash shell: |
|---|
| 80 | $ export INSTALL_DIR=/path/to/astrometry |
|---|
| 81 | $ make install |
|---|
| 82 | or |
|---|
| 83 | $ INSTALL_DIR=/path/to/astrometry make install |
|---|
| 84 | For tcsh shell: |
|---|
| 85 | $ setenv INSTALL_DIR /path/to/astrometry |
|---|
| 86 | $ make install |
|---|
| 87 | |
|---|
| 88 | The astrometry solver is composed of several executables. You may |
|---|
| 89 | want to add the INSTALL_DIR/bin directory to your path: |
|---|
| 90 | For bash shell: |
|---|
| 91 | $ export PATH="$PATH:/usr/local/astrometry/bin" |
|---|
| 92 | For tcsh shell: |
|---|
| 93 | $ setenv PATH "$PATH:/usr/local/astrometry/bin" |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | GETTING INDEXES |
|---|
| 97 | --------------- |
|---|
| 98 | Next, grab some pre-cooked indexes. See the file GETTING-INDEXES for |
|---|
| 99 | details about how to do this. |
|---|
| 100 | |
|---|
| 101 | (If you have indexes from a previous version of the Astrometry.net |
|---|
| 102 | software, see the "Upgrading" section below.) |
|---|
| 103 | |
|---|
| 104 | Each index is designed to solve images within a narrow range of |
|---|
| 105 | scales. The indexes designed to solve small (angular size) images are |
|---|
| 106 | rather large files, so you probably only want to grab the indexes |
|---|
| 107 | required for the images you wish to solve. If you grab extra indexes, |
|---|
| 108 | the solver will run more slowly, but the results should be the same. |
|---|
| 109 | |
|---|
| 110 | Each index contains a large number of "skymarks" (landmarks for the |
|---|
| 111 | sky) that allow our solver to identify your images. The skymarks |
|---|
| 112 | contained in each index have sizes (diameters) within a narrow range. |
|---|
| 113 | You probably want to download indexes whose quads are, say, 10% to |
|---|
| 114 | 100% of the sizes of the images you want to solve. |
|---|
| 115 | |
|---|
| 116 | For example, let's say you have some 1-degree square images. You |
|---|
| 117 | should grab indexes that contain skymarks of size 0.1 to 1 degree, or |
|---|
| 118 | 6 to 60 arcminutes. Referring to the table below, you should grab |
|---|
| 119 | indexes 203 through 209. You might find that the same number of |
|---|
| 120 | fields solve, and faster, using just one or two of the indexes in the |
|---|
| 121 | middle of that range - in our example you might try 205, 206 and 207. |
|---|
| 122 | |
|---|
| 123 | For reference, we used index 202 alone for our SDSS tests (13x9 arcmin |
|---|
| 124 | fields). |
|---|
| 125 | |
|---|
| 126 | --------------------------------------------------------------- |
|---|
| 127 | Index Filename Range of skymark diameters File Size |
|---|
| 128 | (arcminutes) (MB) |
|---|
| 129 | --------------------------------------------------------------- |
|---|
| 130 | index-210+.tar.bz2 60 - 2000 29 |
|---|
| 131 | index-209.tar.bz2 42 - 60 30 |
|---|
| 132 | index-208.tar.bz2 30 - 42 61 |
|---|
| 133 | index-207.tar.bz2 22 - 30 125 |
|---|
| 134 | index-206.tar.bz2 16 - 22 255 |
|---|
| 135 | index-205.tar.bz2 11 - 16 526 |
|---|
| 136 | index-204.tar.bz2 8 - 11 1,023 |
|---|
| 137 | index-203.tar.bz2 5.6 - 8.0 2,089 |
|---|
| 138 | index-202.tar.bz2 4.0 - 5.6 4,260 |
|---|
| 139 | index-201.tar.bz2 2.8 - 4.0 5,878 |
|---|
| 140 | index-200.tar.bz2 2.0 - 2.8 10,058 |
|---|
| 141 | -------------------------------------------------------------- |
|---|
| 142 | |
|---|
| 143 | Download the indexes you need and put them in the top-level |
|---|
| 144 | (astrometry-0.2) source directory. |
|---|
| 145 | |
|---|
| 146 | Install them: |
|---|
| 147 | $ make install-indexes |
|---|
| 148 | |
|---|
| 149 | (Or you can extract them into the INSTALL_DIR/data directory by hand.) |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | Next, you can (optionally) configure the solver by editing the file |
|---|
| 153 | INSTALL_DIR/etc/backend.cfg |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | UPGRADING INDEX FILES |
|---|
| 157 | --------------------- |
|---|
| 158 | |
|---|
| 159 | The format of the index files has changed from the 0.1 and 0.11 |
|---|
| 160 | releases. There is a program for updating them, and there is also a |
|---|
| 161 | makefile target. |
|---|
| 162 | |
|---|
| 163 | $ make upgrade-indexes |
|---|
| 164 | |
|---|
| 165 | If you want to do it by hand, use the program "fix-bb". Run it on |
|---|
| 166 | each of the ckdt.fits and skdt.fits files in your INSTALL_DIR/data |
|---|
| 167 | directory. |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | SOLVING |
|---|
| 171 | ------- |
|---|
| 172 | |
|---|
| 173 | Finally, solve some fields. |
|---|
| 174 | |
|---|
| 175 | (If you didn't build the plotting commands, add "--no-plots" to the |
|---|
| 176 | command lines below.) |
|---|
| 177 | |
|---|
| 178 | If you have any of indexes 213 to 218: |
|---|
| 179 | $ solve-field --scale-low 10 demo/apod4.jpg |
|---|
| 180 | |
|---|
| 181 | If you have index 219: |
|---|
| 182 | $ solve-field --scale-low 30 demo/apod5.jpg |
|---|
| 183 | |
|---|
| 184 | If you have any of indexes 210 to 214: |
|---|
| 185 | $ solve-field --scale-low 1 demo/apod3.jpg |
|---|
| 186 | |
|---|
| 187 | If you have any of indexes 206 to 211: |
|---|
| 188 | $ solve-field --scale-low 1 demo/apod2.jpg |
|---|
| 189 | |
|---|
| 190 | If you have any of indexes 203 to 205: |
|---|
| 191 | $ solve-field apod1.jpg |
|---|
| 192 | |
|---|
| 193 | If you have any of indexes 200 to 203: |
|---|
| 194 | $ solve-field demo/sdss.jpg |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | Copyrights and credits for the demo images are listed in the file demo/CREDITS . |
|---|
| 198 | |
|---|
| 199 | Note that you can also give solve-field a URL rather than a file as input: |
|---|
| 200 | $ solve-field --out apod1b http://antwrp.gsfc.nasa.gov/apod/image/0302/ngc2264_croman_c3.jpg |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | If you don't have the netpbm tools (eg jpegtopnm), do this instead: |
|---|
| 204 | |
|---|
| 205 | If you have any of indexes 213 to 218: |
|---|
| 206 | $ solve-field --scale-low 10 demo/apod4.xyls |
|---|
| 207 | |
|---|
| 208 | If you have index 219: |
|---|
| 209 | $ solve-field --scale-low 30 demo/apod5.xyls |
|---|
| 210 | |
|---|
| 211 | If you have any of indexes 210 to 214: |
|---|
| 212 | $ solve-field --scale-low 1 demo/apod3.xyls |
|---|
| 213 | |
|---|
| 214 | If you have any of indexes 206 to 211: |
|---|
| 215 | $ solve-field --scale-low 1 demo/apod2.xyls |
|---|
| 216 | |
|---|
| 217 | If you have any of indexes 203 to 205: |
|---|
| 218 | $ solve-field demo/apod1.xyls |
|---|
| 219 | |
|---|
| 220 | If you have any of indexes 200 to 203: |
|---|
| 221 | $ solve-field demo/sdss.xyls |
|---|
| 222 | |
|---|
| 223 | |
|---|
| 224 | OUTPUT FILES |
|---|
| 225 | ------------ |
|---|
| 226 | |
|---|
| 227 | <base>-ngc.png : an annotation of the image. |
|---|
| 228 | <base>.wcs : a FITS WCS header for the solution. |
|---|
| 229 | <base>.new : a new FITS file containing the WCS header. |
|---|
| 230 | <base>-objs.png : a plot of the sources (stars) we extracted from |
|---|
| 231 | the image. |
|---|
| 232 | <base>-indx.png : sources (red), plus stars from the index (green), |
|---|
| 233 | plus the skymark ("quad") used to solve the |
|---|
| 234 | image. |
|---|
| 235 | <base>-indx.xyls : a FITS BINTABLE with the pixel locations of |
|---|
| 236 | stars from the index. |
|---|
| 237 | <base>.rdls : a FITS BINTABLE with the RA,Dec of sources we |
|---|
| 238 | extracted from the image. |
|---|
| 239 | <base>.axy : a FITS BINTABLE of the sources we extracted, plus |
|---|
| 240 | headers that describe the job (how the image is |
|---|
| 241 | going to be solved). |
|---|
| 242 | <base>.solved : exists and contains (binary) 1 if the field solved. |
|---|
| 243 | <base>.match : a FITS BINTABLE describing the quad match that |
|---|
| 244 | solved the image. |
|---|
| 245 | <base>.kmz : (optional) KMZ file for Google Sky-in-Earth. You need |
|---|
| 246 | to have "wcs2kml" in your PATH. See |
|---|
| 247 | http://code.google.com/p/wcs2kml/downloads/list |
|---|
| 248 | http://code.google.com/p/google-gflags/downloads/list |
|---|
| 249 | |
|---|
| 250 | |
|---|
| 251 | TRICKS AND TIPS |
|---|
| 252 | --------------- |
|---|
| 253 | |
|---|
| 254 | *** To lower the CPU time limit before giving up: |
|---|
| 255 | |
|---|
| 256 | $ solve-field --cpu-limit 30 ... |
|---|
| 257 | |
|---|
| 258 | will make it give up after 30 seconds. |
|---|
| 259 | |
|---|
| 260 | (Note, however, that the "backend" configuration file (backend.cfg) |
|---|
| 261 | puts a limit on the CPU time that is spent on an image; solve-field |
|---|
| 262 | can reduce this but not increase it.) |
|---|
| 263 | |
|---|
| 264 | |
|---|
| 265 | *** Scale of the image: if you provide bounds (lower and upper limits) |
|---|
| 266 | on the size of the image you are trying to solve, solving can be much |
|---|
| 267 | faster. In the last examples above, for example, we specified that |
|---|
| 268 | the field is at least 30 degrees wide: this means that we don't need |
|---|
| 269 | to search for matches in the indexes that contain only tiny skymarks. |
|---|
| 270 | |
|---|
| 271 | Eg, to specify that the image is between 1 and 2 degrees wide: |
|---|
| 272 | |
|---|
| 273 | $ solve-field --scale-units degwidth --scale-low 1 --scale-high 2 ... |
|---|
| 274 | |
|---|
| 275 | If you know the pixel scale instead: |
|---|
| 276 | |
|---|
| 277 | $ solve-field --scale-units arcsecperpix \ |
|---|
| 278 | --scale-low 0.386 --scale-high 0.406 ... |
|---|
| 279 | |
|---|
| 280 | When you tell solve-field the scale of your image, it uses this to |
|---|
| 281 | decide which indexes to try to use to solve your image; each index |
|---|
| 282 | contains quads whose scale is within a certain range, so if these |
|---|
| 283 | quads are too big or too small to be in your image, there is no need |
|---|
| 284 | to look in that index. It is also used while matching quads: a small |
|---|
| 285 | quad in your image is not allowed to match a large quad in the index |
|---|
| 286 | if such a match would cause the image scale to be outside the bounds |
|---|
| 287 | you specified. However, all these checks are done before computing a |
|---|
| 288 | best-fit WCS solution and polynomial distortion terms, so it is |
|---|
| 289 | possible (though rare) for the final solution to fall outside the |
|---|
| 290 | limits you specified. This should only happen when the solution is |
|---|
| 291 | correct, but you gave incorrect inputs, so you shouldn't be |
|---|
| 292 | complaining! :) |
|---|
| 293 | |
|---|
| 294 | |
|---|
| 295 | *** Guess the scale: solve-field can try to guess your image's scale |
|---|
| 296 | from a number of different FITS header values. When it's right, this |
|---|
| 297 | often speeds up solving a lot, and when it's wrong it doesn't cost |
|---|
| 298 | much. Enable this with: |
|---|
| 299 | |
|---|
| 300 | $ solve-field --guess-scale ... |
|---|
| 301 | |
|---|
| 302 | *** Depth. The solver works by looking at sources in your image, |
|---|
| 303 | starting with the brightest. It searches for all "skymarks" that can |
|---|
| 304 | be built from the N brightest stars before considering star N+1. When |
|---|
| 305 | using several indexes, it can be much faster to search for many |
|---|
| 306 | skymarks in one index before switching to the next one. This flag |
|---|
| 307 | lets you control when the solver switches between indexes. It also |
|---|
| 308 | lets you control how much effort the solver puts in before giving up - |
|---|
| 309 | by default it looks at all the sources in your image, and usually |
|---|
| 310 | times out before this finishes. |
|---|
| 311 | |
|---|
| 312 | Eg, to first look at sources 1-20 in all indexes, then sources 21-30 |
|---|
| 313 | in all indexes, then 31-40: |
|---|
| 314 | |
|---|
| 315 | $ solve-field --depth 20,30,40 ... |
|---|
| 316 | or $ solve-field --depth 1-20 --depth 21-30 --depth 31-40 ... |
|---|
| 317 | |
|---|
| 318 | Sources are numbered starting at one, and ranges are inclusive. If |
|---|
| 319 | you don't give a lower limit, it will take 1 + the previous upper |
|---|
| 320 | limit. To look at a single source, do |
|---|
| 321 | |
|---|
| 322 | $ solve-field --depth 42-42 ... |
|---|
| 323 | |
|---|
| 324 | |
|---|
| 325 | *** Our source extractor sometimes estimates the background badly, so |
|---|
| 326 | by default we sort the stars by brightness using a compromise between |
|---|
| 327 | the raw and background-subtracted flux estimates. For images without |
|---|
| 328 | much nebulosity, you might find that using the background-subtracted |
|---|
| 329 | fluxes yields faster results. Enable this by: |
|---|
| 330 | |
|---|
| 331 | $ solve-field --resort ... |
|---|
| 332 | |
|---|
| 333 | |
|---|
| 334 | *** If you've got big images: you might want to downsample them before |
|---|
| 335 | doing source extraction: |
|---|
| 336 | |
|---|
| 337 | $ solve-field --downsample 2 ... |
|---|
| 338 | or $ solve-field --downsample 4 ... |
|---|
| 339 | or etc |
|---|
| 340 | |
|---|
| 341 | |
|---|
| 342 | *** When solve-field processes FITS files, it runs them through a |
|---|
| 343 | "sanitizer" which tries to clean up non-standards-compliant images. |
|---|
| 344 | If your FITS files are compliant, this is a waste of time, and you can |
|---|
| 345 | avoid doing it. |
|---|
| 346 | |
|---|
| 347 | $ solve-field --no-fits2fits ... |
|---|
| 348 | |
|---|
| 349 | |
|---|
| 350 | *** When solve-field processes FITS images, it looks for an existing |
|---|
| 351 | WCS header. If one is found, it tries to verify that header before |
|---|
| 352 | trying to solve the image blindly. You can prevent this with: |
|---|
| 353 | |
|---|
| 354 | $ solve-field --no-verify ... |
|---|
| 355 | |
|---|
| 356 | Note that currently solve-field only understands a small subset of |
|---|
| 357 | valid WCS headers: essentially just the TAN projection with a CD |
|---|
| 358 | matrix (not CROT). |
|---|
| 359 | |
|---|
| 360 | |
|---|
| 361 | *** If you don't want the plots to be produced: |
|---|
| 362 | |
|---|
| 363 | $ solve-field --no-plots ... |
|---|
| 364 | |
|---|
| 365 | |
|---|
| 366 | *** "I know where my image is to within 1 arcminute, how can I tell |
|---|
| 367 | solve-field to only look there?" |
|---|
| 368 | |
|---|
| 369 | In this release of the software, you can't. We've got plans for v0.3, |
|---|
| 370 | but don't hold your breath! There is one thing you can do: if you |
|---|
| 371 | know that your image is within one HEALPix |
|---|
| 372 | (http://healpix.jpl.nasa.gov/), and if you're using the |
|---|
| 373 | small-angular-scale indexes with filenames like index-###-##.*.fits, |
|---|
| 374 | then each of these indexes covers one HEALPix (the second number is |
|---|
| 375 | the HEALPix number); you can edit the "backend.cfg" config file to |
|---|
| 376 | tell the "backend" program to only load the index that contains your |
|---|
| 377 | image. |
|---|
| 378 | |
|---|
| 379 | |
|---|
| 380 | *** To convert a list of pixel coordinates to RA,Dec coordinates: |
|---|
| 381 | |
|---|
| 382 | $ wcs-xy2rd -w wcs-file -i xy-list -o radec-list |
|---|
| 383 | |
|---|
| 384 | Where xy-list is a FITS BINTABLE of the pixel locations of sources; |
|---|
| 385 | recall that FITS specifies that the center of the first pixel is pixel |
|---|
| 386 | coordinate (1,1). |
|---|
| 387 | |
|---|
| 388 | |
|---|
| 389 | *** To convert from RA,Dec to pixels: |
|---|
| 390 | |
|---|
| 391 | $ wcs-rd2xy -w wcs-file -i radec-list -o xy-list |
|---|
| 392 | |
|---|
| 393 | |
|---|
| 394 | *** To make cool overlay plots: see plotxy, plot-constellations. |
|---|
| 395 | |
|---|
| 396 | |
|---|
| 397 | *** To change the output filenames when processing multiple input |
|---|
| 398 | files: each of the output filename options listed below can include |
|---|
| 399 | "%s", which will be replaced by the base output filename. (Eg, the |
|---|
| 400 | default for --wcs is "%s.wcs"). If you really want a "%" character in |
|---|
| 401 | your output filename, you have to put "%%". |
|---|
| 402 | |
|---|
| 403 | Outputs include: --new-fits, --kmz, --solved, --cancel, --match, |
|---|
| 404 | --rdls, --corr, --wcs --keep-xylist --pnm |
|---|
| 405 | Also included: --solved-in, --verify |
|---|
| 406 | |
|---|
| 407 | |
|---|
| 408 | *** Reusing files between runs: |
|---|
| 409 | |
|---|
| 410 | The first time you run solve-field, save the source extraction |
|---|
| 411 | results: |
|---|
| 412 | $ solve-field --keep-xylist %s.xy input.fits ... |
|---|
| 413 | |
|---|
| 414 | On subsequent runs, instead of using the original input file, use the |
|---|
| 415 | saved xylist instead. Also add --continue to overwrite any output |
|---|
| 416 | file that already exists. |
|---|
| 417 | $ solve-field input.xy --no-fits2fits --continue ... |
|---|
| 418 | |
|---|
| 419 | To skip previously solved inputs (note that this assumes single-HDU |
|---|
| 420 | inputs): |
|---|
| 421 | $ solve-field --skip-solved ... |
|---|
| 422 | |
|---|
| 423 | |
|---|
| 424 | "I wanna go fast!" |
|---|
| 425 | ------------------ |
|---|
| 426 | |
|---|
| 427 | Sadly, gcc doesn't have a flag --super-fast to generate the fastest |
|---|
| 428 | possible code for the machine on which it is running. Also, we are |
|---|
| 429 | shipping the code with assertion and debugging turned on -- this helps |
|---|
| 430 | ensure that bugs are caught and reported, but it does slow down the |
|---|
| 431 | code. Here are some things you can do to make the code run faster: |
|---|
| 432 | |
|---|
| 433 | * in util/makefile.common, set RICKY_BOBBY to yes. |
|---|
| 434 | |
|---|
| 435 | * we try to guess "-mtune" settings that will work for you; if we're |
|---|
| 436 | wrong, you can set the environment variable ARCH_FLAGS before |
|---|
| 437 | compiling: |
|---|
| 438 | |
|---|
| 439 | $ ARCH_FLAGS="-mtune=nocona" make |
|---|
| 440 | |
|---|
| 441 | You can find details in the gcc manual: |
|---|
| 442 | http://gcc.gnu.org/onlinedocs/ |
|---|
| 443 | |
|---|
| 444 | You probably want to look in the section: |
|---|
| 445 | "GCC Command Options" |
|---|
| 446 | -> "Hardware Models and Configurations" |
|---|
| 447 | -> "Intel 386 and AMD x86-64 Options" |
|---|
| 448 | |
|---|
| 449 | http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options |
|---|
| 450 | |
|---|
| 451 | XYLISTS |
|---|
| 452 | ------- |
|---|
| 453 | |
|---|
| 454 | The solve-field program accepts either images or "xylists" (xyls), |
|---|
| 455 | which are just FITS BINTABLE files which contain two columns (float or |
|---|
| 456 | double (E or D) format) which list the pixel coordinates of sources |
|---|
| 457 | (stars, etc) in the image. |
|---|
| 458 | |
|---|
| 459 | To specify the column names (eg, "XIMAGE" and "YIMAGE"): |
|---|
| 460 | $ solve-field --x-column XIMAGE --y-column YIMAGE ... |
|---|
| 461 | |
|---|
| 462 | Our solver assumes that the sources are listed in order of brightness, |
|---|
| 463 | with the brightest sources first. If your files aren't sorted, you |
|---|
| 464 | can specify a column by which the file should be sorted. |
|---|
| 465 | $ solve-field --sort-column FLUX ... |
|---|
| 466 | |
|---|
| 467 | By default it sorts with the largest value first (so it works |
|---|
| 468 | correctly if the column contains FLUX values), but you can reverse |
|---|
| 469 | that by: |
|---|
| 470 | $ solve-field --sort-ascending --sort-column MAG ... |
|---|
| 471 | |
|---|
| 472 | When using xylists, you should also specify the original width and |
|---|
| 473 | height of the image, in pixels: |
|---|
| 474 | $ solve-field --width 2000 --height 1500 ... |
|---|
| 475 | |
|---|
| 476 | Alternatively, if the FITS header contains "IMAGEW" and "IMAGEH" keys, |
|---|
| 477 | these will be used. |
|---|
| 478 | |
|---|
| 479 | The solver can deal with multi-extension xylists; indeed, this is a |
|---|
| 480 | convenient way to solve a large number of fields at once. You can |
|---|
| 481 | tell it which extensions it should solve by: |
|---|
| 482 | $ solve-field --fields 1-100,120,130-200 |
|---|
| 483 | |
|---|
| 484 | (Ranges of fields are inclusive, and the first FITS extension is 1, as |
|---|
| 485 | per the FITS standard.) |
|---|
| 486 | |
|---|
| 487 | Unfortunately, the plotting code isn't smart about handling multiple |
|---|
| 488 | fields, so if you're using multi-extension xylists you probably want |
|---|
| 489 | to turn off plotting: |
|---|
| 490 | $ solve-field --no-plots ... |
|---|
| 491 | |
|---|
| 492 | |
|---|
| 493 | BACKEND CONFIG |
|---|
| 494 | -------------- |
|---|
| 495 | Because we also operate a web service using most of the same software, |
|---|
| 496 | the local version of the solver is a bit more complicated than it |
|---|
| 497 | really needs to be. The "solve-field" program takes your input files, |
|---|
| 498 | does source extraction on them to produce an "xylist" -- a FITS |
|---|
| 499 | BINTABLE of source positions -- then takes the information you |
|---|
| 500 | supplied about your fields on the command-line and adds FITS headers |
|---|
| 501 | encoding this information. We call this file an "augmented xylist"; |
|---|
| 502 | we use the filename suffix ".axy". "solve-field" then calls the |
|---|
| 503 | "backend" program, passing it your axy file. "backend" reads a config |
|---|
| 504 | file (by default /usr/local/astrometry/etc/backend.cfg) that describes |
|---|
| 505 | things like where to find index files, whether to load all the indexes |
|---|
| 506 | at once or run them one at a time, how long to spend on each field, |
|---|
| 507 | and so on. If you want to force only a certain set of indexes to |
|---|
| 508 | load, you can copy the backend.cfg file to a local version and change |
|---|
| 509 | the list of indexes that are loaded, and then tell solve-field to use |
|---|
| 510 | this config file: |
|---|
| 511 | |
|---|
| 512 | $ solve-field --backend-config mybackend.cfg ... |
|---|
| 513 | |
|---|
| 514 | |
|---|
| 515 | SOURCE EXTRACTION USING SEXTRACTOR |
|---|
| 516 | ---------------------------------- |
|---|
| 517 | http://terapix.iap.fr/rubrique.php?id_rubrique=91/ |
|---|
| 518 | |
|---|
| 519 | The "Source Extractor" aka "SExtractor" program by Emmanuel Bertin can |
|---|
| 520 | be used to do source extraction if you don't want to use our own |
|---|
| 521 | bundled "image2xy" program. |
|---|
| 522 | |
|---|
| 523 | You can use the following configuration entries to produce an "xylist" |
|---|
| 524 | which can be fed to solve-field: |
|---|
| 525 | |
|---|
| 526 | CATALOG_TYPE FITS_1.0 |
|---|
| 527 | # this is the output filename: |
|---|
| 528 | CATALOG_NAME out.xyls |
|---|
| 529 | PARAMETERS_NAME xylist.param |
|---|
| 530 | |
|---|
| 531 | In the file "xylist.param", include: |
|---|
| 532 | |
|---|
| 533 | X_IMAGE |
|---|
| 534 | Y_IMAGE |
|---|
| 535 | MAG_ISO |
|---|
| 536 | # or MAG_ISOCOR or MAG_AUTO |
|---|
| 537 | |
|---|
| 538 | After running SExtractor on your image, you can feed the resulting |
|---|
| 539 | file straight to solve-field: |
|---|
| 540 | |
|---|
| 541 | $ solve-field out.xyls --x-column X_IMAGE --y-column Y_IMAGE \ |
|---|
| 542 | --sort-column MAG_ISO --sort-ascending --overwrite \ |
|---|
| 543 | --width 496 --height 340 |
|---|
| 544 | |
|---|
| 545 | |
|---|
| 546 | WORKAROUNDS |
|---|
| 547 | ----------- |
|---|
| 548 | *** No python |
|---|
| 549 | |
|---|
| 550 | There are two places we use python: handling images, and filtering FITS files. |
|---|
| 551 | |
|---|
| 552 | You can avoid the image-handling code by doing source extraction |
|---|
| 553 | yourself; see the "No netpbm" section below. |
|---|
| 554 | |
|---|
| 555 | You can avoid filtering FITS files by using the "--no-fits2fits" |
|---|
| 556 | option to solve-field. |
|---|
| 557 | |
|---|
| 558 | *** No netpbm |
|---|
| 559 | |
|---|
| 560 | We use the netpbm tools (jpegtopnm, pnmtofits, etc) to convert from |
|---|
| 561 | all sorts of image formats to PNM and FITS. |
|---|
| 562 | |
|---|
| 563 | If you don't have these programs installed, you must do source |
|---|
| 564 | extraction yourself and use "xylists" rather than images as the input |
|---|
| 565 | to solve-field. See SEXTRACTOR and XYLIST sections above. |
|---|
| 566 | |
|---|
| 567 | ERROR MESSAGES during compiling |
|---|
| 568 | ------------------------------- |
|---|
| 569 | |
|---|
| 570 | 1. /bin/sh: line 1: /dev/null: No such file or directory |
|---|
| 571 | |
|---|
| 572 | We've seen this happen on Macs a couple of times. Reboot and it goes |
|---|
| 573 | away... |
|---|
| 574 | |
|---|
| 575 | 2. makefile.deps:40: deps: No such file or directory |
|---|
| 576 | |
|---|
| 577 | Not a problem. We use automatic dependency tracking: "make" keeps |
|---|
| 578 | track of which source files depend on which other source files. These |
|---|
| 579 | dependencies get stored in a file named "deps"; when it doesn't exist, |
|---|
| 580 | "make" tries to rebuild it, but not before printing this message. |
|---|
| 581 | |
|---|
| 582 | 3. gnu-specific-test.c: In function 'main': |
|---|
| 583 | gnu-specific-test.c:23: warning: implicit declaration of function 'canonicalize_file_name' |
|---|
| 584 | gnu-specific-test.c:23: warning: initialization makes pointer from integer without a cast |
|---|
| 585 | /usr/bin/ld: Undefined symbols: |
|---|
| 586 | _canonicalize_file_name |
|---|
| 587 | collect2: ld returned 1 exit status |
|---|
| 588 | |
|---|
| 589 | Not a problem. We provide replacements for a couple of GNU-specific |
|---|
| 590 | functions, but we need to decide whether to use them or not. We do |
|---|
| 591 | that by trying to build a test program and checking whether it works. |
|---|
| 592 | This failure tells us your OS doesn't provide the |
|---|
| 593 | canonicalize_file_name() function, so we plug in a replacement. |
|---|
| 594 | |
|---|
| 595 | 4. configure: WARNING: cfitsio: == No acceptable f77 found in $PATH |
|---|
| 596 | configure: WARNING: cfitsio: == Cfitsio will be built without Fortran wrapper support |
|---|
| 597 | drvrfile.c: In function 'file_truncate': |
|---|
| 598 | drvrfile.c:360: warning: implicit declaration of function 'ftruncate' |
|---|
| 599 | drvrnet.c: In function 'http_open': |
|---|
| 600 | drvrnet.c:300: warning: implicit declaration of function 'alarm' |
|---|
| 601 | drvrnet.c: In function 'http_open_network': |
|---|
| 602 | drvrnet.c:810: warning: implicit declaration of function 'close' |
|---|
| 603 | drvrsmem.c: In function 'shared_cleanup': |
|---|
| 604 | drvrsmem.c:154: warning: implicit declaration of function 'close' |
|---|
| 605 | group.c: In function 'fits_get_cwd': |
|---|
| 606 | group.c:5439: warning: implicit declaration of function 'getcwd' |
|---|
| 607 | ar: creating archive libcfitsio.a |
|---|
| 608 | |
|---|
| 609 | Not a problem; these errors come from cfitsio and we just haven't |
|---|
| 610 | fixed them. |
|---|
| 611 | |
|---|
| 612 | |
|---|
| 613 | LICENSE |
|---|
| 614 | ------- |
|---|
| 615 | |
|---|
| 616 | The Astrometry.net code suite is free software licensed under the GNU |
|---|
| 617 | GPL, version 2. See the file LICENSE for the full terms of the GNU |
|---|
| 618 | GPL. |
|---|
| 619 | |
|---|
| 620 | The index files come with their own license conditions. See the file |
|---|
| 621 | GETTING-INDEXES for details. |
|---|
| 622 | |
|---|
| 623 | CONTACT |
|---|
| 624 | ------- |
|---|
| 625 | Please send inquires and bug reports to code@astrometry.net . |
|---|
| 626 | |
|---|