craftutils.observation.epoch.HAWKIImagingEpoch.coadded_class(craftutils.observation.epoch.ImagingEpoch.coadded_class)

alias of HAWKICoaddedImage

Public members

num_chips = 4
craftutils.observation.epoch.instrument_name = 'vlt-hawki'
craftutils.observation.epoch.extract_chip_number(ext: int = 0)
craftutils.observation.epoch.extract_exposure_time()
craftutils.observation.epoch.extract_filter()
craftutils.observation.epoch.zeropoint(**kwargs)
classmethod craftutils.observation.epoch.header_keys()
craftutils.observation.epoch.coadded_class(path: str, ...)

Initialize self. See help(type(self)) for accurate signature.

craftutils.observation.epoch.trim(...)
craftutils.observation.epoch.trim_from_area(...)
craftutils.observation.epoch.register(target: ImagingImage, ...)
craftutils.observation.epoch.load_output_file()
craftutils.observation.epoch.correct_astrometry(...)

Uses astrometry.net to solve the astrometry of the image. Solved image is output as a separate file. :param output_dir: :param tweak: :param time_limit: :param am_flags: :param am_params: :param kwargs: :return:

craftutils.observation.epoch.copy(destination: str, ...)

A note to future me: do copy, THEN make changes, or be prepared to suffer the consequences.

craftutils.observation.epoch.extract_ncombine()
craftutils.observation.epoch.class_dict = {'decam': <class 'craftutils.observation.image.imaging.survey.DESCutout'>, 'gs-aoi': <class 'craftutils.observation.image.imaging.coadded.GSAOIImage'>, 'hst-wfc3_ir': <class 'craftutils.observation.image.imaging.coadded.HubbleImage'>, 'hst-wfc3_uvis2': <class 'craftutils.observation.image.imaging.coadded.HubbleImage'>, 'none': <class 'craftutils.observation.image.imaging.coadded.CoaddedImage'>, 'panstarrs1': <class 'craftutils.observation.image.imaging.survey.PanSTARRS1Cutout'>, 'vlt-fors2': <class 'craftutils.observation.image.imaging.eso.FORS2CoaddedImage'>, 'vlt-hawki': <class 'craftutils.observation.image.imaging.eso.HAWKICoaddedImage'>, 'wise': <class 'craftutils.observation.image.imaging.survey.WISECutout'>}
craftutils.observation.epoch.source_extraction(...) str
craftutils.observation.epoch.psfex(...)

Run PSFEx on this image to obtain a PSF model. Also performs the prerequisite Source Extractor runs.

craftutils.observation.epoch.load_psfex_output(force: bool = False)
craftutils.observation.epoch.psf_image(x: float, y: float, ...)
craftutils.observation.epoch.clone_diagnostics(other, ...)

The intent behind this function is to use it when it is a derived image that should have the same characteristics (eg PSF, astrometry, zeropoint) as the original or other derivative, and to transfer those properties across.

craftutils.observation.epoch.clone_depth(other: ImagingImage, ...)
craftutils.observation.epoch.select_depth(ext: int = 0, ...)
craftutils.observation.epoch.clone_astrometry_info(other, ...)
craftutils.observation.epoch.clone_zeropoints(other, ...)
craftutils.observation.epoch.clone_psf(other: ImagingImage, ...)
craftutils.observation.epoch.source_extraction_psf(output_dir, ...)

Uses a PSFEx-generated PSF model in conjunction with Source Extractor to generate a source catalog. The key difference with source_extraction is that source_extraction uses only Source Extractor, and does not therefore use PSF-fitting (ie, no CLASS_STAR, MAG_PSF or FLUX_PSF columns are written). :param output_dir: The directory in which to write the PSFEx and Source Extractor output files. :param template: The path to the file to use as template, if dual mode is to be used. :param force: If True, performs all functions regardless of whether source_catalogues already exist, and

overwrites them; if False, checks whether they exist first and skips some steps if so.

Parameters
configs

A dictionary of Source Extractor arguments to pass to command line.

Returns

craftutils.observation.epoch.world_to_pixel(...) tuple[ndarray, ndarray]

Turns a sky coordinate into image pixel coordinates; :param coord: SkyCoord object to convert to pixel coordinates; essentially a wrapper for SkyCoord.to_pixel() :param origin: Do you want pixel indexing that starts at 1 (FITS convention) or 0 (numpy convention)? :return: xp, yp: numpy.ndarray, the pixel coordinates.

craftutils.observation.epoch.pixel_to_world(x, ...) SkyCoord

Uses the image’s wcs to turn pixel coordinates into sky; essentially a wrapper for SkyCoord.from_pixel(). :param x: Pixel x-coordinate. Can be provided as an astropy Quantity with units pix, or as a raw number. :param y: Pixel y-coordinate. Can be provided as an astropy Quantity with units pix, or as a raw number. :param origin: Do you want pixel indexing that starts at 1 (FITS convention) or 0 (numpy convention)? :return coord: SkyCoord reflecting the sky coordinates.

craftutils.observation.epoch.plot_ellipse(ax: Axes, coord, ...)
Parameters
ax: Axes

coord

a

b

theta

East from North.

plot_centre

centre_kwargs

kwargs

Returns

craftutils.observation.epoch.load_data(force: bool = False)
craftutils.observation.epoch.get_source_cat(dual: bool, ...)
craftutils.observation.epoch.push_source_cat(dual: bool = True)
craftutils.observation.epoch.load_synth_cat(force: bool = False)
craftutils.observation.epoch.write_synth_cat()
craftutils.observation.epoch.load_wcs() list[WCS]
craftutils.observation.epoch.extract_astrometry_err()
craftutils.observation.epoch.extract_psf_fwhm()
craftutils.observation.epoch.extract_rotation_angle(ext: int = 0)
craftutils.observation.epoch.extract_y_sense(ext: int = 0)
craftutils.observation.epoch.extract_wcs_footprint(ext: int = 0)

Returns the RA & Dec of the corners of the image. :return: tuple of SkyCoords, (top_left, top_right, bottom_left, bottom_right)

craftutils.observation.epoch.extract_pixel_scale(ext: int = 0, ...)
craftutils.observation.epoch.extract_world_scale(ext: int = 0, ...)
craftutils.observation.epoch.extract_airmass()
craftutils.observation.epoch.extract_pointing()
craftutils.observation.epoch.extract_ref_pixel() tuple[float, float]

Retrieve the coordinates of the “reference pixel” from the header. :return: Tuple containing the reference pixel coordinates as (x, y).

craftutils.observation.epoch.extract_old_pointing()
craftutils.observation.epoch.update_output_file()
craftutils.observation.epoch.select_zeropoint(...)
craftutils.observation.epoch.get_zeropoint(cat_name: str, ...)
craftutils.observation.epoch.add_zeropoint(catalogue: str, ...)
craftutils.observation.epoch.add_zeropoint_from_other(other)
craftutils.observation.epoch.aperture_areas()
craftutils.observation.epoch.calibrate_magnitudes(...)
craftutils.observation.epoch.magnitude(flux: Quantity, ...)
craftutils.observation.epoch.estimate_depth(...)

Use various measures of S/N to estimate image depth at a range of sigmas.

craftutils.observation.epoch.send_column_to_source_cat(...)

Takes a column from a table that is a subset of source_cat, and adds the column values to the appropriate entries in source_cat using the NUMBER column. Rows not in the subset table will be assigned -99. in that column. Trust me, it comes in handy. Assumes that NO entries have been removed from or added to the main source_cat since being produced by Source Extractor, as it requires that the relationship source_cat[“NUMBER”] = i - 1 holds true.

craftutils.observation.epoch.detect_frame_value(ext: int = 0)
craftutils.observation.epoch.detect_edges(frame_value: float, ...)
craftutils.observation.epoch.correct_astrometry_coarse(...)
craftutils.observation.epoch.shift_wcs(delta_ra: Quantity, ...)
craftutils.observation.epoch.transfer_wcs(other_image, ...)
craftutils.observation.epoch.correct_astrometry_from_other(...) ImagingImage

Uses the header information from an image that has already been corrected by the Astrometry.net code to apply the same tweak to this image. This assumes that both images had the same astrometry to begin with, eg if one is a derived version of the other. :param other_image: Header must contain both _RVAL and CRVAL keywords. :param output_dir: Path to write new fits file to. :return:

craftutils.observation.epoch.astrometry_diagnostics(...)

Perform diagnostics of astrometric offset of stars in image from catalogue. :param reference_cat: Path to reference catalogue. :param ra_col: :param dec_col: :param mag_col: :param offset_tolerance: Maximum offset to be matched. :param star_tolerance: Maximum CLASS_FLAG for object to be considered. :param local_coord: :param local_radius: :param show_plots: :param output_path: :return:

craftutils.observation.epoch.psf_diagnostics(...)
craftutils.observation.epoch.convert_to_cs(output_path: str, ...)

Converts the image to flux (units of counts per second) and writes to a new file. :param output_path: Path to write converted file to. :param ext: FITS extension to modify. :return new: ImagingImage object representing the modified file.

craftutils.observation.epoch.clean_cosmic_rays(output_path, ...)
craftutils.observation.epoch.scale_to_jansky(ext: int = 0, *args)
craftutils.observation.epoch.pixel_magnitudes(ext: int = 0, ...)
craftutils.observation.epoch.surface_brightness(ext: int = 0)
craftutils.observation.epoch.reproject(other_image, ...)
Parameters
other_image

ext

output_path

include_footprint

write_footprint

method

mask_mode

If you are reprojecting a mask, the values will change slightly, so set this to True to round them back to the correct numbers.

Returns

craftutils.observation.epoch.flip_horizontal(output_path: str, ...)

Flips the pixels of an image horizontally, and corrects the WCS to reflect this. :param output_path: Path to write flipped copy to :param ext: Fits extension to flip :return:

craftutils.observation.epoch.trim_to_wcs(...) ImagingImage

Trims the image to a footprint defined by two RA/DEC coordinates :param bottom_left: :param top_right: :param output_path: :return:

craftutils.observation.epoch.match_to_cat(...)
craftutils.observation.epoch.signal_to_noise_ccd(dual: bool = False)
craftutils.observation.epoch.signal_to_noise_measure(...)
craftutils.observation.epoch.object_axes()
craftutils.observation.epoch.estimate_sky_background(...)

Estimates background as a global median. VERY loose estimate. :param ext: :param force: :return:

craftutils.observation.epoch.find_object(coord: SkyCoord, ...)
craftutils.observation.epoch.find_object_index(index: int, ...)

Using NUMBER column, finds the row referred to. :param index: :param dual: :return:

craftutils.observation.epoch.pixel(value, ...)
craftutils.observation.epoch.frame_from_coord(frame: Quantity, ...)
craftutils.observation.epoch.prep_for_colour(output_path: str, ...)
craftutils.observation.epoch.nice_frame(...)
craftutils.observation.epoch.plot_apertures(dual=False, ...)
craftutils.observation.epoch.plot_subimage(...) tuple[Figure, Axes, dict]
craftutils.observation.epoch.scale_bar(...)
craftutils.observation.epoch.plot_source_extractor_object(...)
craftutils.observation.epoch.plot(ax: Axes | None = None, ...)
craftutils.observation.epoch.wcs_axes(...)
craftutils.observation.epoch.plot_catalogue(cat: QTable, ...)
craftutils.observation.epoch.plot_coords(ax: Axes, coord, ...)
craftutils.observation.epoch.plot_slit(ax: Axes, centre, ...)
craftutils.observation.epoch.insert_synthetic_sources(...)

Catalogue must have column ‘mag’, and either ‘coord’ or ‘x’ AND ‘y’.

craftutils.observation.epoch.insert_synthetic_range(...)
craftutils.observation.epoch.check_synthetic_sources()

Checks on the fidelity of inserted sources against catalogue. :return:

craftutils.observation.epoch.test_limit_location(...) dict | QTable
craftutils.observation.epoch.test_limit_synthetic(...)
craftutils.observation.epoch.model_background_local(...)

Models and subtracts the background of a specified part of the image. A mask can be generated using either sep or photutils, automatically excluding objects from the background fit. Negative and saturated or near-saturated pixels, above saturate_factor * header[“SATURATE”], will also be masked regardless of generate_mask.

craftutils.observation.epoch.model_background_photometry(...)
craftutils.observation.epoch.generate_segmap(ext: int = 0, ...)

Generate a segmentation map of the image in which the image is broken into segments according to detected sources. Each source is assigned an integer, and the segmap has the same spatial dimensions as the input image.

craftutils.observation.epoch.generate_mask(...)

Uses a segmentation map to produce a mask covering field objects.

craftutils.observation.epoch.masked_data(...)
craftutils.observation.epoch.write_mask(...) ImagingImage

Generates and writes a source mask to a FITS file. Any argument accepted by generate_mask() can be passed as a keyword.

craftutils.observation.epoch.mask_nearby()
craftutils.observation.epoch.detection_threshold()
craftutils.observation.epoch.do_subtract_background()
craftutils.observation.epoch.sep_aperture_photometry(x: float, ...)
craftutils.observation.epoch.sep_elliptical_photometry(centre, ...)
craftutils.observation.epoch.sep_elliptical_magnitude(centre, ...)
Parameters
centre

a_world

b_world

theta_world

kron_radius

ext

output

mask_nearby

detection_threshold

kwargs

keyword arguments to pass to the magnitude() method; header exp_time etc can be overridden here.

Returns

craftutils.observation.epoch.make_galfit_version(...)

Generate a version of this file for use with GALFIT. Modifies header item GAIN to conform to GALFIT’s expectations (outlined in the GALFIT User Manual, http://users.obs.carnegiescience.edu/peng/work/galfit/galfit.html) :param output_path: path to write modified file to. :param ext: FITS extension to modify header of. :return:

craftutils.observation.epoch.make_galfit_psf(output_dir: str, ...)
craftutils.observation.epoch.psf_to_hdu(x: float, y: float, ...)
craftutils.observation.epoch.make_galfit_feedme(feedme_path, ...)
craftutils.observation.epoch.galfit(...)
Parameters
coords

output_dir

frame_lower

frame_upper

ext

model_guesses

dict, with: object_type: str position: Either “position” can be provided as a SkyCoord object, or x & y as pixel coordinates.

craftutils.observation.epoch.galfit_object(obj: Galaxy, ...)
classmethod craftutils.observation.epoch.select_child_class(...)
classmethod craftutils.observation.epoch.count_exposures(...)
craftutils.observation.epoch.rank_photometric_cat(cats: list)

Gives the ranking of photometric catalogues available for calibration, ranked by similarity to filter set. :return:

craftutils.observation.epoch.__eq__(other)

Return self==value.

craftutils.observation.epoch.__str__()

Return str(self).

craftutils.observation.epoch.copy_headers(other: Image)
craftutils.observation.epoch.add_log(action: str, method=None, ...)
craftutils.observation.epoch.open(mode: str = 'readonly')
craftutils.observation.epoch.close()
craftutils.observation.epoch.new_image(path: str)
craftutils.observation.epoch.copy_with_outputs(destination: str)
craftutils.observation.epoch.load_headers(force: bool = False, **)
craftutils.observation.epoch.to_ccddata(unit: str | Unit)
craftutils.observation.epoch.get_id()
craftutils.observation.epoch.set_header_items(items: dict, ...)
craftutils.observation.epoch.set_header_item(key: str, value, ...)
craftutils.observation.epoch.add_history(note: str, ext: int = 0)
craftutils.observation.epoch.extract_header_item(key: str, ...)
craftutils.observation.epoch.extract_unit(astropy: bool = False)
craftutils.observation.epoch.extract_units()
craftutils.observation.epoch.extract_program_id()
craftutils.observation.epoch.extract_gain()
craftutils.observation.epoch.extract_date_obs() str
craftutils.observation.epoch.extract_noise_read()
craftutils.observation.epoch.extract_object()
craftutils.observation.epoch.extract_n_pix(ext: int = 0)
craftutils.observation.epoch.extract_pixel_edges()

Using the FITS convention of origin = 1, 1, returns the pixel coordinates of the edges. :return: tuple: left, right, bottom, top

craftutils.observation.epoch.extract_saturate(data_ext: int = 0)
craftutils.observation.epoch.remove_extra_extensions(ext: int = 0)
craftutils.observation.epoch.write_fits_file()
classmethod craftutils.observation.epoch.from_fits(path: str, ...)
craftutils.observation.epoch.split_fits(...)