stellarphot Documentation#

This is the documentation for stellarphot.

Photometry objects always have these attributes, also available dictionary-style:

  • mag – the calibrated magnitude; may be missing (e.g. your data prior to calibration)

  • mag_err – error in mag

  • inst_mag – the instrumental magnitude; may be missing (e.g. catalog data)

  • inst_mag_err – error int the inst_mag

  • band – the filter of the magnitude; required

  • BJD – Barycentric Julian Date of the midpoint of the observation; may be missing/masked

  • RA2000 – right ascension in degrees, in the ICRS frame at epoch 2000

  • DEC2000 – declination in degrees in the ICRS frame at epoch 2000

There may be additional fields.

Reference/API#

stellarphot Package#

Functions#

apass_dr9(field_center[, radius, ...])

Return the items from APASS DR9 that are within the search radius and (optionally) within the field of view of a frame.

test(**kwargs)

Run the tests for the package.

vsx_vizier(field_center[, radius, ...])

Return the items from the copy of VSX on Vizier that are within the search radius and (optionally) within the field of view of a frame.

Classes#

BaseEnhancedTable(*args[, input_data, ...])

A class to validate an astropy.table.QTable table of astronomical data during creation and store metadata as attributes.

CatalogData(*args[, input_data, ...])

A class to hold astronomical catalog data while performing validation to confirm the minumum required columns ('id', 'ra', 'dec', 'mag', and 'passband') are present and have the correct units.

PhotometryData(*args[, input_data, ...])

A modified astropy.table.QTable to hold reduced photometry data that provides the convenience of validating the data table is in the proper format including units.

SourceListData(*args[, input_data, colname_map])

A class to hold information on the source lists to pass to aperture photometry routines.

Class Inheritance Diagram#

Inheritance diagram of stellarphot.core.BaseEnhancedTable, stellarphot.core.CatalogData, stellarphot.core.PhotometryData, stellarphot.core.SourceListData

stellarphot.core Module#

Functions#

apass_dr9(field_center[, radius, ...])

Return the items from APASS DR9 that are within the search radius and (optionally) within the field of view of a frame.

vsx_vizier(field_center[, radius, ...])

Return the items from the copy of VSX on Vizier that are within the search radius and (optionally) within the field of view of a frame.

Classes#

BaseEnhancedTable(*args[, input_data, ...])

A class to validate an astropy.table.QTable table of astronomical data during creation and store metadata as attributes.

PhotometryData(*args[, input_data, ...])

A modified astropy.table.QTable to hold reduced photometry data that provides the convenience of validating the data table is in the proper format including units.

CatalogData(*args[, input_data, ...])

A class to hold astronomical catalog data while performing validation to confirm the minumum required columns ('id', 'ra', 'dec', 'mag', and 'passband') are present and have the correct units.

SourceListData(*args[, input_data, colname_map])

A class to hold information on the source lists to pass to aperture photometry routines.

Class Inheritance Diagram#

Inheritance diagram of stellarphot.core.BaseEnhancedTable, stellarphot.core.PhotometryData, stellarphot.core.CatalogData, stellarphot.core.SourceListData

stellarphot.differential_photometry Package#

Functions#

add_in_quadrature(array)

Add an array of numbers in quadrature.

calc_aij_relative_flux(star_data, comp_stars)

Calculate AstroImageJ-style flux ratios.

calc_multi_vmag(var_stars, star_data, ...)

Calculate the average magnitude and standard deviation of multiple variable stars in a field.

calc_vmag(var_stars, star_data, comp_stars)

Calculate the average magnitude and standard deviation of a variable star in field.

stellarphot.gui_tools Package#

Functions#

make_markers(iw, ccd, RD, vsx, ent[, ...])

Add markers for APASS, TESS targets, VSX.

set_keybindings(image_widget[, scroll_zoom])

Set image widget keyboard bindings.

wrap(imagewidget, outputwidget)

Utility function to let you click to select/deselect comparisons.

Classes#

ComparisonViewer([file, directory, ...])

A class to store an instance of the comparison viewer.

FitsOpener([title, filter_pattern])

A class to open FITS files using a file chooser and display them in an astrowidgets.ImageWidget.

PhotometrySettings()

A class to hold the widgets for photometry settings.

SeeingProfileWidget([imagewidget, width, ...])

A class for storing an instance of a widget displaying the seeing profile of stars in an image.

Class Inheritance Diagram#

Inheritance diagram of stellarphot.gui_tools.comparison_functions.ComparisonViewer, stellarphot.gui_tools.fits_opener.FitsOpener, stellarphot.gui_tools.photometry_widget_functions.PhotometrySettings, stellarphot.gui_tools.seeing_profile_functions.SeeingProfileWidget

stellarphot.io Package#

Functions#

generate_aij_table(table_name, comparison_table)

Generate an AIJ table from a stellarphot table and a comparison table.

parse_aij_table(table_name)

Return a list of objects, one for each source, from an AstroImageJ photometry table.

Classes#

ApertureAIJ()

Represents the aperture information AstroImageJ saves.

ApertureFileAIJ()

Class to represent AstroImageJ aperture file.

MultiApertureAIJ()

Multi-aperture information that AstroImageJ saves.

Star(table, id_num)

A class for storing photometry for a single star.

TOI(tic_id[, toi_table, allow_download])

A class to hold information about a TOI (TESS Object of Interest).

TessSubmission(telescope_code, filter, ...)

A data class to represent TESS submissions.

TessTargetFile(coord, magnitude, depth[, file])

A class to hold information about a TESS target file.

Class Inheritance Diagram#

Inheritance diagram of stellarphot.io.aij.ApertureAIJ, stellarphot.io.aij.ApertureFileAIJ, stellarphot.io.aij.MultiApertureAIJ, stellarphot.io.aij.Star, stellarphot.io.tess.TOI, stellarphot.io.tess.TessSubmission, stellarphot.io.tess.TessTargetFile

stellarphot.photometry.photometry Module#

Functions#

single_image_photometry(ccd_image, ...[, ...])

Perform aperture photometry on a single image, with an options for estimating the local background from sigma clipped stats of the counts in an annulus around the aperture.

multi_image_photometry(...[, ...])

Perform aperture photometry on a directory of images.

faster_sigma_clip_stats(data[, sigma, ...])

Calculate sigma clipped stats quickly using NaNs instead of masking and using bottleneck where possible.

find_too_close(sourcelist, aperture_rad[, ...])

Identify sources that are closer together than twice the aperture radius.

clipped_sky_per_pix_stats(data, annulus[, ...])

Calculate sigma-clipped statistics on an annulus.

calculate_noise([camera, counts, ...])

Computes the noise in a photometric measurement.

Classes#

AperturePhotometry(*, settings)

Class to perform aperture photometry on one or more images

Class Inheritance Diagram#

Inheritance diagram of stellarphot.photometry.photometry.AperturePhotometry

stellarphot.photometry.source_detection Module#

Functions#

source_detection(ccd[, fwhm, sigma, iters, ...])

Returns an SourceListData object containing the position of sources within the image identified using photutils.DAOStarFinder algorithm.

compute_fwhm(ccd, sources[, fwhm_estimate, ...])

Computes the FWHM in both x and y directions of sources in an image.

stellarphot.plotting Package#

Functions#

bin_data(data_set[, num, error_set])

Bins data into groups of num.

multi_night(sources, unique_nights, night, ...)

Plot magnitude vs time data for several sources over several nights.

plot_magnitudes([mags, errors, times, ...])

Plot one night of magnitude data for one source, overlaying a rolling mean and indication of mean/deviation.

plot_many_factors(photometry, shift, scale)

Plots many factors of photometry against each other.

scale_and_shift(data_set, scale, shift[, pos])

Scales and shifts data set passed in.

seeing_plot(raw_radius, raw_counts, ...[, ...])

Show a seeing plot for data from an image with radius on the x axis and counts (ADU) on the y axis.

stellarphot.transit_fitting Package#

Classes#

TransitModelFit()

Transit model fits to observed light curves.

VariableArgsFitter()

A callable class that can be used to fit functions with arbitrary number of positional parameters.

Class Inheritance Diagram#

Inheritance diagram of stellarphot.transit_fitting.core.TransitModelFit, stellarphot.transit_fitting.core.VariableArgsFitter

stellarphot.transit_fitting.gui Module#

Functions#

make_checker(indicator_widget, value_widget)

Build an observer that checks TIC number and, if it is a valid TIC number, looks up information about the TIC object from MAST copy of TIC as priors for EXOTIC.

validate_exposure_time(indicator_widget, ...)

Validates the exposure time input.

populate_TIC_boxes(tic_info, value_widget)

Set the appropriate widget values given information pulled from MAST TIC.

populate_TOI_boxes(toi, exotic_widget)

Set the appropriate widget values given information pulled from TESS Target of Interest (TOI) list.

exotic_settings_widget()

Generate a widget to enter (and store) settings for exotic.

set_values_from_json_file(widget, json_file)

Set values in EXOTIC widget from a JSON file of those settings.

get_values_from_widget(exotic_widget[, key])

Extract EXOTIC settings from widget.

generate_json_file_name(exotic_widget[, key])

Generate settings file name from user input.

Classes#

MyValid(**kwargs)

A class containing a more compact indicator of valid entries based on ipywidgets buton value.

Class Inheritance Diagram#

Inheritance diagram of stellarphot.transit_fitting.gui.MyValid

stellarphot.transit_fitting.io Module#

Functions#

get_tic_info(TIC_ID)

Get the information about this TIC ID from the TESS Input Catalog at MAST.

stellarphot.transit_fitting.plotting Module#

Functions#

plot_predict_ingress_egress(ingress_time, ...)

Plot vertical lines at the ingress and egress times and label them.

stellarphot.utils Package#

Functions#

calc_residual(new_cal, catalog)

Calculate the standard deviations of the residuals between the new calibrated magnitude and the catalog magnitude.

calculate_transform_coefficients(input_mag, ...)

Calculate linear transform coefficients from input magnitudes to catalog magnitudes.

crossmatch_APASS2VSX(CCD, RD, vsx)

Find APASS stars in FOV and matches APASS stars to VSX and APASS to input targets.

f(X, a, b, c, d, z)

Calculate the calibrated magnitudes from the instrumental magnitudes and colors.

filter_transform(mag_data, output_filter[, ...])

Transform SDSS magnitudes to BVRI using either the transforms from Jester et al or Ivezic et al.

in_field(apass_good_coord, ccd, apass, ...)

Return APASS stars in the field of view.

mag_scale(cmag, apass, v_angle, RD_angle[, ...])

Select comparison stars that are 1) not close the VSX stars or to other target stars and 2) fall within a particular magnitude range.

opts_to_str(opts)

Convert the options from a fit to a string.

read_file(radec_file)

Read an AIJ radec file with target and/or comparison positions

set_up(sample_image_for_finding_stars[, ...])

Read in sample image and find known variables in the field of view.

transform_magnitudes(input_mags, catalog, ...)

Calculate catalog magnitudes and transform coefficients from instrumental magnitudes.

transform_to_catalog(observed_mags_grouped, ...)

Transform a set of intrumental magnitudes to a standard system using either instrumental colors or catalog colors.