From 075994e0e55dc4121b221a88481a81df1f3ace8c Mon Sep 17 00:00:00 2001 From: jrob93 Date: Tue, 14 May 2024 13:42:55 +0000 Subject: [PATCH] adler cli updates --- src/adler/adler.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/adler/adler.py b/src/adler/adler.py index 6829d9e..1890d60 100644 --- a/src/adler/adler.py +++ b/src/adler/adler.py @@ -23,10 +23,11 @@ def runAdler(cli_args): logger.info("Calculating phase curves...") # now let's do some phase curves! - N_pc_fit = 5 # minimum number of data points to fit phase curve + N_pc_fit = 10 # minimum number of data points to fit phase curve # # operate on each filter in turn for filt in planetoid.filter_list: + print("fit {} filter data".format(filt)) # get the filter SSObject metadata @@ -39,7 +40,8 @@ def runAdler(cli_args): model_name="HG12_Pen16", ) print(pc) - print(pc.abs_mag, pc.phase_param) + print(pc.abs_mag) + print(pc.phase_param) # get the filter observations obs = planetoid.observations_in_filter(filt) @@ -50,22 +52,32 @@ def runAdler(cli_args): # when fitting, consider only the previous observations (not tonight's) mjd = obs.midPointMjdTai obs_mask = mjd < int(np.amax(mjd)) + # also drop any past outlying observations? print("total N obs = {}".format(len(mjd))) print("number of past obs = {}".format(sum(obs_mask))) print("number of tonight's obs = {}".format(sum(~obs_mask))) if sum(obs_mask) < N_pc_fit: - # use a simple default HG phase curve model - pc = PhaseCurve(abs_mag=sso.H * u.mag, phase_param=0.15, model_name="HG") + # use an assumed value of G12 until more data is available + pc_fit = PhaseCurve(abs_mag=sso.H * u.mag, phase_param=0.62, model_name="HG12_Pen16") else: # do a simple HG12_Pen16 fit to the past data pc_fit = pc.FitModel(alpha[obs_mask], red_mag[obs_mask], mag_err[obs_mask]) + pc_fit = pc.InitModelSbpy(pc_fit) print(pc_fit) + print(pc_fit.abs_mag) + print(pc_fit.phase_param) # now check if the new observations are outlying + # also check for past observations that are outlying? + + # output results + # flag outlying observations + # output the phase curve model parameters + def main(): parser = argparse.ArgumentParser(description="Runs Adler for select planetoid(s) and given user input.")