Module: detecttrails

Detecttrails module is the SDSS oriented wrapper that will call the correct order of operations on the targeted data to succesfully run LFD. The module also handles the IO operations required to succesfully store results and wraps the required functionality for easier debugging.

class lfd.detecttrails.detecttrails.DetectTrails(**kwargs)[source]

Convenience class that processes targeted SDSS frames.

Example usage

foo = DetectTrails(run=2888)
foo = DetectTrails(run=2888, camcol=1, filter='i')
foo = DetectTrails(run=2888, camcol=1, filter='i', field=139)

At least 1 keyword has to be sent!

See documentation for full details on detection parameters. Like results and errors file paths, detection parameters are optional too and can be set after instantiation through provided dictionaries.

foo.params_bright["debug"] = True
foo.params_removestars["filter_caps"]["i"] = 20

All errors are silenced and dumped to error file. Results are dumped to results file.

  • run (int) – run designation
  • camcol (int) – camcol designation, 1 to 6
  • filter (str) – filter designation, one of ugriz filters
  • field (int) – field designation
  • params_dim (dict) – detection parameters for detecting dim trails. See docs for details.
  • params_bright (dict) – detection parameters for bright trails. See docs for details.
  • params_removestars (dict) – detection parameters for tuning star removal. See docs for details.
  • debug (bool) – turns on verbose and step-by-step image output visualizing the processing steps for all steps simultaneously. If $DEBUGPATH env. var. is not set errors will be raised.
  • results (str) – path to file where results will be saved
  • errors (str) – path to file where errors will be stored

Reads runlist.par file and returns a list of all runs.


Parses the send kwargs to determine what selection users wants to process. Currently supported options are:

  • run
  • run-camcol
  • run-filter
  • run-filter-camcol
  • camcol-filter
  • camcol-frame
  • field (full specification run-filter-camcol-frame)

Reads runlist.par file and extracts startfield and endfield of a run. Runs are retrieved from self._run attribute of instance.


Convenience function that runs process_field() for various inputs. Not using this function will void majority of error and exception handling in processing.