Photometry
NIRCAM module
- pydol.photometry.nircam.nircam_phot(input_files, filter='f200w', output_dir='.', ref_img_path='.', cat_name='', param_file=None, sharp_cut=0.01, crowd_cut=0.5, SNR_min=5, type=2, quality_filters='f200w')[source]
- pydol.photometry.nircam.nircam_phot_comp(param_file, m=[20], filter='f200w', region_name='3', output_dir='.', tab_path='.', ref_img_path=None, cat_name='', sharp_cut=0.01, crowd_cut=0.5, SNR_min=5, type=2, ra_col='ra', dec_col='dec', ra=0, dec=0, shape='box', width=0.006666666666666667, height=0.006666666666666667, ang=245, nx=10, ny=10, quality_filters='f200w')[source]
ACS module
- pydol.photometry.acs.acs_phot(flt_files, filter='f435w', output_dir='.', drz_path='.', cat_name='', param_file=None, sharp_cut=0.2, crowd_cut=2.25, obj_type=2, SNR_min=5, quality_filters='f814w')[source]
HST ACS photometry using DOLPHOT (HPC-friendly version)
- Parameters:
flt_files (list) – List of ACS _flt.fits files
filter (str)
output_dir (str)
drz_path (str) – Path (without .fits extension) to drz image
cat_name (str)
param_file (str or None)
sharp_cut (float)
crowd_cut (float)
- pydol.photometry.acs.acs_phot_comp(param_file=None, m=[20], filter='f814w', region_name='3', output_dir='.', tab_path='.', ref_img_path=None, cat_name='', sharp_cut=0.2, crowd_cut=2.25, SNR_min=5, obj_type=2, ra_col='ra', dec_col='dec', ra=0, dec=0, shape='box', width=0.006666666666666667, height=0.006666666666666667, ang=245, nx=10, ny=10, quality_filters='f814w')[source]
ACS completeness analysis using DOLPHOT (HPC-optimized version)
WFC3 module
- pydol.photometry.wfc3.wfc3_phot(flt_files, det='UVIS', filter='f814w', output_dir='.', drz_path='.', cat_name='', param_file=None, sharp_cut=0.15, crowd_cut=1.3)[source]
- Parameters:
flt_files (list,) – list of paths to HST WFC3 level 3 _flt.fits files
det (str,) – WFC3 detector IR or UVIS
filter (str,) – name of the WFC3 filter being processed
output_dir (str,) – path to output directory. Recommended: /photometry/
drz_path (str,) – path to level 3 drizzled image (_drz.fits) image. It is recommended to be inside /photometry/
cat_name (str,) – Output photometry catalogs will have prefix filter + cat_name
- Return type:
None
CMD Tools module
- pydol.photometry.scripts.cmdtools.gen_CMD(tab, df_iso=None, filters={'filt1': 'f115w', 'filt2': 'f150w'}, positions={'dec_cen': 0, 'dec_col': 'dec', 'ra_cen': 0, 'ra_col': 'ra'}, region={'ang': 245.00492, 'r_in': 0, 'r_out': 24, 'spatial_filter': 'circle'}, extinction={'Av': 0.19, 'Av_': 3, 'Av_x': 2, 'Av_y': 19}, distance_modulus=29.7415, axis_limits={'xlims': [-0.5, 2.5], 'ylims': [18, 28]}, isochrone_params={'ages': [7.0, 8.0, 9.0], 'met': 0.02}, plot_settings={'alpha': 1, 'lw': 3, 's': 0.2}, error_settings={'mag_err_lim': 0.2, 'ref_xpos': -0.5, 'show_err_model': False}, kde_contours={'gen_contours': False, 'gen_kde': False}, other_settings={'ab_dist': True, 'show_err_model': False, 'skip_data': False}, fig=None, ax=None)[source]
Generate a Color-Magnitude Diagram (CMD) with optional KDE or contour overlays.
- Parameters:
tab (DataFrame) – Input data table containing magnitudes, positions, and errors for sources.
df_iso (DataFrame, optional) – Isochrone data for overlay.
filters (dict, optional) – Filters used in CMD. Keys: - ‘filt1’: Primary filter for color calculation. - ‘filt2’: Secondary filter for color calculation. - ‘filt3’: Filter for magnitude axis. Defaults to ‘filt2’.
positions (dict, optional) – Positional parameters. Keys: - ‘ra_col’: RA column name. - ‘dec_col’: DEC column name. - ‘ra_cen’: Central RA (in degrees). - ‘dec_cen’: Central DEC (in degrees).
region (dict, optional) – Region parameters for filtering sources. Keys: - ‘r_in’: Inner radius for selection (arcseconds) (used for circular filters). - ‘r_out’: Outer radius for selection (arcseconds) (used for circular filters). - ‘spatial_filter’: Type of spatial filtering (‘circle’, ‘box’, ‘ellipse’). - ‘ang’: Orientation angle (used for box or ellipse filters). - ‘width_in’, ‘height_in’: Inner box dimensions (arcseconds) (used for box filters). - ‘width_out’, ‘height_out’: Outer box dimensions (arcseconds) (used for box filters). - ‘a1’, ‘b1’: Inner semi-major and semi-minor axes (arcseconds) (used for ellipse filters). - ‘a2’, ‘b2’: Outer semi-major and semi-minor axes (arcseconds) (used for ellipse filters).
extinction (dict, optional) – Extinction parameters. Keys: - ‘Av’: Extinction value. - ‘Av_’: Annotation extinction value. - ‘Av_x’, ‘Av_y’: Annotation arrow position.
distance_modulus (float, optional) – Distance modulus for CMD adjustments. Default is 29.7415.
axis_limits (dict, optional) – Plot axis limits. Keys: - ‘xlims’: Limits for x-axis (color). - ‘ylims’: Limits for y-axis (magnitude).
isochrone_params (dict, optional) – Isochrone parameters for plotting. Keys: - ‘met’: Metallicity for isochrones. - ‘label_min’: Minimum label value for filtering. - ‘label_max’: Maximum label value for filtering. - ‘ages’: List of log ages to plot.
plot_settings (dict, optional) – General plot settings. Keys: - ‘alpha’: Transparency for isochrone lines. - ‘s’: Marker size for scatter plots. - ‘lw’: Line width for isochrones.
error_settings (dict, optional) – Settings for error handling and plotting. Keys: - ‘mag_err_cols’: Columns for magnitude errors. Defaults to filter-based columns. - ‘mag_err_lim’: Maximum allowable magnitude error. - ‘show_err_model’: Show error models during plotting. - ‘ref_xpos’: Reference x-position for error bars.
kde_contours (dict, optional) – Settings for KDE or contour plots. Keys: - ‘gen_kde’: Generate KDE overlay. - ‘gen_contours’: Generate contour overlay.
other_settings (dict, optional) – Miscellaneous settings. Keys: - ‘ab_dist’: Include absolute distance modulus adjustments. - ‘skip_data’: Skip scatter plot of source data.
fig (matplotlib.figure.Figure, optional) – Existing figure object. If None, a new figure is created.
ax (matplotlib.axes.Axes, optional) – Existing axis object. If None, a new axis is created.
- Returns:
(fig, ax, tab) where: - fig: The figure object. - ax: The axis object. - tab: The filtered input data table after spatial and error-based selection.
- Return type:
tuple
- pydol.photometry.scripts.cmdtools.gen_CMD_xcut(tab, df_iso=None, filters={'filt1': 'f115w', 'filt2': 'f150w'}, positions={'dec_cen': 0, 'dec_col': 'dec', 'ra_cen': 0, 'ra_col': 'ra'}, region={'ang': 245.00492, 'r_in': 0, 'r_out': 24, 'spatial_filter': 'circle'}, extinction={'Av': 0.19, 'Av_': 3, 'Av_x': 2, 'Av_y': 19}, distance_modulus=29.7415, axis_limits={'xlims': [-0.5, 2.5], 'ylims': [18, 28]}, isochrone_params={'ages': [7.0, 8.0, 9.0], 'met': 0.02}, plot_settings={'alpha': 1, 'cmap': 'jet', 'lw': 3, 's': 0.2}, error_settings={'mag_err_lim': 0.2, 'ref_xpos': -0.5, 'show_err_model': False}, kde_contours={'gen_contours': False, 'gen_kde': False, 'kde_bin': 200j}, other_settings={'ab_dist': True, 'show_err_model': False, 'skip_data': False}, x_cut_settings={}, fig=None, ax=None)[source]
- pydol.photometry.scripts.cmdtools.gen_CMD_ycut(tab, df_iso=None, filters={'filt1': 'f115w', 'filt2': 'f150w'}, positions={'dec_cen': 0, 'dec_col': 'dec', 'ra_cen': 0, 'ra_col': 'ra'}, region={'ang': 245.00492, 'r_in': 0, 'r_out': 24, 'spatial_filter': 'circle'}, extinction={'Av': 0.19, 'Av_': 3, 'Av_x': 2, 'Av_y': 19}, distance_modulus=29.7415, axis_limits={'xlims': [-0.5, 2.5], 'ylims': [18, 28]}, isochrone_params={'ages': [7.0, 8.0, 9.0], 'met': 0.02}, plot_settings={'alpha': 1, 'cmap': 'jet', 'lw': 3, 's': 0.2}, error_settings={'mag_err_lim': 0.2, 'ref_xpos': -0.5, 'show_err_model': False}, kde_contours={'gen_contours': False, 'gen_kde': False, 'kde_bin': 200j}, other_settings={'ab_dist': True, 'show_err_model': False, 'skip_data': False}, y_cut_settings={}, fig=None, ax=None)[source]
- pydol.photometry.scripts.catalog_filter.box(catalog_data, ra_column, dec_column, ra_center, dec_center, width_in=0.006666666666666667, height_in=0.006666666666666667, width_out=0.006666666666666667, height_out=0.006666666666666667, angle=245.00492, show_output=False)[source]
- pydol.photometry.scripts.catalog_filter.ellipse(catalog_data, ra_column, dec_column, ra_center, dec_center, angle=0, a1=1, b1=0, a2=1, b2=1, show_output=False)[source]