SExtractor (source extractor) is a convenient tool to run on a FITS image and return a bunch of detected sources, with their fluxes and magnitudes. Unfortunately, being written quite a while ago, it hasn't fully kept up-to-date with developments in astrometry, in particular the introduction of Simple Imaging Polynomial (SIP) corrections. SExtractor uses an older style WCS correction, which has become abandoned over the years, not least because of the avaibility of Astrometry.net (which uses SIP corrections).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*~ | |
*.pyc | |
.hg | |
.hgignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import numpy as np | |
import healpy as hp | |
from astropy.io import fits | |
from astropy.wcs import WCS | |
from astropy.coordinates import SkyCoord | |
from astropy import units | |
from spherical_geometry.polygon import SphericalPolygon | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Plot multiple figures into a single PDF with matplotlib, using the | |
object-oriented interface. | |
""" | |
from matplotlib.backends.backend_pdf import FigureCanvasPdf, PdfPages | |
from matplotlib.figure import Figure | |
import numpy as np | |
with PdfPages('multi.pdf') as pages: | |
for i in range(10): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""The doc string | |
Very lengthy documentation | |
""" | |
import argparse | |
import pydoc | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from astropy.table import Table | |
def average(col): | |
# Manipulate multiple columns at once? | |
return col.mean() | |
def average_pd(df): | |
weight = df['weight'] | |
total = weight.sum() | |
df['value'] *= weight / total |
This describes the installation of photometry pipeline external dependencies, starting from a minimal CentOS 7.1 (1503) system. (Depending on the selected ISO image, you may want to select 'minimal'.)
Note that the minimal installations comes without a default (X) window manager, nor will it have a network connection.
This post provides a description of setting Astropy in a Django project that is run with Apache and mod_wsgi. I ran into enough issues that I decided to write them down for my future self.
For the GOTO project, I'm running the webpage as a Django project in an Apache server through mod_wsgi. This is overkill for the few, rather static, pages currently in use, but it is done somehwat in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Example to cancel a set of asyncio coroutines (futures), | |
using one coroutine to signal the event loop to stop. | |
""" | |
import asyncio | |
import logging | |
from datetime import datetime | |
from concurrent.futures import CancelledError | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
from distutils.extension import Extension | |
from Cython.Build import cythonize | |
import numpy | |
ext_modules = cythonize([ | |
Extension("testnp", | |
["testnp.pyx"], | |
include_dirs=[numpy.get_include()], |