def pgram_calc(time, flux, interval, kid, max_psearch_len): ''' Calculate Sine Fitting Periodogram''' # Calculate sine lsq periodogram pmin = 0.1 pmax = interval * max_psearch_len nf = 1000 sinout = gls.sinefit(time, flux, err = None, pmin = pmin, pmax = pmax, nper = nf, \ doplot = False, return_periodogram = True) sine_per = sinout[0] sine_height = max(sinout[5]) # save periodogram t_pg = atpy.Table() t_pg.add_column('period', sinout[4]) t_pg.add_column('pgram', sinout[5]) return t_pg, sine_per, sine_height
def pgram_calc(quarter_pgram, time, flux, interval, kid, max_psearch_len): ''' Calculate Sine Fitting Periodogram''' # Calculate sine lsq periodogram pmin = 0.1 pmax = interval * max_psearch_len nf = 1000 sinout = gls.sinefit(time, flux, err = None, pmin = pmin, pmax = pmax, nper = nf, \ doplot = False, return_periodogram = True) sine_per = sinout[0] sine_height = max(sinout[5]) # save periodogram t_pg = atpy.Table() t_pg.add_column('period', sinout[4]) t_pg.add_column('pgram', sinout[5]) t_pg.write('%s/PDCQ%s_output/dat_files/%s_PGRAM.ipac' % (dir, quarter_pgram, kid), overwrite = True) return t_pg, sine_per, sine_height