<jupyter_start><jupyter_text>Explore the sky data from Parker<jupyter_code>import os
import h5py
import numpy as np
import desisim.simexp
import specsim.config
import astropy.units as u
# -- local -- 
import env
from feasibgs import util as UT
import matplotlib as mpl 
import matplotlib.pyplot as pl 
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['axes.xmargin'] = 1
mpl.rcParams['xtick.labelsize'] = 'x-large'
mpl.rcParams['xtick.major.size'] = 5
mpl.rcParams['xtick.major.width'] = 1.5
mpl.rcParams['ytick.labelsize'] = 'x-large'
mpl.rcParams['ytick.major.size'] = 5
mpl.rcParams['ytick.major.width'] = 1.5
mpl.rcParams['legend.frameon'] = False
%matplotlib inline<jupyter_output><empty_output><jupyter_text>import dark sky data<jupyter_code>dark_sky = np.loadtxt(UT.dat_dir()+'sky/spec-sky.dat', unpack=True, skiprows=2, usecols=[0,1])
fig = plt.figure(figsize=(8,4))
sub = fig.add_subplot(111)
sub.scatter(dark_sky[0], dark_sky[1], c='k', lw=0, s=1.)
sub.set_xlabel('Wavelength', fontsize=20)
sub.set_xlim([3600., 9800.])
sub.set_ylabel(r"sky flux [$10^{-17} erg/(\AA\,cm^2s)$]", fontsize=20)
sub.set_yscale("log")
sub.set_ylim([0.5, 100])
sub.set_title('DESI Dark Sky', fontsize=20)<jupyter_output><empty_output><jupyter_text>bright sky data<jupyter_code>f = UT.dat_dir()+'sky/moon_sky_spectrum.hdf5'
assert os.path.isfile(f)
f_hdf5 = h5py.File(f, 'r')
waves, skys = [], [] 
for i in range(4): 
    waves.append(f_hdf5['sky'+str(i)+'/wave'].value)
    skys.append(f_hdf5['sky'+str(i)+'/sky'].value)<jupyter_output><empty_output><jupyter_text>mean moon spectra but with a very strong OI line<jupyter_code>fig = plt.figure(figsize=(8,4))
sub = fig.add_subplot(111)
sub.scatter(10*waves[0], skys[0], lw=0, s=1.)
sub.scatter(10*waves[1], skys[1], lw=0, s=1.)
sub.set_xlabel('Wavelength', fontsize=20)
sub.set_xlim([3600., 9800.])
sub.set_yscale("log")
sub.set_ylim([0.5, 100])
sub.set_title("Moon Spectra with strong OI line", fontsize=20)
fig = plt.figure(figsize=(8,4))
sub = fig.add_subplot(111)
sub.scatter(dark_sky[0], dark_sky[1], c='k', lw=0, s=0.5)
sub.scatter(10*waves[2], skys[2], lw=0, s=1.)
sub.scatter(10*waves[3], skys[3], lw=0, s=1.)
sub.set_xlabel('Wavelength', fontsize=20)
sub.set_xlim([3600., 9800.])
sub.set_yscale("log")
sub.set_ylim([0.5, 100])
sub.set_title("very bright night", fontsize=20)<jupyter_output><empty_output><jupyter_text>How do these sky fluxes different from the sky surface brightnesses used by the `specsim` pipeline?<jupyter_code># read in specsim sky surface-brightnesses
ss_sky_dark = np.loadtxt(os.environ['DESIMODEL']+'/data/spectra/spec-sky.dat', skiprows=2, unpack=True, usecols=[0,1])
ss_sky_bright = np.loadtxt(os.environ['DESIMODEL']+'/data/spectra/spec-sky-bright.dat', skiprows=2, unpack=True, usecols=[0,1])
fig = plt.figure(figsize=(8,8))
sub = fig.add_subplot(211)
sub.scatter(dark_sky[0], dark_sky[1], c='k', lw=0, s=0.2)
sub.scatter(10*waves[2], skys[2], c='k', lw=0, s=1.)
sub.scatter(10*waves[3], skys[3], c='k', lw=0, s=1.)
sub.set_xlim([3600., 9800.])
sub.set_ylabel(r"sky flux [$\frac{10^{-17} erg}{cm^2s \AA}$]", fontsize=20)
sub.set_yscale("log")
sub.set_ylim([0.5, 100])
sub = fig.add_subplot(212)
sub.scatter(ss_sky_dark[0], ss_sky_dark[1], c='C0', lw=0, s=0.5)
sub.scatter(ss_sky_bright[0], ss_sky_bright[1], c='C0', lw=0, s=0.5)
sub.set_xlabel('Wavelength', fontsize=20)
sub.set_xlim([3600., 9800.])
sub.set_ylabel(r"Surface Brigntess [$\frac{10^{-17} erg}{\AA\,arcsec^2\,cm^2 s}$]", fontsize=20)
sub.set_yscale("log")
sub.set_ylim([0.5, 100])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20248618784530387, 'fraction_numerical': 0.05828729281767956, 'mean_word_length': 6.940789473684211, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '536597', 'license': 'MIT', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1584, 'n_words': 257, 'path': 'notebook/notes_sky_parker.ipynb', 'repo_name': 'changhoonhahn/feasiBGS', 'size': '3620'}