In [1]:
from __future__ import print_function, division

In [2]:
# This changes the current directory to the base saga directory - make sure to run this first!
# This is necessary to be able to import the py files and use the right directories,
# while keeping all the notebooks in their own directory.
import os
import sys

if 'saga_base_dir' not in locals():
    saga_base_dir = os.path.abspath('..')
if saga_base_dir not in sys.path:
    os.chdir(saga_base_dir)

In [3]:
%matplotlib inline
from matplotlib import pyplot as plt
from matplotlib import rcParams

rcParams['figure.figsize'] = (16, 8)
rcParams['image.interpolation'] = 'none'
rcParams['image.origin'] = 'lower'

In [4]:
import re
import urllib2
import datetime
from glob import glob

import numpy  as np

from collections import Counter, OrderedDict

from astropy import units as u
from astropy.coordinates import SkyCoord, AltAz, EarthLocation, get_sun
from astropy.time import Time
from astropy.utils.data import get_readable_fileobj
from astropy.io import fits
from astropy.table import Table, QTable, Column, MaskedColumn
from astropy import table

from IPython import display

In [5]:
for module in ['hosts', 'targeting', 'aat']:
    if module in globals():
        reload(globals()[module])
    else:
        globals()[module] = __import__(module)
#g = targeting.get_gama() #re-caches the gama catalog

In [6]:
hsd = hosts.get_saga_hosts_from_google(clientsecretjsonorfn='client_secrets.json', useobservingsummary=False)
hsd = dict([(h.name, h) for h in hsd])


Using cached version of google hosts list from file "hosts_dl.pkl2"

In [7]:
def catalog_to_sc(cat, hostordist = None):
    if hasattr(hostordist, 'dist'):
        distance = hostordist.dist
    else:
        distance = hostordist
        
    return SkyCoord(cat['ra']*u.deg, cat['dec']*u.deg, distance=distance)

Prepare catalogs


In [8]:
nmstoget = ('Dune', 'AnaK', 'Odyssey', 'Gilgamesh', 'OBrother', 'Narnia', 'Catch22')
hosts_to_target = [h for h in hsd.values() if h.name in nmstoget]
assert len(hosts_to_target)==len(nmstoget)
new_targets = [hosts.NSAHost(145729), hosts.NSAHost(21709)]
hosts_to_target.extend(new_targets)

In [9]:
# now set to the latest base catalogs
for h in hsd.values() + hosts_to_target:
    h.fnsdss = 'SAGADropbox/base_catalogs/base_sql_nsa{0}.fits.gz'.format(h.nsaid)
    h._cached_sdss = None

In [10]:
# make sure the catalogs are loaded
for h in hosts_to_target:
    h.get_sdss_catalog()

hosts_to_target


Out[10]:
[<hosts.NSAHost object w/ name 'Narnia' AKA: ['NGC1015', 'NSA132339']>,
 <hosts.NSAHost object w/ name 'Catch22' AKA: ['NGC7541', 'NSA150887']>,
 <hosts.NSAHost object w/ name 'Dune' AKA: ['NGC5750', 'NSA165536']>,
 <hosts.NSAHost object w/ name 'OBrother' AKA: ['NSA149781']>,
 <hosts.NSAHost object w/ name 'Gilgamesh' AKA: ['NGC5962', 'NSA166313']>,
 <hosts.NSAHost object w/ name 'AnaK' AKA: ['NGC7716', 'NSA61945']>,
 <hosts.NSAHost object w/ name 'Odyssey' AKA: ['NGC6181', 'NSA147100']>,
 <hosts.NSAHost object w/ name 'NSA145729'>,
 <hosts.NSAHost object w/ name 'NSA21709'>]

In [11]:
# these are the already-observed objects

# we use "h" for this only as a convenience because the method adds some useful bits that aren't in the raw catalogs
spectra = h.load_and_reprocess_sdss_catalog('SAGADropbox/data/saga_spectra_clean.fits.gz')

Prioritize

x = base catalog on Dropbox
; CORRECT FOR EXTINCTION
      r = x.r - x.extinction_r
      i = x.i - x.extinction_i
      g = x.g - x.extinction_g
; DEFINE GRI CRITERIA, ERRORS ARE SUBTRACTED IN QUADRATURE
     cgr = (g - r) - 2.*sqrt(x.g_err^2 + x.r_err^2)
     cri = (r - i) - 2.*sqrt(x.r_err^2 + x.i_err^2)

; SELECT TARGETS
   qtarget = where(x.rhost_kpc le 300 and $   ; INSIDE RVIR
                   x.fibermag_r le 23 and $   ; FIBERMAG CUT
                   x.remove eq -1 and $       ; SHRED LIST
                   x.phot_sg eq 'GALAXY'and $ ; GALAXIES ONLY
                   cgr le 0.85 and cri le 0.55 and $ ; GRI CUT
                   x.zquality lt 3)           ; NO SPECTRA

The scheme below is:

7: r<300 kpc , M_r<20, "good" colorcuts
6: r<300 kpc , 20<M_r<20.75, "good" colorcuts
5: r<300 kpc , M_r<20, "ok" colorcuts
4: r<300 kpc , 20<M_r<20.75, "ok" colorcuts
3: 450>r>300 kpc , M_r<20, "good" colorcuts
2: 450>r>300 kpc , 20<M_r<20.75, " good" colorcuts
1: everything else with r<21 (*not* M_r)

In [681]:
for h in hosts_to_target:
    print('On host', h.name)
    cat = h.get_sdss_catalog()

    r0 = cat['r'] - cat['Ar']
    
    cutbyrawmagcut = (r0<20.75)&(cat['r']>21)
    if np.sum(cutbyrawmagcut)>0:
        print('WARNING: ', np.sum(cutbyrawmagcut), 'objects have rmags in selection but are extincted too much for r>21')
    pris = np.ones(len(cat))
    
    # remove list
    tokeep = cat['REMOVE']==-1
    pris[~tokeep] = -cat['REMOVE'][~tokeep] # sets the REMOVE objects to -their remove value
    remmskval =  np.min(pris)-1
    # remove anything in the remove list online but not in the catalog as remove
    pris[~targeting.remove_targets_with_remlist(cat, h, maskonly=True, verbose='warning')&(pris>-1)] = remmskval
    if np.sum(pris==remmskval) > 0:
        print('Removed', np.sum(pris==remmskval), 'due to online remove list. Remmsk val:', remmskval)
        
        
    photgood = ((cat['r'] < 21.) & # this is to cut the numbers a bit - more stringent mag cuts below
                (cat['fibermag_r']<23) & 
                (cat['phot_sg']=='GALAXY'))
    nearish = (cat['RHOST_KPC']<450) # again, to limit the numbers
    pris[~photgood|~nearish] = 0 
    
    # pris ~-100 are removed due to already-observed
    nospec = cat['ZQUALITY']<3
    pris[~nospec] = -100-cat['ZQUALITY'][~nospec]
    
    brighter = r0 < 20
    fainter = (r0 < 20.75)&~brighter
    goodcolors = targeting.colorcut_mask(cat, {'g-r': (None, 0.85, 2), 'r-i': (None, 0.55, 2)},deredden=True)
    okcolors = targeting.colorcut_mask(cat, {'g-r': (None, 1.2), 'r-i': (None, 0.7)}, deredden=False)
    inside = cat['RHOST_KPC']<300
    
    pris[(pris>0)&~inside&fainter&goodcolors] = np.max(pris) + 1
    pris[(pris>0)&~inside&brighter&goodcolors] = np.max(pris) + 1
    pris[(pris>0)&inside&fainter&okcolors] = np.max(pris) + 1
    pris[(pris>0)&inside&brighter&okcolors] = np.max(pris) + 1
    pris[(pris>0)&inside&fainter&goodcolors] = np.max(pris) + 1
    pris[(pris>0)&inside&brighter&goodcolors] = np.max(pris) + 1
    #everything left is in pri 1

    # this *shouldn't* be necessary, as ZQUALITY should be in the base catalog.  
    # But as a sanity check we look to see if anything in the spectral catalog is still being included
    spec_this_host = spectra[spectra['HOST_NSAID']==h.nsaid]
    spec_this_host = spec_this_host[np.in1d(spec_this_host['OBJID'], cat['OBJID'])]

    zq = cat['ZQUALITY'].copy()
    for i, zqi in zip(spec_this_host['OBJID'], spec_this_host['ZQUALITY']):
        zq[cat['OBJID']==i] = zqi
    if np.any(pris[zq>2]>=0):
        print('POSSIBLE PROBLEM: Found some objects in spectrum list that are *not* claimed ' 
              'as having spectra in the base catalogs.  Setting them to -11x:', dict(Counter(pris[pris<-110])))
        pris[zq>2] = -110 - zq[zq>2]
        
    #de-duplicate
    if len(np.unique(cat['OBJID'])) != len(cat):
        _, idxs = np.unique(cat['OBJID'], return_index=True)
        msk = np.ones_like(cat, dtype=bool)
        msk[idxs] = 0
        pris[msk] = -1000
        
        print('WARNING: some duplicate objid found.  Setting', np.sum(pris==-1000), 'dupes to pri=-1000')
    
    cat['aat_pris'] = pris
    if 'aat_pris_unjiggered' in cat.colnames:
        cat.remove_column('aat_pris_unjiggered')

    #informational
    counter = Counter(pris)
    print('Rank counts:')
    for k in reversed(sorted(counter)):
        print(int(k), ':', counter[k])


On host Narnia
WARNING: some duplicate objid found.  Setting 12 dupes to pri=-1000
Rank counts:
7 : 191
6 : 313
5 : 145
4 : 97
3 : 405
2 : 655
1 : 2728
0 : 74279
-1 : 6
-2 : 16
-3 : 187
-4 : 20
-103 : 154
-104 : 2280
-1000 : 12
On host Catch22
WARNING:  6 objects have rmags in selection but are extincted too much for r>21
WARNING: some duplicate objid found.  Setting 16 dupes to pri=-1000
Rank counts:
7 : 285
6 : 525
5 : 119
4 : 64
3 : 429
2 : 752
1 : 2976
0 : 69077
-1 : 14
-2 : 26
-3 : 130
-4 : 9
-103 : 18
-104 : 980
-1000 : 16
On host Dune
WARNING: some duplicate objid found.  Setting 13 dupes to pri=-1000
Rank counts:
7 : 81
6 : 156
5 : 125
4 : 182
3 : 407
2 : 1136
1 : 3812
0 : 92519
-1 : 13
-2 : 39
-3 : 290
-4 : 34
-103 : 193
-104 : 4155
-1000 : 13
On host OBrother
WARNING:  2 objects have rmags in selection but are extincted too much for r>21
Removed 1 due to online remove list. Remmsk val: -5.0
WARNING: some duplicate objid found.  Setting 22 dupes to pri=-1000
Rank counts:
7 : 221
6 : 255
5 : 106
4 : 35
3 : 464
2 : 625
1 : 2080
0 : 80709
-1 : 2
-2 : 11
-3 : 150
-4 : 3
-5 : 1
-103 : 61
-104 : 861
-1000 : 22
On host Gilgamesh
WARNING: some duplicate objid found.  Setting 11 dupes to pri=-1000
Rank counts:
7 : 31
6 : 53
5 : 68
4 : 44
3 : 444
2 : 941
1 : 3785
0 : 90692
-1 : 12
-2 : 30
-3 : 347
-4 : 16
-103 : 440
-104 : 3010
-1000 : 11
On host AnaK
WARNING: some duplicate objid found.  Setting 9 dupes to pri=-1000
Rank counts:
7 : 39
6 : 109
5 : 107
4 : 50
3 : 410
2 : 720
1 : 2710
0 : 76941
-1 : 4
-2 : 31
-3 : 189
-4 : 22
-103 : 515
-104 : 3511
-1000 : 9
On host Odyssey
WARNING: some duplicate objid found.  Setting 21 dupes to pri=-1000
Rank counts:
7 : 14
6 : 24
5 : 1
4 : 3
3 : 550
2 : 676
1 : 1847
0 : 117208
-1 : 1
-2 : 11
-3 : 300
-4 : 13
-103 : 412
-104 : 3564
-1000 : 21
On host NSA145729
WARNING: some duplicate objid found.  Setting 20 dupes to pri=-1000
Rank counts:
7 : 554
6 : 859
5 : 199
4 : 85
3 : 649
2 : 988
1 : 3470
0 : 92134
-1 : 8
-2 : 15
-3 : 279
-4 : 8
-104 : 1035
-1000 : 20
On host NSA21709
No matches found for host "NSA21709" in remove list. Maybe you mis-typed something?
WARNING: some duplicate objid found.  Setting 10 dupes to pri=-1000
Rank counts:
7 : 512
6 : 853
5 : 242
4 : 114
3 : 808
2 : 1170
1 : 4513
0 : 57561
-2 : 23
-3 : 292
-4 : 3
-104 : 172
-1000 : 10

Note: the 2 objects in OBrother with the warning have r~21, and are definitely not interesting targets

Re-jigger priorities for new targets to account for ML prob

The re-jiggered scheme is:

7: r<300 kpc , M_r<20, "good" colorcuts, ML>.001
6: r<300 kpc , 20<M_r<20.75, "good" colorcuts, ML>.001
5: r<300 kpc , M_r<20, "good" colorcuts, ML<.001
4: r<300 kpc , 20<M_r<20.75, "good" colorcuts, ML<.001

<3 : same as above

In [682]:
for h in new_targets:
    print(h.name)
        
    cat = h.get_sdss_catalog()
    if 'aat_pris_unjiggered' in cat.colnames:
        print('Already rejiggered', h, 'skipping (but still reporting stats)...')
        
        pris = cat['aat_pris']
        print(dict(Counter(pris[pris>0])))
        print(dict(Counter(pris[pris<=0])))
        continue
    
    p = cat['PROBABILITY_CLASS1']
    if np.all(p<0):
        print('WARNING: host', h, 'does not have probs, so not re-jiggering based on ML probs')
        continue
    
    pris = np.array(cat['aat_pris_unjiggered' if 'aat_pris_unjiggered' in cat.colnames else 'aat_pris'])
    
    goodcolorbright = pris == 7
    goodcolorfaint = pris == 6
    okcolor = (pris==5) | (pris==4)
    
    
    pris[okcolor] = -0.75
    
    pris[goodcolorfaint] = 4
    pris[goodcolorbright] = 5
    pris[goodcolorfaint&(p>.001)] = 6
    pris[goodcolorbright&(p>.001)] = 7
    
    print(dict(Counter(pris[pris>0])))
    print(dict(Counter(pris[pris<=0])))
    
    cat['aat_pris_unjiggered'] = cat['aat_pris']
    cat['aat_pris'] = pris


NSA145729
{1.0: 3470, 2.0: 988, 3.0: 649, 4.0: 630, 5.0: 255, 6.0: 229, 7.0: 299}
{0.0: 92134, -0.75: 284, -104.0: 1035, -1.0: 8, -1000.0: 20, -4.0: 8, -3.0: 279, -2.0: 15}
NSA21709
WARNING: host <hosts.NSAHost object w/ name 'NSA21709'> does not have probs, so not re-jiggering based on ML probs

Some special objects


In [499]:
special_objids = []

In [500]:
possible_anak_sat = SkyCoord(353.7229, 1.2064, unit=u.deg)

spectrascs = SkyCoord(spectra['ra'], spectra['dec'], unit=u.deg)
row = spectra[np.argsort(possible_anak_sat.separation(spectrascs))[0]]
special_objids.append(row['OBJID'])
row


Out[500]:
<Row index=50268>
OBJIDRADECPHOTPTYPEPHOT_SGFLAGScleanSATURATEDBAD_COUNTS_ERRORBINNED1TOO_FEW_GOOD_DETECTIONSugrizu_errg_errr_erri_errz_errMODELMAGERR_UMODELMAGERR_GMODELMAGERR_RMODELMAGERR_IMODELMAGERR_ZEXTINCTION_UEXTINCTION_GEXTINCTION_REXTINCTION_IEXTINCTION_ZDERED_UDERED_GDERED_RDERED_IDERED_ZPETRORAD_UPETRORAD_GPETRORAD_RPETRORAD_IPETRORAD_ZPETRORADERR_UPETRORADERR_GPETRORADERR_RPETRORADERR_IPETRORADERR_ZDEVRAD_UDEVRADERR_UDEVRAD_GDEVRADERR_GDEVRAD_RDEVRADERR_RDEVRAD_IDEVRADERR_IDEVRAD_ZDEVRADERR_ZDEVAB_UDEVAB_GDEVAB_RDEVAB_IDEVAB_ZCMODELMAG_UCMODELMAGERR_UCMODELMAG_GCMODELMAGERR_GCMODELMAG_RCMODELMAGERR_RCMODELMAG_ICMODELMAGERR_ICMODELMAG_ZCMODELMAGERR_ZPSFMAG_UPSFMAGERR_UPSFMAG_GPSFMAGERR_GPSFMAG_RPSFMAGERR_RPSFMAG_IPSFMAGERR_IPSFMAG_ZPSFMAGERR_ZFIBERMAG_UFIBERMAGERR_UFIBERMAG_GFIBERMAGERR_GFIBERMAG_RFIBERMAGERR_RFIBERMAG_IFIBERMAGERR_IFIBERMAG_ZFIBERMAGERR_ZFRACDEV_UFRACDEV_GFRACDEV_RFRACDEV_IFRACDEV_ZQ_UU_UQ_GU_GQ_RU_RQ_IU_IQ_ZU_ZEXPAB_UEXPRAD_UEXPPHI_UEXPAB_GEXPRAD_GEXPPHI_GEXPAB_REXPRAD_REXPPHI_REXPAB_IEXPRAD_IEXPPHI_IEXPAB_ZEXPRAD_ZEXPPHI_ZFIBER2MAG_RFIBER2MAGERR_REXPMAG_REXPMAGERR_RPETROR50_RPETROR90_RPETROMAG_RSB_EXP_RSB_PETRO_RJJERRHHERRKKERRSPEC_ZSPEC_Z_ERRSPEC_Z_WARNPHOTOZPHOTOZ_ERRW1W1ERRW2W2ERRHOST_RAHOST_DECHOST_DISTHOST_VHOSTHOST_MKHOST_NSAIDHOST_FLAGHOST_SAGA_NAMERHOST_ARCMRHOST_KPCOBJ_NSAIDSATSPROBABILITY_CLASS1RESCALED_PROBABILITY_CLASS1REMOVETELNAMEMASKNAMEZQUALITYSPEC_CLASSSPECOBJIDSPEC_REPEATAifibermag_zrhostfibermag_rfibermag_uAgfibermag_iAzArdecAufibermag_gtyperaobjIDpsf_rpsf_upsf_zrhost_kpcphot_sgpsf_gpsf_iUBVRIpsf_Upsf_Bpsf_Vpsf_Rpsf_I
int64float64float64int16str40int64int32int64int64int64int64float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float64float64float32float32float32float32float32float32float32float32int32float32float32float64float64float64float64float64float64float64float64float64int64int64str48float64float64int64int64float64float64int64str6str48int64str2str48str48float32float32float64float32float32float32float32float32float32float64float32float32int16float64int64float32float32float32float64str40float32float32float32float32float32float32float32float32float32float32float32float32
1237678617415057818353.7223583941.207439444433GALAXY52783671686383200026843545628147497671065618.544117.726217.394217.169317.08180.08737790.0155570.01482810.1730150.071751.694190.04276150.04504210.05376793.291370.2143930.1577480.1144120.08675540.061510721.815918.601317.801418.107121.29292.969032.969552.9696643.76792.96952-1000.0-1000.0-1000.0-1000.0-1000.00.0031323187.577729.66741.4603129.66593.0437229.66625.418230.5899424.46750.068710.3675980.338420.6040010.0524.31750.91624719.01650.040920317.91580.045042118.34090.052857422.68470.92550124.28041.531422.75740.12722322.23270.11052822.73510.22493722.72221.9299723.16430.40408421.93620.089660821.49810.073443621.45310.14144721.4670.5170931.00.00.00.01.0-0.0532507-1.25103-0.113049-0.0758591-0.130883-0.0579136-0.20846-0.03018470.5405361.696210.07062150.0297191134.3530.3999319.78309176.60.34999414.0846177.3760.50122410.2318179.480.09256730.40130663.733122.31060.10602817.91580.04504213.943315.5629919.128725.654976515324.10346039349999.09999.09999.09999.09999.09999.00.00867935-1.00-9999.0-9999.0-1.0-1.0-1.0-1.0354.1310.29726534.76742556.76-23.4058610709619450AnaK59.8429010124605.18622782115197820.30896555248-1.0-1NSAned41.23767861742e+18NSA0.086755421.46759.842901012421.498123.16430.15774821.45310.06151070.1144121.207439444430.21439321.93623353.722358394123767861741505781822.232724.280422.7222605.186227821GALAXY22.757422.735117.830418.049117.522617.242816.738523.390723.140622.44522.192622.3332

The above object was put as SAT==2, but is at very close z to AnaK...? r~=17.6 in DECALS. Marla says this is because it's too far from the host, so not worth special-izing


In [501]:
del special_objids[special_objids.index(row['OBJID'])]

In [502]:
possible_anak_sat = SkyCoord(354.286, 0.211, unit=u.deg)

anakcat = hsd['AnaK'].get_sdss_catalog()
anakscs = SkyCoord(anakcat['ra'], anakcat['dec'], unit=u.deg)
seps = possible_anak_sat.separation(anakscs)
closest = np.argsort(seps)[0]
print(seps[closest].arcsec)
row = anakcat[closest]
special_objids.append(row['OBJID'])
row


6.36556073878
Out[502]:
<Row index=4083>
OBJIDRADECPHOTPTYPEPHOT_SGFLAGScleanSATURATEDBAD_COUNTS_ERRORBINNED1TOO_FEW_GOOD_DETECTIONSugrizu_errg_errr_erri_errz_errMODELMAGERR_UMODELMAGERR_GMODELMAGERR_RMODELMAGERR_IMODELMAGERR_ZEXTINCTION_UEXTINCTION_GEXTINCTION_REXTINCTION_IEXTINCTION_ZDERED_UDERED_GDERED_RDERED_IDERED_ZPETRORAD_UPETRORAD_GPETRORAD_RPETRORAD_IPETRORAD_ZPETRORADERR_UPETRORADERR_GPETRORADERR_RPETRORADERR_IPETRORADERR_ZDEVRAD_UDEVRADERR_UDEVRAD_GDEVRADERR_GDEVRAD_RDEVRADERR_RDEVRAD_IDEVRADERR_IDEVRAD_ZDEVRADERR_ZDEVAB_UDEVAB_GDEVAB_RDEVAB_IDEVAB_ZCMODELMAG_UCMODELMAGERR_UCMODELMAG_GCMODELMAGERR_GCMODELMAG_RCMODELMAGERR_RCMODELMAG_ICMODELMAGERR_ICMODELMAG_ZCMODELMAGERR_ZPSFMAG_UPSFMAGERR_UPSFMAG_GPSFMAGERR_GPSFMAG_RPSFMAGERR_RPSFMAG_IPSFMAGERR_IPSFMAG_ZPSFMAGERR_ZFIBERMAG_UFIBERMAGERR_UFIBERMAG_GFIBERMAGERR_GFIBERMAG_RFIBERMAGERR_RFIBERMAG_IFIBERMAGERR_IFIBERMAG_ZFIBERMAGERR_ZFRACDEV_UFRACDEV_GFRACDEV_RFRACDEV_IFRACDEV_ZQ_UU_UQ_GU_GQ_RU_RQ_IU_IQ_ZU_ZEXPAB_UEXPRAD_UEXPPHI_UEXPAB_GEXPRAD_GEXPPHI_GEXPAB_REXPRAD_REXPPHI_REXPAB_IEXPRAD_IEXPPHI_IEXPAB_ZEXPRAD_ZEXPPHI_ZFIBER2MAG_RFIBER2MAGERR_REXPMAG_REXPMAGERR_RPETROR50_RPETROR90_RPETROMAG_RSB_EXP_RSB_PETRO_RJJERRHHERRKKERRSPEC_ZSPEC_Z_ERRSPEC_Z_WARNPHOTOZPHOTOZ_ERRW1W1ERRW2W2ERRHOST_RAHOST_DECHOST_DISTHOST_VHOSTHOST_MKHOST_NSAIDHOST_FLAGHOST_SAGA_NAMERHOST_ARCMRHOST_KPCOBJ_NSAIDSATSPROBABILITY_CLASS1RESCALED_PROBABILITY_CLASS1REMOVETELNAMEMASKNAMEZQUALITYSPEC_CLASSSPECOBJIDSPEC_REPEATAifibermag_zrhostfibermag_rfibermag_uAgfibermag_iAzArdecAufibermag_gtyperaobjIDpsf_rpsf_upsf_zrhost_kpcphot_sgpsf_gpsf_iUBVRIpsf_Upsf_Bpsf_Vpsf_Rpsf_Iaat_pris
int64float64float64int16str40int64int32int64int64int64int64float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float64float64float32float32float32float32float32float32float32float32int32float32float32float64float64float64float64float64float64float64float64float64int64int64str48float64float64int64int64float64float64int64str6str48int64str2str48str48float32float32float64float32float32float32float32float32float32float64float32float32int16float64int64float32float32float32float64str40float32float32float32float32float32float32float32float32float32float32float32float32float64
1237666408439939193354.2842525770.2112704159626STAR31672837040155200026843545628147497671065624.286824.428223.888922.586422.33970.9662180.4471690.4438990.2054750.5451190.9662180.4471690.4438990.2054750.5451190.2014610.1482330.1075110.08152220.057800324.085324.2823.781422.504922.28192.969472.969272.970011.07370.440398-1000.0-1000.0-1000.00.4727120.3428050.19588541.90640.7618026.55321.1425317.57260.012107217.4510.2938617.07960.09850660.050.050.050.0524.27346.4810524.13751.0205423.45182.6071822.5860.67520122.24952.4257124.15140.82660224.40450.45993123.93440.52256622.57270.21096922.28390.52283323.01760.98065123.00830.21617222.21620.15604221.83510.18298121.58980.5336170.01.00.01.01.00.460437-0.413676-0.3029210.03414880.431855-0.05288690.1631430.001080561.213320.841260.235350.203513167.0110.050.73385167.59860.050.90005920.35720.2002770.0175057165.5930.06876220.37909536.112323.09910.29628723.45182.607180.6782461.2056823.76425.218632387924.91643089689999.09999.09999.09999.09999.09999.0-1.0-1.0-1-1.0-1.0-1.0-1.0-1.0-1.0354.1310.29726534.76742556.76-23.4058610709619450AnaK10.5437865106.63364479-1-1-1.0-1.0-1-10.081522221.589810.543786522.216223.01760.14823321.83510.05780030.1075110.2112704159620.20146123.00836354.284252577123766640843993919323.934424.151422.2839106.63364479STAR24.404522.572724.208424.816124.107523.572622.094224.068124.770624.122923.609122.06420.0

This is not actually quite on the center-of-light in DECALS... but it might be an HII region?

Marla wants:RA = 354.527/DEC = 0.533964


In [503]:
possible_anak_sat = SkyCoord(354.527, 0.533964, unit=u.deg)

seps = possible_anak_sat.separation(anakscs)
closest = np.argsort(seps)[0]
print(seps[closest].arcsec)
row = anakcat[closest]
special_objids.append(row['OBJID'])
row


0.911188006658
Out[503]:
<Row index=19477>
OBJIDRADECPHOTPTYPEPHOT_SGFLAGScleanSATURATEDBAD_COUNTS_ERRORBINNED1TOO_FEW_GOOD_DETECTIONSugrizu_errg_errr_erri_errz_errMODELMAGERR_UMODELMAGERR_GMODELMAGERR_RMODELMAGERR_IMODELMAGERR_ZEXTINCTION_UEXTINCTION_GEXTINCTION_REXTINCTION_IEXTINCTION_ZDERED_UDERED_GDERED_RDERED_IDERED_ZPETRORAD_UPETRORAD_GPETRORAD_RPETRORAD_IPETRORAD_ZPETRORADERR_UPETRORADERR_GPETRORADERR_RPETRORADERR_IPETRORADERR_ZDEVRAD_UDEVRADERR_UDEVRAD_GDEVRADERR_GDEVRAD_RDEVRADERR_RDEVRAD_IDEVRADERR_IDEVRAD_ZDEVRADERR_ZDEVAB_UDEVAB_GDEVAB_RDEVAB_IDEVAB_ZCMODELMAG_UCMODELMAGERR_UCMODELMAG_GCMODELMAGERR_GCMODELMAG_RCMODELMAGERR_RCMODELMAG_ICMODELMAGERR_ICMODELMAG_ZCMODELMAGERR_ZPSFMAG_UPSFMAGERR_UPSFMAG_GPSFMAGERR_GPSFMAG_RPSFMAGERR_RPSFMAG_IPSFMAGERR_IPSFMAG_ZPSFMAGERR_ZFIBERMAG_UFIBERMAGERR_UFIBERMAG_GFIBERMAGERR_GFIBERMAG_RFIBERMAGERR_RFIBERMAG_IFIBERMAGERR_IFIBERMAG_ZFIBERMAGERR_ZFRACDEV_UFRACDEV_GFRACDEV_RFRACDEV_IFRACDEV_ZQ_UU_UQ_GU_GQ_RU_RQ_IU_IQ_ZU_ZEXPAB_UEXPRAD_UEXPPHI_UEXPAB_GEXPRAD_GEXPPHI_GEXPAB_REXPRAD_REXPPHI_REXPAB_IEXPRAD_IEXPPHI_IEXPAB_ZEXPRAD_ZEXPPHI_ZFIBER2MAG_RFIBER2MAGERR_REXPMAG_REXPMAGERR_RPETROR50_RPETROR90_RPETROMAG_RSB_EXP_RSB_PETRO_RJJERRHHERRKKERRSPEC_ZSPEC_Z_ERRSPEC_Z_WARNPHOTOZPHOTOZ_ERRW1W1ERRW2W2ERRHOST_RAHOST_DECHOST_DISTHOST_VHOSTHOST_MKHOST_NSAIDHOST_FLAGHOST_SAGA_NAMERHOST_ARCMRHOST_KPCOBJ_NSAIDSATSPROBABILITY_CLASS1RESCALED_PROBABILITY_CLASS1REMOVETELNAMEMASKNAMEZQUALITYSPEC_CLASSSPECOBJIDSPEC_REPEATAifibermag_zrhostfibermag_rfibermag_uAgfibermag_iAzArdecAufibermag_gtyperaobjIDpsf_rpsf_upsf_zrhost_kpcphot_sgpsf_gpsf_iUBVRIpsf_Upsf_Bpsf_Vpsf_Rpsf_Iaat_pris
int64float64float64int16str40int64int32int64int64int64int64float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float64float64float32float32float32float32float32float32float32float32int32float32float32float64float64float64float64float64float64float64float64float64int64int64str48float64float64int64int64float64float64int64str6str48int64str2str48str48float32float32float64float32float32float32float32float32float32float64float32float32int16float64int64float32float32float32float64str40float32float32float32float32float32float32float32float32float32float32float32float32float64
1237663277925335850354.5272531180.5339633236643GALAXY38709711444412000026843545628147497671065623.15721.15120.511120.544520.52171.306250.1161140.0906980.160320.5536351.306250.1161140.0906980.160320.5536350.1835770.1350740.09796710.07428550.052669322.973421.015920.413120.470220.4690.09888042.969783.972464.004752.969940.569557-1000.00.2856133.85316-1000.04.1078624.35747.00833.6127612.89096.0098314.949417.985325.13180.2340.050.2499790.4123170.2701790.22774623.0711.1286721.25170.11374520.5110.10408520.62980.22221520.45221.1568124.27440.64907823.02410.15188522.75820.1487823.23350.34504622.50880.54305322.89080.37060222.30440.10983422.0720.13228721.66660.15653521.36860.4001431.00.145190.00.00.0-6.064353.35698-0.289822-0.0848221-0.254005-0.0180751-0.349996-0.0821505-0.386814-0.1042540.1510871.764190.03202110.2771513.06727101.8980.4873253.2608492.93470.3494643.41147103.4230.3062494.2485497.253922.890.18330720.5110.1040852.136823.1814220.718225.073123141924.36246152299999.09999.09999.09999.09999.09999.00.583004-1.0-10.2092510.08979-1.0-1.0-1.0-1.0354.1310.29726534.76742556.76-23.4058610709619450AnaK27.6933732316280.071871236-1-10.0338816442867-1.0-1MMT/Spectra/Final/MMT/spHect-2014.0925_1.zlog1197.0MMT0.074285521.368627.693373231622.07222.89080.13507421.66660.05266930.09796710.5339633236640.18357722.30443354.527253118123766327792533585022.758224.274422.5088280.071871236GALAXY23.024123.233522.132621.570320.773420.399220.138723.297323.326322.857922.713922.55686.0

That one seems good

Risa's eye-balled selections


In [750]:
def find_risa_objs(stringfromrisa, h):
    risa_tab = Table.read(stringfromrisa, delimiter='\t', format='ascii', names=['unk', 'ra', 'dec', 'mag', 'cand'])
    risa_sc = SkyCoord(risa_tab['ra'], risa_tab['dec'], unit=u.deg)

    cat = h.get_sdss_catalog()

    catsc = SkyCoord(cat['ra'], cat['dec'], unit=u.deg)
    idx, d2d, _ = risa_sc.match_to_catalog_sky(catsc)
    assertmsg = '{} matched of {}: {}'.format(np.sum(d2d < .1*u.arcsec),len(d2d), d2d[d2d > .1*u.arcsec])
    assert np.all(d2d < .1*u.arcsec), assertmsg
    return cat['OBJID'][idx]

In [698]:
risa_145729="""
-1	224.56410	-1.0730193	19.7973	true
-1	224.59164	-1.1261357	17.9597	true
-1	224.58605	-1.1340797	19.9805	true
-1	224.65696	-1.1021396	17.4972	true
-1	224.54478	-1.1645862	19.4057	true
-1	224.50349	-1.1783027	17.7666	true
-1	224.61258	-1.2283750	20.1190	true
-1	224.66071	-1.2407656	20.3448	true
-1	224.58210	-1.2891033	20.1278	true
-1	224.68795	-0.82928863	18.7276	true
-1	224.46354	-0.85993860	20.6228	true
-1	224.43907	-1.3290346	20.2419	true
-1	224.27041	-1.0663297	19.6382	true
-1	224.92796	-1.0868430	19.9441	true
-1	224.95218	-1.2046019	20.2506	true
-1	224.98659	-1.0996963	19.2848	true
-1	224.95028	-1.2134533	19.1667	true
-1	224.56810	-0.71035594	19.5400	true
-1	224.56710	-0.71155324	18.3361	true
-1	224.63475	-0.76637428	20.5220	true
-1	224.79342	-0.82424335	19.5245	true
-1	224.26293	-1.3190454	19.7427	true
-1	224.34037	-1.3851494	19.5061	true
-1	224.67776	-1.3717603	18.9769	true
-1	224.30819	-0.89372642	19.5476	true
-1	224.95888	-1.0081097	19.6524	true
-1	225.01145	-1.2106150	19.6745	true
-1	224.27946	-0.80572367	19.0886	true
-1	224.44473	-0.64135326	18.2103	true
-1	224.59702	-0.60626247	19.4427	true
-1	224.98059	-1.2775413	20.7447	true
-1	224.25056	-1.3830278	20.6792	true
-1	224.03729	-1.0589027	20.7401	true
-1	224.94320	-0.87332390	19.9586	true
-1	224.12169	-1.2418469	18.6920	true
-1	225.09967	-1.2117895	19.8792	true
-1	224.28313	-0.67401930	20.1558	true
-1	224.18769	-0.79627184	19.9399	true
-1	224.23305	-0.67032897	20.2131	true
-1	225.00922	-0.80628957	20.5866	true
-1	224.32848	-1.5812675	18.2125	true
-1	224.27623	-1.5292467	18.4006	true
-1	224.70055	-1.6463751	18.5479	true
-1	225.06682	-1.2727903	20.5982	true
-1	224.89664	-1.5217602	19.0338	true
-1	225.02588	-1.4044669	20.2629	true
-1	224.98083	-1.4368200	20.4261	true
-1	225.07035	-0.95870445	19.6174	true
-1	224.14144	-0.71374995	20.3682	true
-1	224.18156	-0.65458846	19.8804	true
-1	224.03748	-0.86010033	20.2428	true
-1	224.29784	-1.5985485	19.0072	true
-1	224.30080	-1.5957333	20.6291	true
-1	224.65269	-1.6814901	20.2405	true
-1	224.18598	-1.4982058	19.6720	true
-1	225.18215	-0.98714751	20.2422	true
"""[1:-1]
special_objids.extend(find_risa_objs(risa_145729, [h for h in hosts_to_target if h.nsaid==145729][0])

In [752]:
risa_obrother="""
1	335.97281	-3.4295662	17.7332	true
1	335.91314	-3.5404510	19.7043	true
-1	335.77781	-3.4459616	20.1615	true
-1	335.81490	-3.6025596	20.5123	true
1	336.04145	-3.2204987	20.5081	true
-1	336.09493	-3.4649021	19.7341	true
1	335.99401	-3.7007769	20.5931	true
1	336.12273	-3.5101925	20.4868	true
1	335.72556	-3.1674595	20.6372	true
1	335.84376	-3.0261104	20.7444	true
-1	336.23396	-3.1875586	20.7117	true
1	335.55249	-3.6052065	20.0624	true
1	335.65592	-3.6558837	20.5213	true
-1	335.57983	-3.6963397	19.3788	true
-1	336.30042	-3.4636766	19.8654	true
"""[1:-1]
special_objids.extend(find_risa_objs(risa_obrother, hsd['OBrother']))

In [773]:
risa_catch22="""
-1	348.62149	4.5071708	17.7932	true
-1	348.73347	4.5865011	19.4766	true
-1	348.67493	4.6123235	20.3472	true
-1	348.72361	4.4495699	20.6729	true
-1	348.72881	4.4323062	19.4804	true
-1	348.55899	4.5900220	20.2576	true
-1	348.64485	4.4040044	17.6392	true
-1	348.59640	4.3492465	20.6181	true
-1	348.68132	4.3095517	20.6868	true
-1	348.68817	4.3020869	20.7035	true
-1	348.89822	4.4892740	18.9281	true
-1	348.43132	4.7245873	19.3515	true
-1	348.51966	4.7464873	19.3880	true
-1	348.39920	4.5666321	18.2252	true
-1	348.99115	4.5918658	20.7471	true
-1	348.31622	4.3290159	19.6409	true
-1	348.87290	4.8064919	18.9324	true
-1	348.63961	4.2011104	20.5785	true
-1	348.98746	4.3261837	18.3678	true
-1	348.40085	4.8681252	17.4557	true
-1	348.64976	4.8775596	18.4048	true
-1	348.82739	4.9078081	19.3681	true
-1	348.68761	4.9226928	17.8673	true
-1	348.85846	4.8346772	19.6157	true
"""[1:-1]
special_objids.extend(find_risa_objs(risa_catch22, hsd['Catch22']))

In [ ]:
risa_narnia="""
"""[1:-1]
special_objids.extend(find_risa_objs(risa_narnia, hsd['Narnia']))

In [774]:
for soid in special_objids:
    for h in hosts_to_target:
        cat = h.get_sdss_catalog()
        if soid in cat['OBJID']:
            print('Found oid', soid, 'in', h.name, 'so setting to pri=9')
            pris = cat['aat_pris']
            if np.any(pris[np.in1d(cat['OBJID'], soid)]<1):
                print('WARNING: ', np.sum(pris[np.in1d(cat['OBJID'], soid)]<1), 'special objects in', 
                      h.name, 'are pri<0... skipping')
            cat['aat_pris'][np.in1d(cat['OBJID'], soid)&(pris>0)] = 9
            break
    else:
        print('Could not find oid', soid, 'anywhere')


Found oid 1237666408439939193 in AnaK so setting to pri=9
Found oid 1237663277925335850 in AnaK so setting to pri=9
Found oid 1237655499747361174 in NSA145729 so setting to pri=9
Found oid 1237655499747361349 in NSA145729 so setting to pri=9
Found oid 1237648702984552958 in NSA145729 so setting to pri=9
Found oid 1237655499747361262 in NSA145729 so setting to pri=9
Found oid 1237655499747295495 in NSA145729 so setting to pri=9
Found oid 1237655499747361401 in NSA145729 so setting to pri=9
Found oid 1237648702984553164 in NSA145729 so setting to pri=9
Found oid 1237655499747361165 in NSA145729 so setting to pri=9
Found oid 1237648703521424188 in NSA145729 so setting to pri=9
Found oid 1237648720176480877 in NSA145729 so setting to pri=9
Found oid 1237655693014991669 in NSA145729 so setting to pri=9
Found oid 1237648702984356667 in NSA145729 so setting to pri=9
Found oid 1237648702984619001 in NSA145729 so setting to pri=9
Found oid 1237648702984683743 in NSA145729 so setting to pri=9
Found oid 1237648702984684322 in NSA145729 so setting to pri=9
Found oid 1237648702984684203 in NSA145729 so setting to pri=9
Found oid 1237648703521358280 in NSA145729 so setting to pri=9
Found oid 1237648703521358281 in NSA145729 so setting to pri=9
Found oid 1237648703521424032 in NSA145729 so setting to pri=9
Found oid 1237648703521489387 in NSA145729 so setting to pri=9
Found oid 1237655693014926027 in NSA145729 so setting to pri=9
Found oid 1237655693014926250 in NSA145729 so setting to pri=9
Found oid 1237655693015057234 in NSA145729 so setting to pri=9
Found oid 1237655693551797124 in NSA145729 so setting to pri=9
Found oid 1237655693552059263 in NSA145729 so setting to pri=9
Found oid 1237648702984684397 in NSA145729 so setting to pri=9
Found oid 1237648703521227745 in NSA145729 so setting to pri=9
Found oid 1237648703521292752 in NSA145729 so setting to pri=9
Found oid 1237648720713417217 in NSA145729 so setting to pri=9
Found oid 1237655499747492755 in NSA145729 so setting to pri=9
Found oid 1237655693014925997 in NSA145729 so setting to pri=9
Found oid 1237648702984290856 in NSA145729 so setting to pri=9
Found oid 1237655693552059233 in NSA145729 so setting to pri=9
Found oid 1237648702984290789 in NSA145729 so setting to pri=9
Found oid 1237648702984749535 in NSA145729 so setting to pri=9
Found oid 1237648703521227755 in NSA145729 so setting to pri=9
Found oid 1237648703521227224 in NSA145729 so setting to pri=9
Found oid 1237648703521227541 in NSA145729 so setting to pri=9
Found oid 1237648703521555340 in NSA145729 so setting to pri=9
Found oid 1237655499210359418 in NSA145729 so setting to pri=9
Found oid 1237655499210359197 in NSA145729 so setting to pri=9
Found oid 1237655499210555913 in NSA145729 so setting to pri=9
Found oid 1237655499747558099 in NSA145729 so setting to pri=9
Found oid 1237655499210621327 in NSA145729 so setting to pri=9
Found oid 1237655693015253757 in NSA145729 so setting to pri=9
Found oid 1237655693015253613 in NSA145729 so setting to pri=9
Found oid 1237655693552124432 in NSA145729 so setting to pri=9
Found oid 1237648703521161521 in NSA145729 so setting to pri=9
Found oid 1237648703521227143 in NSA145729 so setting to pri=9
Found oid 1237648720176284037 in NSA145729 so setting to pri=9
Found oid 1237655499210359339 in NSA145729 so setting to pri=9
Found oid 1237655499210359352 in NSA145729 so setting to pri=9
Found oid 1237655499210490684 in NSA145729 so setting to pri=9
Found oid 1237655693014860602 in NSA145729 so setting to pri=9
Found oid 1237655693552190170 in NSA145729 so setting to pri=9
Found oid 1237680066954330600 in OBrother so setting to pri=9
Found oid 1237680192048726615 in OBrother so setting to pri=9
Found oid 1237680066954264909 in OBrother so setting to pri=9
Found oid 1237678879399543161 in OBrother so setting to pri=9
Found oid 1237680192048857645 in OBrother so setting to pri=9
Found oid 1237680066954330780 in OBrother so setting to pri=9
Found oid 1237680192048857688 in OBrother so setting to pri=9
Found oid 1237678879399412290 in OBrother so setting to pri=9
Found oid 1237678879399477775 in OBrother so setting to pri=9
Found oid 1237678879399609008 in OBrother so setting to pri=9
Found oid 1237680066954134281 in OBrother so setting to pri=9
Found oid 1237680066954199709 in OBrother so setting to pri=9
Found oid 1237680066954199545 in OBrother so setting to pri=9
Found oid 1237680192048923349 in OBrother so setting to pri=9
Found oid 1237679005021897147 in Catch22 so setting to pri=9
Found oid 1237678777399443705 in Catch22 so setting to pri=9
Found oid 1237679005021897099 in Catch22 so setting to pri=9
Found oid 1237679005021897127 in Catch22 so setting to pri=9
Found oid 1237678777399378429 in Catch22 so setting to pri=9
Found oid 1237679005021831509 in Catch22 so setting to pri=9
Found oid 1237678776862507522 in Catch22 so setting to pri=9
Found oid 1237678776862572922 in Catch22 so setting to pri=9
Found oid 1237678776862572936 in Catch22 so setting to pri=9
Found oid 1237679005021962709 in Catch22 so setting to pri=9
Found oid 1237678777399312955 in Catch22 so setting to pri=9
Found oid 1237678777399378047 in Catch22 so setting to pri=9
Found oid 1237679005021765924 in Catch22 so setting to pri=9
Found oid 1237679005021962980 in Catch22 so setting to pri=9
Found oid 1237678776862376599 in Catch22 so setting to pri=9
Found oid 1237679005558833475 in Catch22 so setting to pri=9
Found oid 1237678776862572822 in Catch22 so setting to pri=9
Found oid 1237678776862704012 in Catch22 so setting to pri=9
Found oid 1237679005558637016 in Catch22 so setting to pri=9
Found oid 1237679005558702452 in Catch22 so setting to pri=9
Found oid 1237679005558768408 in Catch22 so setting to pri=9
Found oid 1237679005558767959 in Catch22 so setting to pri=9
Found oid 1237679005558833574 in Catch22 so setting to pri=9

Make the master catalogs

Sky positions

For some hosts we already have sky positions from the last run, so copy those over


In [597]:
# commented because it should only be run once
!ls aat_targets_jun2015/*_sky.dat
#!cp aat_targets_jun2015/*_sky.dat aat_targets_jul2016/


aat_targets_jun2015/Aeneid_sky.dat    aat_targets_jun2015/Gilgamesh_sky.dat
aat_targets_jun2015/AnaK_sky.dat      aat_targets_jun2015/OBrother_sky.dat
aat_targets_jun2015/Dune_sky.dat      aat_targets_jun2015/Odyssey_sky.dat

For the remainder, generate and visually inspect them one at a time. Edit the file to remove any that are not good sky positions


In [599]:
#Identify sky regions for each host and write out to separate files - 
from os.path import exists

for h in hosts_to_target:
    outfn = 'aat_targets_jul2016/' + h.name.replace(' ','_') + '_sky.dat'
    if exists(outfn):
        print(outfn, 'exists, not overwriting')
    else:
        try:
            h.get_usnob_catalog()
            usnocat = None
        except IOError:
            # this is currently hanging as the usno server is down...
            #print('Downloading USNO B1 catalog for', h.name)  
            #h.usnob_environs_query(dl=True) 
            #usnocat = None
            usnocat = False
        aat.select_sky_positions(h, nsky=100, outfn=outfn, rad=1*u.deg, usnocat=usnocat)
        aat.imagelist_fld_targets(outfn, ttype='sky', n=np.inf)
        !subl $outfn
        raw_input('Wrote ' + outfn + '. Press enter to continue onto the next one once '
                  'you remove bad entries from this file.')


aat_targets_jul2016/Narnia_sky.dat exists, not overwriting
aat_targets_jul2016/Catch22_sky.dat exists, not overwriting
aat_targets_jul2016/Dune_sky.dat exists, not overwriting
aat_targets_jul2016/OBrother_sky.dat exists, not overwriting
aat_targets_jul2016/Gilgamesh_sky.dat exists, not overwriting
aat_targets_jul2016/AnaK_sky.dat exists, not overwriting
aat_targets_jul2016/Odyssey_sky.dat exists, not overwriting
Wrote aat_targets_jul2016/NSA145729_sky.dat. Press enter to continue onto the next one once you remove bad entries from this file.
Wrote aat_targets_jul2016/NSA21709_sky.dat. Press enter to continue onto the next one once you remove bad entries from this file.

Actually generate the master catalogs


In [776]:
for h in hosts_to_target:
    cat = h.get_sdss_catalog()
    pris = cat['aat_pris']
    
    guides = aat.select_guide_stars_sdss(cat)
    calibs = aat.select_flux_stars(cat, onlyoutside=300*u.kpc)
    skyradec = 'aat_targets_jul2016/{0}_sky.dat'.format(h.name)
    aat.produce_master_fld(h, datetime.date(2016, 7, 28), cat[pris>0], pris=pris[pris>0].astype(int),
                           guidestars=guides, fluxstars=calibs,skyradec=skyradec,
                           outfn='aat_targets_jul2016/{}_master.fld'.format(h.name), 
                           randomizeorder=True, inclhost=False)

Observations

We sub-sample from the master lists generated above for individual configurations.


In [12]:
def do_subsampling(h, finum, n_in_pri, **kwargs):
    assert h in hosts_to_target
    
    n_in_pri = dict(n_in_pri)  #copy just in case
    for i in range(9):
        if i+1 not in n_in_pri:
            n_in_pri[i+1] = np.inf

    fnbase = 'aat_targets_jul2016/' + h.name
    
    fnmaster = fnbase + '_master.fld'
    fnconfig = kwargs.pop('fnconfig', fnbase + '_{0}.fld'.format(finum))
    print('Writing', fnconfig, 'from master', fnmaster)
            
    kwargs.setdefault('nflux', 5)
    kwargs.setdefault('nguides', 30)
    kwargs.setdefault('fieldname', str(finum))
    
    if 'listorem' not in kwargs:
        listorem = []
        for i in range(1, finum):
            globpat = fnbase + '_' + str(i) + '*.lis'
            listorem.extend(glob(globpat))
        assertmsg = 'Only got ' + str(len(listorem)) +' .lis file(s):'+str(listorem)+', expected ' + str(finum-1)
        assert len(listorem) == (finum-1), assertmsg
        kwargs['listorem'] = listorem
    
    aat.subsample_from_master_fld(fnmaster, fnconfig, n_in_pri, **kwargs)
    
    return fnconfig

This function parses a dump of all the image headers from 'fitsheader ccd_?/.fits'


In [90]:
def make_logtab(logs, skip_res=[]):
    """
    Generates a table with the AAT observing logs.  
    
    ``logs`` can be a filename or list of lines from fitsheader
    """
    
    logtab = Table()
    logtab['num'] = [1]
    logtab['ccd'] = [2]
    logtab['UTDATE'] = ['2015:06:19']
    logtab['UTSTART'] = ['08:56:19']
    logtab['OBJECT'] = ['a'*100]
    logtab['TOTALEXP'] = ['a'*20]
    logtab['RUNCMD'] = ['a'*20]
    logtab['GRATID'] = ['a'*20]
    logtab['SOURCE'] = ['plate 0 ']
    logtab['MEANRA'] = [1.1]
    logtab['MEANDEC'] = [1.1]
    logtab['CFG_FILE'] = ['Odyssey_1p0xxxxxxxxxx.sds']
    logtab = logtab[1:]

    def add_logcol(accumulated_lines):
        l = accumulated_lines[0]
        hdunum = int(l.split()[2])
        hdupath = l.split()[4][:-1]
        if hdunum != 0:
            return
        for rex in skip_res:
            if re.match(rex, hdupath):
                print('Skipping', hdupath, 'because it has', rex)
                return 

        items = {'num': int(hdupath.split('/')[-1].split('.')[0][5:]),
                 'ccd': int(hdupath.split('/')[-2][4:])}

        for l in accumulated_lines[1:]:
            if '=' in l:
                nm, data = l.split('=')
                nm = nm.strip()
                data = data.split('/')[:2]
                if len(data)> 1:
                    comment = data[1]
                data = data[0].replace("'", '').strip()

                if nm in logtab.colnames:
                    items[nm] = data
        logtab.add_row(items)

    accumulated_lines = None
    if isinstance(logs, basestring):
        with open(logs) as f:
            loglines = list(f)
    else:
        loglines = logs

    for l in loglines:
        if l.startswith('# HDU'):
            if accumulated_lines is not None:
                add_logcol(accumulated_lines)
            accumulated_lines = [l]

        elif l.strip() == '':
            continue
        elif accumulated_lines is not None:
            accumulated_lines.append(l)
    return logtab


Out[90]:
246

In [14]:
sshtarget = 'visitor3@aatlxa'

Night 1

Generate configuration field files


In [267]:
fnconfig = do_subsampling(hsd['Dune'], 1, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Dune_1.fld from master aat_targets_jul2016/Dune_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 94 skies not included):
{1: 3812, 2: 1136, 3: 407, 4: 182, 5: 125, 6: 156, 7: 81, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
Dune_1.fld                                    100%   99KB  98.5KB/s   00:00    

In [268]:
fnconfig = do_subsampling(hsd['Odyssey'], 1, {1:200, 2:200, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Odyssey_1.fld from master aat_targets_jul2016/Odyssey_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 92 skies not included):
{1: 1847, 2: 676, 3: 550, 4: 3, 5: 1, 6: 24, 7: 14, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
Odyssey_1.fld                                 100%   73KB  72.7KB/s   00:00    

In [269]:
fnconfig = do_subsampling(hsd['OBrother'], 1, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/OBrother_1.fld from master aat_targets_jul2016/OBrother_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 95 skies not included):
{1: 2080, 2: 625, 3: 464, 4: 35, 5: 106, 6: 255, 7: 221, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
OBrother_1.fld                                100%  105KB 105.0KB/s   00:00    

In [270]:
fnconfig = do_subsampling(hsd['Catch22'], 1, {1:100, 2:50, 3:100})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Catch22_1.fld from master aat_targets_jul2016/Catch22_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2976, 2: 752, 3: 429, 4: 64, 5: 119, 6: 525, 7: 285, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
Catch22_1.fld                                 100%  116KB 115.8KB/s   00:00    

In [509]:
fnconfig = do_subsampling(hsd['AnaK'], 1, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/AnaK_1.fld from master aat_targets_jul2016/AnaK_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 96 skies not included):
{1: 2710, 2: 720, 3: 410, 4: 50, 5: 107, 6: 108, 7: 39, 8: 0, 9: 2}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: 100.0}%
AnaK_1.fld                                    100%   78KB  77.7KB/s   00:00    

Make observing log


In [547]:
# use this to get the log data from the remote machine
rem_fitsheader_loc = '/home/visitor3/miniconda2/bin/fitsheader'
datadir = '/data_lxy/aatobs/OptDet_data/160728'
fitsheader_output = !ssh $sshtarget "$rem_fitsheader_loc $datadir/ccd_?/*.fits"

In [783]:
# use this to use the local file to make the log
fitsheader_output = !fitsheader aat_data/28jul2016/ccd_?/*.fits

In [784]:
logtab = make_logtab(fitsheader_output, skip_res=['.*temp.*'])
logtab[logtab['ccd']==1].show_in_notebook(display_length=20)


Out[784]:
<Table length=53>
idxnumccdUTDATEUTSTARTOBJECTTOTALEXPRUNCMDGRATIDSOURCEMEANRAMEANDECCFG_FILE
01000112016:07:2804:24:40Bias Frame0.BIAS580Vplate 1161.315178574-31.188541979Tuc3_Field2_250716_p1.sds
11000212016:07:2804:26:47Bias Frame0.BIAS580Vplate 1161.844691627-31.1880858615Tuc3_Field2_250716_p1.sds
21000312016:07:2804:28:54Bias Frame0.BIAS580Vplate 1162.372855483-31.1877663493Tuc3_Field2_250716_p1.sds
31000412016:07:2804:31:01Bias Frame0.BIAS580Vplate 1162.905072975-31.1874874032Tuc3_Field2_250716_p1.sds
41000512016:07:2804:33:08Bias Frame0.BIAS580Vplate 1163.433348547-31.187233356Tuc3_Field2_250716_p1.sds
51000612016:07:2804:35:15Bias Frame0.BIAS580Vplate 1163.965092743-31.1869906114Tuc3_Field2_250716_p1.sds
61000712016:07:2804:37:22Bias Frame0.BIAS580Vplate 1164.495413023-31.186757729Tuc3_Field2_250716_p1.sds
71000812016:07:2804:39:29Bias Frame0.BIAS580Vplate 1165.024224867-31.1865336466Tuc3_Field2_250716_p1.sds
81000912016:07:2804:41:36Bias Frame0.BIAS580Vplate 1165.553667785-31.186318408Tuc3_Field2_250716_p1.sds
91001012016:07:2804:43:43Bias Frame0.BIAS580Vplate 1166.084767639-31.1861112497Tuc3_Field2_250716_p1.sds
101001112016:07:2806:53:41Dome Flat200.SKY580Vplate 0198.629293892-31.1891470177Dune_1_p0.sds
111001212016:07:2807:03:39Dome Flat40.SKY580Vplate 0201.128039399-31.1904086269Dune_1_p0.sds
121001312016:07:2808:16:49Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0221.546584806-0.225285497888Dune_1_p0.sds
131001412016:07:2808:19:20Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0221.546577361-0.225258731989Dune_1_p0.sds
141001512016:07:2808:22:10ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 0221.546585334-0.225279952029Dune_1_p0.sds
151001612016:07:2808:35:23Dune 11920.RUN580Vplate 0221.546967468-0.224803834175Dune_1_p0.sds
161001712016:07:2809:09:29Dune 11920.RUN580Vplate 0221.547061727-0.22473431261Dune_1_p0.sds
171001812016:07:2809:43:36Dune 11920.RUN580Vplate 0221.547286663-0.224662429939Dune_1_p0.sds
181001912016:07:2810:17:42Dune 11920.RUN580Vplate 0221.547402929-0.224821801039Dune_1_p0.sds
191002012016:07:2810:51:48Dune 11920.RUN580Vplate 0221.547189013-0.224377422186Dune_1_p0.sds
201002112016:07:2811:27:27Odyssey 11200.RUN580Vplate 1248.08871283419.8263534352Odyssey_1_p1.sds
211002212016:07:2811:49:34Odyssey 11200.RUN580Vplate 1248.0888570719.826127344Odyssey_1_p1.sds
221002312016:07:2812:11:40Odyssey 11200.RUN580Vplate 1248.08919170919.826023821Odyssey_1_p1.sds
231002412016:07:2812:33:46Odyssey 11200.RUN580Vplate 1248.08837471919.8263966741Odyssey_1_p1.sds
241002512016:07:2812:56:21Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1248.08857422419.8263688217Odyssey_1_p1.sds
251002612016:07:2812:58:45Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1248.08857301319.8263640276Odyssey_1_p1.sds
261002712016:07:2813:01:31ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 1248.08854220719.8263591926Odyssey_1_p1.sds
271002812016:07:2813:07:26Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0335.912779267-3.43312646888OBrother_1_p0.sds
281002912016:07:2813:09:47Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0335.912756284-3.43314999649OBrother_1_p0.sds
291003012016:07:2813:12:29ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 0335.912783743-3.43313708535OBrother_1_p0.sds
301003112016:07:2813:16:17OBrother 11950.RUN580Vplate 0335.912776903-3.43298517483OBrother_1_p0.sds
311003212016:07:2813:51:02OBrother 11950.RUN580Vplate 0335.912888327-3.43326163603OBrother_1_p0.sds
321003312016:07:2814:25:38OBrother 11950.RUN580Vplate 0335.91349634-3.43334896213OBrother_1_p0.sds
331003412016:07:2815:00:14OBrother 11950.RUN580Vplate 0335.913464151-3.43340742605OBrother_1_p0.sds
341003512016:07:2815:34:56OBrother 11950.RUN580Vplate 0335.913355755-3.433695392OBrother_1_p0.sds
351003612016:07:2816:11:59Catch22 11800.RUN580Vplate 1348.6837443854.53400159438Catch22_1_p1.sds
361003712016:07:2816:44:12Catch22 11800.RUN580Vplate 1348.6843511044.53395262442Catch22_1_p1.sds
371003812016:07:2817:16:18Catch22 11800.RUN580Vplate 1348.6846399024.53400871049Catch22_1_p1.sds
381003912016:07:2817:48:24Catch22 11800.RUN580Vplate 1348.6848371434.53405837773Catch22_1_p1.sds
391004012016:07:2818:20:31Catch22 11800.RUN580Vplate 1348.6847736494.53408317222Catch22_1_p1.sds
401004112016:07:2818:53:03Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1348.6848183524.53409986369Catch22_1_p1.sds
411004212016:07:2818:55:22Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1348.6848225574.53409757865Catch22_1_p1.sds
421004312016:07:2818:58:06ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1348.684838814.53409485667Catch22_1_p1.sds
431004412016:07:2819:02:31AnaK 11200.RUN580Vplate 0354.1312071490.295832286362AnaK_1_p0.sds
441004512016:07:2819:24:38AnaK 11200.RUN580Vplate 0354.1316088850.295798803758AnaK_1_p0.sds
451004612016:07:2819:47:18Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0354.1316809510.295909530757AnaK_1_p0.sds
461004712016:07:2819:49:40Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0354.1317088390.295929731474AnaK_1_p0.sds
471004812016:07:2819:52:25ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 0354.1316931320.295961048871AnaK_1_p0.sds
481004912016:07:2819:58:15Dark Frame0.DARK580Vplate 011.0305379368-18.0415742377AnaK_1_p0.sds
491005012016:07:2820:30:21Dark Frame0.DARK580Vplate 043.4135358227-31.3454989091AnaK_1_p0.sds
501005112016:07:2821:02:27Dark Frame0.DARK580Vplate 051.4668394867-31.3355563821AnaK_1_p0.sds
511005212016:07:2821:34:33Dark Frame0.DARK580Vplate 059.5195771237-31.3245619395AnaK_1_p0.sds
521005312016:07:2822:06:39Dark Frame0.DARK580Vplate 067.5718793838-31.3126540109AnaK_1_p0.sds

In [785]:
comments_jul28 = """
* At start of night weather clear, but high humidity and possible fog
* The Dune_1 observations have the blue side centered 20 angstroms further to the red than the remaining 
  observations.  The initial setup provides a bit more overlap but after inspecting a bit we concluded that it 
  would be better to tryto make sure 3727 falls into the image at the blue side
* start of Dune_1 : seeing ~1.5-2"
* start of Odyssey_1 : seeing ~2-3"
* start of OBrother_1: seeing ~4-5"
* near end of OBrother_1: seeing ~2.5". Sudden improvement in weather, humidity fell/fog disappeared, 
* start of Catch22_1: seeing ~3"
* start of AnaK_1: seeing ~1.9"
"""[1:-1]
display.Markdown(comments_jul28)


Out[785]:
  • At start of night weather clear, but high humidity and possible fog
  • The Dune_1 observations have the blue side centered 20 angstroms further to the red than the remaining observations. The initial setup provides a bit more overlap but after inspecting a bit we concluded that it would be better to try to make sure 3727 falls into the image at the blue side
  • start of Dune_1 : seeing ~1.5-2"
  • start of Odyssey_1 : seeing ~2-3"
  • start of OBrother_1: seeing ~4-5"
  • near end of OBrother_1: seeing ~2.5". Sudden improvement in weather, humidity fell/fog disappeared,
  • start of Catch22_1: seeing ~3"
  • start of AnaK_1: seeing ~1.9"

In [787]:
logfn = 'aat_data/28jul2016/log_jul28'

logtab.write(logfn,format='ascii')
with open(logfn, 'a') as f:
    f.write('\nComments:\n')
    f.write(comments_jul28)

Night 2

Note: master catalogs changed due to Risa's custom targets, so some added pri=9 objects appear even in repeats


In [587]:
fnconfig = do_subsampling(hsd['Dune'], 2, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Dune_2.fld from master aat_targets_jul2016/Dune_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Dune_1_p0.lis
Total remaining in each priority (5 fluxes, 30 guides, and 94 skies not included):
{1: 3812, 2: 1136, 3: 407, 4: 155, 5: 17, 6: 11, 7: 8, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 85.16483516483517, 5: 13.6, 6: 7.051282051282051, 7: 9.876543209876543, 8: None, 9: None}%
Dune_2.fld                                    100%   67KB  67.5KB/s   00:00    

In [588]:
fnconfig = do_subsampling(hsd['Gilgamesh'], 1, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Gilgamesh_1.fld from master aat_targets_jul2016/Gilgamesh_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3785, 2: 941, 3: 444, 4: 44, 5: 68, 6: 53, 7: 31, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
Gilgamesh_1.fld                               100%   69KB  68.9KB/s   00:00    

In [770]:
fnconfig = do_subsampling(hsd['OBrother'], 2, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/OBrother_2.fld from master aat_targets_jul2016/OBrother_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/OBrother_1_p0.lis
Total remaining in each priority (5 fluxes, 30 guides, and 95 skies not included):
{1: 2080, 2: 625, 3: 463, 4: 35, 5: 95, 6: 109, 7: 24, 8: 0, 9: 2}
{1: 100.0, 2: 100.0, 3: 99.78448275862068, 4: 100.0, 5: 89.62264150943396, 6: 44.48979591836735, 7: 11.059907834101383, 8: None, 9: 14.285714285714286}%
OBrother_2.fld                                100%   74KB  74.0KB/s   00:00    

In [778]:
fnconfig = do_subsampling(hsd['Catch22'], 2, {1:50, 2:50, 3:200})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Catch22_2.fld from master aat_targets_jul2016/Catch22_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 351 objects to remove in aat_targets_jul2016/Catch22_1_p1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2976, 2: 752, 3: 429, 4: 64, 5: 119, 6: 413, 7: 39, 8: 0, 9: 7}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 79.88394584139265, 7: 14.444444444444445, 8: None, 9: 30.434782608695652}%
Catch22_2.fld                                 100%   89KB  89.3KB/s   00:00    

In [24]:
fnconfig = do_subsampling(hsd['Narnia'], 1, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Narnia_1.fld from master aat_targets_jul2016/Narnia_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 2728, 2: 655, 3: 405, 4: 97, 5: 145, 6: 313, 7: 191, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
Narnia_1.fld                                  100%  115KB 115.1KB/s   00:00    

Make observing log


In [145]:
# use this to use the local file to make the log
fitsheader_output = !fitsheader aat_data/29jul2016/ccd_?/*.fits

In [146]:
logtab = make_logtab(fitsheader_output, skip_res=['.*temp.*'])
logtab[logtab['ccd']==1].show_in_notebook(display_length=20)


Out[146]:
<Table length=59>
idxnumccdUTDATEUTSTARTOBJECTTOTALEXPRUNCMDGRATIDSOURCEMEANRAMEANDECCFG_FILE
01000112016:07:2902:23:29Bias Frame0.BIAS580Vplate 0131.945030492-31.2139446262AnaK_1_p0.sds
11000212016:07:2902:25:36Bias Frame0.BIAS580Vplate 0132.475100885-31.2133058505AnaK_1_p0.sds
21000312016:07:2902:27:42Bias Frame0.BIAS580Vplate 0133.002201067-31.2126755312AnaK_1_p0.sds
31000412016:07:2902:29:49Bias Frame0.BIAS580Vplate 0133.529731937-31.2120510106AnaK_1_p0.sds
41000512016:07:2902:31:56Bias Frame0.BIAS580Vplate 0134.0616817-31.211426516AnaK_1_p0.sds
51000612016:07:2902:34:02Bias Frame0.BIAS580Vplate 0134.588797018-31.2108140715AnaK_1_p0.sds
61000712016:07:2902:36:09Bias Frame0.BIAS580Vplate 0135.116918414-31.2102051034AnaK_1_p0.sds
71000812016:07:2902:38:16Bias Frame0.BIAS580Vplate 0135.648107877-31.2095992104AnaK_1_p0.sds
81000912016:07:2902:40:22Bias Frame0.BIAS580Vplate 0136.175504116-31.209002682AnaK_1_p0.sds
91001012016:07:2902:42:29Bias Frame0.BIAS580Vplate 0136.703470933-31.2084119317AnaK_1_p0.sds
101001112016:07:2906:33:01Dome Flat40.SKY580Vplate 1194.440692084-31.1871479295Catch22_1_p1.sds
111001212016:07:2906:37:19Dome Flat200.SKY580Vplate 1195.517413485-31.1876247207Catch22_1_p1.sds
121001312016:07:2907:06:19Dome Flat40.SKY580Vplate 0202.776608026-31.1913882339Dune_2_p0.sds
131001412016:07:2907:09:21Dome Flat200.SKY580Vplate 0203.538003652-31.1918935998Dune_2_p0.sds
141001512016:07:2908:16:56Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0221.547171386-0.224908487053Dune_2_p0.sds
151001612016:07:2908:19:17Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0221.547187521-0.224904074056Dune_2_p0.sds
161001712016:07:2908:24:40ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0221.54720736-0.224951441465Dune_2_p0.sds
171001812016:07:2908:28:03ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 0221.547172713-0.224938701303Dune_2_p0.sds
181001912016:07:2908:33:25Dune 21200.RUN580Vplate 0221.547129051-0.224496696506Dune_2_p0.sds
191002012016:07:2908:55:31Dune 21200.RUN580Vplate 0221.546740606-0.224482810842Dune_2_p0.sds
201002112016:07:2909:17:37Dune 21200.RUN580Vplate 0221.547298589-0.224387652715Dune_2_p0.sds
211002212016:07:2909:41:20Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1234.13287567116.6074982559Gilgamesh_1_p1.sds
221002312016:07:2909:43:49Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1234.13284387916.6074893188Gilgamesh_1_p1.sds
231002412016:07:2909:46:31ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 1234.13285965816.6075068471Gilgamesh_1_p1.sds
241002512016:07:2909:49:46Gilgamesh 12000.RUN580Vplate 1234.13358886316.607549852Gilgamesh_1_p1.sds
251002612016:07:2910:25:12Gilgamesh 12000.RUN580Vplate 1234.1335112416.6076238627Gilgamesh_1_p1.sds
261002712016:07:2911:00:38Gilgamesh 12000.RUN580Vplate 1234.13326930216.6074253061Gilgamesh_1_p1.sds
271002812016:07:2911:38:21Odyssey 11000.RUN580Vplate 0248.08737861919.8243999402Odyssey_1a_p0.sds
281002912016:07:2911:57:07Odyssey 11000.RUN580Vplate 0248.0868347819.8243717274Odyssey_1a_p0.sds
291003012016:07:2912:15:54Odyssey 11000.RUN580Vplate 0248.08723335919.8243908934Odyssey_1a_p0.sds
301003112016:07:2912:35:06Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0248.08673030719.8244385278Odyssey_1a_p0.sds
311003212016:07:2912:37:27Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0248.08677555819.8244498192Odyssey_1a_p0.sds
321003312016:07:2912:40:13ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 0248.08676268119.8244680662Odyssey_1a_p0.sds
331003412016:07:2912:45:20Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1335.913602943-3.43183615705OBrother_2_p1.sds
341003512016:07:2912:47:47Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1335.913653874-3.43182095885OBrother_2_p1.sds
351003612016:07:2912:50:39ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 1335.913637628-3.43182797677OBrother_2_p1.sds
361003712016:07:2912:54:00OBrother 21800.RUN580Vplate 1335.913515729-3.43202213952OBrother_2_p1.sds
371003812016:07:2913:26:06OBrother 21800.RUN580Vplate 1335.913867495-3.43209526663OBrother_2_p1.sds
381003912016:07:2913:58:12OBrother 21800.RUN580Vplate 1335.914195491-3.43235721019OBrother_2_p1.sds
391004012016:07:2914:30:19OBrother 21800.RUN580Vplate 1335.914612027-3.43233436174OBrother_2_p1.sds
401004112016:07:2915:05:06Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0348.6823285914.53164267586Catch22_2_p0.sds
411004212016:07:2915:07:36Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0348.682345614.53164967187Catch22_2_p0.sds
421004312016:07:2915:10:24ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 0348.6823471724.53165496527Catch22_2_p0.sds
431004412016:07:2915:13:47Catch22 21800.RUN580Vplate 0348.6828218384.53197001444Catch22_2_p0.sds
441004512016:07:2915:45:53Catch22 21800.RUN580Vplate 0348.682716314.53215342121Catch22_2_p0.sds
451004612016:07:2916:17:59Catch22 21800.RUN580Vplate 0348.6829299544.53202934718Catch22_2_p0.sds
461004712016:07:2916:50:06Catch22 21800.RUN580Vplate 0348.6829281474.53206005382Catch22_2_p0.sds
471004812016:07:2917:24:58Narnia 12000.RUN580Vplate 139.5487663796-1.31931907377Narnia_1_p1.sds
481004912016:07:2918:00:24Narnia 12000.RUN580Vplate 139.5486900985-1.31950294595Narnia_1_p1.sds
491005012016:07:2918:35:51Narnia 12000.RUN580Vplate 139.5492458339-1.31945240221Narnia_1_p1.sds
501005112016:07:2919:11:17Narnia 12000.RUN580Vplate 139.5492316793-1.31959493805Narnia_1_p1.sds
511005212016:07:2919:47:06Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 139.5494080458-1.31969537826Narnia_1_p1.sds
521005312016:07:2919:49:25Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 139.5494556215-1.31969299082Narnia_1_p1.sds
531005412016:07:2919:52:07ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_160.ARC580Vplate 139.549395829-1.31970034028Narnia_1_p1.sds
541005512016:07:2919:56:53Dark Frame0.DARK580Vplate 136.0048491226-31.3529533674Narnia_1_p1.sds
551005612016:07:2920:28:59Dark Frame0.DARK580Vplate 144.0595557188-31.3442192381Narnia_1_p1.sds
561005712016:07:2921:01:06Dark Frame0.DARK580Vplate 152.1142616474-31.3341647874Narnia_1_p1.sds
571005812016:07:2921:33:12Dark Frame0.DARK580Vplate 160.1668328875-31.3230972007Narnia_1_p1.sds
581005912016:07:2922:05:18Dark Frame0.DARK580Vplate 168.2186992838-31.3111148406Narnia_1_p1.sds

In [147]:
comments_jul29 = """
* start of Dune_2 : seeing ~1.3"
* start of Gilgamesh_1 : seeing ~1.6"
* start of Odyssey_1a : seeing ~1.4"
* start of OBrother_2 : seeing ~1.7"
* temperature rose dramatically near end of OBrother_2 - might lead to variable seeing
* start of Catch22_2: seeing ~2.3"
* start of Narnia_1: seeing ~1.5"
"""[1:-1]
display.Markdown(comments_jul29)


Out[147]:
  • start of Dune_2 : seeing ~1.3"
  • start of Gilgamesh_1 : seeing ~1.6"
  • start of Odyssey_1a : seeing ~1.4"
  • start of OBrother_2 : seeing ~1.7"
  • temperature rose dramatically near end of OBrother_2 - might lead to variable seeing
  • start of Catch22_2: seeing ~2.3"
  • start of Narnia_1: seeing ~1.5"

In [148]:
logfn = 'aat_data/29jul2016/log_jul29'

logtab.write(logfn,format='ascii')
with open(logfn, 'a') as f:
    f.write('\nComments:\n')
    f.write(comments_jul29)

Nights 3+

These nights are by the team that's doing the time-trade. They will be primarily second-half, but with a little time in the first half


In [56]:
hs = [h for h in hosts_to_target if h.nsaid==145729]
assert len(hs) == 1
fnconfig = do_subsampling(hs[0], 1, {1:25, 2:25, 3:50, 4:100})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/NSA145729_1.fld from master aat_targets_jul2016/NSA145729_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3470, 2: 988, 3: 649, 4: 618, 5: 251, 6: 220, 7: 269, 8: 0, 9: 55}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: 100.0}%
NSA145729_1.fld                               100%   94KB  94.4KB/s   00:00    

NSA 145729 is being treated a bit oddly because there might be two back-to-back-ish observations. So we're making one config in advance for both the p0 and p1 configurations, and making fld's for config 2 assuming either of those.


In [130]:
hs = [h for h in hosts_to_target if h.nsaid==145729]
assert len(hs) == 1
fnconfig = do_subsampling(hs[0], 2, {1:25, 2:25, 3:50, 4:100}, 
                          listorem=['aat_targets_jul2016/NSA145729_1_p0.lis'], 
                          fnconfig='aat_targets_jul2016/NSA145729_2_after1p0.fld')
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/NSA145729_2_after1p0.fld from master aat_targets_jul2016/NSA145729_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/NSA145729_1_p0.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3470, 2: 988, 3: 649, 4: 618, 5: 251, 6: 164, 7: 23, 8: 0, 9: 4}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 74.54545454545455, 7: 8.550185873605948, 8: None, 9: 7.2727272727272725}%
NSA145729_2_after1p0.fld                      100%   63KB  63.4KB/s   00:00    

In [134]:
hs = [h for h in hosts_to_target if h.nsaid==145729]
assert len(hs) == 1
fnconfig = do_subsampling(hs[0], 2, {1:25, 2:25, 3:50, 4:100}, 
                          listorem=['aat_targets_jul2016/NSA145729_1_p1.lis'], 
                          fnconfig='aat_targets_jul2016/NSA145729_2_after1p1.fld')
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/NSA145729_2_after1p1.fld from master aat_targets_jul2016/NSA145729_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 351 objects to remove in aat_targets_jul2016/NSA145729_1_p1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3470, 2: 988, 3: 649, 4: 618, 5: 251, 6: 165, 7: 25, 8: 0, 9: 3}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 75.0, 7: 9.293680297397769, 8: None, 9: 5.454545454545454}%
NSA145729_2_after1p1.fld                      100%   64KB  63.5KB/s   00:00    

In [57]:
fnconfig = do_subsampling(hsd['Catch22'], 3, {1:100, 2:100, 3:300)
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Catch22_3.fld from master aat_targets_jul2016/Catch22_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 351 objects to remove in aat_targets_jul2016/Catch22_1_p1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Catch22_2_p0.lis
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2976, 2: 752, 3: 428, 4: 64, 5: 105, 6: 119, 7: 2, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 99.76689976689977, 4: 100.0, 5: 88.23529411764706, 6: 23.017408123791103, 7: 0.7407407407407407, 8: None, 9: 0.0}%
Catch22_3.fld                                 100%   76KB  76.0KB/s   00:00    

In [58]:
fnconfig = do_subsampling(hsd['Narnia'], 2, {1:100, 2:100, 3:300})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/Narnia_2.fld from master aat_targets_jul2016/Narnia_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 351 objects to remove in aat_targets_jul2016/Narnia_1_p1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 2728, 2: 655, 3: 405, 4: 97, 5: 144, 6: 136, 7: 18, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 99.3103448275862, 6: 43.45047923322684, 7: 9.424083769633508, 8: None, 9: None}%
Narnia_2.fld                                  100%   85KB  84.6KB/s   00:00    

In [55]:
hs = [h for h in hosts_to_target if h.nsaid==21709]
assert len(hs) == 1
fnconfig = do_subsampling(hs[0], 1, {1:25, 2:25, 3:50, 4:100})
!scp $fnconfig "$sshtarget:configure/"


Writing aat_targets_jul2016/NSA21709_1.fld from master aat_targets_jul2016/NSA21709_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 90 skies not included):
{1: 4513, 2: 1170, 3: 808, 4: 114, 5: 242, 6: 853, 7: 512, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%
NSA21709_1.fld                                100%  165KB 165.4KB/s   00:00    

Logs for observations


In [155]:
# fitsheader run on the output downloaded to another computer
with open('/Users/erik/tmp/fitsheader_jul30') as f:
    fitsheader_output = list(f)

In [158]:
logtab = make_logtab(fitsheader_output, skip_res=['.*temp.*'])
logtab[logtab['ccd']==1].show_in_notebook(display_length=20)

logfn = 'aat_data/30jul2016/log_jul30'
logtab.write(logfn,format='ascii')

Utilities for during the night

Pull in as-generated files from remote

Note that this assumes the .lis files were generated after the configuration was made. If need be these can be re-created from the .sds files by starting up configure and exporting the allocated fibers list.


In [132]:
!scp "$sshtarget:configure/*.sds" aat_targets_jul2016/


AnaK_1_p0.sds                                 100%  220KB 220.4KB/s   00:00    
Catch22_1_p1.sds                              100%  312KB 311.7KB/s   00:00    
Catch22_2_p0.sds                              100%  248KB 247.8KB/s   00:00    
Dune_1_p0.sds                                 100%  270KB 270.1KB/s   00:00    
Dune_2_p0.sds                                 100%  196KB 195.7KB/s   00:00    
Gilgamesh_1_p1.sds                            100%  198KB 197.8KB/s   00:00    
Narnia_1_p1.sds                               100%  314KB 313.8KB/s   00:00    
NSA145729_1_p0.sds                            100%  261KB 260.7KB/s   00:00    
NSA145729_1_p1.sds                            100%  261KB 260.8KB/s   00:00    
OBrother_1_p0.sds                             100%  286KB 286.2KB/s   00:00    
OBrother_2_p1.sds                             100%  212KB 211.7KB/s   00:00    
Odyssey_1a_p0.sds                             100%  206KB 206.3KB/s   00:00    
Odyssey_1_p1.sds                              100%  206KB 206.5KB/s   00:00    

In [133]:
# *_* because otherwise the collision matrix list comes through too
!scp "$sshtarget:configure/*_*.lis" aat_targets_jul2016/


AnaK_1_p0.lis                                 100%   45KB  44.8KB/s   00:00    
Catch22_1_p1.lis                              100%   45KB  44.7KB/s   00:00    
Catch22_2_p0.lis                              100%   45KB  44.8KB/s   00:00    
Dune_1_p0.lis                                 100%   45KB  44.8KB/s   00:00    
Dune_2_p0.lis                                 100%   45KB  44.8KB/s   00:00    
Gilgamesh_1_p1.lis                            100%   45KB  44.8KB/s   00:00    
Narnia_1_p1.lis                               100%   45KB  44.8KB/s   00:00    
NSA145729_1_p0.lis                            100%   45KB  44.8KB/s   00:00    
NSA145729_1_p1.lis                            100%   45KB  44.8KB/s   00:00    
OBrother_1_p0.lis                             100%   45KB  44.8KB/s   00:00    
OBrother_2_p1.lis                             100%   45KB  44.8KB/s   00:00    
Odyssey_1a_p0.lis                             100%   45KB  44.8KB/s   00:00    
Odyssey_1_p1.lis                              100%   45KB  44.7KB/s   00:00    

Inspect guider fields as needed


In [54]:
listab, lisscs, lisheader = aat.load_lis_file('aat_targets_jul2016/Narnia_1_p1.lis')
guidemsk = listab['codes']=='F'
names = ['{0[ids]}_f#={0[fibnums]}'.format(row) for row in listab[guidemsk]]
print(targeting.sampled_imagelist(lisscs[guidemsk], None, names=names))


name ra dec
Guide25_f#=50 39.8618333333 -1.74961111111
Guide1_f#=100 39.6368333333 -1.98125555556
Guide8_f#=150 39.1610833333 -1.84921388889
Guide12_f#=200 38.6333333333 -1.28503888889
Guide9_f#=250 39.41225 -1.34490833333
Guide6_f#=300 39.4490416667 -0.646416666667
Guide17_f#=350 39.9677083333 -0.844094444444
Guide19_f#=400 40.2536666667 -1.26711388889

Planning


In [61]:
import astroplan

Find possible targets


In [8]:
#if online
ufo = urllib2.urlopen('https://docs.google.com/spreadsheet/ccc?key=1b3k2eyFjHFDtmHce1xi6JKuj3ATOWYduTBFftx5oPp8&output=csv')
hosttab = QTable.read(ufo.read(), format='csv')
ufo.close()

In [9]:
#if offline
#hosttab = Table.read('SAGADropbox/hosts/host_catalog_flag0.csv')

In [10]:
hostscs = SkyCoord(u.Quantity(hosttab['RA'], u.deg), 
                   u.Quantity(hosttab['Dec'], u.deg), 
                   distance=u.Quantity(hosttab['distance'], u.Mpc))

In [11]:
allspec = Table.read('/Users/erik/Dropbox/SAGA/data/allspectaken_v5.fits.gz')

In [12]:
sagaobsed = allspec[~((allspec['TELNAME']=='NSA')|
                      (allspec['TELNAME']=='SDSS')|
                      (allspec['TELNAME']=='GAMA'))]
sagaobsed_nsaids = np.unique(sagaobsed['HOST_NSAID'])

In [13]:
#UTC time from 8:35-19:35 is AAT 18 deg window
nighttimes = Time('2016-7-28 8:45:00') + np.arange(12)*u.hour
aao = EarthLocation(lon='149:3:57.9', lat='-31:16:37.3')
aao_frame = AltAz(obstime=nighttimes, location=aao)

In [14]:
sunaao = get_sun(nighttimes).transform_to(aao_frame)
np.max(sunaao.alt.value)


Out[14]:
-14.806986509372573

In [15]:
seczs = []
for sc in hostscs:
    az = sc.transform_to(aao_frame)
    seczs.append(az.secz)
seczs = np.array(seczs)

hrsvis = np.sum((1<=seczs)&(seczs<1.75),axis=1)
visenough = hrsvis>2

In [16]:
aaoobs = astroplan.Observer(aao, 'Australia/NSW')
midnight = aaoobs.midnight(Time('2016-7-28'))

Airmass chart


In [121]:
up_times = {}

hoststoshow = hosttab[visenough]

hosts_to_target_nsaids = []
for h in hosts_to_target:
    hosts_to_target_nsaids.append(h.nsaid)
    if h.nsaid not in hoststoshow['NSAID']:
        print('adding', h)
        hoststoshow.add_row(None)
        hoststoshow['NSAID'][-1] = h.nsaid
        hoststoshow['RA'][-1] = h.ra
        hoststoshow['Dec'][-1] = h.dec
        

with open('aat_targets_jul2016/aattargs_iobserve.dat', 'w') as f:
    for host in hoststoshow:
        already_obs = host['NSAID'] in sagaobsed_nsaids
        
        name = 'NSA'+str(host['NSAID'])
        for nm, val in hsd.items():
            if val.nsaid == host['NSAID']:
                name = nm
                if nm.startswith('NSA'):
                    name = name+'_obsed'
                break
        
        f.write(name.replace(' ','_'))
        if already_obs:
            f.write('-observed')
        f.write(' ')
        f.write(str(host['RA']) + ' ')
        f.write(str(host['Dec']) + '\n')
        
        targ = astroplan.FixedTarget(SkyCoord(host['RA'], host['Dec'], unit=u.deg), name)
        
        tpl = (name, host['NSAID'], host['RA'], host['Dec'])
        transit = aaoobs.target_meridian_transit_time(midnight, targ)
        up_times[transit.jd] = tpl
        
        
        timestoplot = transit + np.linspace(-6, 6, 100)*u.hour
        taa = aaoobs.altaz(timestoplot, targ)
        msk = taa.secz >=1
        
        color = 'g' if already_obs else 'k'
        color = 'r' if host['NSAID'] in hosts_to_target_nsaids else color
        
        plt.plot(timestoplot.plot_date[msk], taa.secz[msk], c=color)
        plt.text(transit.plot_date, aaoobs.altaz(transit, targ).secz, name, ha='center', color=color)

t0 = aaoobs.sun_rise_time(midnight, 'previous')
t1 = aaoobs.sun_set_time(midnight, 'previous')
t2 = aaoobs.twilight_evening_civil(midnight, 'previous')
t3 = aaoobs.twilight_evening_nautical(midnight, 'previous')
t4 = aaoobs.twilight_evening_astronomical(midnight, 'previous')
t5 = aaoobs.twilight_morning_astronomical(midnight, 'next')
t6 = aaoobs.twilight_morning_nautical(midnight, 'next')
t7 = aaoobs.twilight_morning_civil(midnight, 'next')
t8 = aaoobs.sun_rise_time(midnight, 'next')
t9 = aaoobs.sun_set_time(midnight, 'next')

plt.fill_between([t0.plot_date,t1.plot_date],1,3, lw=0, facecolor='y', alpha=.9)
plt.fill_between([t1.plot_date,t2.plot_date],1,3, lw=0, facecolor='y', alpha=.75)
plt.fill_between([t2.plot_date,t3.plot_date],1,3, lw=0, facecolor='y', alpha=.5)
plt.fill_between([t3.plot_date,t4.plot_date],1,3, lw=0, facecolor='y', alpha=.25)
plt.fill_between([t5.plot_date,t6.plot_date],1,3, lw=0, facecolor='y', alpha=.25)
plt.fill_between([t6.plot_date,t7.plot_date],1,3, lw=0, facecolor='y', alpha=.5)
plt.fill_between([t7.plot_date,t8.plot_date],1,3, lw=0, facecolor='y', alpha=.75)
plt.fill_between([t8.plot_date,t9.plot_date],1,3, lw=0, facecolor='y', alpha=.9)

plt.axvline(midnight.plot_date, ls=':', c='k')

plt.gca().xaxis_date(aaoobs.timezone)
plt.xlim(t1.plot_date-.05, t8.plot_date+.05)
plt.axhline(1/np.cos(65*u.deg), c='k', ls='--')  #~AAT limit
plt.ylim(2.5,1)
plt.tight_layout()


adding <hosts.NSAHost object w/ name 'NSA21709'>

In [18]:
#NSA urls
for jd in sorted(up_times):
    name, nsaid, ra, dec = up_times[jd]
    print(name, 'http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID={}&submit_form=Submit'.format(nsaid))


NSA165082 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=165082&submit_form=Submit
NSA145398 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=145398&submit_form=Submit
Dune http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=165536&submit_form=Submit
NSA145729 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=145729&submit_form=Submit
NSA145879 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=145879&submit_form=Submit
NSA166141 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=166141&submit_form=Submit
Gilgamesh http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=166313&submit_form=Submit
Odyssey http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=147100&submit_form=Submit
OBrother http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=149781&submit_form=Submit
NSA149977 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=149977&submit_form=Submit
NSA150307 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=150307&submit_form=Submit
NSA150578 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=150578&submit_form=Submit
Catch22 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=150887&submit_form=Submit
AnaK http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=61945&submit_form=Submit
NSA153017 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=153017&submit_form=Submit
Bandamanna http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=126115&submit_form=Submit
NSA127226 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=127226&submit_form=Submit
NSA129237 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=129237&submit_form=Submit
NSA129387 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=129387&submit_form=Submit
NSA130133 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=130133&submit_form=Submit
NSA130625 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=130625&submit_form=Submit
NSA131531 http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=131531&submit_form=Submit
Narnia http://www.nsatlas.org/getAtlas.html?search=nsaid&nsaID=132339&submit_form=Submit

In [19]:
# DECALS URLs
for jd in sorted(up_times):
    name, nsaid, ra, dec = up_times[jd]
    print(name, 'http://legacysurvey.org/viewer?ra={}&dec={}&zoom=8'.format(ra, dec))


NSA165082 http://legacysurvey.org/viewer?ra=217.418&dec=3.23331&zoom=8
NSA145398 http://legacysurvey.org/viewer?ra=219.796&dec=5.36347&zoom=8
Dune http://legacysurvey.org/viewer?ra=221.546&dec=-0.222942&zoom=8
NSA145729 http://legacysurvey.org/viewer?ra=224.594&dec=-1.09102&zoom=8
NSA145879 http://legacysurvey.org/viewer?ra=227.456&dec=0.470085&zoom=8
NSA166141 http://legacysurvey.org/viewer?ra=230.485&dec=5.07063&zoom=8
Gilgamesh http://legacysurvey.org/viewer?ra=234.132&dec=16.6078&zoom=8
Odyssey http://legacysurvey.org/viewer?ra=248.087&dec=19.8264&zoom=8
OBrother http://legacysurvey.org/viewer?ra=335.913&dec=-3.43167&zoom=8
NSA149977 http://legacysurvey.org/viewer?ra=339.372&dec=10.5315&zoom=8
NSA150307 http://legacysurvey.org/viewer?ra=343.924&dec=-5.49535&zoom=8
NSA150578 http://legacysurvey.org/viewer?ra=346.236&dec=12.3229&zoom=8
Catch22 http://legacysurvey.org/viewer?ra=348.683&dec=4.53406&zoom=8
AnaK http://legacysurvey.org/viewer?ra=354.131&dec=0.297265&zoom=8
NSA153017 http://legacysurvey.org/viewer?ra=359.856&dec=20.7498&zoom=8
Bandamanna http://legacysurvey.org/viewer?ra=0.995575&dec=20.7524&zoom=8
NSA127226 http://legacysurvey.org/viewer?ra=8.69484&dec=-8.39644&zoom=8
NSA129237 http://legacysurvey.org/viewer?ra=20.449&dec=17.5922&zoom=8
NSA129387 http://legacysurvey.org/viewer?ra=21.0163&dec=12.9175&zoom=8
NSA130133 http://legacysurvey.org/viewer?ra=24.7772&dec=-7.51266&zoom=8
NSA130625 http://legacysurvey.org/viewer?ra=28.3054&dec=4.19576&zoom=8
NSA131531 http://legacysurvey.org/viewer?ra=33.8651&dec=6.00248&zoom=8
Narnia http://legacysurvey.org/viewer?ra=39.5482&dec=-1.31876&zoom=8

Notes:

  • NSA165082: in DECALS DR2, only z-band, looks like a group, elliptical
  • NSA145398: in DECALS DR2, z-band and a bit of g and r, elliptical, otherwise good
  • NSA145729: in DECALS DR2, z-band and some r, OK but somewhat near SDSS edge?
  • NSA145879: in DECALS DR2, z-band and some g and r, elliptical, otherwise good
  • NSA166141: in DECALS DR2, z-band and some g and r, otherwise good
  • NSA149977: in DECALS DR2, z-band and some g and r, otherwise good
  • NSA150578: in DECALS DR2, only z-band, otherwise good
  • NSA153017: in DECALS DR2, only z-band, otherwise good
  • Bandamanna: in DECALS DR2, only z-band, otherwise good
  • NSA127226: otherwise good
  • NSA129237: in DECALS DR2, only z-band, otherwise good
  • NSA129387: otherwise good
  • NSA130133: elliptical? otherwise good
  • NSA130625: S0? otherwise good
  • NSA131531: near SDSS edge, otherwise good

In [440]:
sagaobsed[sagaobsed['HOST_NSAID']==150307].show_in_notebook()


Out[440]:
<Table masked=True length=43>
idxobjIDradecphot_sgflagsspecObjIDugrizu_errg_errr_erri_errz_errAuAgArAiAzfibermag_rfiber2mag_rexpRad_rsb_exp_rpetroR50_rpetroR90_rpetroMag_rsb_petro_rJJerrHHerrKKerrw1w1errw2w2errspec_zspec_z_errspec_z_warnphotozphotoz_errHOST_RAHOST_DECHOST_DISTHOST_VHOSTHOST_MKHOST_NSAIDHOST_FLAGHOST_SAGA_NAMERHOST_ARCMRHOST_KPCOBJ_NSAIDSATSPCLASS_1PCLASS_1_WISEREMOVETELNAMEMASKNAMEZQUALITYSPEC_REPEAT
01237680064810057894343.294258523-5.5892157763431056221043102885021.278620.077918.96318.559318.14660.2703920.03719320.02066060.02153630.054770.1892580.1392540.1009990.07658430.054299220.071120.69360.96271321.19628084261.668485.2762719.044522.15153999439999.09999.09999.09999.09999.09999.015.1960.02735614.7820.1030.321661-1.0-10.3064450.066518343.924-5.4953539.4062859.09.229150307038.0301638926435.921017981-106.89668104769e-050.000141353059347-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
11237680064810123417343.444169465-5.541315903373352555076157605618.934217.757817.097116.695916.43720.03817640.006548180.005356180.005394260.0130330.1926890.1417790.102830.07797270.055283618.214218.88591.5928720.1034599241.862044.317.056220.401600145415.8640.09415.0860.11414.7020.12713.68050.0066050513.6860.0530.0897762-1.0-10.1154240.022878343.924-5.4953539.4062859.09.229150307028.7899180127330.007508884-100.002526299723190.00556550653963-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
21237680065346994239343.326444569-5.27580467943352533601321126920.212718.982118.30617.897617.65840.1015980.01294320.01115330.01138380.02936640.188610.1387780.1006530.07632220.054113419.181819.84791.3458120.94639484661.478763.4024218.295121.140020887316.6620.1515.5239999.015.0769999.015.18830.023318715.1330.1570.0735444-1.0-10.1075550.023803343.924-5.4953539.4062859.09.229150307038.0419851507436.056513705-100.003507889862430.00289022683502-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
31237680064810123422343.302816457-5.490943729093352533600013688320.024418.658217.772117.241616.93450.1033410.01323880.00926040.008620310.02140260.1880440.1383610.1003510.0760930.053950918.999519.64481.2798820.62241210841.725864.9091817.929721.110219100116.2670.11615.2820.12114.8610.1314.06690.0093581213.8310.0520.167784-1.0-10.1564910.024198343.924-5.4953539.4062859.09.229150307037.1006559893425.266946008-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
41237680189904519388343.283100026-5.307736658953352211478814887819.571818.917118.294418.019417.79690.06786220.01323230.01229170.01397080.03771750.1876030.1380370.1001160.07591480.053824519.47420.19381.8325521.60517583861.770313.5666418.330221.56588934919999.09999.09999.09999.09999.09999.015.27080.026660715.1730.1680.232963-1.0-10.2448540.046643343.924-5.4953539.4062859.09.229150307039.8981754873457.332174987-100.00126276622320.00110375076419-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
51237680064809992382343.13867092-5.615615468233105622104179216722.600319.950518.647418.112817.80221.136250.04391790.02074970.01989170.05427590.1889220.1390070.100820.07644840.054202920.134420.80941.8945422.40625518341.912645.0602418.946722.35031806929999.09999.09999.09999.09999.09999.014.78260.01885489999.09999.00.204143-1.0-10.2115510.029907343.924-5.4953539.4062859.09.229150307047.4550105436543.947207645-105.09129220406e-05nan-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
61237680189904585058343.424951295-5.489026867113690551524568723.237619.892818.457517.948917.54121.087940.02059510.01134080.01116550.02100860.1909690.1405130.1019120.07727680.054790219.185819.75110.83239820.19179446381.241283.2373518.484520.949338673216.3950.11915.840.1714.8390.12914.67510.01376114.4070.0860.243971-1.0-10.245750.029337343.924-5.4953539.4062859.09.229150307029.8077183133341.673866111-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
71237680064810057752343.194216946-5.5133887848931759221290148005619.015717.668117.185316.855816.71520.06444320.008686330.008174870.009064550.0278690.1871010.1376670.09984760.07571140.053680319.31520.04815.0089922.67948804763.739199.035517.174122.03342329189999.09999.09999.09999.09999.09999.014.3020.014351714.7420.1050.0654179-1.0-10.0644280.014781343.924-5.4953539.4062859.09.229150307043.599173265499.752622675-100.001450146811170.00384500164673-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
81237680065346928826343.257886426-5.26680673743689879121926920.583619.416918.525718.034317.7680.115740.015860.01151090.01086120.02732230.1865210.137240.09953820.07547680.05351419.170719.76850.93023620.36409630131.225472.6735418.510120.947020682416.6840.13515.570.13115.1490.16714.63770.01358614.0440.0590.216952-1.0-10.1921690.02489343.924-5.4953539.4062859.09.229150307042.0800711853482.340901523-100.001310432469890.000793392297173-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
91237680189367714013343.307045753-5.734660729683352555076198563419.46918.251117.699317.311417.09590.0730580.01167050.01013190.01072890.03087850.1960760.1442710.1046370.07934330.056255419.509720.23794.6044923.0106881992.994227.0105917.754422.13129447269999.09999.09999.09999.09999.09999.014.70910.020156815.2520.1860.0597085-1.0-10.0674450.014687343.924-5.4953539.4062859.09.229150307039.545936461453.294819877-100.0009300115657460.00177635213848-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
101237680189367714002343.279903407-5.881129684853689879124485322.461620.131618.790218.283417.99170.6656640.02900420.01513450.01517790.03573180.2011050.1479710.1073210.08137820.057698119.691820.3050.9399820.83245737231.27923.0172518.930721.460897614717.3770.25216.2830.26115.2660.19315.38470.029207815.0520.1460.205144-1.0-10.2094350.013974343.924-5.4953539.4062859.09.229150307044.895147071514.606803872-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
111237680189367648673343.194588017-5.7814570051931583986624473605320.875119.859618.824718.403918.08820.1715890.02674190.01721420.01795340.04709070.1963140.1444460.1047640.07943940.056323519.933920.64571.5015121.70280953091.682083.3861318.869221.99387740549999.09999.09999.09999.09999.09999.015.22730.027453914.7350.1140.310551-1.0-10.2768540.04809343.924-5.4953539.4062859.09.229150307046.8238301272536.712830359-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
121237680064809992507343.137176061-5.575177202893689879121925020.22819.654318.806418.300318.09530.1123010.02798720.0192110.01870420.05556330.1881510.1384390.1004080.07613620.053981519.975520.62041.0703421.24584516481.624284.1119118.978522.02721315979999.09999.09999.09999.09999.09999.015.46150.031360115.1710.1580.233497-1.0-10.3314010.104254343.924-5.4953539.4062859.09.229150307047.2359177046541.436041404-100.0001604446921930.000247556661682-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
131237680064809992370343.131492299-5.4858834388931056221041787048721.491218.621517.418516.898616.57310.390370.01397210.007765510.007291610.01733370.1870760.1376490.09983450.07570150.053673318.739519.3791.5319720.66769217161.988025.4535517.552721.040257986416.1410.10615.5380.14814.7990.13213.88460.0088699213.8350.0520.166783-1.0-10.1769490.020902343.924-5.4953539.4062859.09.229150307047.3353268178542.575434503-107.62729818351e-057.1170591068e-05-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
141237680064809992492343.092097618-5.519062838063352533601367205020.375419.481218.615818.165717.93870.1202070.02243470.01516370.01526980.04387440.1877350.1381340.1001860.0759680.053862319.664220.28381.0569321.00003128021.683555.6619818.638321.76492413049999.09999.09999.09999.09999.09999.014.94140.02021814.3190.0840.238568-1.0-10.2136640.035774343.924-5.4953539.4062859.09.229150307049.7051032405569.736861182-100.0003030072980690.000377608872966-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
151237680064809992423343.074860719-5.509650845553352533600010407820.445619.438618.945418.640118.51010.09160460.01627520.01449440.01616060.05046350.1877110.1381160.1001730.07595830.053855319.558920.16010.7465520.30612817721.176593.303218.872821.22140099519999.09999.09999.09999.09999.09999.015.93750.045756115.490.1940.0981153-1.0-10.1152150.027068343.924-5.4953539.4062859.09.229150307050.7214551949581.385797353-100.001069773399410.000953794507447-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
161237680265066774628343.304747221-5.9245685615231056221043097768021.855719.905718.93418.445418.06530.3550030.02431460.01635030.01610840.03606080.2022650.1488250.107940.08184760.05803119.516420.09480.67362420.17362343841.277853.4759118.905921.433744023716.2380.10915.759999.015.199999.015.48970.029374414.9910.1340.124801-1.0-10.0797870.01777343.924-5.4953539.4062859.09.229150307045.0673801666516.580898197-100.001908776912280.000275162970286-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
171237680189367648312343.187517816-5.719344010713352533601364642422.526420.718419.004818.404218.12660.963880.0766870.02732420.02263050.05195550.1926020.1417150.1027830.07793740.055258620.072920.70920.99291421.36216148831.866065.8229919.040722.39082616819999.09999.09999.09999.09999.09999.014.8110.02009319999.09999.00.318925-1.0-10.3177910.01575343.924-5.4953539.4062859.09.229150307045.993236929527.192823419-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
181237680189367582881343.125927455-5.7173140834931408064763988489621.017918.808517.635417.151116.73540.2751120.01524840.009130980.008788670.02053980.1926660.1417620.1028180.07796360.055277119.088819.69941.557121.05052883332.602075.5643617.732621.804632873416.3460.13915.5570.13915.4040.20714.11360.01196414.3130.0880.15691-1.0-10.1475350.009675343.924-5.4953539.4062859.09.229150307049.4898788034567.270056009-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
191237680189367648414343.194673452-5.772512876353689880435205319.76618.026517.086416.59816.21610.09334490.009132260.006438840.006194810.01404470.1957890.1440590.1044840.0792270.056172918.824719.54884.361422.27994072872.84777.1640417.129421.397279953516.0390.12215.2150.12314.6320.11813.38770.0065351513.5990.0640.0897762-1.0-10.088830.021427343.924-5.4953539.4062859.09.229150307046.6249919686534.433810615-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
201237680065346863596343.044599238-5.242844869533689879121929422.217920.151318.698318.126717.6870.699970.0401250.01763850.01601730.03826040.1808020.1330330.09648640.07316270.051873319.842520.45641.0102521.07622694262.035986.5476218.661322.200608569917.4520.24616.0930.1915.220.14914.79320.018761914.9360.1260.269755-1.0-10.2372770.01969343.924-5.4953539.4062859.09.229150307054.6630046385626.561447144-106.4905844254e-054.97824022554e-05-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
211237680065346863389343.112790905-5.255866028483352533601321128421.236619.350718.856318.501818.30320.2337060.01715030.01646340.01779310.05261760.1828430.1345340.09757530.07398840.052458719.686120.36511.2485721.33385520241.392432.7182718.911621.62596405849999.09999.09999.09999.09999.09999.015.84310.040890115.3040.1550.116657-1.0-10.0761970.02626343.924-5.4953539.4062859.09.229150307050.5347393715579.245754371-100.0043960198570.00356706470496-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
221237680065346863393343.112692307-5.2560962823533167304843266728421.384125.662924.805924.791922.86030.3900942.051452.685552.421942.321940.1828510.134540.09757980.07399180.052461119.866420.59330.051267620.3467762913-9999.0-9999.024.824746.81997387639999.09999.09999.09999.09999.09999.09999.09999.015.3040.1550.116657-1.0-10.3101720.191135343.924-5.4953539.4062859.09.229150307050.5364589486579.265463308-100.0043960198570.00356706470496-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
231237680064809992310343.011342004-5.63836380307335255507619928421.257919.094318.029417.624417.35650.1603370.01211950.007436870.007422140.01723670.1915060.1409080.1021980.07749390.054944118.50119.04140.61492818.96895713830.891361.8576118.087919.833645728516.4580.11615.7380.1415.5430.21415.55230.029276715.2780.1780.000667134-1.0-10.2049140.033154343.924-5.4953539.4062859.09.229150307055.179083758632.476373382-120.0004018541879870.000399833947269-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
241237680064809992362343.117832673-5.4998457117731759908484877682519.557617.455216.497816.039815.68160.08493380.006963090.004842630.004752010.01030340.1872840.1378020.09994540.07578560.053732918.051318.67672.2740220.67824364183.093988.0756316.52120.968996250415.480.08614.7770.09914.3410.0913.12770.0049571113.7360.0660.0907302-1.0-10.0798520.016613343.924-5.4953539.4062859.09.229150307048.1484852603551.895560066-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
251237680189904519279343.148168788-5.276280593573352533601321127919.736418.547217.87217.460717.19270.07175320.009642790.008704230.008663480.02113550.1842990.1356060.09835250.07457770.052876618.934219.63571.4166220.62369075431.633493.334217.897120.958149800116.6560.15815.8380.17815.3530.18314.65620.014635714.5750.0980.125221-1.0-10.1130490.024841343.924-5.4953539.4062859.09.229150307048.1641703411552.075336441-100.0009687366435910.0015550639963-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
261237680189367582834343.08798306-5.744506022763689880432643618.409417.270616.756416.550916.36640.03915330.006599240.006170520.007146290.02021360.1942840.1429520.1036810.07861820.055741318.6519.34122.8720821.45001022482.758816.9359817.063321.26237863499999.09999.09999.09999.09999.09999.014.51640.01852914.8590.120.0130246-1.0-10.0239350.014136343.924-5.4953539.4062859.09.229150307052.1203966403597.419706524-120.184344089650.183182390961-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
271237680189367648383343.146969722-5.799541688223352533601364647720.246618.285617.29516.853816.45930.09912750.008429020.005894790.005776110.01212430.1971410.1450550.1052060.07977430.05656118.280418.87820.93225319.40531098771.53324.8150617.336120.259531096415.80.0715.1190.114.5340.10713.95280.0083993614.0070.0630.0901965-1.0-10.0998460.010596343.924-5.4953539.4062859.09.229150307049.8675968496571.59928797-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
281237680065346797796342.968372467-5.189756044453352533601321126218.537916.62815.784815.362615.07160.03833090.004264660.003340130.003313280.006361070.1768420.1301190.09437280.07156010.05073717.25317.9081.9326319.53087494492.312537.1078615.905119.720981695714.8570.06814.2470.08713.8540.07112.73280.0034157213.0870.040.0485006-1.0-10.0461540.01827343.924-5.4953539.4062859.09.229150307059.9470727325687.122928843-120.002433521862990.000218915720773-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
291237680064809992410343.00807705-5.630033509973198710018706645420.670919.234518.389217.93417.60040.1524120.01837810.01284320.01303670.03392530.1913160.1407680.1020970.07741710.054889719.528620.22721.655921.47983176481.819294.0260518.37521.66998614329999.09999.09999.09999.09999.09999.015.07980.021831914.8640.120.143434-1.0-10.1262140.022965343.924-5.4953539.4062859.09.229150307055.296465789633.821719482-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
301237680065346863210343.015483699-5.205437522393352533601321126220.613318.784617.611517.126716.72790.1565670.01334780.007734270.007381030.01671510.1786160.1314240.09531950.07227790.051245918.688519.29680.97111519.83896303911.743275.3485317.630720.833013527815.9610.08715.3260.10414.9020.1214.15310.01072114.00.0660.15649-1.0-10.1599290.013352343.924-5.4953539.4062859.09.229150307056.9804622924653.122360901-100.0001457558456625.04721835735e-05-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
311237680065346863288343.099423374-5.068286291513689880473608419.439518.115917.46417.09116.79650.05983680.008306280.007207450.0073330.01818960.1748480.1286510.09330860.07075310.050164818.652719.34511.5704220.43956192261.919174.1756817.447220.858222884616.3140.13815.6230.18915.3960.214.27950.011489114.4220.0930.0877272-1.0-10.0808970.02904343.924-5.4953539.4062859.09.229150307055.5145753109636.321527686-100.001735601210250.00111331854698-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
321237680189367582848343.124739699-5.69517919337368987912704819.887118.106917.0716.630416.21020.07183970.007262040.005097770.004956210.009671850.1917470.1410850.1023270.07759140.055013317.991918.60011.3842419.91046821791.365653.5481717.158119.830251911915.390.0714.6230.0714.2150.07813.6210.0061020613.4250.0410.124087-1.0-10.1170890.014818343.924-5.4953539.4062859.09.229150307049.2179304792564.153104114-100.0001574695375610.000366032401855-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
331237680189367517356342.967745574-5.751653497923352211478773923718.518217.611317.27116.994516.87080.02534770.005789360.005848510.006354520.0186920.1958920.1441360.1045390.0792690.056202718.427119.15641.5446620.21058985291.727363.1774317.332620.514954201916.5950.12815.9970.22815.410.18814.44820.01265214.1750.0710.10007-1.0-10.0703850.021712343.924-5.4953539.4062859.09.229150307059.1457560712677.939021607-100.004429056051260.00167851765444-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
341237680189367582776342.985510025-5.832115372553352877198704804920.510818.359117.356217.005716.81620.08726220.007219240.005217410.005225940.01214930.1993320.1466660.1063750.08066080.057189517.844418.40150.6963218.56566164090.9363111.9603417.39919.25160062615.9540.06715.2640.09615.0690.13515.02540.018241314.9810.1333.0021e-05-1.0-10.3199070.096493343.924-5.4953539.4062859.09.229150307059.5814480036682.932500678-120.0009603190026130.000288450908183-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
351237680189904453718343.052535255-5.336503505423352533601362082319.881318.731917.943517.48917.18730.0743480.0108260.008601570.008416630.02076620.1845770.135810.09850080.07469020.052956318.889319.4891.0741320.32341221441.52644.2989817.955620.869379352816.4330.10915.7840.15215.1450.15214.41650.011685414.1680.0670.156776-1.0-10.1590290.023949343.924-5.4953539.4062859.09.229150307052.9129975217606.504024814-100.003728442318430.000859869692103-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
361237680189904453854343.009391296-5.315015977743352533601364641520.000119.108918.610118.301218.23210.09880440.01630050.01681860.01893480.06507860.1827980.1345010.09755130.07397020.052445820.003920.7162.8529322.88201908372.129264.3754818.646122.28270094359999.09999.09999.09999.09999.09999.015.82370.045879115.1290.1350.155899-1.0-10.1511510.039093343.924-5.4953539.4062859.09.229150307055.6856206698638.281919866-10-1.0-1.0-1WIYN/Spectra/Final/WIYN/zspec.Iliad_2-bright.fits4.0
371237680065346863232343.038180259-5.163713947163352533601362809420.675419.150118.322517.790617.52160.1501390.01591330.01155710.01088860.02975540.1774690.130580.09470740.07181380.050916919.31420.00281.426421.08910761091.634553.9129418.291821.354200963816.5580.12916.1110.20915.1430.16114.57180.014342814.0620.0630.14004-1.0-10.1178260.032605343.924-5.4953539.4062859.09.229150307056.5231486808647.881007822-100.0001644291307980.0011020820159-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
381237680243590561959343.21692133-5.975787094713689880437763118.551117.334916.700616.307316.08070.03648850.005836160.004969510.005221950.01272150.2032610.1495580.1084720.08225080.058316918.16318.8311.5556520.03308611512.244437.213316.832420.583368444615.8460.09815.2570.13314.6130.1113.56870.0068955313.6810.0510.0917309-1.0-10.102180.020398343.924-5.4953539.4062859.09.229150307051.1302435828586.071118526-100.002010312308170.00127515119458-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0
391237680064809926954342.943186298-5.657018181653689880437767120.265319.039218.370317.927117.73610.09233110.01333760.0105250.01060420.02878290.1928480.1418950.1029140.07803690.055329119.146319.79081.2238620.80442544841.324032.9900418.367820.972766453916.8710.13815.9440.14915.4240.18114.92570.017399814.6520.0920.0901965-1.0-10.1163610.02474343.924-5.4953539.4062859.09.229150307059.3760475055680.57840041-100.0007091485903910.000915808531066-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
401237680189367517465342.969243995-5.6960701474131936173942708083520.509919.368218.824318.434918.26040.1136690.01670370.01603040.0164780.0543470.1937950.1425920.103420.07842010.055600819.831520.49361.8656322.17385721421.582043.4397818.855721.84724870649999.09999.09999.09999.09999.09999.015.77370.04187619999.09999.00.0750525-1.0-10.0907270.018766343.924-5.4953539.4062859.09.229150307058.2799789591668.016290397-100.000682756859976nan-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
411237680189904388264342.932498398-5.461716193963352533601362084420.08218.410517.365216.911716.56240.1284380.01185350.007982410.007699540.01902140.1855480.1365240.09901870.07508280.053234718.763419.43411.578520.73711845662.074125.8950817.562721.142357603116.2520.10715.5650.16115.0150.13414.21010.012273814.0170.0650.125088-1.0-10.1478740.017647343.924-5.4953539.4062859.09.229150307059.251054002679.145845536-100.0007009358253580.000244723014887-1WIYN/Spectra/Final/WIYN/zspec.Iliad_1-bright.fits4.0
421237680243590496443343.08030126-6.03273066414323818278010883719.153517.911617.394517.117316.89680.05824030.007906110.007455170.008576860.02404940.2049560.1508040.1093760.08293650.05880319.03319.75723.7348222.25128827742.805976.739117.367921.603747018416.7720.1815.4439999.014.9989999.014.69050.019214614.6060.0880.0250175-1.0-10.0323870.011592343.924-5.4953539.4062859.09.229150307059.8220588151685.690144132-120.007612335858170.00983660306319-1WIYN/Spectra/Final/WIYN/zspec.Iliad_3-bright.fits4.0

Note: NSA150307 was called "Iliad" when it was observed on WIYN

Mock sets of configurations


In [227]:
for h in hosts_to_target:
    fnbase = 'aat_targets_jul2016/test_runs/' + h.name

    finum = 1
    fnmaster = fnbase.replace('test_runs/', '') + '_master.fld'
    fnconfig = fnbase + '_test_{0}.fld'.format(finum)
    print('Writing', fnconfig, 'from master', fnmaster)

    listorem = [fnbase + '_test_' + str(i) + '.lis' for i in range(1, finum)]
    aat.subsample_from_master_fld(fnmaster, fnconfig,
                                  {1:30, 2:30, 3:30, 4:np.inf, 5:np.inf, 6:np.inf, 7:np.inf, 8:np.inf, 9:np.inf}, #8 reserved for flux
                                  nflux=5, nguides=30,
                                  fieldname=str(finum), listorem=listorem)
    print('')


Writing aat_targets_jul2016/Narnia_test_1.fld from master aat_targets_jul2016/Narnia_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 2728, 2: 655, 3: 405, 4: 97, 5: 145, 6: 313, 7: 191, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%

Writing aat_targets_jul2016/Catch22_test_1.fld from master aat_targets_jul2016/Catch22_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2976, 2: 752, 3: 429, 4: 64, 5: 119, 6: 525, 7: 285, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%

Writing aat_targets_jul2016/Dune_test_1.fld from master aat_targets_jul2016/Dune_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 94 skies not included):
{1: 3812, 2: 1136, 3: 407, 4: 182, 5: 125, 6: 156, 7: 81, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%

Writing aat_targets_jul2016/OBrother_test_1.fld from master aat_targets_jul2016/OBrother_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 95 skies not included):
{1: 2080, 2: 625, 3: 464, 4: 35, 5: 106, 6: 255, 7: 221, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%

Writing aat_targets_jul2016/Gilgamesh_test_1.fld from master aat_targets_jul2016/Gilgamesh_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3785, 2: 941, 3: 444, 4: 44, 5: 68, 6: 53, 7: 31, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%

Writing aat_targets_jul2016/AnaK_test_1.fld from master aat_targets_jul2016/AnaK_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 96 skies not included):
{1: 2710, 2: 720, 3: 410, 4: 50, 5: 107, 6: 109, 7: 39, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%

Writing aat_targets_jul2016/Odyssey_test_1.fld from master aat_targets_jul2016/Odyssey_master.fld
Total remaining in each priority (5 fluxes, 30 guides, and 92 skies not included):
{1: 1847, 2: 676, 3: 550, 4: 3, 5: 1, 6: 24, 7: 14, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 100.0, 7: 100.0, 8: None, 9: None}%


In [175]:
for h in hosts_to_target:
    fnbase = 'aat_targets_jul2016/test_runs/' + h.name

    finum = 2
    fnmaster = fnbase.replace('test_runs/', '') + '_master.fld'
    fnconfig = fnbase + '_test_{0}.fld'.format(finum)
    print('Writing', fnconfig, 'from master', fnmaster)

    listorem = [fnbase + '_test_' + str(i) + '.lis' for i in range(1, finum)]
    aat.subsample_from_master_fld(fnmaster, fnconfig,
                                  {1:30, 2:30, 3:30, 4:np.inf, 5:np.inf, 6:np.inf, 7:np.inf, 8:np.inf, 9:np.inf}, #8 reserved for flux
                                  nflux=5, nguides=30,
                                  fieldname=str(finum), listorem=listorem)
    print('')


Writing aat_targets_jul2016/Narnia_test_2.fld from master aat_targets_jul2016/Narnia_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Narnia_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 2728, 2: 655, 3: 404, 4: 93, 5: 130, 6: 149, 7: 23, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 99.75308641975309, 4: 95.87628865979381, 5: 89.65517241379311, 6: 47.6038338658147, 7: 12.041884816753926, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/Dune_test_2.fld from master aat_targets_jul2016/Dune_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Dune_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 94 skies not included):
{1: 3812, 2: 1136, 3: 406, 4: 148, 5: 24, 6: 14, 7: 7, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 99.75429975429975, 4: 81.31868131868131, 5: 19.2, 6: 8.974358974358974, 7: 8.641975308641975, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/OBrother_test_2.fld from master aat_targets_jul2016/OBrother_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/OBrother_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 95 skies not included):
{1: 2080, 2: 625, 3: 446, 4: 32, 5: 84, 6: 127, 7: 40, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 96.12068965517241, 4: 91.42857142857143, 5: 79.24528301886792, 6: 49.80392156862745, 7: 18.099547511312217, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/Gilgamesh_test_2.fld from master aat_targets_jul2016/Gilgamesh_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Gilgamesh_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3785, 2: 926, 3: 279, 4: 6, 5: 13, 6: 1, 7: 4, 8: 0, 9: 0}
{1: 100.0, 2: 98.40595111583421, 3: 62.83783783783784, 4: 13.636363636363637, 5: 19.11764705882353, 6: 1.8867924528301887, 7: 12.903225806451612, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/AnaK_test_2.fld from master aat_targets_jul2016/AnaK_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/AnaK_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 96 skies not included):
{1: 2710, 2: 720, 3: 315, 4: 10, 5: 23, 6: 10, 7: 5, 8: 0, 9: 1}
{1: 100.0, 2: 100.0, 3: 76.82926829268293, 4: 20.0, 5: 21.49532710280374, 6: 9.174311926605505, 7: 12.820512820512821, 8: None, 9: 50.0}%

Writing aat_targets_jul2016/Odyssey_test_2.fld from master aat_targets_jul2016/Odyssey_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Odyssey_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 92 skies not included):
{1: 1847, 2: 611, 3: 303, 4: 1, 5: 0, 6: 1, 7: 0, 8: 0, 9: 0}
{1: 100.0, 2: 90.38461538461539, 3: 55.09090909090909, 4: 33.333333333333336, 5: 0.0, 6: 4.166666666666667, 7: 0.0, 8: None, 9: 0.0}%


In [188]:
for h in hosts_to_target:
    fnbase = 'aat_targets_jul2016/test_runs/' + h.name

    finum = 3
    fnmaster = fnbase.replace('test_runs/', '') + '_master.fld'
    fnconfig = fnbase + '_test_{0}.fld'.format(finum)
    print('Writing', fnconfig, 'from master', fnmaster)

    listorem = [fnbase + '_test_' + str(i) + '.lis' for i in range(1, finum)]
    aat.subsample_from_master_fld(fnmaster, fnconfig,
                                  {1:30, 2:30, 3:30, 4:np.inf, 5:np.inf, 6:np.inf, 7:np.inf, 8:np.inf, 9:np.inf}, #8 reserved for flux
                                  nflux=5, nguides=30,
                                  fieldname=str(finum), listorem=listorem)
    print('')


Writing aat_targets_jul2016/Narnia_test_3.fld from master aat_targets_jul2016/Narnia_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Narnia_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Narnia_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 2717, 2: 638, 3: 377, 4: 43, 5: 35, 6: 17, 7: 2, 8: 0, 9: 0}
{1: 99.59677419354838, 2: 97.40458015267176, 3: 93.08641975308642, 4: 44.329896907216494, 5: 24.137931034482758, 6: 5.431309904153355, 7: 1.0471204188481675, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/Dune_test_3.fld from master aat_targets_jul2016/Dune_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Dune_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 268 objects to remove in aat_targets_jul2016/Dune_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 94 skies not included):
{1: 3783, 2: 1107, 3: 376, 4: 11, 5: 0, 6: 0, 7: 2, 8: 0, 9: 0}
{1: 99.2392444910808, 2: 97.44718309859155, 3: 92.38329238329239, 4: 6.043956043956044, 5: 0.0, 6: 0.0, 7: 2.4691358024691357, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/OBrother_test_3.fld from master aat_targets_jul2016/OBrother_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/OBrother_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 316 objects to remove in aat_targets_jul2016/OBrother_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 95 skies not included):
{1: 2055, 2: 596, 3: 416, 4: 5, 5: 20, 6: 24, 7: 2, 8: 0, 9: 0}
{1: 98.79807692307692, 2: 95.36, 3: 89.65517241379311, 4: 14.285714285714286, 5: 18.867924528301888, 6: 9.411764705882353, 7: 0.9049773755656109, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/Gilgamesh_test_3.fld from master aat_targets_jul2016/Gilgamesh_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Gilgamesh_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 109 objects to remove in aat_targets_jul2016/Gilgamesh_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 98 skies not included):
{1: 3755, 2: 896, 3: 249, 4: 2, 5: 1, 6: 0, 7: 2, 8: 0, 9: 0}
{1: 99.20739762219287, 2: 95.21785334750265, 3: 56.08108108108108, 4: 4.545454545454546, 5: 1.4705882352941178, 6: 0.0, 7: 6.451612903225806, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/AnaK_test_3.fld from master aat_targets_jul2016/AnaK_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/AnaK_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 136 objects to remove in aat_targets_jul2016/AnaK_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 96 skies not included):
{1: 2682, 2: 690, 3: 285, 4: 0, 5: 1, 6: 0, 7: 0, 8: 0, 9: 0}
{1: 98.96678966789668, 2: 95.83333333333333, 3: 69.51219512195122, 4: 0.0, 5: 0.9345794392523364, 6: 0.0, 7: 0.0, 8: None, 9: 0.0}%

Writing aat_targets_jul2016/Odyssey_test_3.fld from master aat_targets_jul2016/Odyssey_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Odyssey_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 89 objects to remove in aat_targets_jul2016/Odyssey_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 92 skies not included):
{1: 1820, 2: 581, 3: 273, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0}
{1: 98.53817000541419, 2: 85.94674556213018, 3: 49.63636363636363, 4: 0.0, 5: 0.0, 6: 0.0, 7: 0.0, 8: None, 9: 0.0}%

Basically there after 2 observations of Narnia and OBrother. AnaK and Dune 1 or maybe 2, Gilg/Ody 1.

Guess: Catch 22 requires 2 or 3

NSA 145729 and maybe 165082?

Catch22 added later


In [231]:
h = hsd['Catch22']
fnbase = 'aat_targets_jul2016/test_runs/' + h.name

finum = 2
fnmaster = fnbase.replace('test_runs/', '') + '_master.fld'
fnconfig = fnbase + '_test_{0}.fld'.format(finum)
print('Writing', fnconfig, 'from master', fnmaster)

listorem = [fnbase + '_test_' + str(i) + '.lis' for i in range(1, finum)]
aat.subsample_from_master_fld(fnmaster, fnconfig,
                              {1:30, 2:30, 3:30, 4:np.inf, 5:np.inf, 6:np.inf, 7:np.inf, 8:np.inf, 9:np.inf}, #8 reserved for flux
                              nflux=5, nguides=30,
                              fieldname=str(finum), listorem=listorem)


Writing aat_targets_jul2016/Catch22_test_2.fld from master aat_targets_jul2016/Catch22_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Catch22_test_1.lis
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2976, 2: 752, 3: 429, 4: 64, 5: 119, 6: 411, 7: 46, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 100.0, 4: 100.0, 5: 100.0, 6: 78.28571428571429, 7: 16.140350877192983, 8: None, 9: None}%

In [232]:
h = hsd['Catch22']
fnbase = 'aat_targets_jul2016/test_runs/' + h.name

finum = 3
fnmaster = fnbase.replace('test_runs/', '') + '_master.fld'
fnconfig = fnbase + '_test_{0}.fld'.format(finum)
print('Writing', fnconfig, 'from master', fnmaster)

listorem = [fnbase + '_test_' + str(i) + '.lis' for i in range(1, finum)]
aat.subsample_from_master_fld(fnmaster, fnconfig,
                              {1:30, 2:30, 3:30, 4:np.inf, 5:np.inf, 6:np.inf, 7:np.inf, 8:np.inf, 9:np.inf}, #8 reserved for flux
                              nflux=5, nguides=30,
                              fieldname=str(finum), listorem=listorem)


Writing aat_targets_jul2016/Catch22_test_3.fld from master aat_targets_jul2016/Catch22_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Catch22_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Catch22_test_2.lis
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2976, 2: 752, 3: 426, 4: 63, 5: 88, 6: 137, 7: 2, 8: 0, 9: 0}
{1: 100.0, 2: 100.0, 3: 99.3006993006993, 4: 98.4375, 5: 73.94957983193277, 6: 26.095238095238095, 7: 0.7017543859649122, 8: None, 9: None}%

In [235]:
h = hsd['Catch22']
fnbase = 'aat_targets_jul2016/test_runs/' + h.name

finum = 4
fnmaster = fnbase.replace('test_runs/', '') + '_master.fld'
fnconfig = fnbase + '_test_{0}.fld'.format(finum)
print('Writing', fnconfig, 'from master', fnmaster)

listorem = [fnbase + '_test_' + str(i) + '.lis' for i in range(1, finum)]
aat.subsample_from_master_fld(fnmaster, fnconfig,
                              {1:30, 2:30, 3:30, 4:np.inf, 5:np.inf, 6:np.inf, 7:np.inf, 8:np.inf, 9:np.inf}, #8 reserved for flux
                              nflux=5, nguides=30,
                              fieldname=str(finum), listorem=listorem)


Writing aat_targets_jul2016/Catch22_test_4.fld from master aat_targets_jul2016/Catch22_master.fld
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Catch22_test_1.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 353 objects to remove in aat_targets_jul2016/Catch22_test_2.lis
Kept the following fibers in due to zltabkeepfunc: []
Found 317 objects to remove in aat_targets_jul2016/Catch22_test_3.lis
Total remaining in each priority (5 fluxes, 30 guides, and 89 skies not included):
{1: 2957, 2: 724, 3: 397, 4: 13, 5: 18, 6: 18, 7: 0, 8: 0, 9: 0}
{1: 99.36155913978494, 2: 96.27659574468085, 3: 92.54079254079254, 4: 20.3125, 5: 15.126050420168067, 6: 3.4285714285714284, 7: 0.0, 8: None, 9: None}%

Log from last run


In [91]:
logtab2015 = make_logtab('aat_targets_jul2016/alljun_2015_aaomega_headers')

In [92]:
logtab2015[(logtab2015['ccd']==1)].show_in_notebook(display_length=20)


Out[92]:
<Table length=123>
idxnumccdUTDATEUTSTARTOBJECTTOTALEXPRUNCMDGRATIDSOURCEMEANRAMEANDECCFG_FILE
01000112015:06:1908:56:19Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0221.546377452-0.222954220588Dune_1p0.sds
11000212015:06:1908:58:47Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0221.546356619-0.222936925056Dune_1p0.sds
21000312015:06:1909:01:45ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0221.546364632-0.222939560562Dune_1p0.sds
31000412015:06:1910:54:11Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1221.546400952-0.222954199967Dune_1p1.sds
41000512015:06:1910:56:42Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1221.546391869-0.22291846743Dune_1p1.sds
51000612015:06:1910:59:28ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1221.546367689-0.222955327287Dune_1p1.sds
61000712015:06:1913:31:31Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0221.545561468-0.220320318818Odyssey_1p0.sds
71000812015:06:1913:33:53Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0221.545556258-0.220305052591Odyssey_1p0.sds
81000912015:06:1913:36:40ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0221.545525634-0.220313397766Odyssey_1p0.sds
91001012015:06:1913:40:54Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0248.08727434519.8264618711Odyssey_1p0.sds
101001112015:06:1913:43:13Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0248.087319619.826425418Odyssey_1p0.sds
111001212015:06:1913:45:54ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0248.0872995519.8264528153Odyssey_1p0.sds
121001312015:06:1914:47:34Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1309.727044828-5.64000044444Aeneid_1p1.sds
131001412015:06:1914:50:05Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1309.727026911-5.63999462457Aeneid_1p1.sds
141001512015:06:1914:53:02ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1309.727029716-5.63998161799Aeneid_1p1.sds
151001612015:06:1917:00:23Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0335.913183365-3.43168691952OBrother_1p0.sds
161001712015:06:1917:02:53Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0335.91317467-3.43168639018OBrother_1p0.sds
171001812015:06:1917:05:58ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0335.913176561-3.43165772554OBrother_1p0.sds
181001912015:06:1917:31:18OBrother 11800.RUN580Vplate 0335.912554436-3.43059053055OBrother_1p0.sds
191002012015:06:1918:03:25OBrother 10.RUN580Vplate 0335.914178558-3.43155471296OBrother_1p0.sds
201002112015:06:1918:53:06Dark Frame0.DARK580Vplate 0335.914143822-3.43152464918OBrother_1p0.sds
211002212015:06:1919:25:13Dark Frame0.DARK580Vplate 0347.85947261-31.3628295895OBrother_1p0.sds
221002312015:06:1919:57:19Dark Frame0.DARK580Vplate 0355.914891531-31.3641471712OBrother_1p0.sds
231002412015:06:1920:29:25Dark Frame0.DARK580Vplate 03.9709295543-31.3637304629OBrother_1p0.sds
241002512015:06:1921:01:31Dark Frame0.DARK580Vplate 012.0269550806-31.3615576694OBrother_1p0.sds
251000112015:06:2008:04:26Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0221.546782098-0.221174604921Dune_1p0.sds
261000212015:06:2008:06:58Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0221.546765747-0.221164684035Dune_1p0.sds
271000312015:06:2008:09:44ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0221.546838563-0.221158281366Dune_1p0.sds
281000412015:06:2008:19:11Dune 11800.RUN580Vplate 0221.547438846-0.222192816246Dune_1p0.sds
291000512015:06:2008:51:18Dune 11800.RUN580Vplate 0221.547655326-0.222506805267Dune_1p0.sds
301000612015:06:2009:23:24Dune 11800.RUN580Vplate 0221.547868579-0.222798060194Dune_1p0.sds
311000712015:06:2009:55:30Dune 11800.RUN580Vplate 0221.547756159-0.22300099215Dune_1p0.sds
321000812015:06:2010:31:35Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1221.547548907-0.223201174273Dune_2p1.sds
331000912015:06:2010:33:55Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1221.547562701-0.223227882924Dune_2p1.sds
341001012015:06:2010:36:38ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1221.547558207-0.223236982595Dune_2p1.sds
351001112015:06:2010:39:40Dune 21800.RUN580Vplate 1221.547549091-0.223013180259Dune_2p1.sds
361001212015:06:2011:11:46Dune 21800.RUN580Vplate 1221.547629664-0.222275145205Dune_2p1.sds
371001312015:06:2011:43:53Dune 21800.RUN580Vplate 1221.548187803-0.222156134866Dune_2p1.sds
381001412015:06:2012:17:24Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0248.08678559119.8254036233Odyssey_1p0.sds
391001512015:06:2012:19:47Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0248.0867977919.8254155404Odyssey_1p0.sds
401001612015:06:2012:22:32ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0248.0868183919.8253751777Odyssey_1p0.sds
411001712015:06:2012:25:38Odyssey 11800.RUN580Vplate 0248.08675132119.825687816Odyssey_1p0.sds
421001812015:06:2012:57:44Odyssey 11800.RUN580Vplate 0248.08669206219.825776613Odyssey_1p0.sds
431001912015:06:2013:29:50Odyssey 11800.RUN580Vplate 0248.08663062519.8258397083Odyssey_1p0.sds
441002012015:06:2014:01:56Odyssey 11800.RUN580Vplate 0248.08659141419.8259942974Odyssey_1p0.sds
451002112015:06:2014:35:40Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1309.727756359-5.63832789861Aeneid_1p1.sds
461002212015:06:2014:38:52Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1309.727719909-5.63829854672Aeneid_1p1.sds
471002312015:06:2014:41:35ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1309.727719317-5.63833003766Aeneid_1p1.sds
481002412015:06:2014:44:40Aeneid 11800.RUN580Vplate 1309.728158052-5.63889309593Aeneid_1p1.sds
491002512015:06:2015:16:46Aeneid 11800.RUN580Vplate 1309.728175906-5.63907767781Aeneid_1p1.sds
501002612015:06:2015:48:53Aeneid 11800.RUN580Vplate 1309.728334269-5.63925974012Aeneid_1p1.sds
511002712015:06:2016:20:59Aeneid 11800.RUN580Vplate 1309.728213957-5.63934929025Aeneid_1p1.sds
521002812015:06:2016:54:03Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0335.912978019-3.430586418OBrother_1p0.sds
531002912015:06:2016:56:31Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0335.912999444-3.43059350837OBrother_1p0.sds
541003012015:06:2016:59:17ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0335.912955815-3.43056601269OBrother_1p0.sds
551003112015:06:2017:02:53OBrother 11800.RUN580Vplate 0335.914531586-3.43123939977OBrother_1p0.sds
561003212015:06:2017:34:59OBrother 11800.RUN580Vplate 0335.914327585-3.43155261075OBrother_1p0.sds
571003312015:06:2018:07:06OBrother 11800.RUN580Vplate 0335.914393236-3.43181242848OBrother_1p0.sds
581003412015:06:2018:40:53AnaK 11200.RUN580Vplate 1354.1324727770.298102525542AnaK_1p1.sds
591003512015:06:2019:02:59AnaK 11800.RUN580Vplate 1354.1321702010.297935191393AnaK_1p1.sds
601003612015:06:2019:35:05AnaK 11800.RUN580Vplate 1354.1324957090.297995729714AnaK_1p1.sds
611003712015:06:2020:07:38Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1354.1328479280.298002966085AnaK_1p1.sds
621003812015:06:2020:09:57Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1354.1328707780.297989172309AnaK_1p1.sds
631003912015:06:2020:12:43ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1354.1327911980.297985768454AnaK_1p1.sds
641004012015:06:2020:17:53Bias Frame0.BIAS580Vplate 02.06520339342-31.3642641408NONE
651004112015:06:2020:20:00Bias Frame0.BIAS580Vplate 02.59329456673-31.3641993574NONE
661004212015:06:2020:22:06Bias Frame0.BIAS580Vplate 03.12148714453-31.3641076861NONE
671004312015:06:2020:24:13Bias Frame0.BIAS580Vplate 03.65367059264-31.3640239736NONE
681004412015:06:2020:26:20Bias Frame0.BIAS580Vplate 04.18353683083-31.3639356702NONE
691000112015:06:2105:53:19Offset Sky Frame25.SKY580Vplate 0146.345526809-31.2011362101Dune_3p0.sds
701000212015:06:2105:56:00Offset Sky Frame200.SKY580Vplate 0147.016813605-31.2005892806Dune_3p0.sds
711000312015:06:2106:39:25Offset Sky Frame25.SKY580Vplate 1157.890369205-31.1932552862Dune_2p1.sds
721000412015:06:2106:44:11Offset Sky Frame200.SKY580Vplate 1159.083707895-31.192604024Dune_2p1.sds
731000512015:06:2108:03:44Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0221.547207369-0.22204002376Dune_3p0.sds
741000612015:06:2108:06:04Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0221.547200805-0.22202324197Dune_3p0.sds
751000712015:06:2108:08:50ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0221.547224316-0.222017894389Dune_3p0.sds
761000812015:06:2108:18:20Dune 31800.RUN580Vplate 0221.547387571-0.22210179567Dune_3p0.sds
771000912015:06:2108:50:26Dune 31800.RUN580Vplate 0221.547732113-0.222495890391Dune_3p0.sds
781001012015:06:2109:22:33Dune 31800.RUN580Vplate 0221.547976029-0.222612898961Dune_3p0.sds
791001112015:06:2109:54:39Dune 31800.RUN580Vplate 0221.547685166-0.222945379953Dune_3p0.sds
801001212015:06:2110:29:02Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1221.548251432-0.221709822523Dune_2p1.sds
811001312015:06:2110:31:25Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1221.548243349-0.221705990167Dune_2p1.sds
821001412015:06:2110:34:11ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1221.548258637-0.221679456928Dune_2p1.sds
831001512015:06:2110:37:15Dune 21800.RUN580Vplate 1221.548010538-0.222055722084Dune_2p1.sds
841001612015:06:2111:09:22Dune 21800.RUN580Vplate 1221.548144758-0.222025281493Dune_2p1.sds
851001712015:06:2111:41:28Dune 21800.RUN580Vplate 1221.54806835-0.222021729952Dune_2p1.sds
861001812015:06:2112:15:01Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0234.13139842216.6072206684Gilgamesh_1p0.sds
871001912015:06:2112:17:23Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0234.13143737116.607234847Gilgamesh_1p0.sds
881002012015:06:2112:20:08ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0234.13141342116.6072664106Gilgamesh_1p0.sds
891002112015:06:2112:23:09Gilgamesh 11800.RUN580Vplate 0234.13176373216.6071782201Gilgamesh_1p0.sds
901002212015:06:2112:55:15Gilgamesh 11800.RUN580Vplate 0234.13197546416.607480923Gilgamesh_1p0.sds
911002312015:06:2113:27:22Gilgamesh 11800.RUN580Vplate 0234.13188994316.607610932Gilgamesh_1p0.sds
921002412015:06:2113:59:28Gilgamesh 11800.RUN580Vplate 0234.13212699916.6079118663Gilgamesh_1p0.sds
931002512015:06:2114:34:01Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1309.72727792-5.63901941321Aeneid_2p1.sds
941002612015:06:2114:36:22Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1309.72730257-5.63900487905Aeneid_2p1.sds
951002712015:06:2114:39:04ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1309.727305572-5.63900983922Aeneid_2p1.sds
961002812015:06:2114:42:05Aeneid 21800.RUN580Vplate 1309.728486942-5.63906792696Aeneid_2p1.sds
971002912015:06:2115:14:11Aeneid 21800.RUN580Vplate 1309.728627509-5.63909477861Aeneid_2p1.sds
981003012015:06:2115:46:18Aeneid 21800.RUN580Vplate 1309.728330925-5.63935923909Aeneid_2p1.sds
991003112015:06:2116:19:17Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 0335.913479382-3.43117311487OBrother_2p0.sds
1001003212015:06:2116:21:37Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 0335.913465335-3.43116213914OBrother_2p0.sds
1011003312015:06:2116:24:19ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 0335.91350215-3.4311657484OBrother_2p0.sds
1021003412015:06:2116:27:20OBrother 21500.RUN580Vplate 0335.914543387-3.43150389118OBrother_2p0.sds
1031003512015:06:2116:54:27OBrother 21500.RUN580Vplate 0335.914518412-3.43168397511OBrother_2p0.sds
1041003612015:06:2117:21:33OBrother 21500.RUN580Vplate 0335.914359754-3.43171054732OBrother_2p0.sds
1051003712015:06:2117:48:39OBrother 21500.RUN580Vplate 0335.914497687-3.43192874359OBrother_2p0.sds
1061003812015:06:2118:17:00AnaK 21500.RUN580Vplate 1354.1324670660.298073104396AnaK_2p1.sds
1071003912015:06:2118:44:06AnaK 21500.RUN580Vplate 1354.1325166190.297872376962AnaK_2p1.sds
1081004012015:06:2119:11:13AnaK 21500.RUN580Vplate 1354.132541120.297722913077AnaK_2p1.sds
1091004112015:06:2119:38:19AnaK 21200.RUN580Vplate 1354.1324407660.297828834271AnaK_2p1.sds
1101004212015:06:2120:01:20Fibre Flat Field - Quartz_75_A4.FLAT580Vplate 1354.1330500360.297820663416AnaK_2p1.sds
1111004312015:06:2120:03:39Fibre Flat Field - Quartz_75_A25.FLAT580Vplate 1354.1329772920.297821236181AnaK_2p1.sds
1121004412015:06:2120:06:26ARC - FeAr_1 FeAr_2 CuAr_1 CuAr_2 CuHe_1 CuNe_145.ARC580Vplate 1354.1330079420.297825474661AnaK_2p1.sds
1131004512015:06:2120:10:16Bias Frame0.BIAS580Vplate 01.13921332451-31.3644276362NONE
1141004612015:06:2120:12:24Bias Frame0.BIAS580Vplate 01.67256545505-31.3643351659NONE
1151004712015:06:2120:14:30Bias Frame0.BIAS580Vplate 02.20079718235-31.3642514643NONE
1161004812015:06:2120:16:36Bias Frame0.BIAS580Vplate 02.72921229738-31.3641929572NONE
1171004912015:06:2120:18:43Bias Frame0.BIAS580Vplate 03.25846386503-31.3641023457NONE
1181005012015:06:2120:21:03Dark Frame0.DARK580Vplate 03.84628622222-31.3640093402NONE
1191005112015:06:2120:53:10Dark Frame0.DARK580Vplate 011.9019640941-31.3618466022NONE
1201005212015:06:2121:25:16Dark Frame0.DARK580Vplate 019.9573121464-31.3579995087NONE
1211005312015:06:2121:57:22Dark Frame0.DARK580Vplate 028.0130613221-31.3525110111NONE
1221005412015:06:2122:29:28Dark Frame0.DARK580Vplate 036.0684584775-31.3455156205NONE