In [1]:
cd ..


/Users/phil/research/TP-AGBcalib/code/TPAGB-calib

In [2]:
import ResolvedStellarPops as rsp
import galaxy_tests
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [3]:
pdb


Automatic pdb calling has been turned ON

In [4]:
from TPAGBparams import snap_src
match_zc_sfh = snap_src + '/data/sfh_parsec/templates/ddo71/ddo71.zc.sfh'
cmd_file = 'cmd_input_parsecCAF09_S12.dat'
gal_inp = snap_src + '/input/input_DDO71.dat'
galaxy_input = snap_src + '/data/sfh_parsec/templates/ddo71/triinput_ddo71.dat'
fake_files = [snap_src + '/data/fakes/9884_DDO71_F606W_F814W_gst.fake.fits.matchfake', 
              snap_src + '/data/fakes/11719_DDO71_IR_F110W_F160W_gst.matchfake']
tri_output = snap_src + '/data/sfh_parsec/templates/ddo71/mc/inputs/output_ddo71_parseccaf09_s12.dat'

In [21]:
#reload(rsp.TrilegalUtils)
reload(rsp.Galaxies)
reload(galaxy_tests)


Out[21]:
<module 'galaxy_tests' from 'galaxy_tests.py'>

In [5]:
vSFH = galaxy_tests.VarySFHs(galaxy_input, match_zc_sfh)

In [19]:
vSFH.vary_the_SFH(cmd_file, make_many_kw={'nsfhs': 1})


Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
Warning: no uncertainties
wrote /Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/triinput_ddo7100.dat
code_2.2/main -f cmd_input_parsecCAF09_S12.dat -a -l /Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/triinput_ddo7100.dat /Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/output_ddo71_parseccaf09_s12.dat
0.0774980330448 0.0812809600223
wrote <open file '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_opt_lf.dat', mode 'a' at 0x10f65bc00>, <open file '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_ir_lf.dat', mode 'a' at 0x10f65bdb0>
wrote <open file '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_narratio.dat', mode 'a' at 0x10e051a50>
TRILEGAL was terminated successfully

In [17]:
vSFH.gather_results(tri_output)


0.0924515360456 0.0884451867598
wrote <open file '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_opt_lf.dat', mode 'a' at 0x10f65bdb0>, <open file '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_ir_lf.dat', mode 'a' at 0x10e051a50>
wrote <open file '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_narratio.dat', mode 'a' at 0x10e051ae0>

In [14]:
opt_lf_file = '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_opt_lf.dat'
ir_lf_file = '/Users/phil/research/TP-AGBcalib/SNAP/data/sfh_parsec/templates/ddo71/mc/inputs/ddo71_ir_lf.dat'

In [20]:
vSFH.plot_lf_file(opt_lf_file, ir_lf_file)


Out[20]:
array([<matplotlib.axes.AxesSubplot object at 0x10f705cd0>,
       <matplotlib.axes.AxesSubplot object at 0x10f721c90>], dtype=object)

In [67]:



Out[67]:
[<matplotlib.lines.Line2D at 0x1151cee50>]

In [50]:
reload(galaxy_tests)
ags = galaxy_tests.AncientGalaxies()

In [51]:
ags.write_trgb_table()


opt
looks like no IR fits table
ir
wrote /Users/phil/research/TP-AGBcalib/SNAP/tables/ancients_galaxies_2_1.5_mag_below.dat