Skip to content

Commit

Permalink
adler cli updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jrob93 committed May 14, 2024
1 parent fd053ef commit 075994e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/adler/adler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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.")
Expand Down

0 comments on commit 075994e

Please sign in to comment.