API Documentation


jhat

st_wcs_align

Created on Thu Apr 21 14:32:42 2022

@author: arest, bhilbert, mcorrenti, acanipe, jpierel

class jhat.st_wcs_align.st_wcs_align[source]

Main class for alignment.

outrootdir

output root directory. The output directoy is the output root directory + the outsubdir if not None

Type:

str

outsubdir

outsubdir added to output root directory

Type:

str

overwrite

overwrite files if they exist.

Type:

bool

telescope

If None, then telescope is determined automatically from the filename (“jw*” and “hst*” for JWST and HST, respectively)

Type:

str

skip_if_exists

Skip doing the analysis of a given input image if the cal file already exists, assuming the full analysis has been already done

Type:

bool

verbose

verbosity count (lower is less verbose)

Type:

int

SNR_min

mininum SNR for objects in image to be used for analysis

Type:

float

use_dq

use the DQ extensions for masking

Type:

bool

refcat

reference catalog. Can be a filename or Gaia

Type:

str

refcat_racol

RA column of reference catalog. If None, then automatically determined

Type:

str

refcat_deccol

Dec column of reference catalog. If None, then automatically determined

Type:

str

refcat_magcol

mag column of reference catalog. If None and not one of the default refcats like gaia, then 3rd column is used

Type:

str

refcat_magerrcol

magerr column of reference catalog. If None, then not used

Type:

str

refcat_colorcol

color column of reference catalog. If None, then not used

Type:

str:

refcat_pmflag

Apply the proper motion correction (only for catalogs it is applicable, e.g., gaia

Type:

bool

refcat_pmmedian

Apply the MEDIAN proper motion correction (only for catalogs it is applicable, e.g., gaia

Type:

bool

photfilename

photometry output filename. if “auto”, the fits in the image filename is substituted with phot.txt

Type:

str

load_photcat_if_exists

If the photometric catalog file already exists, skip recreating it.

Type:

bool

rematch_refcat

if –load_photcat_if_exists and the photcat already exists, load the photcat, but rematch with refcat

Type:

bool

d2d_max

maximum distance between source in image and refcat object, in arcsec

Type:

float

dmag_max

maximum uncertainty of sources in image

Type:

float

sharpness_lim

sharpness limits of sources in image (iterable of length 2)

Type:

list of float

roundness1_lim

roundness1 limits of sources in image (iterable of length 2)

Type:

list of float

delta_mag_lim

limits on mag - refcat_mainfilter (iterable of length 2)

Type:

list of float

objmag_lim

limits on mag, the magnitude of the objects in the image (iterable of length 2)

Type:

list of float

refmag_lim

limits on refcat_mainfilter, the magnitude of the reference catalog (iterable of length 2)

Type:

list of float

slope_min

minimum slope for linear correction applied to dx/dy. This effectively accounts for rotation. slopes go from slopemin to -slopemin

Type:

float

Nbright4match

Use only Nbright brightest objects for matching to the ref cat

Type:

int

Nbright

Use only Nbright brightest objects in image that are matched to refcat for alignment

Type:

int

histocut_order

histocut_order defines whether the histogram cut is first done for dx or first for dy (choices are ‘dxdy’ or ‘dydx’)

Type:

str

xshift

added to the x coordinate before calculating ra,dec (only impacts ra,dec, not x). This can be used to correct for large shifts before matching!

Type:

float

yshift

added to the y coordinate before calculating ra,dec (only impacts ra,dec, not y). This can be used to correct for large shifts before matching!

Type:

float

iterate_with_xyshifts

After the first histogram fit, redo the match with refcat with x/yshift=median(dx/dy) and redo histofit. Use this if the offsets are big, since the second iteration will give you better matching with the refcat

Type:

bool

showplots

showplots=1: most important plots. showplots=2: all plots (debug/test/finetune)

Type:

int

saveplots

saveplots=1: most important plots. saveplots=2: all plots (debug/test/finetune)

Type:

int

savephottable

Save the final photometry table

Type:

bool

replace_sip

Replace the tweaked fits image wcs with the SIP representation.

Type:

bool

sip_err

max_pix_error for SIP transformation.

Type:

float

sip_degree

degree for SIP transformation.

Type:

int

sip_points

npoints for SIP transformation.

Type:

int

ee_radius

encircled energy percentage (multiples of 10) for photometry

Type:

int

rough_cut_px_min

first rough cut: best d_rotated+-rough_cut_pix. This is the lower limit for rough_cut

Type:

float

rough_cut_px_max

first rough cut: best d_rotated+-rough_cut_pix. This is the upper limit for rough_cut

Type:

float

d_rotated_Nsigma

Nsigma for sigma cut of d_rotated. If 0.0, then 3-sigma cut is skipped

Type:

float

set_telescope(telescope=None, imname=None)[source]

Figuring out which telescope your data come from (HST or JWST). Note that if your filename is non-standard, then you MUST set


simple_jwst_phot

Created on Wed Apr 27 09:21:15 2022

@author: arest, jpierel, mcorrenti

This is class wrapper around doing simple photometry on a single JWST image

class jhat.simple_jwst_phot.hst_photclass(psf_fwhm=2, aperture_radius=None, verbose=0)[source]

The photometry class for HST images.

aperture_phot(filt=None, pupil=None, radii_Nfwhm=None, radius_Nfwhm_sky_in=None, radius_Nfwhm_sky_out=None, radius_Nfwhm_for_mag=None, primaryhdr=None, scihdr=None)[source]

Aperture photometry routine for HST.

Returns:

table_aper

Return type:

astropy.table.Table

match_refcat(max_sep=1.0, borderpadding=40, refcatshort=None, ixs_obj=None, ixs_refcat=None)[source]

Matches the photometry catalog to the reference catalog.

Parameters:
  • max_sep (float) – Maximum separation between sources in arcseconds

  • borderpadding (float) – Pixel separation required from border of image

  • refcatshort (string, optional) – Short name of reference catalog that is used as prefix for the column names. The default is None. If None, then refcatshort is set to self.refcat.short

  • indices (list) – The indices to access the photometry catalog, default None (use the full catalog)

Return type:

None.

class jhat.simple_jwst_phot.jwst_photclass(verbose=0)[source]

The photometry class for JWST images.

aperture_phot(filt=None, pupil=None, radii_Nfwhm=None, radius_Nfwhm_sky_in=None, radius_Nfwhm_sky_out=None, radius_Nfwhm_for_mag=None, primaryhdr=None, scihdr=None)[source]

Aperture photometry routine for HST.

Returns:

table_aper

Return type:

astropy.table.Table

find_stars(threshold=3, var_bkg=False, primaryhdr=None, scihdr=None)[source]
Parameters:
  • threshold (float) – The absolute image value above which to select sources.

  • fwhm (float) – The full-width half-maximum (FWHM) of the major axis of the Gaussian kernel in units of pixels.

  • var_bkg (bool) – Use Background2D (see description above)

match_refcat(max_sep=1.0, borderpadding=40, refcatshort=None, ixs_obj=None, ixs_refcat=None)[source]

Matches the photometry catalog to the reference catalog.

Parameters:
  • max_sep (float) – Maximum separation between sources in arcseconds

  • borderpadding (float) – Pixel separation required from border of image

  • refcatshort (string, optional) – Short name of reference catalog that is used as prefix for the column names. The default is None. If None, then refcatshort is set to self.refcat.short

  • indices (list) – The indices to access the photometry catalog, default None (use the full catalog)

Return type:

None.


st_wcs_align_batch

Created on Mon Apr 25 09:39:07 2022

@author: arest