In [1]:
# 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 [2]:
import wiyn
import mmthecto
import magellan
import targeting
import hosts

from astropy import coordinates as coords
from astropy import units as u
from astropy.io import ascii

In [5]:
h1 = hosts.hamlet
h2 = hosts.NSAHost(165153)
h3 = hosts.NSAHost(165980)
h4 = hosts.NSAHost(63326)

In [12]:
wiyn.imagelist_fibers('hydra_targets/Hamlet_1.hydra', 'fop')


Out[12]:
'name ra dec\n             fop 96   228.3099125 41.8046361111\n            fop 120   228.461075 42.0242583333\n            fop 137   228.576770833 42.1713166667\n            fop 157   228.6785 42.0444638889\n            fop 165   228.704920833 42.0367\n            fop 167   228.725125 42.0130583333\n            fop 174   228.758504167 42.0428416667'

Hamlet


In [13]:
print h1.distmod, h1.projected_to_physical(30*u.arcmin)


32.8172356036 319.370275292 kpc

In [14]:
h1.usnob_environs_query(dl=True)


Downloading USNO-B to catalogs/Hamlet_usnob.dat
Unknown Size
1090 kB downloaded

In [25]:
h1.sdss_environs_query(dl=True, inclphotzs=True)


File catalogs/Hamlet_sdss.dat exists - not downloading anything.

In [30]:
best = fits.getdata('hydra_targets/bestbright_' + str(h1.nsaid) + '.fits')
wiyn.construct_master_catalog(h1, targetcat=best,fnout='hydra_targets/Hamlet_best.cat');


36 objects
41 FOPS
USNO/SDSS offsets: -0.0648733698313 0.241753205346
Constucting catalog in hydra_targets/Hamlet_best.cat

In [39]:
wiyn.imagelist_from_master('hydra_targets/Hamlet_best.cat', 'fop')
#use this to clean out bad FOPS


Out[39]:
'name ra dec\nUSNO1320-0301967      228.725370833 42.0131222222\nUSNO1322-0314356      228.9001 42.2454055556\nUSNO1322-0313684      228.185745833 42.2319166667\nUSNO1320-0301326      228.1731 42.0775388889\nUSNO1318-0288529      228.551116667 41.8240277778\nUSNO1316-0268523      228.612 41.6882916667\nUSNO1324-0316676      228.561479167 42.402325\nUSNO1319-0295272      228.806454167 41.9011805556\nUSNO1319-0294587      228.168991667 41.9041055556\nUSNO1315-0258310      228.847416667 41.5962861111\nUSNO1316-0268653      228.806829167 41.6792\nUSNO1319-0294658      228.300375 41.9259944444\nUSNO1317-0283638      228.9849 41.7229527778\nUSNO1317-0283722      229.1287 41.752575\nUSNO1318-0288611      228.610145833 41.8526944444\nUSNO1320-0302418      229.264745833 42.0239027778\nUSNO1324-0316771      228.660041667 42.4811138889\nUSNO1319-0295400      228.9639875 41.9796916667\nUSNO1320-0301912      228.678516667 42.0443972222\nUSNO1323-0318347      228.530916667 42.3884888889\nUSNO1323-0318196      228.432095833 42.3615805556\nUSNO1323-0318767      229.026470833 42.3391583333\nUSNO1319-0295487      229.095741667 41.9773333333\nUSNO1316-0268584      228.7030375 41.6496527778\nUSNO1319-0294696      228.357808333 41.9759694444\nUSNO1316-0268439      228.494329167 41.6729472222'

In [40]:
wiyn.generate_ast_file('hydra_targets/{h1.name}_best.cat'.format(**locals()), lst=18,texp=2, scpname='turtle')
# only make one config for this because there's only 30-some targets


Using existing catalogs [] for removing from master
Writing to hydra_targets/Hamlet_best_1.ast
SCP commands:
scp hydra_targets/Hamlet_best_1.ast turtle:/home/ejt26/hydra_simulator/whydra
scp "turtle:/home/ejt26/hydra_simulator/whydra/Hamlet_best_1.hydra" hydra_targets

In [102]:
#check
wiyn.imagelist_fibers('hydra_targets/Hamlet_best_1.hydra','target')


Out[102]:
'name ra dec\nNSA166035             228.763516667 42.0498555556\nJ151512.86+420518.5   228.8036 42.088475\nJ151423.82+420103.4   228.599270833 42.0176361111\nJ151420.26+420322.9   228.584441667 42.056375\nJ151617.22+421235.1   229.0717875 42.20975\nJ151328.60+415522.0   228.369195833 41.9227916667\nJ151329.54+421908.8   228.3731 42.3191361111\nJ151334.45+421544.4   228.393575 42.2623555556\nJ151552.20+420636.0   228.967516667 42.1100166667\nJ151434.63+415523.8   228.644295833 41.9232888889\nJ151430.31+414213.4   228.626291667 41.7037416667\nJ151257.54+420721.6   228.239783333 42.1226722222\nJ151336.40+421312.2   228.401675 42.2200583333\nJ151601.93+415745.2   229.008075 41.9625583333\nJ151643.99+420822.0   229.183291667 42.1394638889\nJ151414.85+421604.3   228.561879167 42.2678638889\nJ151558.45+415317.6   228.993554167 41.8882305556\nJ151522.05+415035.0   228.841875 41.843075\nJ151259.33+415346.6   228.247241667 41.8962805556\nJ151529.30+421358.0   228.8721125 42.2327888889\nJ151515.11+413847.9   228.812995833 41.6466416667\nJ151520.10+413839.8   228.833775 41.6444027778\nJ151326.76+415702.1   228.361508333 41.9506055556\nJ151347.95+422043.7   228.449829167 42.3454972222\nJ151517.81+420313.4   228.8242125 42.0537222222\nJ151553.13+422444.3   228.971375 42.4123055556\nJ151646.63+415137.6   229.194295833 41.8604583333\nJ151252.69+420435.2   228.219579167 42.0764555556\nJ151621.72+422300.1   229.0905 42.3833638889\nJ151457.07+422812.2   228.737829167 42.470075\nJ151623.24+421315.7   229.096866667 42.22105\nJ151610.97+422119.7   229.045745833 42.3554833333\nJ151702.46+420405.2   229.260258333 42.0681333333\nJ151641.66+422322.9   229.173616667 42.3897194444'

In [119]:
print h1.coords
h1.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{0}_best.cat'.format(h1.name),'target'),
                     scale=40*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)


<ICRS Coordinate: ra=228.763517049 deg, dec=42.0498566142 deg>
Out[119]:

165153


In [43]:
print h2.distmod, h2.projected_to_physical(30*u.arcmin)


32.4361587361 267.965645631 kpc

In [44]:
h2.usnob_environs_query(dl=True)


Downloading USNO-B to catalogs/NSA165153_usnob.dat
Unknown Size
1470 kB downloaded

In [45]:
h2.sdss_environs_query(dl=True, inclphotzs=True)


File catalogs/NSA165153_sdss.dat exists - not downloading anything.

In [106]:
best = fits.getdata('hydra_targets/bestbright_' + str(h2.nsaid) + '.fits')
wiyn.construct_master_catalog(h2, targetcat=best,fnout='hydra_targets/{0}_best.cat'.format(h2.name));


111 objects
67 FOPS
USNO/SDSS offsets: 0.0686339999618 0.255275999993
Constucting catalog in hydra_targets/NSA165153_best2.cat

In [58]:
wiyn.imagelist_from_master('hydra_targets/{0}_best.cat'.format(h2.name), 'fop')
#use this to clean out bad FOPS


Out[58]:
'name ra dec\nUSNO1475-0290729      218.432916667 57.5755388889\nUSNO1479-0285196      217.6274 57.92455\nUSNO1477-0300008      217.023604167 57.7766916667\nUSNO1476-0297380      218.654370833 57.6060194444\nUSNO1477-0301334      218.760295833 57.7337666667\nUSNO1478-0295659      217.998725 57.8415472222\nUSNO1481-0271552      217.6991 58.103075\nUSNO1476-0297012      218.192725 57.6751972222\nUSNO1477-0300521      217.6261625 57.7169888889\nUSNO1476-0296188      217.272304167 57.6431305556\nUSNO1474-0290203      218.412495833 57.4969166667\nUSNO1483-0246198      218.319158333 58.3544722222\nUSNO1483-0246142      218.147795833 58.3556444444\nUSNO1484-0229492      218.2522 58.4080333333\nUSNO1476-0296765      217.918433333 57.6311916667\nUSNO1483-0245962      217.677679167 58.3387666667\nUSNO1477-0300002      217.016604167 57.7941138889\nUSNO1474-0289682      217.790529167 57.4158\nUSNO1478-0296211      218.8074625 57.8998777778\nUSNO3866-00743-1      218.7738625 58.0009722222\nUSNO1475-0290033      217.647225 57.5281666667\nUSNO1478-0295168      217.326754167 57.84585\nUSNO1480-0274547      217.3811375 58.0426361111\nUSNO1478-0296083      218.6636125 57.804575\nUSNO1482-0263309      218.430245833 58.2596166667\nUSNO1475-0290508      218.230075 57.5944555556\nUSNO1482-0263465      218.681404167 58.2337611111\nUSNO1476-0296916      218.067845833 57.6029027778\nUSNO1478-0295695      218.052170833 57.8967055556\nUSNO1478-0295857      218.267933333 57.8998583333\nUSNO1479-0284938      217.103995833 57.9909388889\nUSNO1479-0284889      217.02575 57.9167277778\nUSNO1482-0262932      217.550379167 58.2351861111\nUSNO1476-0297300      218.547691667 57.6268361111\nUSNO1476-0297147      218.374754167 57.6350055556\nUSNO1480-0275164      218.621095833 58.0828972222\nUSNO1479-0285830      218.7076125 57.9687888889\nUSNO1479-0285167      217.540120833 57.9146777778\nUSNO1476-0297378      218.653504167 57.6050388889\nUSNO1483-0246295      218.559179167 58.3436722222\nUSNO1481-0272039      218.904129167 58.1564388889\nUSNO1475-0290407      218.115325 57.5993972222\nUSNO1476-0296641      217.777729167 57.6566833333\nUSNO1483-0245934      217.606495833 58.3488305556\nUSNO1480-0274654      217.5980875 58.0998888889\nUSNO1483-0245924      217.5637 58.3541833333\nUSNO1479-0285030      217.287954167 57.9251944444\nUSNO1475-0290465      218.178054167 57.5295166667\nUSNO1479-0285348      217.881854167 57.9314166667\nUSNO1479-0285629      218.3329 57.9501527778'

In [110]:
wiyn.generate_ast_file('hydra_targets/{0}_best.cat'.format(h2.name), lst=18,texp=2, scpname='turtle')
# only make one config for this because there's only 30-some targets


Using existing catalogs [] for removing from master
Writing to hydra_targets/NSA165153_best_1.ast
SCP commands:
scp hydra_targets/NSA165153_best_1.ast turtle:/home/ejt26/hydra_simulator/whydra
scp "turtle:/home/ejt26/hydra_simulator/whydra/NSA165153_best_1.hydra" hydra_targets

In [118]:
print h2.coords
h2.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{0}_best.cat'.format(h2.name),'target'),
                     scale=40*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)


<ICRS Coordinate: ra=218.023327874 deg, dec=57.9214670755 deg>
Out[118]:

165980


In [75]:
print h3.distmod, h3.projected_to_physical(30*u.arcmin)


32.803676309 317.382249338 kpc

In [76]:
h3.usnob_environs_query(dl=True)


File catalogs/NSA165980_usnob.dat exists - not downloading anything.

In [77]:
h3.sdss_environs_query(dl=True, inclphotzs=True)


File catalogs/NSA165980_sdss.dat exists - not downloading anything.

In [107]:
best = fits.getdata('hydra_targets/bestbright_' + str(h3.nsaid) + '.fits')
wiyn.construct_master_catalog(h3, targetcat=best,fnout='hydra_targets/{0}_best.cat'.format(h3.name), usnosdssoffsettol = .75);


34 objects
55 FOPS
USNO/SDSS offsets: -0.328209206424 0.262344660312
Constucting catalog in hydra_targets/NSA165980_best2.cat

In [86]:
wiyn.imagelist_from_master('hydra_targets/{0}_best.cat'.format(h3.name), 'fop')
#use this to clean out bad FOPS


Out[86]:
'name ra dec\nUSNO1501-0223235      227.999158333 60.1384972222\nUSNO1494-0223033      228.485604167 59.4659277778\nUSNO1501-0223394      228.345533333 60.1659916667\nUSNO1501-0223099      227.5772875 60.1766222222\nUSNO1497-0226192      228.27185 59.7541222222\nUSNO1495-0224244      228.341216667 59.5284305556\nUSNO1495-0224242      228.337104167 59.5005916667\nUSNO1495-0224207      228.247979167 59.5270611111\nUSNO1497-0226290      228.535616667 59.7975277778\nUSNO1495-0224087      227.939616667 59.523675\nUSNO1494-0222987      228.350045833 59.4735388889\nUSNO1501-0223416      228.437308333 60.1783083333\nUSNO1495-0224181      228.173633333 59.53055\nUSNO1500-0222044      228.391108333 60.02905\nUSNO1493-0224540      227.8694125 59.3905055556\nUSNO1496-0224650      227.129091667 59.6830111111\nUSNO1495-0224272      228.436754167 59.5699833333\nUSNO1501-0223142      227.715825 60.1609472222\nUSNO1498-0225836      228.057825 59.8293416667\nUSNO1494-0222662      227.531608333 59.4434916667\nUSNO1495-0223957      227.603958333 59.5148555556\nUSNO1498-0225914      228.236120833 59.8483527778\nUSNO1499-0223318      227.572208333 59.9854277778\nUSNO1501-0223222      227.982733333 60.1678138889\nUSNO1495-0224208      228.249208333 59.5593944444\nUSNO1498-0225992      228.464854167 59.8786722222\nUSNO1496-0224694      227.204683333 59.6149611111\nUSNO1498-0225745      227.9070375 59.8766388889\nUSNO1495-0223813      227.234741667 59.5076222222\nUSNO1499-0223374      227.6867 59.9752\nUSNO1499-0223263      227.432204167 59.9630305556\nUSNO4180-00165-1      227.542441667 60.047325\nUSNO1495-0223908      227.492875 59.5423027778\nUSNO1499-0223237      227.394670833 59.9438277778\nUSNO1494-0222892      228.092795833 59.4013805556\nUSNO1497-0225741      227.252054167 59.7011388889\nUSNO1495-0223891      227.461175 59.5560222222\nUSNO1499-0223354      227.6288375 59.9177527778\nUSNO1498-0226016      228.529570833 59.8456916667\nUSNO1500-0221979      228.2465625 60.06295\nUSNO1501-0223345      228.219229167 60.1274\nUSNO1500-0221633      227.2725 60.0954333333'

In [112]:
wiyn.generate_ast_file('hydra_targets/{0}_best.cat'.format(h3.name), lst=18,texp=2, scpname='turtle')
# only make one config for this because there's only 30-some targets


Using existing catalogs [] for removing from master
Writing to hydra_targets/NSA165980_best_1.ast
SCP commands:
scp hydra_targets/NSA165980_best_1.ast turtle:/home/ejt26/hydra_simulator/whydra
scp "turtle:/home/ejt26/hydra_simulator/whydra/NSA165980_best_1.hydra" hydra_targets

In [116]:
print h3.coords
h3.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{0}_best.cat'.format(h3.name),'target'),
                     scale=40*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)


<ICRS Coordinate: ra=227.920600638 deg, dec=59.8089907583 deg>
Out[116]:

63326


In [88]:
print h4.distmod, h4.projected_to_physical(30*u.arcmin)


33.066608657 358.235897983 kpc

In [89]:
h4.usnob_environs_query(dl=True)


File catalogs/NSA63326_usnob.dat exists - not downloading anything.

In [95]:
h4.sdss_environs_query(dl=True, inclphotzs=True)


File catalogs/NSA63326_sdss.dat exists - not downloading anything.

In [108]:
best = fits.getdata('hydra_targets/bestbright_' + str(h4.nsaid) + '.fits')
wiyn.construct_master_catalog(h4, targetcat=best,fnout='hydra_targets/{0}_best.cat'.format(h4.name));


64 objects
47 FOPS
USNO/SDSS offsets: 0.0741499920025 0.217653298917
Constucting catalog in hydra_targets/NSA63326_best2.cat

In [99]:
wiyn.imagelist_from_master('hydra_targets/{0}_best.cat'.format(h4.name), 'fop')
#use this to clean out bad FOPS


Out[99]:
'name ra dec\nUSNO1118-0297028      248.3856 21.8785777778\nUSNO1112-0259406      248.348191667 21.2922833333\nUSNO1115-0260431      248.3851875 21.5873\nUSNO1114-0257615      248.1906125 21.4085805556\nUSNO1115-0260445      248.399766667 21.5829888889\nUSNO1113-0259442      248.651608333 21.3741694444\nUSNO1111-0258845      248.437404167 21.1783277778\nUSNO1113-0259119      248.324333333 21.3054722222\nUSNO1111-0259237      248.837795833 21.1959027778\nUSNO1112-0260011      248.906620833 21.2317416667\nUSNO1112-0259724      248.633204167 21.2653694444\nUSNO1114-0257644      248.224291667 21.4911944444\nUSNO1114-0257978      248.601108333 21.4102833333\nUSNO1113-0259743      248.911341667 21.3796638889\nUSNO1115-0260409      248.368883333 21.5904527778\nUSNO1112-0259901      248.790858333 21.2153111111\nUSNO1116-0271849      248.6797 21.6297361111\nUSNO1113-0259045      248.2636125 21.3680138889\nUSNO1118-0296977      248.345058333 21.8396361111\nUSNO1114-0257769      248.364808333 21.4040083333\nUSNO1113-0259701      248.881620833 21.3632\nUSNO1115-0260345      248.3050875 21.5504444444\nUSNO1113-0259576      248.763016667 21.3532888889\nUSNO1116-0272063      248.880075 21.6188833333\nUSNO1116-0271358      248.170470833 21.6375833333\nUSNO1116-0271490      248.301483333 21.6133888889\nUSNO1116-0271675      248.482216667 21.6186\nUSNO1114-0258017      248.639995833 21.4801555556\nUSNO1116-0272069      248.884595833 21.6449083333\nUSNO1112-0259938      248.826929167 21.2853888889\nUSNO1119-0293084      248.620466667 21.9066833333\nUSNO1112-0259588      248.519658333 21.25255\nUSNO1114-0257848      248.458520833 21.4009944444\nUSNO1113-0259348      248.558966667 21.3101638889'

In [115]:
wiyn.generate_ast_file('hydra_targets/{0}_best.cat'.format(h4.name), lst=18,texp=2, scpname='turtle')
# only make one config for this because there's only 30-some targets


Using existing catalogs [] for removing from master
Writing to hydra_targets/NSA63326_best_1.ast
SCP commands:
scp hydra_targets/NSA63326_best_1.ast turtle:/home/ejt26/hydra_simulator/whydra
scp "turtle:/home/ejt26/hydra_simulator/whydra/NSA63326_best_1.hydra" hydra_targets

In [117]:
print h4.coords
h4.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{0}_best.cat'.format(h4.name),'target'),
                     scale=40*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)


<ICRS Coordinate: ra=248.606166185 deg, dec=21.5408969471 deg>
Out[117]:

In [ ]: