Top Banner
Transient Detection and SQL Gijs Molenaar Anton Pannekoek Institute (UvA) @gijzelaerr [email protected]
22

Python User Group November 2013, SQL(alchemy) and transient detection

May 31, 2015

Download

Technology

Gijs Molenaar
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Python User Group November 2013, SQL(alchemy) and transient detection

Transient Detection and SQL

Gijs Molenaar !

Anton Pannekoek Institute (UvA) !

@gijzelaerr [email protected]

Page 2: Python User Group November 2013, SQL(alchemy) and transient detection

LOFAR

• Radio telescope

• ~10–240 MHz

• Software telescope

• omni-directional

Page 3: Python User Group November 2013, SQL(alchemy) and transient detection

AARTFAAC

• Lofar sub project

• 24/7 full sky transient detection

• ‘Changes’

• 99% Python code

Page 4: Python User Group November 2013, SQL(alchemy) and transient detection

Transients

• Super-nova

• Gamma-ray burst

• Pulsars

• exo-planets

• ?

Page 5: Python User Group November 2013, SQL(alchemy) and transient detection

Images

• 10-240 MHz

• Split in 10 bands

• 1 image cube per second

• future 10 images per second

Page 6: Python User Group November 2013, SQL(alchemy) and transient detection

Data

• Source

• Position

• Flux (intensity)

• Shape (2d gaussian)

Page 7: Python User Group November 2013, SQL(alchemy) and transient detection

Data rate

• 500 - 5000 inserts per second

• Higher in other modes

Page 8: Python User Group November 2013, SQL(alchemy) and transient detection

Calculations

• Associate in frequency

• Associate in time

Page 9: Python User Group November 2013, SQL(alchemy) and transient detection

Quite a lot of data

• move calculations to data (base)

Page 10: Python User Group November 2013, SQL(alchemy) and transient detection

nonosql

• Structured data

• Natural sharding by sky position

• MonetDB

Page 11: Python User Group November 2013, SQL(alchemy) and transient detection

Why MonetDB

• Dutch (CWI)

• Fast with huge datasets

• Developers next door

Page 12: Python User Group November 2013, SQL(alchemy) and transient detection

calculations to data

• No moving around data

• one huge big monolithic query per ‘operation’

Page 13: Python User Group November 2013, SQL(alchemy) and transient detection

Example

Page 14: Python User Group November 2013, SQL(alchemy) and transient detection

HORRIBLE• Huge monolithic queries

• hard to read

• hard to reason about

• hard to test

• hard to maintain

• hard to port

Page 15: Python User Group November 2013, SQL(alchemy) and transient detection

Solution?

• Functions?

Page 16: Python User Group November 2013, SQL(alchemy) and transient detection

NO!

• DB revisions, versioning hell

• For every code change new version

• Schema migrations

• Init functions on startup?

• DB specific

Page 17: Python User Group November 2013, SQL(alchemy) and transient detection

SOLUTION

Page 18: Python User Group November 2013, SQL(alchemy) and transient detection

Why?• Object Relational Mapper

• Better Query Builder Language!

• Support multiple database dialect

• Functions per dialect

!

• SQLAlchemy -> SQL is like C -> assembler

Page 19: Python User Group November 2013, SQL(alchemy) and transient detection

example

Page 20: Python User Group November 2013, SQL(alchemy) and transient detection

Why not earlier?

• Started by non programmers

• No MonetDB dialect for SQLAlchemy

Page 21: Python User Group November 2013, SQL(alchemy) and transient detection

sqlalchemy-monetdb

• pip install sqlalchemy-monetdb

• https://github.com/gijzelaerr/sqlalchemy-monetdb

• https://github.com/gijzelaerr/djonet

• (banana)

Page 22: Python User Group November 2013, SQL(alchemy) and transient detection

Questions?