In [1]:
import os
In [2]:
from lsst.sims.photUtils import BandpassDict
In [3]:
import pandas as pd
In [4]:
import obscond
In [5]:
%matplotlib inline
import matplotlib.pyplot as plt
In [12]:
import seaborn as sns
sns.set_style('whitegrid')
sns.set_context('talk')
In [13]:
TotbpDict, hwbpDict = BandpassDict.loadBandpassesFromFiles()
In [14]:
fig, ax = plt.subplots()
ax.plot(hwbpDict['g'].wavelen, hwbpDict['g'].sb, 'k')
ax.plot(hwbpDict['g'].wavelen, TotbpDict['g'].sb, 'r')
Out[14]:
In [15]:
pointings = pd.read_csv(os.path.join(obscond.example_data_dir, 'example_pointings.csv'), index_col='obsHistID')
In [16]:
skycalc = obscond.SkyCalculations(photparams="LSST", hwBandpassDict=hwbpDict)
In [17]:
pointings[['fieldRA', 'fieldDec', 'expMJD', 'airmass', 'FWHMeff', 'filter']].head()
Out[17]:
In [18]:
plt.plot(skycalc.adb.bandpassForAirmass('g', 1.00).sb)
Out[18]:
In [19]:
skycalc.fiveSigmaDepth('g', 1.086662, 0.925184, -0.4789, 61044.077855, use_provided_airmass=False)
Out[19]:
Try it out when a value has not been provided but use_provided_airmass
is True
In [20]:
skycalc.fiveSigmaDepth('g', 1.086662, 0.925184, -0.4789, 61044.077855, use_provided_airmass=True)
Out[20]:
In [21]:
skycalc.fiveSigmaDepth('g', 1.086662, 0.925184, -0.4789, 61044.077855, provided_airmass=1.008652,
use_provided_airmass=True)
Out[21]:
In [22]:
skycalc.skymag('r', 0.925, -0.4789, 59580.14)
Out[22]:
In [23]:
skycalc.calculatePointings(pointings)
Out[23]:
In [18]:
x = skycalc.calculatePointings(pointings).join(pointings, rsuffix='opsim')
In [19]:
x['airmass_diff'] = x.airmass - x.airmassopsim
In [20]:
x.airmass_diff.hist()
Out[20]: