1 / 9

The Astro-wise pipeline

Python Data processing - the low-level interfaces Data administration - persistent objects. The Astro-wise pipeline. Python. Object Oriented scripting language clean, easy-to-understand syntax extensive library powerful built-in data types (str, dict, list, file)

bruce-wade
Télécharger la présentation

The Astro-wise pipeline

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python Data processing - the low-level interfaces Data administration - persistent objects The Astro-wise pipeline

  2. Python • Object Oriented scripting language • clean, easy-to-understand syntax • extensive library • powerful built-in data types (str, dict, list, file) • byte-code interpreted, dynamically typed Rapid development and easy maintenance

  3. Python, a 1-slide course wordcount = {} for line in file('my_thesis.txt'): for word in line.split(): if word not in wordcount: wordcount[word] = 1 else: wordcount[word] += 1 print wordcount

  4. Image processing • eclipse libraray in C (ESO, N. Devillard) • wrapped with SWIG • fits images and headers as built-in data types >>> from eclipse import image, header >>> img = image('science.fits') >>> hdr = header('science.fits') >>> flat = image('flat.fits') >>> img = img / flat >>> hdr['FLATFLD'] = 'flat.fits' >>> img.save('flatfielded.fits', hdr) • Co-addition with SWARP (IAP, E. Bertin)

  5. Catalog Processing • Sextractor (IAP, E. Bertin) • LDAC (OmegaCAM, E. Deul) • Astrometry • Photometry • Common interfaces, but no Python types • Persistent Sourcelists (see KGB)

  6. Astro-wise Pipelines • Pipelines are about data-administration, not about data-processing • Persistent objects • Object's state persists across program boundaries • Python classes representing SQL tables • Should also work without back-end • Distinguish meta-data and bulk (FITS) data • meta data in persistent objects • bulk (FITS) data through file-server

  7. The make metaphor • 'Making' objects • think unix Makefile • targets and dependencies (recursive) >>> bias = BiasFrame() >>> bias.raw_frames = [RawBiasFrame('bias1.fits'), RawBiasFrame('bias2.fits'), ... RawBiasFrane('biasN.fits')] >>> bias.make()

  8. An example with Queries • Queries are Python expressions (see Danny) • Dependencies can be filled through queries >>> bias = BiasFrame() >>> query = ((RawBiasFrames.chip.name == 'ccd50') & (RawBiasFrames.DATE_OBS > a_date-1) & (RawBiasFrames.DATE_OBS < a_date+1)) >>> bias.raw_frames = list(query) >>> bias.make() >>> bias.store() # the bulk FITS data >>> bias.commit() # the meta data

  9. Image Pipeline

More Related