def getCoordinate(tableName): return "select objra,objdec from %s where %s" % (tableName, getCoordinateRegion()) def getCount(tableName): return "select count(*) from %s where %s" % (tableName, getCoordinateRegion()) def getSQL(tableName): return getDistinct(tableName), getCoordinate(tableName), getCount(tableName) """ Lamost data density """ table = "dr3.M31_ELL" sql_distinct, sql_coordinate, sql_count = getSQL(table) dp.plot(sql_distinct, sql_coordinate, sql_count, "Lamost_ELL") dp.plotScatter(sql_distinct, sql_coordinate, sql_count, "Lamost_ELL") """ SDSS Region data density """ table = "sdss.M31_ELL" sql_distinct, sql_coordinate, sql_count = getSQL(table) dp.plotScatter("", sql_coordinate, sql_count, "SDSS_ELL", True) dp.plot("", sql_coordinate, sql_count, "SDSS_ELL", True)
__author__ = "zdwdong" import Astronomy.Plot.DensityPlot as dp """ Lamost data density """ sql_distinct = "select distinct(mainclass) from dr3.M31" sql_select_coordinate = "select objra,objdec from dr3.M31" sql_select_coordinate_count = "select count(*) from dr3.M31" dp.plot(sql_distinct, sql_select_coordinate, sql_select_coordinate_count, "Lamost") dp.plotScatter(sql_distinct, sql_select_coordinate, sql_select_coordinate_count, "Lamost") """ Lamost Region data density """ sql_distinct_region = "select distinct(mainclass) from dr3.M31_Region" sql_select_coordinate_region = "select objra,objdec from dr3.M31_Region" sql_select_coordinate_count_region = "select count(*) from dr3.M31_Region" dp.plot(sql_distinct_region, sql_select_coordinate_region, sql_select_coordinate_count_region, "Lamost_Region") dp.plotScatter(sql_distinct_region, sql_select_coordinate_region, sql_select_coordinate_count_region, "Lamost_Region") """ SDSS data density """ sql_select_coordinate = "select objra,objdec from sdss.M31" sql_select_coordinate_count = "select count(*) from sdss.M31" dp.plotScatter("", sql_select_coordinate, sql_select_coordinate_count, "SDSS", True) """