In [1]:
from __future__ import print_function, absolute_import, division

Re-Introduction to Databases:

Selecting Sources from the Sloan Digital Sky Survey

Version 0.1


By AA Miller 2017 Apr 19

During the first session of the DSFP we learned about the basics of database operation and writing queries/code in SQL. Here, we will review some basics and complete some problems concerning queries on the SDSS database.


In [2]:
import matplotlib.pyplot as plt
%matplotlib notebook


/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/astroquery/sdss/__init__.py:29: UserWarning: Experimental: SDSS has not yet been refactored to have its API match the rest of astroquery (but it's nearly there).
  warnings.warn("Experimental: SDSS has not yet been refactored to have its API "

At the most basic level - databases store your bytes, and later return those bytes (or a subset of them) when queried.

They provide a highly efficient means for filtering your bytes (there are many different strategies that the user can employ).

The backend for most databases is the Structured Query Language or SQL, which is a standard declarative language.

There are many different libraries that implement SQL: MySQL, PostgreSQL, Greenplum, Microsoft SQL server, IBM DB2, Oracle Database, etc.

Problem 1) Basic SQL Operations with SQLite

The most basic implementation is SQLite a self-contained, SQL database engine. We will discuss SQLite further later in the week, but in brief - it is a nice stand alone package that works really well for small problems (such as the example that we are about to encounter).


In [3]:
import sqlite3

Without diving too much into the weeds (we'll investigate this further later this week), we need to establish a connection to the database. From the connection we create a cursor, which allows us to actually interact with the database.


In [4]:
conn = sqlite3.connect("reintro.db")
cur = conn.cursor()

And just like that - we have now created a new database reintro.db, with which we can "store bytes" or later "retrieve bytes" once we have added some data to the database.

Aside - note that unlike many SQL libraries, SQLite does not require a server and creates an actual database file on your hard drive. This improves portability, but also creates some downsides as well.

Now we need to create a table and insert some data. We will interact with the database via the execute() method for the cursor object.

Recall that creating a table requires a specification of the table name, the columns in the table, and the data type for each column. Here's an example where I create a table to store info on my pets:

cur.execute("""create table PetInfo(
                                    Name text, 
                                    Species text,
                                    Age tinyint,
                                    FavoriteFood text
                                    )""")

Problem 1a

Create a new table in the database called DSFPstudents with columns Name, Institution, and Year, where Year is the year in graduate school.


In [ ]:
cur.execute( # complete

In [10]:
cur.execute("""create table DSFPstudents(
                                    Name text, 
                                    Institution text,
                                    Year tinyint
                                    )""")


Out[10]:
<sqlite3.Cursor at 0x10f537ea0>

Once a table is created, we can use the database to store bytes. If I were to populate my PetInfo table I would do the following:

cur.execute("""insert into PetInfo(Name, Species, Age, FavoriteFood) 
                            values ("Rocky", "Dog", 12, "Bo-Nana")""")
cur.execute("""insert into PetInfo(Name, Species, Age, FavoriteFood) 
                            values ("100 Emoji-Flames Emoji", "Red Panda", 2, "bamboo leaves")""")

Note - column names do not need to be explicitly specified, but for clarity this is always preferred.

Problem 1b

Insert data for yourself, and the two people sitting next to you into the database.


In [ ]:
cur.execute( # complete

In [12]:
cur.execute("""insert into DSFPstudents(Name, Institution, Year) 
                            values ("Adam Miller", "Northwestern", 10)""")
cur.execute("""insert into DSFPstudents(Name, Institution, Year) 
                            values ("Lucianne Walkowicz", "Adler", 13)""")


Out[12]:
<sqlite3.Cursor at 0x10f537ea0>

Now that we have bytes in the database, we can retrieve those bytes with one (or several) queries. There are 3 basic building blocks to a query:

SELECT...
FROM...
WHERE...

Where SELECT specifies the information we want to retrieve from the database, FROM specifies the tables being queried in the database, and WHERE specifies the conditions for the query.

Problem 1c

Select the institutions for all students in the DSFPstudents table who have been in grad school for more than 2 years.

Hint - to display the results of your query run cur.fetchall().


In [ ]:
cur.execute( # complete
cur.fetchall()

In [13]:
cur.execute("""select Institution from DSFPstudents where year > 2""")
cur.fetchall()


Out[13]:
[('Northwestern',), ('Adler',)]

As we round out this brief review of databases, recall that the quality of databases relies on ACID properties:

  1. Atomicity
  2. Consistency
  3. Isolation
  4. Durability

As we round out this brief review of databases, recall that the success of databases relies on ACID properties:

  1. Atomicity - all parts of transaction succeed, or rollback state of database
  2. Consistency
  3. Isolation
  4. Durability

As we round out this brief review of databases, recall that the success of databases relies on ACID properties:

  1. Atomicity - all parts of transaction succeed, or rollback state of database
  2. Consistency - data always meets validation rules
  3. Isolation
  4. Durability

As we round out this brief review of databases, recall that the success of databases relies on ACID properties:

  1. Atomicity - all parts of transaction succeed, or rollback state of database
  2. Consistency - data always meets validation rules
  3. Isolation - no interference across transactions (even if concurrent)
  4. Durability

As we round out this brief review of databases, recall that the success of databases relies on ACID properties:

  1. Atomicity - all parts of transaction succeed, or rollback state of database
  2. Consistency - data always meets validation rules
  3. Isolation - no interference across transactions (even if concurrent)
  4. Durability - a committed transaction remains committed (even if there's a power outage, etc)

Problem 2) Complex Queries with SDSS

Above we looked at the most basic operations possible with a database (recall - databases are unnecessary, and possibly cumbersome, with small data sets). A typical database consists of many tables, and these tables may be joined together to unlock complex questions for the data.

As a reminder on (some of) this functionality, we are now going to go through some problems using the SDSS database. The full SDSS schema explains all of the tables, columns, views and functions for querying the database. We will keep things relatively simple in that regard.


In [16]:
from astroquery.sdss import SDSS

As we have seen previously, astroquery enables seemless connections to the SDSS database via the Python shell.

Problem 2a

Select 20 random sources from the PhotoObjAll table and return all columns in the table.

Hint - while this would normally be accomplished by starting the query select limit 20 ..., SDSS CasJobs uses Microsoft's SQL Server, which adopts select top 20 ... to accomplish an identical result.


In [ ]:
SDSS.query_sql( # complete

In [19]:
SDSS.query_sql("""select top 20 * from PhotoObjAll""")


Out[19]:
<Table length=10>
objIDskyVersionrunreruncamcolfieldobjmodenChildtypecleanprobPSFinsideMaskflagsrowcrowcErrcolccolcErrrowvrowvErrcolvcolvErrrowc_urowc_growc_rrowc_irowc_zrowcErr_urowcErr_growcErr_rrowcErr_irowcErr_zcolc_ucolc_gcolc_rcolc_icolc_zcolcErr_ucolcErr_gcolcErr_rcolcErr_icolcErr_zsky_usky_gsky_rsky_isky_zskyIvar_uskyIvar_gskyIvar_rskyIvar_iskyIvar_zpsfMag_upsfMag_gpsfMag_rpsfMag_ipsfMag_zpsfMagErr_upsfMagErr_gpsfMagErr_rpsfMagErr_ipsfMagErr_zfiberMag_ufiberMag_gfiberMag_rfiberMag_ifiberMag_zfiberMagErr_ufiberMagErr_gfiberMagErr_rfiberMagErr_ifiberMagErr_zfiber2Mag_ufiber2Mag_gfiber2Mag_rfiber2Mag_ifiber2Mag_zfiber2MagErr_ufiber2MagErr_gfiber2MagErr_rfiber2MagErr_ifiber2MagErr_zpetroMag_upetroMag_gpetroMag_rpetroMag_ipetroMag_zpetroMagErr_upetroMagErr_gpetroMagErr_rpetroMagErr_ipetroMagErr_zpsfFlux_upsfFlux_gpsfFlux_rpsfFlux_ipsfFlux_zpsfFluxIvar_upsfFluxIvar_gpsfFluxIvar_rpsfFluxIvar_ipsfFluxIvar_zfiberFlux_ufiberFlux_gfiberFlux_rfiberFlux_ifiberFlux_zfiberFluxIvar_ufiberFluxIvar_gfiberFluxIvar_rfiberFluxIvar_ifiberFluxIvar_zfiber2Flux_ufiber2Flux_gfiber2Flux_rfiber2Flux_ifiber2Flux_zfiber2FluxIvar_ufiber2FluxIvar_gfiber2FluxIvar_rfiber2FluxIvar_ifiber2FluxIvar_zpetroFlux_upetroFlux_gpetroFlux_rpetroFlux_ipetroFlux_zpetroFluxIvar_upetroFluxIvar_gpetroFluxIvar_rpetroFluxIvar_ipetroFluxIvar_zpetroRad_upetroRad_gpetroRad_rpetroRad_ipetroRad_zpetroRadErr_upetroRadErr_gpetroRadErr_rpetroRadErr_ipetroRadErr_zpetroR50_upetroR50_gpetroR50_rpetroR50_ipetroR50_zpetroR50Err_upetroR50Err_gpetroR50Err_rpetroR50Err_ipetroR50Err_zpetroR90_upetroR90_gpetroR90_rpetroR90_ipetroR90_zpetroR90Err_upetroR90Err_gpetroR90Err_rpetroR90Err_ipetroR90Err_zq_uq_gq_rq_iq_zqErr_uqErr_gqErr_rqErr_iqErr_zu_uu_gu_ru_iu_zuErr_uuErr_guErr_ruErr_iuErr_zmE1_umE1_gmE1_rmE1_imE1_zmE2_umE2_gmE2_rmE2_imE2_zmE1E1Err_umE1E1Err_gmE1E1Err_rmE1E1Err_imE1E1Err_zmE1E2Err_umE1E2Err_gmE1E2Err_rmE1E2Err_imE1E2Err_zmE2E2Err_umE2E2Err_gmE2E2Err_rmE2E2Err_imE2E2Err_zmRrCc_umRrCc_gmRrCc_rmRrCc_imRrCc_zmRrCcErr_umRrCcErr_gmRrCcErr_rmRrCcErr_imRrCcErr_zmCr4_umCr4_gmCr4_rmCr4_imCr4_zmE1PSF_umE1PSF_gmE1PSF_rmE1PSF_imE1PSF_zmE2PSF_umE2PSF_gmE2PSF_rmE2PSF_imE2PSF_zmRrCcPSF_umRrCcPSF_gmRrCcPSF_rmRrCcPSF_imRrCcPSF_zmCr4PSF_umCr4PSF_gmCr4PSF_rmCr4PSF_imCr4PSF_zdeVRad_udeVRad_gdeVRad_rdeVRad_ideVRad_zdeVRadErr_udeVRadErr_gdeVRadErr_rdeVRadErr_ideVRadErr_zdeVAB_udeVAB_gdeVAB_rdeVAB_ideVAB_zdeVABErr_udeVABErr_gdeVABErr_rdeVABErr_ideVABErr_zdeVPhi_udeVPhi_gdeVPhi_rdeVPhi_ideVPhi_zdeVMag_udeVMag_gdeVMag_rdeVMag_ideVMag_zdeVMagErr_udeVMagErr_gdeVMagErr_rdeVMagErr_ideVMagErr_zdeVFlux_udeVFlux_gdeVFlux_rdeVFlux_ideVFlux_zdeVFluxIvar_udeVFluxIvar_gdeVFluxIvar_rdeVFluxIvar_ideVFluxIvar_zexpRad_uexpRad_gexpRad_rexpRad_iexpRad_zexpRadErr_uexpRadErr_gexpRadErr_rexpRadErr_iexpRadErr_zexpAB_uexpAB_gexpAB_rexpAB_iexpAB_zexpABErr_uexpABErr_gexpABErr_rexpABErr_iexpABErr_zexpPhi_uexpPhi_gexpPhi_rexpPhi_iexpPhi_zexpMag_uexpMag_gexpMag_rexpMag_iexpMag_zexpMagErr_uexpMagErr_gexpMagErr_rexpMagErr_iexpMagErr_zmodelMag_umodelMag_gmodelMag_rmodelMag_imodelMag_zmodelMagErr_umodelMagErr_gmodelMagErr_rmodelMagErr_imodelMagErr_zcModelMag_ucModelMag_gcModelMag_rcModelMag_icModelMag_zcModelMagErr_ucModelMagErr_gcModelMagErr_rcModelMagErr_icModelMagErr_zexpFlux_uexpFlux_gexpFlux_rexpFlux_iexpFlux_zexpFluxIvar_uexpFluxIvar_gexpFluxIvar_rexpFluxIvar_iexpFluxIvar_zmodelFlux_umodelFlux_gmodelFlux_rmodelFlux_imodelFlux_zmodelFluxIvar_umodelFluxIvar_gmodelFluxIvar_rmodelFluxIvar_imodelFluxIvar_zcModelFlux_ucModelFlux_gcModelFlux_rcModelFlux_icModelFlux_zcModelFluxIvar_ucModelFluxIvar_gcModelFluxIvar_rcModelFluxIvar_icModelFluxIvar_zaperFlux7_uaperFlux7_gaperFlux7_raperFlux7_iaperFlux7_zaperFlux7Ivar_uaperFlux7Ivar_gaperFlux7Ivar_raperFlux7Ivar_iaperFlux7Ivar_zlnLStar_ulnLStar_glnLStar_rlnLStar_ilnLStar_zlnLExp_ulnLExp_glnLExp_rlnLExp_ilnLExp_zlnLDeV_ulnLDeV_glnLDeV_rlnLDeV_ilnLDeV_zfracDeV_ufracDeV_gfracDeV_rfracDeV_ifracDeV_zflags_uflags_gflags_rflags_iflags_ztype_utype_gtype_rtype_itype_zprobPSF_uprobPSF_gprobPSF_rprobPSF_iprobPSF_zradeccxcyczraErrdecErrbloffsetRa_uoffsetRa_goffsetRa_roffsetRa_ioffsetRa_zoffsetDec_uoffsetDec_goffsetDec_roffsetDec_ioffsetDec_zextinction_uextinction_gextinction_rextinction_iextinction_zpsffwhm_upsffwhm_gpsffwhm_rpsffwhm_ipsffwhm_zmjdairmass_uairmass_gairmass_rairmass_iairmass_zphioffset_uphioffset_gphioffset_rphioffset_iphioffset_znProf_unProf_gnProf_rnProf_inProf_zloadVersionhtmIDfieldIDparentIDspecObjIDugrizerr_uerr_gerr_rerr_ierr_zdered_udered_gdered_rdered_idered_zcloudCam_ucloudCam_gcloudCam_rcloudCam_icloudCam_zresolveStatusthingIdbalkanIdnObservenDetectnEdgescorecalibStatus_ucalibStatus_gcalibStatus_rcalibStatus_icalibStatus_znMgyPerCount_unMgyPerCount_gnMgyPerCount_rnMgyPerCount_inMgyPerCount_zTAI_uTAI_gTAI_rTAI_iTAI_z
int64int64int64int64int64int64int64int64int64int64int64int64int64int64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64int64int64int64int64int64int64int64int64int64int64int64int64int64int64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64float64float64float64float64float64float64float64float64float64float64int64int64int64int64int64int64int64int64int64int64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64int64int64int64int64int64int64int64int64int64int64int64float64int64int64int64int64int64float64float64float64float64float64float64float64float64float64float64
1237645876861272065294301111134300048826295556916655.689031.0080071909.3731.006504-9999.0-9999.0-9999.0-9999.062.3271769.6209155.6258859.4905265.055691.01.01.01.01.01911.8681914.0381909.3231906.611908.7471.01.01.01.01.01.8493322.1453675.56610711.9907839.44223115867.568460.2744214.595288.5695439.5710.929379.6488714.391849.32171911.049310.00035662669.074066e-050.01772459.235229e-050.000511944511.122599.7298814.293629.40308712.37640.0021279280.000805553427019.440.00031740210.00277044711.164619.73672115.147959.41082713.300250.001505912272.18810.03865255435.420477140.9310.914629.63837812.014579.30547511.004830.00087327680.00062184620.0068463470.0011363720.0026234442486.44138182.21750.916186772.338043.00.0051347660.0074979140.0012239680.0039621270.00310780235560.32128247.21916.682173286.811205.730.00020587490.00011044964.395371e-160.0003896710.0012231234210.1127441.7872.6114172055.84785.1860.00044416149.796861e-160.0010362172.100353e-168.651298e-1843067.9139524.015637.64189587.639634.180.00083336910.00015659750.00010284622.539732e-050.00010903523.6294475.9220555.9800666.8019793.3722010.047107290.11705390.21695820.24515550.036271232.1442213.1843543.0737343.1835961.9409120.0047920580.013825010.013627450.02512630.0029132745.6210057.4936627.6825478.6255114.7008270.10970540.15766020.15798920.2605990.052819860.13752610.17204960.14754630.1444260.0066152720.0005196120.00022151690.00020735770.00023023320.0003291701-0.0234536-0.002324058-0.01744305-0.01851548-0.0056309460.00051033510.00021523840.00020304750.00022565330.00032916610.13363790.37284150.33013540.32049860.08828475-0.05147791-0.01094185-0.05974403-0.046111060.0139268-1000.06.424013e-058.481451e-050.0001299837-1000.0-1000.04.421963e-061.261892e-051.66817e-05-1000.0-1000.06.922796e-058.96917e-050.0001370763-1000.020.4831188.5666480.3903581.5452317.78692-1000.00.0070529850.0080747040.01241958-1000.00.47736511.9388831.9288161.9606660.56226260.05660950.045259740.0079301750.13241880.02255016-0.05276328-0.009676965-0.0326623-0.08726448-0.045114285.9871536.2449215.4611775.6596975.8265932.0563032.074662.0609372.0900882.0859052.8838996.3730826.382389.8916452.3291320.037677920.074572940.07895950.13855190.022660560.82523350.77477960.81522270.84633450.86609270.0087895570.0097930190.011345220.012881040.009673044167.515178.7627155.7975164.9705166.566313.1210912.6513712.4529511.7551911.793320.0065369650.0060684670.0067876190.0063031110.007011485643.7298698.68810442.8619857.5719172.180.00086609210.00042304160.00023462557.524657e-056.523586e-052.6824734.6954164.6224234.9985322.1099980.033359350.028113950.027120460.044879250.017012420.93487080.7790250.81646030.87106220.99995230.0087789350.0056933070.0062426940.0077960.008888426167.3981178.5604156.0326164.6681164.481512.9701512.4735312.2271211.9000111.433710.0079496580.0061964860.0068745450.0066007080.00814487311.065429.67237812.452949.32280912.258850.00080508280.00038305640.0067876180.00054629570.00813495613.0793612.5780912.3419511.8159811.653770.0070339310.0061494750.0068741850.0064291490.0077131496485.45810246.812857.3417377.8226700.30.00044347630.00029240230.00015088928.959359e-052.492572e-0537482.81135222.510442.95186584.812487.010.0012945030.00043936450.00023462140.00011345950.00011424085864.8369306.00311566.9918776.2821801.730.00069269270.00035995330.00018645138.089518e-054.168725e-0542486.44138182.213883.85186772.338043.03.435339e-051.585304e-051.014333e-051.183173e-055.633831e-06-11772.29-13732.43-10161.51-11668.18-9334.092-5388.929-2357.314-1536.536-2000.688-4139.626-957.7337-1709.401-1219.707-713.7246-1062.8980.73731710.60770740.53442080.56395180.650702558563975127384473858113670140382826246759485635297345766325514838057025856397507369738263333300000336.438801475-0.8342574668870.916536475463-0.399685995269-0.0145600251170.3990397886510.39844470516-46.27928144463.7346936823-0.010217870.02428235-0.02498654-0.09338244-0.1369183-0.39914560.02853472-0.01996101-0.434521-0.33520740.34110530.2509820.18203310.13803020.097865121.6126891.6473841.5404171.5686491.591149510751.2008011.2008931.200841.2008051.2008310.0061456240.0061456230.0061456240.0061456270.006145629141515141401274847782182812376458768612720640011.065429.67237812.452949.32280912.258850.00080508280.00038305640.0067876180.00054629570.00813495610.724329.42139812.270919.1847812.16099000008-1-10000.7847437111110.0073643570.0031948940.0047698230.0069000750.033998474412900267.364412900410.834412900123.94412900195.654412900339.07
1237645876861272066294301111240300048378753253787855.470131.0082371909.461.007598-9999.0-9999.0-9999.0-9999.062.3271769.3599455.4048859.4873765.051821.01.01.01.01.01911.8681914.0331909.3041906.5761908.7471.01.01.01.01.01.8503353.9588987.0162111.9907840.6508213394.590.097063110.072641095288.5690.124427710.929459.65931714.391699.32178111.061060.00035664120.00016004960.041180829.235495e-050.000666978214.0718614.5549314.2940414.121712.37380.032251891.08573627029.750.024525010.00289472414.9978915.3851215.1474214.9803813.300370.051723481.0857360.118493373575.377149.4710.918439.65710912.14959.31112411.045550.00060884170.00022643140.0030008110.00060365110.00110284342483.51136859.01751.158186761.737633.610.005135050.0024569310.00022667730.0039623510.0018709992351.011506.7031915.9512245.53711232.630.00020503574.404988e-074.395371e-160.00038867780.0011149911001.945701.3796873.03621018.234784.6560.00043891962.032796e-060.0001101532.100353e-168.651298e-1842916.93137137.513810.15188603.838175.180.0017265630.0012225390.00068639569.094437e-050.00066505753.638145.1210815.1638156.4952493.362570.052185390.060271210.1061340.23862560.041880312.1263772.8407872.8358243.0654641.8828290.0033124180.0046545880.0047285760.011983410.0010568245.1879655.1880415.626127.4675954.0966880.064263540.038708060.046273220.12021270.013880760.13830390.18176220.1566490.14633620.0072682860.00052528740.00093986320.00083705370.00023594490.000385259-0.02289512-0.005755376-0.02061155-0.021601-0.0015479550.00051578920.00091030120.00081758680.00023115680.00038523960.13363790.37508210.32249090.32059570.08827204-0.05147791-0.0198824-0.05406168-0.04518380.01409255-1000.08.923117e-059.576193e-050.0001300173-1000.0-1000.08.312628e-061.335803e-051.652047e-05-1000.0-1000.09.623986e-050.00010101910.0001371224-1000.020.4831179.0953877.0693181.5780417.78125-1000.00.0087740310.0086688320.01242842-1000.00.47736511.8440111.8649811.9582340.56252870.05660950.045259740.0079301750.13241880.02255016-0.05276328-0.009676965-0.0326623-0.08726448-0.045114285.9871536.2449215.4611775.6596975.8265932.0563032.074662.0609372.0900882.0859052.8725013.2963973.627848.470531.7705790.037094110.031612980.055714240.12524970.015391510.82769510.55753830.86724770.969290.82097210.0088140540.005744430.012505550.013425680.01019525166.6351163.397675.15765166.431774.3025413.119513.5263413.048811.8526212.111230.0065367210.0069247010.0070531540.0063403990.0084564535651.9643885.6566032.2618153.1314305.690.00086363420.0016282370.00065121128.898411e-058.054796e-052.6882963.0240112.942334.8026772.0087960.033506730.01611350.018236250.035982720.012983560.93956410.75005950.97317280.92102040.99997190.0089111950.0039832440.008604770.0079892990.01331552166.9241163.34377.05157163.8346114.935512.9659112.8589412.5232811.9534311.484880.0079300710.0070789070.0075957440.0066231940.00823485211.05119.72639213.04889.35686212.680030.00086309050.00013886140.0070531520.00040479530.0101796513.0852813.0268612.8516311.8816711.642330.0069407990.0072755010.0075709410.0064208190.0084855446510.7987184.9279787.83216543.5825471.20.00044220740.00045569210.00021327269.818713e-052.679404e-0537980.59128659.96032.272180823.78472.0410.0010970150.0036931670.00065120880.00022002240.00015849185832.936155.417233.51317673.8322032.770.00071921090.00058777190.00039305249.153908e-053.372492e-0542483.51136859.013281.83186761.737633.613.743611e-051.78111e-051.036812e-051.086313e-054.331135e-06-11767.06-11852.33-9677.24-11641.71-6579.208-5337.753-4034.423-3292.263-2065.695-1589.305-951.586-3507.652-1673.942-858.0659-2033.8380.78929010.31204390.68014120.70221390.3079508519957289598652008051904266083766149324618609093811503124519056569673177908851995728958523023523333300000336.438777376-0.8342464990970.916536309904-0.399686381893-0.01455983371320.3991308129590.398877817512-46.279255951563.73468334050.07654020.007722394-0.0257919-0.007898715-0.05168042-0.4386296-0.01284212-0.06186683-0.4832312-0.37327670.34111240.25098730.18203690.13803310.097867171.6126891.6473841.5404171.5686491.591149510751.2008011.2008931.200841.2008051.2008310.0061456240.0061456260.0061456280.0061456270.006145629141515141401274847782188012376458768612720641237645876861272065011.05119.72639213.04889.35686212.680030.00086309050.00013886140.0070531520.00040479530.0101796510.709989.47540512.866769.21882912.58216000008-1-10000.7847437111110.0073643570.0031948940.0047698230.0069000750.033998474412900267.364412900410.834412900123.94412900195.654412900339.07
123764587686127206729430111134030003521900066075863.595960.14164671882.5860.15307060.013551840.005204086-0.014131940.00539674469.7795577.2463.0995967.4581573.301220.12589670.16877230.020849690.038363110.069795621886.3871887.3591882.9611881.5081882.7560.15082470.16418270.017749490.041468350.067955151.84846211.3120620.5105211.9889982.47786115976.60.00067933610.00032835995290.1471.940258e-0524.6278818.0768917.7537517.3517617.526021.3707060.75642690.74159350.015943542.600219.3571618.1952117.8047717.436317.69050.025953950.76999150.74662770.0059445092.78556620.2047818.9893418.5339118.1744418.353740.037949421.0686710.95131070.0078787683.29856316.6464613.7145313.9618114.7302714.287620.89079530.36460350.50638480.79470642.5919590.00175355758.7817279.15884114.629297.626618.0025210.00059624660.00034206910.35292671.828937e-0518.076352.7127875.52532106.042583.901115.3544950.00071554970.00037072422.966552.157502e-058.2787525.366338.5863253.7303345.5394211.929220.0016040730.00087482336.5776915.218737e-05219.48993267.2952601.8041282.0131927.3053.083636e-058.306735e-076.791069e-071.135664e-064.723798e-08258.272619.7231614.394073.96041750.7484-1000.010.331767.9349060.0299227122.9296822.2575810.25267.70237320.184457.5129814.95312.6697052.96823712.35881-1000.027.069918.161518.0641727.2333917.84365-1000.0-1000.0-1000.0-1000.0-1000.0-0.10396780.19346050.06399150.04549108-0.0097465770.60805390.11654950.18169380.0054237120.9971305-0.4430175-0.04209923-0.040685160.02104806-0.049333370.70990430.11261710.18125360.005414920.99945940.1973648-9999.00.2448151-0.104959-0.051020570.7180313-9999.00.33943550.013493880.09450022-1000.0-9999.00.0023000930.0039307480.01848026-1000.0-9999.0-0.0006838550.00014875060.001284881-1000.0-9999.00.0022314380.003952220.0184215514.60042-9999.0452.527743.45354420.1009-1000.0-9999.01.2169250.17367227.829086-0.1056664-9999.01.9798041.9090652.0893780.05660950.045259740.0079301750.13241880.02255016-0.05276328-0.009676965-0.0326623-0.08726448-0.045114285.9871536.2449215.4611775.6596975.8265932.0563032.074662.0609372.0900882.08590529.6572929.6661129.6573.51316228.95462.9372530.11872490.48483750.06139191.3946470.45537190.82810870.84062080.98472570.99999850.53862940.0082579070.010144350.017081110.01608893157.8575161.217216.8696862.318260.0758419.7146513.6324313.4732215.6415113.394370.32264370.00310250.0029915070.0041930850.0111990413.004393523.9484080.472553.85234387.8470.066930060.0098620280.00791130.21857140.000488184159.3068912.513578.3887892.0049318.21141224.6420.077665020.050496680.019364980.2121690.44776970.77552120.91372780.94997070.92766040.31251670.0058639880.0081472160.011574870.03203933159.485165.808745.1214170.6786363.2722717.0737413.8653414.1722815.8998214.239060.13262210.0028078880.0028542550.0039806320.0107959420.4374414.2998114.1722815.5575414.219330.39427770.0029737320.0028542560.0070720870.0108039219.7146513.8615814.1722815.6415114.239060.32264370.002815890.0028542550.0041930850.01079594148.08192843.562143.317436.58682015.4720.0030564070.018491160.031498510.3903040.0024898576.6808691905.7972143.321598.38812052.420.16959620.03670220.03149840.065824480.00239747313.004392853.4452143.317553.85232015.4720.066930060.018259060.031498510.21857140.0024898570.74856841013.8091220.26416.9023939.4576177.57180.00045430850.00021348650.02823270.0002589148-36.35352-79028.59-70675.34-22168.04-4587.264-15.01355-11959.04-10683.46-2574.801-528.9827-34.18461-25464.52-17159.89-6230.23-875.49591.00.014528040.01.00.090071994061673131801522342880872445044246809149642752977633442751632839843333300000336.439672899-0.8372149729520.916541864135-0.399671754478-0.01461163784440.05607366305820.0605960536041-46.281853972263.7322347065-0.1980266-0.09110503-0.1965859-0.07074645-0.001906230.15102030.11410640.14834290.23757710.0094240410.34127220.25110490.18212220.13809770.097913021.6126891.6473841.5404171.5686491.591149510751.2008411.2009331.2008811.2008441.2008710.006145530.0061455260.006145530.0061455260.006145523151515151501274847777193112376458768612720641237645876861272065020.4374414.2998114.1722815.5575414.219330.39427770.0029737320.0028542560.0070720870.0108039220.0961714.048713.9901615.4194514.12142000008-1-10000.7847437111110.0073608950.0031945050.0047708960.0068990460.033995584412900267.564412900411.034412900124.14412900195.864412900339.29
123764587686127206829430111144060107237432237503771823.179570.066644031874.8380.066038520.0-9999.00.0-9999.029.6931736.9090623.1795727.0624132.717840.14666290.15044870.066644030.15149630.14590031878.3771879.5251874.8381873.2791875.1210.17353620.1515450.066038520.1573530.16277212.8532673.7842185.56695811.989139.456692.7256490.611562844201.055290.055435.58322.6177525.1642621.0486120.7830721.486530.74484018.4852370.061191340.10081040.587053121.1224419.6168419.5376219.1443519.983130.18279550.095766470.021851860.023694980.196434321.8705620.3864120.2632419.9823320.724920.23332470.1311090.028769540.034242580.27756923.244725.1044621.8899421.5973121.888361.0754636.1615550.097852840.12513730.56848590.8753784-0.0082692833.8029894.8548572.3279262.5155130.504266421.681664.8944450.44950013.55100614.2313515.3082721.9902510.102692.78050.634541510.532054.3406950.29303411.7745867.0043087.84516310.16095.0222026.7089321.39690523.119189.725380.55815050.46472390.0016471361.7457722.2824521.4447843.4623150.958267139.6456514.099380.85268560.58215592.9692710.56489780.58371393.7455680.3373594-1000.00.02846050.038371013.5098320.28567720.36876990.26259630.28187840.3183337-1000.0-1000.00.015622610.020687230.18180670.47169281.1200230.45515890.47027540.5317295-1000.0-1000.00.05299030.06818597-1000.00.05701445-0.42372110.010051560.01195611-0.077254270.4110017-9999.00.03425930.04289510.2890736-0.1015354-1.6636930.1513856-0.03362193-0.093653590.4138741-9999.00.03503210.042937420.28987320.02732195-0.30611240.017654080.048351593.471295-0.7800171-1.3861420.4419883-0.0058293792.2772560.02400941-1000.00.0039974660.09802911-1000.00.003506328-1000.0-0.00035316690.001647706-1000.00.0150297-1000.00.0035863690.09814223-1000.00.8961622-375.10940.90346431.0014010.26072620.03444293-1000.00.0040282160.09851313-1000.01.9658518.3801361.634311.3309511.4939610.05660950.045259740.0079301750.13241880.02255016-0.05276328-0.009676965-0.0326623-0.08726448-0.045114285.9871536.2449215.4611775.6596975.8265932.0563032.074662.0609372.0900882.0859050.00191066229.660340.0019676550.00010281543.2419785.6067742.7479571.1020520.103284817.453480.13026170.38227130.051674140.29418260.4672860.4190340.209290129.28445178.7222.254002134.070487.7625645.1119190.3766618.9131522.6431519.3494321.311420.9167920.029210.39873530.14100810.079112370.093027260.73201020.854114418.206092.9835834.290659.6783119.1773140.178848121.022417.3474280.022949670.03787559.327980.00011403160.000745849.193288e-0665.702772.9274810.1118770.51898531.759898e-050.05008870.68855990.30530740.073701350.1530004140.03410.366250893.5315363.84426451.4425134.337763.3329745.0729190.3560184.4993722.6430315.8989721.3114920.9168421.111360.39881760.055088190.079112080.093027320.703122622.643424.9426721.3114820.9167221.111310.39884041.0373240.079112080.093042620.434876622.6430315.8989721.3114920.9168420.029210.39881760.055088190.079112080.093027320.73201020.8542111436.93052.9833544.290433.4405729.1716510.0020347321.025777.3481680.16997810.85390590.028587942.983364.2909273.4407389.17652432.980421.025687.344060.44431130.8542111436.93052.9833544.290439.6783119.1716510.0020347321.025777.3481680.022949671.5359850.41633583.141543.1084082.5690856.21618111.267494.7946810.52589880.05289077-13.92117-416.8351-95.76134-32.28881-3.577883e-05-15.37605-236.5724-99.04765-34.49699-0.0001718966-15.37521-393.1852-99.0482-34.49688-0.00010275760.00.00.00.01.013464782590077491535956697656174382379829213464782590071993893893296366310110336.435229009-0.8380628548220.91651066433-0.399742754257-0.01462643459330.02638236779320.026142664794-46.279003197363.727152789-0.06714018-0.058630410.0-0.06776045-0.067532920.032336970.063674350.00.042177630.043249050.34298930.25236820.18303850.13879260.098405651.6126891.6473841.5404171.5686491.591149510751.2008531.2009451.2008931.2008561.2008820.0061460880.0061460880.0061460860.0061460880.0061460888888801274847776818512376458768612720641237645876861272065022.643424.9426721.3114820.9167221.111310.39884041.0373240.079112080.093042620.434876622.3004224.6903121.1284520.7779221.01291000008-1-10000.7847437111110.0073595350.0031938340.0047705530.0068991090.034010944412900266.54412900409.974412900123.054412900194.794412900338.22
123764587686127206929430111153233000104695283987662055.691421.0080071909.2771.006504-9999.0-9999.0-9999.0-9999.062.3659769.623355.6127759.4145964.982191.01.01.01.01.01911.8611913.9421909.191906.4341908.6731.01.01.01.01.01.9197932.0949045.55842212.1312239.487551579.8497908.3933680.2361597.53975.2056510.930269.64934314.393519.32244711.051110.00035683929.076003e-050.017631359.239157e-050.000512756511.122699.72987214.294999.40312812.377180.0021170310.000804192427053.50.00031359180.00274250411.164689.736715.149589.41085113.300950.001501904272.1910.03825466435.430477190.2310.917029.63980612.025599.30771411.009610.00071722260.00050640040.006044490.00092005040.00222514742451.6138122.01748.219186647.237979.980.0051370690.0075012510.0012407550.0039640690.00310825635556.8128248.21914.269173280.211197.640.00020804080.0001108224.395371e-160.00039922840.00124997434208.13127444.1871.3009172051.94782.1290.00044658649.796284e-160.0010610692.100353e-168.651298e-1842972.72139340.615479.77189196.939459.930.0012409520.00023675820.00013464813.890426e-050.00015290393.6265125.8652855.9249776.6128513.3761520.047216390.11714570.20622540.22645970.035780432.1323873.155383.0554043.140941.9388670.00390450.011152440.011833710.019811860.0024712715.3869317.2687857.5116518.3474784.6251630.08375490.12482250.1366640.2119920.042433030.13755070.17246220.14785410.14487190.0062635260.00052080640.00022228230.00020788730.00023143580.0003294136-0.02397688-0.00162618-0.01686051-0.01791499-0.0061701290.00051151760.00021595250.00020354430.0002267990.00032941320.133720.37360490.33054630.32126210.08827689-0.0515472-0.01103897-0.0597031-0.046107930.01391626-1000.06.434538e-058.494193e-050.0001305374-1000.0-1000.04.454847e-061.264333e-051.677672e-05-1000.0-1000.06.936427e-058.984035e-050.0001376979-1000.020.4800388.2084980.1424581.0326117.78592-1000.00.0070424030.0080653220.01240361-1000.00.47741351.9347441.9252191.9543740.56227870.053645320.047755950.0069899570.14938880.05192978-0.05662155-0.01052805-0.03375066-0.09266223-0.038572575.9822376.2411585.4634785.6770735.8423922.0542472.0726632.056992.0728082.0687552.4396475.2798085.5273828.49312.1989540.024045090.063503670.07881510.1283680.017495350.82089350.69986840.7526410.76887790.85001030.0076968270.0084922010.010096230.010880990.009486295169.1919178.6332158.1425168.0054168.031513.1942712.8789112.6370911.9649311.823330.0068378890.0062465080.0069331330.0063862070.0072152455275.8257053.9798813.79916369.1518649.610.00090578240.00060716350.00031569180.00010787236.510392e-052.6556434.1763794.1857074.885382.106870.031599060.035159160.037768180.038780280.020973830.92726340.83396610.8715320.86481660.99976630.0083065420.0057147540.0065425620.0069122660.01396164167.555178.6977159.2674167.0513164.49412.9838712.4614112.2069511.9445911.439760.0079503170.0062376660.0068989030.0065275360.00814490211.075129.66230512.206949.31246812.283030.00081520530.00044836690.0068989030.00062020960.00845875213.102312.6438712.3944111.9559411.644560.0074601120.0063505250.0070383470.006450370.0079054466404.01610361.8213098.516678.7526551.840.00045475240.00028218390.00014435949.945421e-052.520505e-0537149.57136482.913098.53188370.512212.030.0012853070.00031479310.00014435888.636667e-050.00011047415742.2298758.92411021.3516505.3921987.430.00064238720.00038100260.00019590140.00010399873.90164e-0542451.6138122.013842.25186647.237979.983.408422e-051.571872e-051.012325e-051.188098e-055.786737e-06-10746.86-13591.94-10086.1-11603.79-8710.542-4366.761-2417.406-1547.95-1634.075-3517.501-1113.912-2459.897-1668.405-1024.432-1104.1660.58659030.48457480.48478270.55995040.57761075861980283028480088648582552479703482929011020350423168648582547110994045856350778125557843333300000336.438801754-0.8342685699340.916536474818-0.39968598969-0.01456021888120.3990397886510.39844470516-46.279288813763.73468165990.0041376150.02424491-0.03111347-0.1244067-0.1669967-0.36183740.03066561-0.03441272-0.4659778-0.3250230.34110850.25098440.18203480.13803150.097866041.6120271.6468871.5407421.5710551.593305510751.2008011.2008931.200841.2008051.2008310.0061456240.0061456230.0061456250.0061456290.00614563111111111101274847782182812376458768612720641237645876861272065011.075129.66230512.206949.31246812.283030.00081520530.00044836690.0068989030.00062020960.00845875210.734019.41132412.024919.17443812.18517000008-1-10000.7847437111110.0073643570.0031949880.0047698230.0069000750.033998474412900267.364412900410.834412900123.94412900195.644412900339.07
1237645876861272070294301111640300048378753411074055.641541.0080071909.2331.006505-9999.0-9999.0-9999.0-9999.062.3659769.5733355.5698359.2879564.982191.01.01.01.01.01911.8611913.8971909.1591906.3681908.6731.01.01.01.01.01.9198862.4051315.84477413.1264239.487551169.4331.496731.1994010.312702366.4841410.930259.65137314.394589.32637911.050890.00035684239.674886e-050.019894130.00010715730.000512731414.0905114.5536114.288414.1372412.385970.0321320322995.1326889.830.031062740.00274253215.0235215.3850315.1460814.9948213.327590.051685230.056217580.0471828874559.9979108.0210.918169.64533412.074929.31855111.013170.00055352690.00023457960.003112340.00030503790.00169646242452.17137864.01746.501185972.437987.960.0051368430.0066260610.00097647460.0029683030.0031072542310.9861508.5431925.9212213.62511107.420.00021378529.796284e-164.395371e-160.00024932230.001270337978.5743701.4357874.11461004.7834666.1980.00046081670.00075810340.00069301532.100353e-168.651298e-1842927.43138632.914792.11187318.039330.770.0020878590.0011146420.00055617830.00036106210.00026478623.6238885.6164785.6016245.6265963.3524980.046492380.088533070.1337590.16654160.036039992.1273413.0435122.9636332.9444341.9258310.0029938210.0049897690.0055817010.0056744360.0018102965.255386.3939286.7522216.9118094.5576470.060812210.052181750.062989160.070507150.030330480.13824580.17373270.15089890.14706240.0063046040.00052275470.00032182330.00029610190.00044287320.0003288463-0.02352902-0.003242874-0.01880237-0.01965153-0.004899090.00051332540.00031253170.00028968380.00043376240.00032884120.133720.36933680.32733130.31869260.08827689-0.0515472-0.01376492-0.05904489-0.03829880.01391626-1000.06.861659e-058.726357e-050.0001384382-1000.0-1000.05.264697e-061.283889e-051.613583e-05-1000.0-1000.07.383021e-059.219011e-050.0001459466-1000.020.4800385.8332578.8122677.9496517.78592-1000.00.0072709650.0081207880.01261663-1000.00.47741351.9077821.9076291.9144560.56227870.053645320.047755950.0069899570.14938880.05192978-0.05662155-0.01052805-0.03375066-0.09266223-0.038572575.9822376.2411585.4634785.6770735.8423922.0542472.0726632.056992.0728082.0687552.4296793.282563.7077974.1143282.1953920.023612390.050826420.053656020.044733380.017378390.8210660.68023440.70990330.73989650.85052930.0076802690.0073114730.0092813580.010169780.009513584168.29232.499704161.7965165.4473167.315613.1945113.3183813.0715612.7654611.823180.0068452590.0067843810.0074395910.0070659380.0072179665274.6974705.9635907.1047830.9818652.160.00090421950.0011564610.00061038130.00038501426.503704e-052.6606053.8191793.8517853.8990072.1059960.031658970.019697950.022223190.024989540.02149450.9285980.84045620.87224680.88202170.99974510.0083294350.0051498670.005803490.006215790.01373176167.19331.541677160.8167162.7367164.717312.9790412.6302812.3317212.1779711.437670.0079331440.0063070190.0069277580.006731750.00814062811.063089.67388112.331779.33377812.1640.00088584230.00038990780.0069277620.00049811970.00832354513.1582312.8832912.5981712.4393711.765450.007113080.0066683370.007352930.0070577320.0075079946432.5858869.25311676.5313452.7926602.980.00045267530.00037672660.00018015060.00014373682.513461e-0537563.84135035.411675.97184709.213627.030.0010646230.00042523540.00018016770.00013925299.162827e-055453.9377025.5869135.47510574.3319670.670.00078327280.00053709170.00026125550.00021164715.404584e-0542452.17137864.013648.12185972.437987.963.512052e-051.62544e-051.051171e-051.182789e-055.583858e-06-10719.88-12796.24-9650.954-10622.71-8705.927-4299.418-1953.404-1219.293-1483.21-3503.741-1113.793-3950.61-2833.76-2672.359-1108.1290.84520140.4428390.44043450.51201580.8718985878868775423549608671100543066808522951529017648455888671100544408985805878868775423549603333300000336.438796268-0.8342732109490.916536435471-0.399686076966-0.01456029987360.3990398354670.398445127137-46.27928761263.73467141070.023885170.02421719-0.02837113-0.1548035-0.1472471-0.34512980.02958731-0.02933779-0.4747266-0.30805470.34110850.25098440.18203480.13803150.097866041.6120271.6468871.5407421.5710551.593305510751.2008011.2008931.200841.2008061.2008310.0061456240.0061456240.0061456250.006145630.00614563111111111101274847782188012376458768612720641237645876861272069011.063089.67388112.331779.33377812.1640.00088584230.00038990780.0069277620.00049811970.00832354510.721979.42289612.149739.19574712.06613000004098799302043117257121270.7847437111110.0073643570.0031949880.0047698230.0069000750.033998474412900267.364412900410.834412900123.94412900195.644412900339.07
123764587686127207129430111172030003525336197147663.27340.020212551882.6290.017290230.0048268590.0061749880.0017830050.00613360769.7795577.3290963.273467.4583373.426060.12589670.13408990.020212550.023752311.01886.3871887.2541882.6291880.9721882.4260.15082470.13624130.017290230.025538491.01.91069910.5908816.3230224.2471139.474031588.2130.00081345510.00049679830.000433435275.506124.6349418.3682818.0098217.6003322.826861.0228820.8931550.76227720.58597071.07511319.4189318.2216917.8236417.4790217.710190.022168170.73950340.62458810.50659750.0204384620.2667619.0203718.5510318.2153518.376430.03271831.0228520.79256710.64572710.0252938524.3363715.2760214.9619414.3587628.09313156.72061.1762340.93983270.69325521.291237-6.822729e-0544.9455562.5273591.1738.350252e-0514.370820.00073150030.00051889110.00041300710.465604417.0764951.4425874.22407101.950482.392788.2238450.00081454920.0005484880.00044191590.415567.81911524.6517537.9826551.7431544.5970817.988530.0018539770.0013007350.0010559030.9253970.07790292775.51781035.6751805.073-94.555910.0005681981.416699e-061.244229e-067.527876e-077.905933e-052.96865115.4322117.0720517.815542.969081-1000.07.878258.8671759.048911-1000.015.105117.036147.6633428.316065-9999.0-1000.0-1000.07.8925365.105838-9999.015.8087614.296216.1300716.04143-9999.0-1000.0-1000.0-1000.0-1000.0-9999.0-0.4669539-0.04480723-0.03635759-0.1068286-0.55185814.070110.39376820.39753250.2448313-9999.0-0.04068973-0.03413632-0.0073409460.002947554-0.0196343611.760460.39343770.39702940.2420862-9999.0-9999.0-0.2242272-0.1646118-0.3527684-9999.0-9999.0-0.29315290.066566150.03789814-9999.0-9999.00.0050003780.005565620.004313657-9999.0-9999.0-0.0013155150.00059065790.0005330376-9999.0-9999.00.0049056010.0056300790.004606721-9999.0-9999.0361.1886359.2194506.4421-9999.0-9999.02.0435642.0873762.648-9999.0-9999.02.2624532.3887662.264077-9999.00.053645320.047755950.0069899570.14938880.05192978-0.05662155-0.01052805-0.03375066-0.09266223-0.038572575.9822376.2411585.4634785.6770735.8423922.0542472.0726632.056992.0728082.06875516.5105728.5552929.6583629.674150.036502014.0313210.5358950.73728180.32413980.00.31907650.72700550.88499990.86698050.23544671034.7220.011033130.012871390.010676660.089.96738121.919671.4804782.5824568.5742424.3551314.4585814.0316913.5211622.82691196.02780.0042133870.00382330.0034838011.7726650.072891671646.5192439.6213904.241.60629e-050.00036645390.024493580.013549620.0063719020.171266316.702668.1674457.6952869.9728860.036304540.21559580.080645680.074735510.099724590.00.33253580.7357450.86517110.72725050.2517064319.67490.0088187660.010317770.0080768990.089.9673116.727770.8212485.2585768.1537323.7065715.2532714.9893214.2653822.82691227.78080.0040869460.0038484670.0034557291.77084323.9519714.3542314.031713.5116126.112517.073960.0042549210.0038233010.0034849392.03643324.3551315.1913214.5077614.0083822.82691196.02780.0042209140.0041889930.0036738591.7708430.2695821791.94061009.8841967.2021.609674e-050.00015039150.11252930.078042260.025507720.17161880.18789841812.6262439.6123938.743-15.220910.035562940.019817510.013549720.0062566660.0012154590.07289167838.4381573.6082492.5731.609674e-050.00036645390.094122570.027129170.014057490.17161883.755199e-05409.1405494.9523784.75520.00017343020.00.0067885080.0082438430.005924110.00.0-29740.86-31615.32-40587.06-3.701003e-060.0-1092.285-2025.489-1519.675-1.745396e-050.0-3153.884-1505.894-2303.37-1.745396e-051.00.054409690.39428470.27122410.09007199397777681275148345364450387490993358827528256309290071996662131683333600001336.43963735-0.8372054993410.916541618374-0.399672324109-0.01461147251630.008001540916850.00684468055654-46.281820689963.7322120351-0.070050310.072162610.00.057282880.17563060.11691530.038250850.00.00487935-0.15067270.34127150.25110430.18212180.13809740.09791281.6120271.6468871.5407421.5710551.593305510751.2008411.2009341.2008811.2008441.2008710.006145530.0061455250.0061455280.0061455260.006145522111111111101274847777196012376458768612720641237645876861272069023.9519714.3542314.031713.5116126.112517.073960.0042549210.0038233010.0034849392.03643323.6106914.1031213.8495813.3735126.014590000010257993023031172731313150.7847437111110.0073608950.0031945050.0047708960.0068990430.033995584412900267.564412900411.044412900124.114412900195.864412900339.29
1237645876861272072294301111840601038709708285979668.485691.01925.371.00.0-9999.00.0-9999.075.1084282.499968.4856971.9090978.167850.12499841.01.00.99654750.12410271928.8181929.51925.371923.3751925.5920.15035181.01.00.86241990.13778844.68171213.5566712.5926628.1000346.635630.82470720.00061893920.13119280.000331390.0887269224.6349420.4443924.8019418.6721222.826864.7486517.39236812.888631.8295092.89041419.4060718.4958118.3372817.8655918.330050.07285181.0942220.071916220.86211130.0950792520.3275519.4532119.2138718.7597119.268220.11218751.7577190.10724911.3007320.148131724.6345317.7918224.8019415.9013922.8267918.80392.37948952.320380.570389311.20813-6.829224e-056.6399462.239848e-0533.973638.351276e-050.66679470.00048891490.12320050.00030510340.0644176917.2799439.9643446.2472471.4100646.544660.74365190.00061643010.10656430.00031102270.060131017.3930916.5464120.6269631.3402719.592641.7111380.0013934470.24084180.00070926790.13915413.758774e-0576.431182.43378e-05435.95560.00017345150.042524243.563999e-050.0074762581.906431e-050.0042840962.96865127.915162.96902518.288332.969081-1000.0-1000.0-1000.09.310202-1000.03.922313.6955163.9228033.8885883.922879-1000.0-1000.0-1000.01.192975-1000.04.2950945.4631314.2956355.5459014.295717-1000.0-1000.0-1000.0-1000.0-1000.00.3283838-0.15424860.3283838-0.12445570.3283838-9999.02.390343-9999.00.6187996-9999.0-0.1326109-0.032167-0.1326109-0.03801986-0.1326109-9999.02.337838-9999.00.6103123-9999.0-9999.0-0.1006868-9999.0-0.1713952-9999.0-9999.0-0.01402619-9999.0-0.1857086-9999.0-9999.0-1000.0-9999.00.006212635-9999.0-9999.0-1000.0-9999.0-0.001125034-9999.0-9999.0-1000.0-9999.00.006196255-9999.0-9999.024.01037-9999.0742.4338-9999.0-9999.0-1000.0-9999.04.90937-9999.0-9999.00.4535364-9999.02.059695-9999.00.053645320.047755950.0069899570.14938880.05192978-0.05662155-0.01052805-0.03375066-0.09266223-0.038572575.9822376.2411585.4634785.6770735.8423922.0542472.0726632.056992.0728082.0687554.45068929.666464.4568735.085364.4460760.00.73431070.00.27143929.356740.52073410.75952540.52155720.99971460.52157030.00.04451480.00.037850492289.7380.0251657375.194180.02501686105.46740.0257657824.6381515.9438524.8061116.0688622.83501273.66580.01762903181.41190.014376864.787-0.0008946019419.2379-0.0008990963373.642-0.011027850.00020076450.021580940.00062185430.040851910.0001282113.9223111.393783.52570810.358483.8519230.00.43113580.00.13787610.00.47694220.617920.46847770.79993930.55597890.00.030255270.00.015536250.050.9005670.2158718.86892107.518416.1393724.634716.4585724.8020814.4799222.82694235.38490.01622554166.74790.00829230468.5230224.6347418.3234524.8020816.5605722.826954.9146690.02706394.3110470.016082593.6627424.634716.4585724.8020814.5743822.82694235.38490.01622554166.74790.00862483968.52302-4.690158e-06260.9595-7.921096e-061614.475-2.637334e-050.00027137860.065751220.00073604680.0065771170.0001146178-1.399546e-0546.84001-7.921098e-06237.5601-4.519428e-050.62250660.73354651.1011860.080758590.04011557-4.690158e-06260.9595-7.921096e-061479.949-2.637334e-050.00027137860.065751220.00073604680.0072352380.00011461783.758774e-0599.493352.43378e-05597.42330.00017345150.00.015360980.00.0023295820.00.0-2185.5540.0-8720.5160.00.0-168.93680.0-727.85990.00.0-490.02230.0-6397.5250.00.00.00.00.10841540.090071993977776819077568269358389135107992951565327064389252302990071993977776813363600101336.440207689-0.8325047047580.916546692559-0.399663678389-0.01452943688280.3958699405190.395869940519-46.279226542163.7379439062-0.013219460.057653890.0-0.2408837-0.01374570.006279098-0.15954580.0-0.12321550.017815950.34033430.25041470.18162160.13771820.097643911.6120271.6468871.5407421.5710551.593305510751.2007761.2008691.2008161.2007791.2008050.0061454410.0061454390.0061454410.006145450.006145441910911901274847781865912376458768612720641237645876861272069024.6347418.3234524.8020816.5605722.826954.9146690.02706394.3110470.016082593.6627424.294418.0730424.6204616.4228522.729310000051376284073311726912200.7847437111110.0073679020.0031951240.0047706650.0069018360.033999754412900267.74412900411.174412900124.244412900195.974412900339.42
1237645876861272073294301111940601038709708285986829.612551.0082371935.8171.0076070.0-9999.00.0-9999.037.2135243.5014730.5718637.6813740.286380.19476431.00.15006090.23318470.19419071938.4411940.3991935.0571929.5981935.2280.2034211.00.13764940.27403170.19431942.8598794.4068748.48995815.6415942.120355.0886491.5702860.68923570.15457940.25475924.6350525.1272124.8030320.3124122.84732.183135.356785.7000550.46763621.91331420.4663819.4183619.2056918.8942419.198450.093808480.050900820.060605750.098778620.10667421.2100420.1588919.9714219.7371319.862560.12624190.067599020.083821640.14605620.147738724.2485326.9679125.9639518.9945525.38266.2713235.55776210.959460.35577441.077877-9.500464e-05-0.002124161-0.00021633417.495228-0.027779783.154811.2677560.62989430.095733060.14696026.5049917.086120.7830827.6876920.896643.1598561.558350.74292190.15757090.2360513.2748468.63768610.2653712.7367911.301226.8469453.4560851.5912930.34036230.41574230.1016968-0.4798678-0.30874325.244-7.7191010.33775360.14528910.064179960.014611490.016424742.9686512.9692712.9690256.1793852.969081-1000.0-1000.0-1000.03.378883-1000.04.481425-9999.0-9999.02.300097-9999.0-1000.0-9999.0-9999.00.5102775-9999.04.56711-9999.0-9999.03.771697-9999.0-1000.0-9999.0-9999.0-1000.0-9999.0-0.2938983-0.6903822-0.86098840.06192409-1.058606-9999.0-9999.0-9999.00.2124027-9999.0-2.4150910.7001511.625285-0.2201783-0.5105911-9999.0-9999.0-9999.00.2216133-9999.0-9999.0-9999.0-9999.00.3371865-9999.0-9999.0-9999.0-9999.0-0.5436755-9999.0-9999.0-9999.0-9999.00.05344739-9999.0-9999.0-9999.0-9999.00.02430747-9999.0-9999.0-9999.0-9999.00.04764855-9999.0-9999.0-9999.0-9999.065.64757-9999.0-9999.0-9999.0-9999.05.117347-9999.0-9999.0-9999.0-9999.02.335198-9999.00.053645320.047755950.0069899570.14938880.05192978-0.05662155-0.01052805-0.03375066-0.09266223-0.038572575.9822376.2411585.4634785.6770735.8423922.0542472.0726632.056992.0728082.0687554.74240218.600310.152172411.592838.661889641.73320.003705810.02.62578597.101020.050.99979260.10316070.35078390.999776620.832486.808380.00.072868442.19553758.1274316.90593135.8165165.0892162.616224.2581228.2100924.8090617.9675125.4234323.420958.6155474.4576630.041382123.4608120.09906966-1.552634-0.00154942765.01165-8.0201970.024361170.0065004931.0298960.16286490.0014797214.7116469.92287312.743733.89948115.3599429.0363448.45370.00.4262732315.52180.050.99985910.050.42641810.9997522.622986.790850.00.071030384.23333158.4796455.68027131.9567164.048162.671424.0342328.6790823.4803818.6225127.7613923.480416.99979314.449980.041424162.1754621.9452728.6786927.4091417.6004526.947973.4822531.3719933.4019560.057428990.836441424.0342328.2100924.8090617.9675125.4234323.480418.6155474.4576630.041382123.4608120.1628651-2.3961050.369844135.56189-69.657730.020377840.0041669930.02904370.5431595.131116e-051.655078-2.395245-1.31352191.16296-32.917870.034501340.10854240.057128830.043007340.0015518050.1628651-1.552634-0.00154942765.01165-8.0201970.020377840.0065004941.0298960.16286490.001479721-48950.86-21208.02-31678.0732.18118-225747.00.00.00.00.15699110.00.0-2.14273e-14-5.251355e-14-134.2379-2.206888e-070.0-3.774758e-15-2.27407e-12-4.040738-2.559312e-080.0-1.099121e-13-3.60123e-12-3.740378-9.372419e-070.01.01.01.01.090071993977449211351079929512377290071993993177897064389252303790071993977449213663601101336.435932363-0.8313554362120.916517134648-0.399732185063-0.01450938047710.3991308129590.398881400413-46.275217527563.73522818020.37858210.0071064260.37994161.5953250.3780544-0.31536170.01704307-0.3009016-1.795908-0.3037560.34162210.25136230.18230890.13823930.098013391.6120271.6468871.5407421.5710551.593305510751.2007611.2008521.2008011.200771.200790.0061459630.0061459760.0061459630.0061459220.0061459636669601274847782396712376458768612720641237645876861272069021.9452728.6786927.4091417.6004526.947973.4822531.3719933.4019560.057428990.836441421.6036528.4273327.2268317.4622126.84996000002-131172690000.7847437111110.0073728710.0031942250.0047712250.0069026620.034000284412900266.74412900410.154412900123.254412900195.074412900338.42
12376458768612720742943011111040300010565649944168489.53710.056036871941.2720.07130989-0.0048323060.0049027160.0066265110.00503187495.89616103.267489.537193.2421599.11070.26817350.046336580.056036870.15388560.42012391943.0371946.0331941.2721939.4981940.5590.45321510.050596290.071309890.15431510.72720282.0097353.0041465.93106514.8723939.6591321.345253.2846542.5951144.6657242.73129221.2388820.1347319.8118822.506820.136260.12728010.079550390.063715310.62569330.198587621.1868219.7666319.7586719.3593320.234430.11961060.052844520.059827770.035429090.209905822.0202120.5031120.4660320.174120.909280.17107940.069572790.076673510.050528780.255816721.0132320.25419.6739522.8571820.109330.21822930.18252860.12250071.9494710.41544013.1887088.83205111.890650.96115738.758467.10172.3870442.0529252.8583980.37884533.34592212.3972812.4879418.039467.990077.3088172.7460252.1110622.8847520.40517961.543076.2902666.5078958.5146124.2014716.376196.1500174.72816.3571960.90779763.9278837.91307813.501630.67463958.9814691.5962610.56476980.43078620.53046090.08243311.9624071.5094081.6606121.2464191.8281831.0946550.039714690.034836581.1546060.42843561.0928320.82906030.96246670.68646390.93088160.12222160.089087730.07038277-1000.00.24668351.7752181.3746411.4933121.1018641.708461-1000.0-1000.0-1000.0-1000.0-1000.00.070780720.042792790.0740367-0.058991670.12005840.085878060.061143860.041970610.72367990.15751590.14047240.038354320.1619222-0.063759890.16995770.087120880.061121920.042822880.72410040.15971620.19490680.11684320.1581201-0.062957910.27219930.11994340.07172770.4035078-0.16259680.34690230.15040030.034168620.028084790.79175540.276644-0.02344554-0.003149617-0.007184371-0.08026656-0.088345520.15223410.034315660.026024310.78277210.269646311.492716.8873769.3623994.1478218.4487631.8444170.24084150.29915273.3483942.8047921.7374981.8326641.7950241.7898091.7731080.053645320.047755950.0069899570.14938880.05192978-0.05662155-0.01052805-0.03375066-0.09266223-0.038572575.9822376.2411585.4634785.6770735.8423922.0542472.0726632.056992.0728082.0687550.72536970.17398780.65362770.28629170.47535790.81776920.1500180.103853312.797062.0398160.43388370.097982030.050.48468790.051.04992213.491180.028.030210.012.4062515.2958934.35518132.794921.2262720.8716120.1053419.5039522.4438819.944610.18463670.023759620.021269892.9532650.61657294.476449.07449715.790441.0222810.47141.71890125.3485910.447910.11506230.027725560.82499560.28168760.8156640.29453750.66954020.7503260.10906420.0679847210.486872.4071180.55000390.15424340.050.33325470.050.9000387.0654260.027.635940.011.7714715.7241534.6111123.278420.6998920.8822320.1002419.5068222.4855819.936330.2070080.023752730.021009213.1864420.644071720.9798519.9868219.5067622.3958919.890580.1000620.024461980.021009210.46332070.182941120.8822320.1053419.5068222.4438819.936330.2070080.023759620.021009212.9532650.64407174.4327839.11722815.748820.98140110.552321.39441525.126210.765460.1062470.025027894.05082310.1213515.74971.07119611.010867.14090719.2243310.764254.3000510.28536954.4327839.07449715.748821.0222810.552321.39441525.3485910.765460.11506230.025027893.9080037.89934913.480840.66864268.6994320.00.00.00.00.0-0.002718371-1.468201-150.64610.0-2.553513e-15-1.226547e-07-0.8341792-30.778750.00.0-4.916711e-06-0.9623448-56.537940.0-1.110223e-160.01.00.01.00.07064392410728170369047773205450387480887298035557397706439241072813636301010336.442521658-0.8307641248220.916563236962-0.399626838278-0.0144990612320.02218331404480.0282294431654-46.279873280463.7420272727-0.1150767-0.054005430.0-0.1260903-0.05794528-0.62685260.1204370.0-0.02744835-0.33057280.33926290.24962640.18104990.13728470.097336541.6120271.6468871.5407421.5710551.593305510751.2007541.2008431.2007911.2007551.2007820.0061451490.0061451460.0061451440.0061451490.0061451478888901274847778716112376458768612720641237645876861272069020.9798519.9868219.5067622.3958919.890580.1000620.024461980.021009210.46332070.182941120.6405819.7371919.3257122.2586119.793240000051376284074311726912100.7847437111110.0073755970.0031953370.0047715720.0069042770.034000484412900268.254412900411.724412900124.84412900196.544412900339.97

That's more columns than we will likely ever need. Instead, let's focus on objID, a unique identifier, cModelMag_u, cModelMag_g, cModelMag_r, cModelMag_i, and cModelMag_z, the source magnitude in $u', g', r', i', z'$, respectively.

We will now (re-)introduce the concept of joining two tables.

The most common operation is known as an inner join (which is often referred to as just join). An inner join returns records that have matching sources in both tables in the join.

Less, but nevertheless still powerful, is the outer join. An outer join returns all records in either table, with NULL values for columns in a table in which the record does not exist.

Specialized versions of the outer join include the left join and right join, whereby all records in either the left or right table, respectively, are returned along with their counterparts.

Problem 2b

Select objid and $u'g'r'i'z'$ from PhotoObjAll and the corresponding class from specObjAll for 20 random sources.

There are multiple columns you could use to join the tables, in this case match objid to bestobjid from specObjAll and use an inner join.


In [ ]:
SDSS.query_sql( # complete

In [20]:
SDSS.query_sql("""select top 20 objid, cModelMag_u, cModelMag_g, cModelMag_r, cModelMag_i, cModelMag_z, 
                         class
                  from photoobjall p 
                      inner join specobjall s on p.objid = s.bestobjid""")


Out[20]:
<Table length=20>
objidcModelMag_ucModelMag_gcModelMag_rcModelMag_icModelMag_zclass
int64float64float64float64float64float64bytes6
123764587955100076420.1809920.767819.3749118.4486418.55745GALAXY
123764587955106626219.5212118.1232117.4871517.1253116.96935GALAXY
123764587956286269920.1384819.2851819.0311118.9448718.73979STAR
123764587956292814422.7610820.0399218.6032618.0831817.80411GALAXY
123764587956292825821.1891920.2592919.2455918.7913218.41072GALAXY
123764587956292880521.5534122.1313521.3175119.5004918.87878GALAXY
123764587957387337319.9037321.7359520.2040219.48519.05127GALAXY
123764587957747725221.5517718.9206517.7526917.2651716.88253GALAXY
123764587957747725221.5517718.9206517.7526917.2651716.88253GALAXY
123764587957747725221.5517718.9206517.7526917.2651716.88253GALAXY
123764587957773968122.4313921.33319.7487319.0356818.71565GALAXY
123764587957793613819.4710218.2568417.6396217.2525317.03179GALAXY
123764587957793613819.4710218.2568417.6396217.2525317.03179GALAXY
123764587957793613819.4710218.2568417.6396217.2525317.03179GALAXY
123764587957846025519.077317.7823917.0625616.6732316.34688GALAXY
123764587957846025519.077317.7823917.0625616.6732316.34688GALAXY
123764587957846025519.077317.7823917.0625616.6732316.34688QSO
123764587957846027119.0652417.4492316.8053816.4101416.17271GALAXY
123764587957846027119.0652417.4492316.8053816.4101416.17271GALAXY
123764587957846027119.0652417.4492316.8053816.4101416.17271GALAXY

Problem 2c

Perform an identical query to the one above, but this time use a left outer join (or left join).

How do your results compare to the previous query?


In [21]:
SDSS.query_sql("""select top 20 objid, cModelMag_u, cModelMag_g, cModelMag_r, cModelMag_i, cModelMag_z, 
                         class
                  from photoobjall p 
                      left outer join specobjall s on p.objid = s.bestobjid""")


Out[21]:
<Table length=20>
objidcModelMag_ucModelMag_gcModelMag_rcModelMag_icModelMag_zclass
int64float64float64float64float64float64bool
123764587686127206513.0793612.5780912.3419511.8159811.65377False
123764587686127206613.0852813.0268612.8516311.8816711.64233False
123764587686127206719.7146513.8615814.1722815.6415114.23906False
123764587686127206822.6430315.8989721.3114920.9168420.02921False
123764587686127206913.102312.6438712.3944111.9559411.64456False
123764587686127207013.1582312.8832912.5981712.4393711.76545False
123764587686127207124.3551315.1913214.5077614.0083822.82691False
123764587686127207224.634716.4585724.8020814.5743822.82694False
123764587686127207324.0342328.2100924.8090617.9675125.42343False
123764587686127207420.8822320.1053419.5068222.4438819.93633False
123764587686127207521.5370723.2611721.2639420.7682621.62034False
123764587686127207624.0993219.1089819.8696520.6548820.19429False
123764587686127207723.3289621.9708420.9694121.5025622.0869False
123764587686127207821.7507225.31725.0330521.2936820.90678False
123764587686127207921.0145521.0253620.2079820.0031720.60809False
123764587686127208024.8250625.6790224.9771121.8171823.40933False
123764587686127208125.2778220.0148722.4170122.937120.26106False
123764587686127208221.5929126.4551126.2261825.2960522.35419False
123764587686127208324.5259222.7262525.4182524.9438323.09492False
123764587686127208421.6942523.2338423.2993720.4762722.40297False

Problem 2d

This time use a right outer join (or right join).

How do your results compare to the previous query?


In [37]:
SDSS.query_sql("""select top 20 objid, cModelMag_u, cModelMag_g, cModelMag_r, cModelMag_i, cModelMag_z, 
                         class
                  from photoobjall p 
                      right outer join specobjall s on s.bestobjid = p.objid
                """)


Out[37]:
<Table length=20>
objidcModelMag_ucModelMag_gcModelMag_rcModelMag_icModelMag_zclass
boolboolboolboolboolboolbytes6
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY
FalseFalseFalseFalseFalseFalseGALAXY

Challenge Problem

To close the notebook we will perform a nested query. In brief, the idea is to join the results of one query with a separate query.

Here, we are going to attempt to identify bright AGN that don't have SDSS spectra. To do so we will need the photoObjAll table, the specObjAll table, both of which we've seen before, and the rosat table, which includes all cross matches between SDSS sources and X-ray sources detected by the Rosat satellite.

Create a nested query that selects all Rosat sources that don't have SDSS spectra with cModelFlux_u + cModelFlux_g + cModelFlux_r + cModelFlux_i + cModelFlux_z > 10000 (this flux contraints ensures the source is bright without making any cuts on color) and type = 3, this last constraint means the source is extended in SDSS images.

Hint - you may run into timeout issues in which case you should run the query on CasJobs.


In [42]:
SDSS.query_sql("""select rm.*
from 
(select r.objid, r.sourcename, r.ra, r.dec, r.cps, r.hr1, r.hr2, cModelMag_u, cModelMag_g, cModelMag_r, cModelMag_i, cModelMag_z
from photoobjall p join rosat r on p.objid = r.objid
  where (cModelFlux_u + cModelFlux_g + cModelFlux_r + cModelFlux_i + cModelFlux_z > 10000)
    and p.type = 3) as rm
  left join specobjall p on rm.objid = p.bestobjid
  where p.bestobjid is null 
                """)


ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 16))

---------------------------------------------------------------------------
timeout                                   Traceback (most recent call last)
/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    385                     # otherwise it looks like a programming error was the cause.
--> 386                     six.raise_from(e, None)
    387         except (SocketTimeout, BaseSSLError, SocketError) as e:

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/packages/six.py in raise_from(value, from_value)

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    381                 try:
--> 382                     httplib_response = conn.getresponse()
    383                 except Exception as e:

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/http/client.py in getresponse(self)
   1196             try:
-> 1197                 response.begin()
   1198             except ConnectionError:

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/http/client.py in begin(self)
    296         while True:
--> 297             version, status, reason = self._read_status()
    298             if status != CONTINUE:

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/http/client.py in _read_status(self)
    257     def _read_status(self):
--> 258         line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    259         if len(line) > _MAXLINE:

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/socket.py in readinto(self, b)
    574             try:
--> 575                 return self._sock.recv_into(b)
    576             except timeout:

timeout: timed out

During handling of the above exception, another exception occurred:

ReadTimeoutError                          Traceback (most recent call last)
/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    422                     retries=self.max_retries,
--> 423                     timeout=timeout
    424                 )

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    648             retries = retries.increment(method, url, error=e, _pool=self,
--> 649                                         _stacktrace=sys.exc_info()[2])
    650             retries.sleep()

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
    346             if read is False or not self._is_method_retryable(method):
--> 347                 raise six.reraise(type(error), error, _stacktrace)
    348             elif read is not None:

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/packages/six.py in reraise(tp, value, tb)
    685             raise value.with_traceback(tb)
--> 686         raise value
    687 

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
    599                                                   body=body, headers=headers,
--> 600                                                   chunked=chunked)
    601 

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
    387         except (SocketTimeout, BaseSSLError, SocketError) as e:
--> 388             self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
    389             raise

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py in _raise_timeout(self, err, url, timeout_value)
    307         if isinstance(err, SocketTimeout):
--> 308             raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
    309 

ReadTimeoutError: HTTPConnectionPool(host='skyserver.sdss.org', port=80): Read timed out. (read timeout=60)

During handling of the above exception, another exception occurred:

ReadTimeout                               Traceback (most recent call last)
<ipython-input-42-3a7f290631ae> in <module>()
      7   left join specobjall p on rm.objid = p.bestobjid
      8   where p.bestobjid is null
----> 9                 """)

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/astroquery/utils/class_or_instance.py in f(*args, **kwds)
     23         def f(*args, **kwds):
     24             if obj is not None:
---> 25                 return self.fn(obj, *args, **kwds)
     26             else:
     27                 return self.fn(cls, *args, **kwds)

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/astroquery/utils/process_asyncs.py in newmethod(self, *args, **kwargs)
     24             verbose = kwargs.pop('verbose', False)
     25 
---> 26             response = getattr(self, async_method_name)(*args, **kwargs)
     27             if kwargs.get('get_query_payload') or kwargs.get('field_help'):
     28                 return response

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/astroquery/sdss/core.py in query_sql_async(self, sql_query, timeout, data_release, cache, **kwargs)
    473         url = self._get_query_url(data_release)
    474         response = self._request("GET", url, params=request_payload,
--> 475                                  timeout=timeout, cache=cache)
    476         return response
    477 

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/astroquery/query.py in _request(self, method, url, params, data, headers, files, save, savedir, timeout, cache, stream, auth, continuation)
    195                                              self.cache_location,
    196                                              stream=stream,
--> 197                                              auth=auth)
    198                     to_cache(response, query.request_file(self.cache_location))
    199             self._last_query = query

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/astroquery/query.py in request(self, session, cache_location, stream, auth)
     58                                data=self.data, headers=self.headers,
     59                                files=self.files, timeout=self.timeout,
---> 60                                stream=stream, auth=auth)
     61 
     62     def hash(self):

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    486         }
    487         send_kwargs.update(settings)
--> 488         resp = self.send(prep, **send_kwargs)
    489 
    490         return resp

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/sessions.py in send(self, request, **kwargs)
    607 
    608         # Send the request
--> 609         r = adapter.send(request, **kwargs)
    610 
    611         # Total elapsed time of the request (approximately)

/Users/adamamiller/miniconda3/envs/py35/lib/python3.5/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
    497                 raise SSLError(e, request=request)
    498             elif isinstance(e, ReadTimeoutError):
--> 499                 raise ReadTimeout(e, request=request)
    500             else:
    501                 raise

ReadTimeout: HTTPConnectionPool(host='skyserver.sdss.org', port=80): Read timed out. (read timeout=60)

In [ ]: