Project

General

Profile

Query all data

Query all data except junk- fwhm > 0", ellipticity > 0, exposure time > 30 seconds

SELECT e.expnum         AS exposure_id,
       e.mjd,
       n.date,
       e.ra,
       e.dec,
       e.filter,
       e.exptime,
       Avg(fwhm)        AS fwhm,
       Avg(ellipticity) AS ellipticity,
       Avg(bkg)         AS bkg,
       e.object
FROM   exposure e,
       ccd c,
       night n
WHERE  e.exposure_id = c.exposure_id
       AND e.night_id = n.night_id
       AND e.exptime > 30
       AND c.fwhm > 0
       AND ellipticity > 0.
GROUP  BY e.mjd,
          e.exptime,
          e.zd,
          e.filter,
          e.object,
          e.expnum,
          e.ra,
          e.dec,
          n.date 
ORDER BY e.expnum

Dealing with time

This works:

% python
>>> import ephem
>>> mjdNow = ephem.julian_date()-2400000.5; mjdNow
56342.234745370224
>>> mjdThen = ephem.julian_date("2013-02-18 00:00:20.737928 00")-2400000.5; mjdThen
56341.00024002232
>>> desdayZero = 56282; # 12-21-2012, the end of the last bak tun, the end of the world
>>> desday = mjdNow-desdayZero; desday
60.23474537022412