observatories

NEOS

kete.neos.FOV_HEIGHT: float = 1.68

Expected effective field of view height in degrees. Approximate Value.

kete.neos.FOV_WIDTH: float = 7.1

Expected effective field of view width in degrees. Approximate Value.

kete.neos.sunshield_rotation(sun2obs, pointing)

Calculate the angle the field of view must be rotated around the pointing vector by in order to place the sun shield directly between the telescope and sun.

The rotation is defined as the angle needed to move the sun shield from the Z-axis down to the angle required to place it between the sun and telescope. The angle is defined by the right hand rule applied along the pointing vector.

Pointing vector must be at least about a half an arcsecond from the poles in order to be computable.

Note that no coordinate frames are specified here, this provides the rotation in the current frame from the frame’s Z-axis. Provided inputs are assumed to be from the matching frame.

Parameters:
  • sun2obs – The vector from the sun to the telescope, units are arbitrary.

  • pointing – The vector along which the telescope is pointing, the spacecraft’s Z-axis.

Returns:

Angle in degrees around the pointing vector the spacecraft must be rotated to place the sun shield between the telescope and the sun.

Return type:

float

WISE

kete.wise.MISSION_PHASES = {'3-Band': ('3-Band', 2455414.9417830086, 2455469.278276, (1, 2, 3), 'https://irsa.ipac.caltech.edu/ibe/data/wise/cryo_3band/3band_p1bm_frm/', 'allsky_3band_p1bs_frm', 'allsky_3band_p1bs_psd'), 'Cryo': ('Cryo', 2455179.500766019, 2455414.941783008, (1, 2, 3, 4), 'https://irsa.ipac.caltech.edu/ibe/data/wise/allsky/4band_p1bm_frm/', 'allsky_4band_p1bs_frm', 'allsky_4band_p1bs_psd'), 'Post-Cryo': ('Post-Cryo', 2455469.278277, 2455593.96119803, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/postcryo/2band_p1bm_frm/', 'allsky_2band_p1bs_frm', 'allsky_2band_p1bs_psd'), 'Reactivation_2014': ('Reactivation_2014', 2456639.500777593, 2457023.500777593, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2015': ('Reactivation_2015', 2457023.500777593, 2457388.500789167, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2016': ('Reactivation_2016', 2457388.500789167, 2457754.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2017': ('Reactivation_2017', 2457754.500800741, 2458119.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2018': ('Reactivation_2018', 2458119.500800741, 2458484.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2019': ('Reactivation_2019', 2458484.500800741, 2458849.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2020': ('Reactivation_2020', 2458849.500800741, 2459215.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2021': ('Reactivation_2021', 2459215.500800741, 2459580.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2022': ('Reactivation_2022', 2459580.500800741, 2459945.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2023': ('Reactivation_2023', 2459945.500800741, 2460310.500800741, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd'), 'Reactivation_2024': ('Reactivation_2024', 2460310.500800741, 2460523.7923257407, (1, 2), 'https://irsa.ipac.caltech.edu/ibe/data/wise/neowiser/p1bm_frm/', 'neowiser_p1bs_frm', 'neowiser_p1bs_psd')}

Public released mission phases of WISE.

class kete.wise.MissionPhase(name, jd_start, jd_end, bands, frame_url, frame_meta_table, source_table)

Information about a specific mission phase. The cannonical set of these is stored in the MISSION_PHASES constant.

Create new instance of MissionPhase(name, jd_start, jd_end, bands, frame_url, frame_meta_table, source_table)

bands

WISE wavelength bands available during the phase.

count(value, /)

Return number of occurrences of value.

frame_meta_table

SQL Table on IRSA where the metadata for the frames are stored.

frame_url

URL of where the frames are stored on IRSA servers.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

jd_end

JD date of the end of the mission phase.

jd_start

JD date of the start of the mission phase.

name

Name of the mission phase.

source_table

SQL Table on IRSA where source information is stored.

kete.wise.fetch_frame(scan_id, frame_num=None, band=None, as_fits=True, im_type='int', retry=2)

Fetch the WISE FITs frame, if it is not present in the cache, download it first.

This can return either an Astropy FITs file object, or the path to the downloaded file.

Parameters:
  • scan_id – The scan id of the desired frames, or a WISE FOV object, if this is provided, then frame number does not have to be provided.

  • frame_num – The frame number of the desired frames.

  • band – Band number of the target frame/scan combination.

  • as_fits – Should the file path or an Astropy FITs object be returned.

  • im_type – Which image type should be returned, int for intensity is typical, mask for the mask file.

kete.wise.mission_phase_from_jd(jd)

Return which mission phase is associated with the provided JD. Returns None if no matching mission phase.

The WISE mission has different phases based on the cryogen on board and the hibernation period, resulting in different useable bands and different locations in the IRSA archive.

Parameters:

jd (float) – The Julian Date in TDB scaled time, this is fully sufficient to determine the mission phase.

kete.wise.mission_phase_from_scan(scan_id)

Return the mission phase for WISE from the provided scan id.

During reactivation, scan ids do not end on exact dates at the end of the year, and as a result this function may return the wrong reactivation year for scan IDs near the end of a year. However the Cryo/3-band/post-cryo phases will all be exact.

The WISE mission has different phases based on the cryogen on board and the hibernation period, resulting in different useable bands and different locations in the IRSA archive.

Parameters:

scan_id (str) – The scan id to be converted, this is sufficient to determine the mission phase.

Return type:

MissionPhase | None

kete.wise.plot_frames(scan_id, frame_num=None, ra=None, dec=None, zoom=True, bands=None, cmap='gray_r', annotate=True)

Plot up to a 2x2 grid of images showing the W1, W2, W3, and W4 data for the (scan, frame) pair, centered on the ra, dec if provided.

More than one RA/DEC pair may also be provided, but zooming will not work in that case.

Parameters:
  • scan_id – The scan id of the desired frames, or a WISE FOV object, if this is provided, then frame number does not have to be provided.

  • frame_num – The frame number of the desired frames.

  • ra (float | list[float] | None) – The RA position of where to zoom/center the frames.

  • dec (float | list[float] | None) – The RA position of where to zoom/center the frames.

  • zoom (bool | float) – If the image should be centered and zoomed in on the provided RA/DEC. This can also be a number, which will change the zoom level.

  • bands (list[int] | None) – Bands of WISE to plot, if not provided this will plot all bands for the given mission phase.

  • annotate – If ra/dec are provided, then the plot may be optionally annotated as well. This may be any style which is accepted by the annotate function.

kete.wise.w1_color_correction(temp)

Calculate the W1 black body color correction for the given temperature in kelvin.

kete.wise.w2_color_correction(temp)

Calculate the W2 black body color correction for the given temperature in kelvin.

kete.wise.w3_color_correction(temp)

Calculate the W3 black body color correction for the given temperature in kelvin.

kete.wise.w4_color_correction(temp)

Calculate the W4 black body color correction for the given temperature in kelvin.

ZTF

ZTF Related Functions and Data.

kete.ztf.fetch_ZTF_file(field, filefracday, filtercode, ccdid, imgtypecode, qid, products='sci', im_type='sciimg.fits', force_download=False)

Fetch a ZTF file directly from the IPAC server, returning the path to where it was saved.

Parameters:
  • field – Field identifier number, integer between 1 and ~2200.

  • filefracday – String describing the fraction of a day, a record keeping string based on time.

  • filtercode – Which filter was used for the exposure.

  • ccdid – The CCD identified. (1-16)

  • imgtypecode – Image type code.

  • qid – Which quad of the ccd was used. (1-4)

  • products – Exposure products, “sci” for science images.

  • im_type – Image extension, this must match the products variable.

  • force_download – Optionally force a re-download if the file already exists in the cache.

kete.ztf.fetch_ZTF_fovs(year)

Load all FOVs taken during the specified mission year of ZTF.

This will download and cache all FOV information for the given year from IRSA.

This can take about 20 minutes per year of survey, each year is 2-3 GB of data.

Parameters:

year (int) – Which year of ZTF, 2018 through 2024.

kete.ztf.fetch_frame(fov, products='sci', im_type='sciimg.fits', force_download=False, retry=2)

Given a ztf FOV, return the FITs file associated with it.

This downloads the fits file into the cache.

Parameters:
  • fov (ZtfCcdQuad) – A single CCD Quad FOV.

  • products – Which data product to fetch.

  • im_type – Image extension, this must match the products variable.

  • force_download – Optionally force a re-download if the file already exists in the cache.