Frame represents a single SDSS image. On a single CCD there can be up to 3 such frames simultaneously, slightly overlapped on top and bottom edges. It is not clear to me how to resolve a Frame’s position within a CCD due to the SDSS’ drift-scan method.

Frames can only exist within a CCD and CCD’s are placed in an fiter x camcol grid in the CCD plane where the distance between camcols is only slightly less than the size of the CCD itself so that the gaps can be filled in by another run.

A single Frame can contain many Events.

class lfd.results.frame.Frame(run, camcol, filter, field, crpix1, crpix2, crval1, crval2, cd11, cd12, cd21, cd22, t, **kwargs)[source]

Class Frame maps table ‘frames’. Corresponds to an SDSS frame. A frame is uniquely defined by the set (run, camcol, filter, field). For in-depth see datamodel:

  • run (int) – run id (composite PrimaryKey)
  • camcol (int) – camcol id (composite PrimaryKey)
  • filter (str) – filter id (composite PrimaryKey)
  • field (int) – field id (composite PrimaryKey)
  • crpix1 (int) – x frame coordinate of the reference central pixel
  • crpix2 (int) – y frame coordinate of the reference central pixel
  • crval1 (float) – RA on-sky coordinates of the reference pixel (degrees)
  • crval2 (float) – DEC on-sky coordinate of the reference pixel
  • cd11 (float) – change of RA per column pixel
  • cd12 (float) – change of RA per row pixel
  • cd21 (float) – change of DEC per column pixel
  • cd22 (float) – chage of DEC per row pixel
  • t (BasicTime) – time of start of frame exposure
  • events (sql.relationship) – list of all event(s) registered on this frame, a one to many relationship to events


Almost everything is not nullable so supply everything:

>>> foo = Frame(run, camcol, filter, field, crpix1, cprix2, crval1, crval2,
                cd11, cd21, cd22, t)


>>> foo = Frame(2888, 1, 'i', 139, 741, 1024, 119, 23, 1, 1, 1,

Time can be given as SDSS TAI or any of the other formats supported by Astropy Time Object. In the DB itself it is always forced to the SDSS TAI time format.

classmethod query(condition=None)[source]

Class method that used to query the Frame (‘frames’) table. Returns a Query object. Appropriate for interactive work as Session remains open for the lifetime of the Query. See results package help to see details.

If condition is supplied it is interpreted as an SQL string query. It’s suffiecient to use mapped class names and their attributes as the translation to table and column names will be automaticall performed.


Frame.query(“ > 2”).first() Frame.query(“field == 1 and filter == ‘i’”).all() Frame.query(“Event.y1 > 2).all()