Welcome to legacyzpts’s documentation!

Introduction

This is the documentation for legacyzpts.

The legacyzpts package/API

class legacyzpts.legacy_zeropoints.DecamMeasurer(*args, **kwargs)[source]

DECam CP units: ADU Class to measure a variety of quantities from a single DECam CCD.

Image read will be converted to e- also zpt to e-

read_image()[source]

Read the image and header. Convert image from ADU to electrons.

read_image_and_bitmask(funpack=True)[source]

funpack, then read

class legacyzpts.legacy_zeropoints.Mosaic3Measurer(*args, **kwargs)[source]

Class to measure a variety of quantities from a single Mosaic3 CCD. UNITS: e-/s

read_image()[source]

Read the image and header. Convert image from electrons/sec to electrons.

class legacyzpts.legacy_zeropoints.NinetyPrimeMeasurer(*args, **kwargs)[source]

Class to measure a variety of quantities from a single 90prime CCD. UNITS – CP e-/s

read_image()[source]

Read the image and header. Convert image from electrons/sec to electrons.

legacyzpts.legacy_zeropoints._ccds_table(camera='decam')[source]

Initialize the output CCDs table. See decstat.pro and merge-zeropoints.py for details.

legacyzpts.legacy_zeropoints._measure_image(args)[source]

Utility function to wrap measure_image function for multiprocessing map.

legacyzpts.legacy_zeropoints._stars_table(nstars=1)[source]

Initialize the stars table, which will contain information on all the stars detected on the CCD, including the PS1 photometry.

legacyzpts.legacy_zeropoints.convert_stars_table(T, camera=None)[source]

converges legacy stars to idl matches table

Note, unlike converte_zeropoints_table, must treat each band
separately so loop over the bands
Parameters:T – legacy stars fits_table, can be a single stars table or a merge of many stars tables
legacyzpts.legacy_zeropoints.convert_stars_table_one_band(T, zp_fid=None, pixscale=0.262)[source]

Converts legacy star fits table (T) to idl names and units

legacyzpts.legacy_zeropoints.T

legacy star fits table

legacyzpts.legacy_zeropoints.zp_fid

fiducial zeropoint for the band

legacyzpts.legacy_zeropoints.pixscale

pixscale

legacyzpts.legacy_zeropoints.expnum2exptime

dict mapping expnum to exptime

Example: kwargs= primary_hdr(zpt_fn) T= fits_table(stars_fn) newT= convert_stars_table(T, zp_fid=kwargs[‘zp_fid’], pixscale=kwargs[‘pixscale’])

legacyzpts.legacy_zeropoints.convert_zeropoints_table(T)[source]

Make column names and units of -zpt.fits identical to IDL zeropoints

Parameters:T – fits_table of some -zpt.fits like fits file
legacyzpts.legacy_zeropoints.create_legacypipe_table(ccds_fn)[source]

input _ccds_table fn output a table formatted for legacypipe/runbrick

legacyzpts.legacy_zeropoints.create_matches_table(stars_fn, zp_fid=None, pixscale=0.262)[source]

Takes legacy star table fn, reads, write out converted to idl names and units

Parameters:
  • stars_fn – legacy star file, ends with -star.fits
  • zp_fid – fiducial zeropoint for the band
  • pixscale – pixscale

Example: kwargs= primary_hdr(zpt_fn) create_matches_table(stars_fn, zp_fid=kwargs[‘zp_fid’], pixscale=kwargs[‘pixscale’])

legacyzpts.legacy_zeropoints.extra_ccd_keys(camera='decam')[source]

Returns list of camera-specific keywords for the ccd table

legacyzpts.legacy_zeropoints.get_extlist(camera, fn)[source]

Returns ‘mosaic’, ‘decam’, or ‘90prime’

legacyzpts.legacy_zeropoints.get_parser()[source]

return parser object, tells it what options to look for options can come from a list of strings or command line

legacyzpts.legacy_zeropoints.main(image_list=None, args=None)[source]

Produce zeropoints for all CP images in image_list image_list – iterable list of image filenames args – parsed argparser objection from get_parser()

legacyzpts.legacy_zeropoints.measure_image(img_fn, **measureargs)[source]

Wrapper on the camera-specific classes to measure the CCD-level data on all the FITS extensions for a given set of images.

legacyzpts.legacy_zeropoints.parse_coords(s)[source]

stackoverflow: https://stackoverflow.com/questions/9978880/python-argument-parser-list-of-list-or-tuple-of-tuples

legacyzpts.legacy_zeropoints.runit(imgfn_proj, **measureargs)[source]

Generate a legacypipe-compatible CCDs file for a given image.

legacyzpts.legacy_zeropoints.stdouterr_redirected(to='/dev/null', comm=None)[source]

assign unique log file to each mpi task

Based on http://stackoverflow.com/questions/5081657

Example: import os with stdouterr_redirected(to=filename): print(“from Python”) os.system(“echo non-Python applications are also supported”)

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/legacyzpts/checkouts/stable/doc/index.rst, line 31)

autodoc: failed to import module ‘legacyzpts.qa.compare_idlzpts’; the following exception was raised: Traceback (most recent call last): File “/home/docs/checkouts/readthedocs.org/user_builds/legacyzpts/conda/stable/lib/python3.5/site-packages/Sphinx-1.6.3-py3.5.egg/sphinx/ext/autodoc.py”, line 657, in import_object __import__(self.modname) File “/home/docs/checkouts/readthedocs.org/user_builds/legacyzpts/checkouts/stable/py/legacyzpts/qa/compare_idlzpts.py”, line 32, in <module> from legacyzpts.qa.paper_plots import LegacyZpts, myscatter File “/home/docs/checkouts/readthedocs.org/user_builds/legacyzpts/checkouts/stable/py/legacyzpts/qa/paper_plots.py”, line 23, in <module> from astrometry.util.fits import fits_table, merge_tables ImportError: No module named ‘astrometry’

Indices and tables