Skip to content

Conversation

@cdressing
Copy link
Contributor

Description

Added the ability to reduce only a subset of stars. Made bad pixel mapping and contrast curve creation more robust by changing defaults or making them adaptive.

Motivation and Context

Prevents noise images from being too small for FWHM of data.
Avoids literal evaluation issues when determining image numbers for dark images.
Improves runtime by allowing users to reduce data for just a subset of stars at once.

How Has This Been Tested?

This version successfully reduced data for our 2024 paper.

Screenshots (if appropriate):

Types of changes

  • [x ] Bug fix (non-breaking change which fixes an issue)
  • [x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • [x ] My code follows the code style of this project.
  • [x ] My change requires a change to the documentation.
  • I have updated the documentation accordingly.

cdressing added 30 commits July 22, 2021 10:57
When using csv files for logs, save version with darks to a new file (marked by "_with_darks.csv") so that darks are not appended repeatedly when the pipeline is rerun.
Set default reduction method using bracket notation instead of dot notation because the column isn't actually added to the data frame when using dot notation.
Check if specified reduction directory exists and create it if needed.
Corrected description of reddir.
Share original filenames with plot_array so that the shift1_cube.png files can be annotated with filenames.
If ShARCS dataset contains BrG-2.16 data and no corresponding flat, use the Ks flat instead.
Label each subpanel with filename or star name. Add new functionality for plotting reduced images of all stars observed on a single night.
For ShARCS, if no BrG-2.16 flat exists, use Ks flat for reducing BrG-2.16 data. Also removed leftover stray comments.
Removed previously commented out text changing head.update to head.set.
Corrected typo (missing = in equality check).
Corrected typo (missing : before if/then statement)
Changed literal eval to avoid issues when filenames have leading zeros.
Added ability to save time by using existing darks, flats, and skies.
Added if statement to tell the code when to use the "all_stars" version of the plot.
Added snames=None to ensure that all plotting routines are compatible with the addition of plot_all_stars
Corrected typos in plot_all_stars.
Truncate error array to the inner 10" so that lim_arc_lengths, delta_mags, and lim_stds are all the same length.
correct typo in comments (afrer --> after)
Automatically run contrast curve code for each star and save plots and csv files showing contrast as a function of angular separation.
fixed typo in generation of lim_stds
Flipped y-axis to show brighter objects at top.
Produce grid of all images and plot showing all contrast curves.
added a space to improve readability
Produce grid showing reduced images for all stars observed and plot showing all contrast curves.
When plotted in a grid, flats are now shown with a narrower, adaptive color scaling range and labeled by file name.
When run with verbose=False, warning messages from concur are suppressed to avoid messing up the progress bars.
Cast header['CRPIX1'] and header['CRPIX2'] as floats to prevent errors that occur when they are read in as integers.
cdressing and others added 28 commits March 29, 2022 12:34
Don't run darks, flats, and sky drivers again after registering images.
Don't print to screen unless VERBOSE is set. Allow all types of flats to match (e.g., sky flats, dome flats, flats) and improve matching of images taken in J+Ch4-1.2 by allowing different filter capitalization and whitespace in the logsheet.
Return configuration file when user requests to skip data reduction.
corrected a minor typo in comments
Made larger intermediate images (800x800 pixels versus 600x600) to avoid edge effects in final 600x600 pixel images. Changed contrast curve spacing to <= 0.5" beyond FWHM. Made larger fake images to avoid cases where sky annulus falls outside the fake image for high FWHM.
Move contrast curves into a central directory and format as needed for TRICERATOPS runs.
Now use 1000x1000 pixel images for majority of process instead of 800x800 pixel images. Removed hardcoding of initial image size when trimming down to the final image.
TRICERATOPS can't handle missing contrast curve values, so now rows with missing values are removed from the contrast curve dataframe before saving to file.
Restricted possible image centers to central region when using shift_bruteforce to avoid selecting bright image edges.
Use astropy.convolution to interpolate over NaNs before registration. Fixes issue with  shift (from scipy.ndimage.interpolation) generating images that are completely NaN if the input image contains NaNs.

Also fixed typo in comment in drivers.
Properly handle observations taken in J+Ch4-1.2 by reading both filters in the FITS header and saving files accordingly.
Make separate folders for J+Ch4-1.2 files
Increased default maximum allowed image shift from 200 pixels to 350 pixels in registration.py. Improved handling of NaNs in skies and image reduction. Corrected typos in comments.
Added option to run image drivers and registration for only a subset of stars. Need to improve tracking of reduction methods for selected star registration. Currently assuming "saturated" by default.
Sped up contrast curve code 20-30x by using the FWHM to set the size of the fake image.
Updated size used for fake images to 5 pixels wider than the size used for the outer radius of the sky annulus.
Deal with gaps in list of images. Without this fix, only the final set of images is used for each star/filter combination.
Also deal with breaks in the lists of flats, darks, and skies. Previously, the code just used a single set rather than combining sets of images with a given exposure time and filter.
corrected typo (skis --> skies)
Streamline handling of flats and skies.
Corrected bug in splitting skies by filter. Switched to adaptive color scaling for grids of skies.
@arjunsavel
Copy link
Owner

dependencies seem broken for macos, but that's not a problem with these PR — happy to merge given ubuntu passed!

@arjunsavel arjunsavel merged commit 487289c into arjunsavel:main May 9, 2025
3 of 7 checks passed
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.

2 participants