Пример #1
0
def find_20_50_day_periodics_and_save_to_file():
	blp = best_long_period(long_periodic_selector(maxvars_spread_per, max_period=100), max_period=100)
	ukvar_blp = blp.where(np.in1d(blp.SOURCEID, ukvar_spread.SOURCEID))

	print "There are {0} stars with nominal periods between 50 and 100.".format(len(ukvar_blp))

	for sid, period in zip(ukvar_blp.SOURCEID, ukvar_blp.best_period):
	    sd = OrionStarData(variables_photometry, sid, ukvar_spread.UKvar_ID[ukvar_spread.SOURCEID==sid][0])
	    fig = lc_and_phase_and_colors(sd, period)
	    fig.ax_j_phase.set_title("ONCvar {}".format(sd.name))
	    fig.ax_j_lc.set_title(sid)
	    fig.savefig("{0}/{1}/{2}.png".format(path, "50_100", sd.name))
	    plt.close()

	blp2 = best_long_period(long_periodic_selector(maxvars_spread_per, min_period=20, max_period=50), min_period=20, max_period=50)
	ukvar_blp2 = blp2.where(np.in1d(blp2.SOURCEID, ukvar_spread.SOURCEID))

	print "There are {0} stars with nominal periods between 20 and 50.".format(len(ukvar_blp2))

	for sid, period in zip(ukvar_blp2.SOURCEID, ukvar_blp2.best_period):
	    sd = OrionStarData(variables_photometry, sid, ukvar_spread.UKvar_ID[ukvar_spread.SOURCEID==sid][0])
	    fig = lc_and_phase_and_colors(sd, period)
	    fig.ax_j_phase.set_title("ONCvar {}".format(sd.name))
	    fig.ax_j_lc.set_title(sid)
	    fig.savefig("{0}/{1}/{2}.png".format(path, "20_50", sd.name))
	    plt.close()

	blp3 = best_long_period(long_periodic_selector(maxvars_spread_per, min_period=10, max_period=20), min_period=10, max_period=20)
	ukvar_blp3 = blp3.where(np.in1d(blp3.SOURCEID, ukvar_spread.SOURCEID))

	print "There are {0} stars with nominal periods between 10 and 20.".format(len(ukvar_blp3))

	for sid, period in zip(ukvar_blp3.SOURCEID, ukvar_blp3.best_period):
	    sd = OrionStarData(variables_photometry, sid, ukvar_spread.UKvar_ID[ukvar_spread.SOURCEID==sid][0])
	    fig = lc_and_phase_and_colors(sd, period)
	    fig.ax_j_phase.set_title("ONCvar {}".format(sd.name))
	    fig.ax_j_lc.set_title(sid)
	    fig.savefig("{0}/{1}/{2}.png".format(path, "10_20", sd.name))
	    plt.close()
Пример #2
0
def find_min_max_day_periodics_and_write(min_period=2, max_period=10, path=path2):
	blp = best_long_period(long_periodic_selector(maxvars_spread_per, min_period=min_period, max_period=max_period),
	                       min_period=min_period, max_period=max_period)
	ukvar_blp = blp.where(np.in1d(blp.SOURCEID, ukvar_spread.SOURCEID))

	print "There are {0} stars with nominal periods between {1} and {2}.".format(len(ukvar_blp), min_period, max_period)

	for sid, period in zip(ukvar_blp.SOURCEID, ukvar_blp.best_period):
	    sd = OrionStarData(variables_photometry, sid, ukvar_spread.UKvar_ID[ukvar_spread.SOURCEID==sid][0])
	    fig = lc_and_phase_and_colors(sd, period)
	    fig.ax_j_phase.set_title("ONCvar {} ({})".format(sd.name, megeath_class_column[ukvar_spread.SOURCEID==sid][0]))
	    fig.ax_j_lc.set_title("{0}, Q={1}".format(sid, int((ukvar_spread.autovar+ukvar_spread.strict)[[ukvar_spread.SOURCEID==sid]][0])))
	    fig.savefig("{0}/{1}_{2}/{3}.png".format(path, min_period, max_period, sd.name))
	    plt.close()
    44508746124658: 15.198723 / 24,
    44508746127865: 2.045,
    44508746128156: 4.035187,
    44508746093223: 4.155218 / 24,  # pulsating stars
    44508746113922: 13.702932 / 24,
    44508746121910: 12.926229 / 24,
    44508746105255: 0.213672930845,
}

# assert that all the overrides are in maxvars!
for key in period_override.keys():
    assert key in maxvars.SOURCEID

periodics = ps.best_long_period(ps.long_periodic_selector(
    maxvars_spread_per,
    min_period=2,
    max_period=75,
    period_override=period_override),
                                min_period=2,
                                max_period=75,
                                period_override=period_override)
periodics.sort('RA')

maxvars_periodics = maxvars.where(np.in1d(maxvars.SOURCEID,
                                          periodics.SOURCEID))

autovars_true_periodics = autovars_true.where(
    np.in1d(autovars_true.SOURCEID, periodics.SOURCEID))

autovars_strict_periodics = autovars_strict.where(
    np.in1d(autovars_strict.SOURCEID, periodics.SOURCEID))
    44508746120939 : 3.154922,
    44508746124658 : 15.198723 / 24,
    44508746127865 : 2.045,
    44508746128156 : 4.035187,
    44508746093223 : 4.155218 / 24, # pulsating stars
    44508746113922 : 13.702932 / 24,
    44508746121910 : 12.926229 / 24,
    44508746105255 : 0.213672930845,
}

# assert that all the overrides are in maxvars!
for key in period_override.keys():
    assert key in maxvars.SOURCEID

periodics = ps.best_long_period(
    ps.long_periodic_selector(maxvars_spread_per, min_period=2, max_period=75, period_override=period_override), 
    min_period=2, max_period=75, period_override=period_override)
periodics.sort('RA')

maxvars_periodics = maxvars.where( 
    np.in1d(maxvars.SOURCEID, periodics.SOURCEID) )

autovars_true_periodics = autovars_true.where( 
    np.in1d(autovars_true.SOURCEID, periodics.SOURCEID) )

autovars_strict_periodics = autovars_strict.where(
    np.in1d(autovars_strict.SOURCEID, periodics.SOURCEID) )


c_print( "" )
c_print( "Number of possible variables with detected periods: %d" % len(maxvars_periodics) )