Using new OpSim output from Rahul Biswas - astro_lsst_01_1068_sqlite.db


Slightly different format


In [1]:
from __future__ import print_function ## Force python3-like printing
%matplotlib inline

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import os
import time

import sqlite3
from sqlalchemy import create_engine

then = time.time()

# opsimdbpath = os.environ.get('OPSIMDBPATH')
opsimdbpath = "/Users/berto/data/LSST/OpSimOutputDBs/astro_lsst_01_1068_sqlite.db"
print(opsimdbpath)

conn = create_engine('sqlite:///'+opsimdbpath, echo = False)


/Users/berto/data/LSST/OpSimOutputDBs/astro_lsst_01_1068_sqlite.db

In [2]:
# opsimdf = pd.read_sql_query('SELECT * FROM Summary WHERE night = 1000', engine)
# opsimdf = pd.read_sql_query('SELECT * FROM Summary WHERE night < 366', engine)
opsimdf = pd.read_sql_table('Summary', con=conn)


1.5257549285888672

In [3]:
now = time.time()
print(now - then)
ddf = opsimdf.query('propID == 56') ## 56 is DDF
filters = np.unique(ddf["filter"])
print(filters)


125.81722712516785
[]

In [ ]:
opsimdf

In [ ]:
# ddf

In [ ]:
type(ddf)

In [ ]:
import astropy.coordinates as coord
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.coordinates import ICRS, Galactic, FK4, FK5  # Low-level frames
from astropy.coordinates import Angle, Latitude, Longitude  # Angles

In [ ]:


In [ ]:
fig = plt.figure(figsize=[8, 4])

fig.subplots_adjust(left = 0.01, bottom = 0.05, top = 0.85, right = 0.99, hspace=0, wspace = 0)
ax = fig.add_subplot(111, projection="aitoff")
ax.grid(True)

ax.scatter(ddf["fieldRA"], ddf["fieldDec"])

In [ ]:


In [ ]: