In [ ]:
# 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 [1]:
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 [2]:
h1 = hosts.beowulf
h2 = hosts.starwars
In [5]:
print h1.distmod,h1.projected_to_physical(30*u.arcmin)
In [6]:
h1.usnob_environs_query(dl=True)
In [7]:
h1.sdss_environs_query(dl=True, inclphotzs=True)
In [8]:
fullcat = h1.get_sdss_catalog()
In [95]:
# a master catalog already exists from Feb, with bad fops removed.
# need to remove these already observed, or those overly-clustered
tomatch = ascii.read('hydra_targets/Beowulf_successful_premar2014.dat')
gotzcoos = coords.ICRS(tomatch['RA']*u.deg, tomatch['DEC']*u.deg)
removed, reason = wiyn.update_master_catalog('hydra_targets/{h1.name}.cat'.format(**locals()),
'hydra_targets/{h1.name}_take2.cat'.format(**locals()),
consolidategrps=None, removecoords=gotzcoos)
In [96]:
#only useful if consolidategrps above is not None
removedduetogrp = [a for a,b in zip(removed, reason) if b!='matched']
targeting.sampled_imagelist([coords.Angle(line.split()[2], u.hourangle).deg for line in removedduetogrp],
[coords.Angle(line.split()[3], u.deg).deg for line in removedduetogrp]);
In [ ]:
wiyn.imagelist_from_master('hydra_targets/{h1.name}_take2.cat'.format(**locals()),'target')
In [114]:
h1.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{h1.name}.cat'.format(**locals()),'target'),
scale=30*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)
#use this with the next two to figure out what to manually remove because it's the same object twice
Out[114]:
In [113]:
h1.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{h1.name}_take2.cat'.format(**locals()),'target'),
scale=30*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)
#use this with the previous and next to figure out what to manually remove because it's the same object twice
Out[113]:
In [122]:
coo1 = coords.ICRS(136.35975*u.deg, 25.55069*u.deg)
ang1 = 1*u.arcmin
print wiyn.imagelist_from_master('hydra_targets/{h1.name}_take2.cat'.format(**locals()),'target',nearloc=(coo1, ang1))
coo2 = coords.ICRS(136.57173*u.deg, 25.58107*u.deg)
ang2 = 30*u.arcsec
print wiyn.imagelist_from_master('hydra_targets/{h1.name}_take2.cat'.format(**locals()),'target',nearloc=(coo2, ang2))
#use these with the previous two to figure out what to manually remove because it's the same object twice
In [160]:
#manually deleted these from hydra_targets/Beowulf_take2.cat to yield
h1.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{h1.name}_take2.cat'.format(**locals()),'target'),
scale=30*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)
Out[160]:
In [126]:
#repeat this as much as necessary to get all configs, running do_whydra on turtle each time
#NOTE: use 20 fibers, not default: do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h1.name}_take2.cat'.format(**locals()),
lst=9,texp=2, faintmagcut=20, scpname='turtle')
In [127]:
#repeat this as much as necessary to get all configs, running do_whydra on turtle each time
#NOTE: use 20 fibers, not default: do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h1.name}_take2.cat'.format(**locals()),
lst=9,texp=2, faintmagcut=20, scpname='turtle')
In [128]:
#repeat this as much as necessary to get all configs, running do_whydra on turtle each time
#NOTE: use 20 fibers, not default: do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h1.name}_take2.cat'.format(**locals()),
lst=9,texp=2, faintmagcut=20, scpname='turtle')
In [130]:
#repeat this as much as necessary to get all configs, running do_whydra on turtle each time
#NOTE: use 20 fibers, not default: do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h1.name}_take2.cat'.format(**locals()),
lst=9,texp=2, faintmagcut=20, scpname='turtle')
In [131]:
#repeat this as much as necessary to get all configs, running do_whydra on turtle each time
#NOTE: use 20 fibers, not default: do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h1.name}_take2.cat'.format(**locals()),
lst=9,texp=2, faintmagcut=20, scpname='turtle')
In [138]:
wiyn.imagelist_fibers('hydra_targets/Beowulf_take2_1.hydra','target')
wiyn.imagelist_fibers('hydra_targets/Beowulf_take2_2.hydra','target')
wiyn.imagelist_fibers('hydra_targets/Beowulf_take2_3.hydra','target')
wiyn.imagelist_fibers('hydra_targets/Beowulf_take2_4.hydra','target')
wiyn.imagelist_fibers('hydra_targets/Beowulf_take2_5.hydra','target')
Out[138]:
In [132]:
h2.altnames
Out[132]:
In [154]:
# a master catalog already exists from Feb, with bad fops removed.
# need to remove these already observed, or those overly-clustered
tomatch = ascii.read('hydra_targets/StarWars_successful_premar2014.dat')
gotzcoos = coords.ICRS(tomatch['RA']*u.deg, tomatch['DEC']*u.deg)
removed, reason = wiyn.update_master_catalog('hydra_targets/StarWars.cat'.format(**locals()),
'hydra_targets/{h2.name}_take2.cat'.format(**locals()),
consolidategrps=None, removecoords=gotzcoos)
In [148]:
#check for duplicate/shredded targets in *original* master cat
print h2.coords
h2.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/NGC5485.cat'.format(**locals()),'target'),
scale=30*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)
#only one obvious case to NE
Out[148]:
In [155]:
#and cross with post-observe
h2.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{h2.name}_take2.cat'.format(**locals()),'target'),
scale=30*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)
#only two obvious case to NE and NWW
Out[155]:
In [157]:
coo1 = coords.ICRS(211.85401*u.deg, 55.10302*u.deg)
ang1 = 1*u.arcmin
print wiyn.imagelist_from_master('hydra_targets/{h2.name}_take2.cat'.format(**locals()),'target',nearloc=(coo1, ang1))
coo2 = coords.ICRS(211.37293*u.deg, 55.09409*u.deg)
ang2 = 50*u.arcsec
print wiyn.imagelist_from_master('hydra_targets/{h2.name}_take2.cat'.format(**locals()),'target',nearloc=(coo2, ang2))
#use these with the previous two to figure out what to manually remove because it's the same object twice
In [159]:
#manually delete the above from the StarWars_take2 catalog to give:
h2.sdss_image_cutout(targets=wiyn.parse_master('hydra_targets/{h2.name}_take2.cat'.format(**locals()),'target'),
scale=60*u.arcmin, imagesize=(1024, 1024),raoffset=0*u.arcmin)
Out[159]:
In [162]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [163]:
#last one required
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [164]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [165]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [166]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [167]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [168]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [169]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [170]:
#make these with do_hydra, but use *20* sky fibers per target:
# do_whydra -s 20 <fieldname>
wiyn.generate_ast_file('hydra_targets/{h2.name}_take2.cat'.format(**locals()),
lst=11,texp=2, faintmagcut=20, scpname='turtle')
In [172]:
wiyn.generate_wiyn_cache('hydra_targets/mar2014.cachelist',
['hydra_targets/Beowulf_take2*.hydra', 'hydra_targets/StarWars_take2*.hydra'])