Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev with main branch to add back in stellar variability and EXOTIC fixes #1244

Open
wants to merge 53 commits into
base: main
Choose a base branch
from

Conversation

rzellem
Copy link
Owner

@rzellem rzellem commented Feb 2, 2024

No description provided.

tamimfatahi and others added 30 commits December 1, 2023 13:55
… even if they don't match the filter of the observation if needed. Also, some QOL changes.
…etting correctly predicted results, but will continue comparing this version and the previous version on main 3.3.0.
…-enter comp stars and check for variability again. Closes #1094
…s. Not entirely complete. Organized some code a bit for clarity.
…ng warning font if a variable star is detected as one of the user-entered comp stars.
Issue 1235: Changing fitting prior from a/Rs to inc
…so, fixed bug regarding how time is accessed from residual results.
…rtions of OOT data being masked, causing multiple sections to be appear.
… variability code. Also, reorganizing for clarity.
Issue 1229: Bug for removing variable stars
Issue 1164: Printing variable star name and coordinates
tamimfatahi
tamimfatahi previously approved these changes Feb 2, 2024
exotic/exotic.py Outdated
def vsp_query(file, axis, obs_filter, img_scale, maglimit=14):
stars_count = 0
comp_stars = {}
def vsp_query(file, axis, obs_filter, img_scale, user_comp_stars, maglimit=14):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding an arg here breaks the API. We may want to up the version by a major number (or to mid-minor, e.g. 3.5.x? to indicate that) or add it to the end of the method arguments.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #1248

return True
return False
except Exception:
return False


def check_for_variable_stars(ra_wcs, dec_wcs, comp_ra_dec, comp_stars):
for i, comp_star in enumerate(comp_stars[:]):
ra = ra_wcs[int(comp_star[1])][int(comp_star[0])]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If those values don't exist then this method will throw an index exception. Are these exceptions handled by calling methods?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point: defensive programming

def stellar_variability(ref_flux, lmfit, times, comp_stars, id, vsp_comp_stars, vsp_ind, best_comp, save, s_name):
ref_comp = {}
idx_list, vsp_params = [], []
def stellar_variability(fit_lc_refs, fit_lc_best, comp_stars, vsp_comp_stars, vsp_ind, best_comp, save, s_name):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be exception handling here? This comment would apply to other new methods, also.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #1248

exotic/exotic.py Outdated
@@ -1566,7 +1572,7 @@ def realTimeReduce(i, target_name, p_dict, info_dict, ax):
ax.plot(timeList, norm_flux, 'bo')


def fit_lightcurve(times, tFlux, cFlux, airmass, ld, pDict):
def fit_lightcurve(times, jd_times, tFlux, cFlux, airmass, ld, pDict):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comment here re method signature. In this instance it could possibly impact CITISENS as I think this method is called. @pearsonkyle @tamimfatahi Comments?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will at it to the end to resolve this issue. CITISENS won't have any impact if so.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #1248

exotic/exotic.py Show resolved Hide resolved
exotic/exotic.py Show resolved Hide resolved
exotic/inputs.py Outdated Show resolved Hide resolved
exotic/inputs.py Outdated
@@ -507,8 +507,9 @@ def comparison_star_coords(comp_stars, rt_bool):
all(isinstance(star, list) for star in comp_stars):
comp_stars = [star for star in comp_stars if star != []]
elif isinstance(comp_stars, str) and any(str.isdigit(x) for x in comp_stars):
comp_stars = ' '.join(re.sub('\D', ' ', comp_stars).split()).split(' ')
comp_stars = [[int(comp_stars[i]), int(comp_stars[i+1])] for i in range(0, len(comp_stars), 2)]
comp_stars = re.findall(r"[-+]?(?:\d*\.*\d+)", comp_stars)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the non-capturing group, it seems to allow '.'. I was wondering if it was intentional to capture a group starting with a decimal. (Maybe \d+ or \d{1,3}?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may be a little safer: '\d*.?\d+'. (limits to single decimal or none)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #1248

exotic/output_files.py Show resolved Hide resolved
class VSPOutputFiles:
def __init__(self, fit, p_dict, i_dict, vsp_params):
class AIDOutputFiles:
def __init__(self, fit, p_dict, i_dict, auid, chart_id, vsp_params):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method signature changes ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name change sounds appropriate. Options are to increase major version but that's a bit dramatic. If we version up to 3.5.0 then it indicates itself a semi-major change. So, set version up to 3.5.0.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in PR #1248

@jpl-jengelke jpl-jengelke changed the title Merge dev with main branch to add back in stellar variability and EXOTIC fixes DRAFT Merge dev with main branch to add back in stellar variability and EXOTIC fixes Mar 21, 2024
@jpl-jengelke jpl-jengelke marked this pull request as draft March 21, 2024 05:38
@rzellem
Copy link
Owner Author

rzellem commented Mar 21, 2024

@jpl-jengelke and @tamimfatahi - please let me know when you're ready for me to approve this PR

…tries, updated linear fitter on how it checks for given labels, modified exotic.py for to take into account API handling. Version bump to 3.5.0 to indicate minor/major release of method signature changes
@rzellem
Copy link
Owner Author

rzellem commented Mar 26, 2024

@jpl-jengelke and @tamimfatahi - please let me know when you're ready for me to approve this PR

@tamimfatahi tamimfatahi marked this pull request as ready for review April 25, 2024 20:19
@tamimfatahi tamimfatahi changed the title DRAFT Merge dev with main branch to add back in stellar variability and EXOTIC fixes Merge dev with main branch to add back in stellar variability and EXOTIC fixes May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants