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

Fix for case where there is a masked column to aggregate #45

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stellarphot/differential_photometry/aij_rel_fluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def calc_aij_relative_flux(star_data, comp_stars,
# Not sure this is really close enough for a good match...
good = d2d < 1 * u.arcsec


error_column_name = 'noise-aij'
# Calculate comp star counts for each time

Expand All @@ -72,8 +71,11 @@ def calc_aij_relative_flux(star_data, comp_stars,
# np.isnan(comp_fluxes[error_column_name]).sum())
# print(star_data[good][flux_column_name][np.isnan(comp_fluxes[flux_column_name])])

# Check whether any of the columns are masked, but with no masked values,
# and convert to regular column...eventually

comp_fluxes = comp_fluxes.group_by('date-obs')
comp_totals = comp_fluxes.groups.aggregate(np.add)[flux_column_name]
comp_totals = comp_fluxes.groups.aggregate(np.sum)[flux_column_name]
comp_errors = comp_fluxes.groups.aggregate(_add_in_quadrature)[error_column_name]

comp_total_vector = np.ones_like(star_data[flux_column_name])
Expand Down