32
Two components Data Definition Language (DDL): create table, etc. Data Manipulation Language (DML): select, insert, delete, update, etc. Intro to SQL

Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

  • Upload
    others

  • View
    25

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

• Two components

• Data Definition Language (DDL):

• create table, etc.

• Data Manipulation Language (DML):

• select, insert, delete, update, etc.

Intro to SQL

Page 2: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

The basic “SELECT” statement:

Select A1, A2,......AN From R1, R2,.......RN

Where condition

Page 3: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

The basic “SELECT” statement:

Select A1, A2,......AN From R1, R2,.......RN

Where condition

3

21

Page 4: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

The basic “SELECT” statement:

Select A1, A2,......AN From R1, R2,.......RN

Where condition

3

21

what to returnrelationscombine/filter

Page 5: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

SELECT s.ra, s.dec, s.psfmag_g-s.extinction_g as g, s.psfmag_r-s.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

The basic “SELECT” statement:

Load query into DR9 servershow SELECT count(*)

show check syntax and retrieval optionsshow clean photometry query

Page 7: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

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

Page 8: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Binary, decimal, hexadecimal....

What??

https://www.youtube.com/watch?v=TFY8YuBLNKc

Go back to bitmasks page and showsearch with flags again.

Page 9: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Mag

nitu

de

Sun

10Msun

Color/Temperature

0.1Msun

CMD = Color-Magnitude Diagram (Color vs. Mag)

HR = Herzberg-Russell Diagram (Temp vs. Luminosity)

Science Interlude: Stellar Evolution

When stars form there are a small number of high mass stars, and a large number of low mass stars.

Main Sequence

and CMDs

Page 10: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

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.

F =L

4�d2

The flux we measure from a source depends on its distance:

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.

Page 11: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

The star Sirius has an apparent magnitude mV = V = -1.4

The faintest stars observed with HST have apparent magnitudes V ~ 30.

Color

Mag

nitude

The Magnitude System

Colors are defined as the ratio of fluxes, equivalently, the difference between magnitudes, e.g., V - I

Dotter et al. (2011)

Page 12: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

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.

Page 13: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Apparent versus Absolute Magnitude

The observed flux of an object depends on its distance from us (F = L / 4*pi*d2).

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

Page 14: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

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.

Page 15: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

05.03.2007 Mürren - Saas-Fee-Course - E.K. Grebel 31

2MASSinfrared image

Magellanic Clouds

Sagittarius

bulge

disk

halo

Can we find traces of such events

in our Local Group?

Milky Way

Sun

8 kpc

~200 kpchalo

GC’s

25 kpc

1kpc = 3 x 10^19 m ~ 3300 ly

open clusters

Page 16: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Science Interlude: Color Magnitude Diagrams

The Pleiadesseveral 1000 stars

Page 17: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a
Page 18: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

M80~million stars

Page 19: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

100 million years oldChemical abundance similar to Sun.Significant binary star fraction

12 Billion years oldChemical abundance similar to early universe

Science Interlude: Color Magnitude Diagrams

M13

Page 20: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Mas

s

Sun

10Msun

Temperature

0.1Msun

Stellar Evolution

Lowest mass star 0.08Msun,

limit for nuclear burning.

Highest mass star ~100Msun,

limit for fragmentation?

Main Sequence

Out of a single gas cloud, many stars are born at a single time:

-> lots of small mass stars -> handful of massive stars

Page 21: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Stellar Evolution

gravity pulls in

pressure pushes out

While a star is on the main sequence, it is in equilibrium.

Gravity balances pressure.

Pressure comes from heat generated by nuclearfusion in star’s core.

More massive stars therefore must have a higher pressure/temperature in their core, in order to maintain equilibrium.

Page 22: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

The Sun’s Lifetime

Sun is born Now White dwarf formsSun runs out

of hydrogen fuel

The Sun formed 4 billion years ago, and will live for another 4 billion years.

Page 23: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

The Sun’s Lifetime

At very end of evolution, outer region expands and disappears.

Inner region shrinks,white dwarf left behind.

white dwarf

Page 24: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

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

Page 25: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

L �M3.5

Stellar Evolution

More massive stars must have a higher temperature to maintain equilibrium.

Stars are approximately black-bodies, thushotter stars are also bluer.

L � T 4

Along the main sequence, temperature, T, and luminosity, L, are related:

Page 26: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Stellar Evolution - Lifetimes

How does stellar mass relate to a star’s lifetime?

The total energy released by a star in its lifetime is, Etotal: Etotal = L * time

Nuclear fusion is turning mass into energy, which means Etotal = eff * M c2

t �M�2.5

Using the relationship between L and M on the main sequence:

Massive star lifetimes are much shorter than lower mass stars.

Page 27: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Stellar EvolutionM

agni

tude

/Mas

s

Sun

10Msun

Color/Temperature

0.1Msun

10-100 million years(very short lifetime)

2-8 billion years

10-100 billion years(longer than age of Universe)

Page 28: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Stellar EvolutionM

agni

tude

/Mas

s

Sun

10Msun

Color/Temperature

0.1Msun

How does Sun’s post-mainsequence evolution appearin color-magnitude space?

Page 29: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

Stellar Evolution

Composite CMD for open star clusters in the Milky Way

If stars of all masses form at same time, can determine ageby noting which stars are justevolving off of the main sequence.

Page 30: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a

100 million years oldChemical abundance similar to Sun.Significant binary star fraction

12 Billion years oldChemical abundance similar to early universe

Science Interlude: Color Magnitude Diagrams

MS = main sequence MS

RGB = Red Giant Branch

HB = Horizontal Branch

WD = White Dwarfs

Page 31: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a
Page 32: Two components Data Definition Language (DDL): create ... · •Data Definition Language (DDL): •create table, etc. ... L M 3.5 Stellar Evolution More massive stars must have a