Intro to SQL Two components Data Definition Language (DDL): create table, etc. Data Manipulation Language (DML): select, insert, delete, update, etc.
The basic SELECT statement: Select From Where A1, A2,...AN R1, R2,...RN condition
The basic SELECT statement: 3 1 2 Select From Where A1, A2,...AN R1, R2,...RN condition
The basic SELECT statement: 3 Select A1, A2,...AN what to return 1 From R1, R2,...RN relations 2 Where condition combine/filter
The basic SELECT statement: SELECT s.ra, s.dec, s.psfmag_g-s.extinction_g as g, s.psfmag_rs.extinction_r as r, s.psfmag_i-s.extinction_i as i, pm.pmra, pm.pmdec, pm.pmraerr, pm.pmdecerr FROM star as s JOIN propermotions as pm ON s.objid = pm.objid WHERE s.ra BETWEEN 225.6 AND 225.8 and s.dec BETWEEN -2.0 and -1.8 AND CLEAN=1 AND s.psfmag_r <22 Load query into DR9 server show SELECT count(*) show check syntax and retrieval options show clean photometry query
relevant URL s from previous page: http://skyserver.sdss3.org/dr9/en/tools/search/sql.asp http://skyserver.sdss3.org/dr9/en/help/docs/ realquery.asp#cleanstars
Flags & Bitmasks One thing that's important to fully exploit the SDSS database is a good understanding of bitmasks. A bitmask uses the bits in an integer as "toggles" to indicate whether certain conditions are met. http://www.sdss3.org/dr10/algorithms/bitmasks.php
Binary, decimal, hexadecimal... What?? https://www.youtube.com/watch?v=tfy8yublnkc Go back to bitmasks page and show search with flags again.
Science Interlude: Stellar Evolution and CMDs CMD = Color-Magnitude Diagram (Color vs. Mag) Magnitude 10Msun Main Sequence Sun HR = Herzberg-Russell Diagram (Temp vs. Luminosity) When stars form there are a small number of high mass stars, and a large number of low mass stars. 0.1Msun Color/Temperature
Magnitudes, Luminosity and Fluxes An astronomical source gives off a certain number of photons (per second per wavelength) which we will call its luminosity, L. The flux we measure from a source depends on its distance: F = L 4 d 2 In the radio, fluxes are typically measured in Janskys, where: 1 Jansky = 10-26 watts / square meter / Hertz Optical and infrared astronomers quantify the brightness of an object using the magnitude system, which is the proportional to the logarithm of flux. Magnitudes are define as: m = 2.5 * log10(f) + 2.5*log10(F0) where 2.5*log10(F0) depends on the photometric system.
Dotter et al. (2011) Colors are defined as the ratio of fluxes, equivalently, the difference between magnitudes, e.g., V - I The star Sirius has an apparent magnitude mv = V = -1.4 The faintest stars observed with HST have apparent magnitudes V ~ 30.
The Magnitude System In addition to the UBVRI photometric system, the SDSS system is also widely used (ugriz): It is possible to transform between photometric systems.
Apparent versus Absolute Magnitude The observed flux of an object depends on its distance from us (F = L / 4*pi*d 2 ). Thus, when we observe an object, we are measuring its apparent magnitude (mv or V, mg or g) The absolute magnitude of an object (MV, Mg, etc.) is related to its total luminosity. Absolute magnitude is defined to be M = m when an object is placed at 10 parsecs (10 pc). In PS#2, you will show that: M = m + 5 + 5*log10(d) where d is distance in units of parsecs
Science Interlude: Stellar Evolution Stars form out of clouds of gas. Out of a single gas cloud, many stars are born at a single time: -> lots of small mass stars -> handful of massive stars Stellar birth is clustered.
1kpc = 3 x 10^19 m ~ 3300 ly Can we find traces of such events in our Local Group? Milky Way halo GC s bulge disk 8 kpc open clusters halo ~200 kpc 05.03.2007 Sun 25 kpc Sagittarius Magellanic Clouds Mürren - Saas-Fee-Course - E.K. Grebel 2MASS infrared 31 image
Science Interlude: Color Magnitude Diagrams several 1000 stars The Pleiades
~million stars M80
Science Interlude: Color Magnitude Diagrams M13 12 Billion years old Chemical abundance similar to early universe 100 million years old Chemical abundance similar to Sun. Significant binary star fraction
Stellar Evolution 10Msun Out of a single gas cloud, many stars are born at a single time: -> lots of small mass stars -> handful of massive stars Mass Main Sequence Sun Highest mass star ~100Msun, limit for fragmentation? 0.1Msun Lowest mass star 0.08Msun, limit for nuclear burning. Temperature
Stellar Evolution gravity pulls in While a star is on the main sequence, it is in equilibrium. Gravity balances pressure. pressure pushes out Pressure comes from heat generated by nuclear fusion in star s core. More massive stars therefore must have a higher pressure/ temperature in their core, in order to maintain equilibrium.
The Sun s Lifetime The Sun formed 4 billion years ago, and will live for another 4 billion years. Sun is born Now Sun runs out of hydrogen fuel White dwarf forms
The Sun s Lifetime At very end of evolution, outer region expands and disappears. Inner region shrinks, white dwarf left behind. white dwarf
Stellar Evolution Stars are ~black bodies, i.e., in thermal equilibrium.the radiation has a specific spectrum and intensity that depends only on the temperature of the body.
Stellar Evolution More massive stars must have a higher temperature to maintain equilibrium. Stars are approximately black-bodies, thus hotter stars are also bluer. Along the main sequence, temperature, T, and luminosity, L, are related: L T 4 L M 3.5
Stellar Evolution - Lifetimes How does stellar mass relate to a star s lifetime? The total energy released by a star in its lifetime is, E total : E total = L * time Nuclear fusion is turning mass into energy, which means E total = eff * M c 2 Using the relationship between L and M on the main sequence: t M 2.5 Massive star lifetimes are much shorter than lower mass stars.
Stellar Evolution Magnitude/Mass 10Msun Sun 0.1Msun 10-100 million years (very short lifetime) 2-8 billion years 10-100 billion years (longer than age of Universe) Color/Temperature
Stellar Evolution Magnitude/Mass 10Msun Sun How does Sun s post-main sequence evolution appear in color-magnitude space? 0.1Msun Color/Temperature
Stellar Evolution If stars of all masses form at same time, can determine age by noting which stars are just evolving off of the main sequence. Composite CMD for open star clusters in the Milky Way
Science Interlude: Color Magnitude Diagrams HB = Horizontal Branch RGB = Red Giant Branch MS = main sequence MS WD = White Dwarfs 12 Billion years old Chemical abundance similar to early universe 100 million years old Chemical abundance similar to Sun. Significant binary star fraction