diff --git a/schema/alert.go b/schema/alert.go index b21e00b..a4e217a 100644 --- a/schema/alert.go +++ b/schema/alert.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema @@ -56,6 +57,11 @@ type Alert struct { + Fp_hists *UnionNullArrayFp_hist + + + + CutoutScience *UnionNullCutout @@ -71,7 +77,7 @@ type Alert struct { } -const AlertAvroCRC64Fingerprint = "\xb0\x9f;,H\xc2\xdc\r" +const AlertAvroCRC64Fingerprint = "\xbc\x10\x1b\v"B" func NewAlert() (*Alert) { return &Alert{} @@ -139,6 +145,11 @@ func writeAlert(r *Alert, w io.Writer) error { return err } + err = writeUnionNullArrayFp_hist( r.Fp_hists, w) + if err != nil { + return err + } + err = writeUnionNullCutout( r.CutoutScience, w) if err != nil { return err @@ -162,7 +173,7 @@ func (r *Alert) Serialize(w io.Writer) error { } func (r *Alert) Schema() string { - return "{\"doc\":\"avro alert schema for ZTF (www.ztf.caltech.edu)\",\"fields\":[{\"doc\":\"schema version used\",\"name\":\"schemavsn\",\"type\":\"string\"},{\"doc\":\"origin of alert packet\",\"name\":\"publisher\",\"type\":\"string\"},{\"doc\":\"object identifier or name\",\"name\":\"objectId\",\"type\":\"string\"},{\"name\":\"candid\",\"type\":\"long\"},{\"name\":\"candidate\",\"type\":{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for science image to facilitate archive retrieval\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":\"long\"},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":\"double\"},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":\"double\"},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":\"float\"},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":\"float\"},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Random Forest classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":\"double\"},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":\"double\"},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr1\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted\",\"name\":\"ndethist\",\"type\":\"int\"},{\"doc\":\"Number of times input candidate position fell on any field and readout-channel going back to beginning of survey\",\"name\":\"ncovhist\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Earliest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdstarthist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Latest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdendhist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":0,\"doc\":\"1 =\\u003e candidate is from a Target-of-Opportunity (ToO) exposure; 0 =\\u003e candidate is from a non-ToO exposure\",\"name\":\"tooflag\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Object ID of closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps1\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Object ID of second closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps2\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of second closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to second closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Object ID of third closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps3\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of third closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to third closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr3\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of source matches from PS1 catalog falling within 30 arcsec\",\"name\":\"nmtchps\",\"type\":\"int\"},{\"doc\":\"Processing ID for reference image to facilitate archive retrieval\",\"name\":\"rfid\",\"type\":\"long\"},{\"doc\":\"Observation Julian date of earliest exposure used to generate reference image [days]\",\"name\":\"jdstartref\",\"type\":\"double\"},{\"doc\":\"Observation Julian date of latest exposure used to generate reference image [days]\",\"name\":\"jdendref\",\"type\":\"double\"},{\"doc\":\"Number of frames (epochal images) used to generate reference image\",\"name\":\"nframesref\",\"type\":\"int\"},{\"doc\":\"version of Random Forest classifier model used to assign RealBogus (rb) quality score\",\"name\":\"rbversion\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Ratio: D/stddev(D) on event position where D = difference image\",\"name\":\"dsnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: S/stddev(S) on event position where S = image of convolution: D (x) PSF(D)\",\"name\":\"ssnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference of statistics: dsnrms - ssnrms\",\"name\":\"dsdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of PS1 photometric calibrators used to calibrate science image from science image processing\",\"name\":\"nmatches\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Covariance in magzpsci and clrcoeff from science image processing [mag^2]\",\"name\":\"zpclrcov\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point from median of all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"zpmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Median color of all PS1 photometric calibrators used from science image processing [mag]: for filter (fid) = 1, 2, 3, PS1 color used = g-r, g-r, r-i respectively\",\"name\":\"clrmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS color (deviation from average) of all PS1 photometric calibrators used from science image processing [mag]\",\"name\":\"clrrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [mag]\",\"name\":\"maggaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [mag]\",\"name\":\"maggaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Integration time of camera exposure [sec]\",\"name\":\"exptime\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Deep-Learning-based classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"drb\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of Deep-Learning-based classifier model used to assign RealBogus (drb) quality score\",\"name\":\"drbversion\",\"type\":\"string\"}],\"name\":\"candidate\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"3.3\"}},{\"default\":null,\"name\":\"prv_candidates\",\"type\":[\"null\",{\"items\":{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for image\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":[\"null\",\"long\"]},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":[\"null\",\"float\"]},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of RealBogus model/classifier used to assign rb quality score\",\"name\":\"rbversion\",\"type\":\"string\"}],\"name\":\"prv_candidate\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"3.3\"},\"type\":\"array\"}]},{\"default\":null,\"name\":\"cutoutScience\",\"type\":[\"null\",{\"doc\":\"avro alert schema\",\"fields\":[{\"name\":\"fileName\",\"type\":\"string\"},{\"doc\":\"fits.gz\",\"name\":\"stampData\",\"type\":\"bytes\"}],\"name\":\"cutout\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"3.3\"}]},{\"default\":null,\"name\":\"cutoutTemplate\",\"type\":[\"null\",\"ztf.alert.cutout\"]},{\"default\":null,\"name\":\"cutoutDifference\",\"type\":[\"null\",\"ztf.alert.cutout\"]}],\"name\":\"ztf.alert\",\"type\":\"record\",\"version\":\"3.3\"}" + return "{\"doc\":\"avro alert schema for ZTF (www.ztf.caltech.edu)\",\"fields\":[{\"doc\":\"schema version used\",\"name\":\"schemavsn\",\"type\":\"string\"},{\"doc\":\"origin of alert packet\",\"name\":\"publisher\",\"type\":\"string\"},{\"doc\":\"object identifier or name\",\"name\":\"objectId\",\"type\":\"string\"},{\"name\":\"candid\",\"type\":\"long\"},{\"name\":\"candidate\",\"type\":{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for science image to facilitate archive retrieval\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":\"long\"},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":\"double\"},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":\"double\"},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":\"float\"},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":\"float\"},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Random Forest classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":\"double\"},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":\"double\"},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr1\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted. All raw detections down to a photometric S/N of ~ 3 are included.\",\"name\":\"ndethist\",\"type\":\"int\"},{\"doc\":\"Number of times input candidate position fell on any field and readout-channel going back to beginning of survey\",\"name\":\"ncovhist\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Earliest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdstarthist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Latest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdendhist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"1 =\\u003e candidate is from a Target-of-Opportunity (ToO) exposure; 0 =\\u003e candidate is from a non-ToO exposure\",\"name\":\"tooflag\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Object ID of closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps1\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Object ID of second closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps2\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of second closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to second closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Object ID of third closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps3\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of third closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to third closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr3\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of source matches from PS1 catalog falling within 30 arcsec\",\"name\":\"nmtchps\",\"type\":\"int\"},{\"doc\":\"Processing ID for reference image to facilitate archive retrieval\",\"name\":\"rfid\",\"type\":\"long\"},{\"doc\":\"Observation Julian date of earliest exposure used to generate reference image [days]\",\"name\":\"jdstartref\",\"type\":\"double\"},{\"doc\":\"Observation Julian date of latest exposure used to generate reference image [days]\",\"name\":\"jdendref\",\"type\":\"double\"},{\"doc\":\"Number of frames (epochal images) used to generate reference image\",\"name\":\"nframesref\",\"type\":\"int\"},{\"doc\":\"version of Random Forest classifier model used to assign RealBogus (rb) quality score\",\"name\":\"rbversion\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Ratio: D/stddev(D) on event position where D = difference image\",\"name\":\"dsnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: S/stddev(S) on event position where S = image of convolution: D (x) PSF(D)\",\"name\":\"ssnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference of statistics: dsnrms - ssnrms\",\"name\":\"dsdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of PS1 photometric calibrators used to calibrate science image from science image processing\",\"name\":\"nmatches\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Covariance in magzpsci and clrcoeff from science image processing [mag^2]\",\"name\":\"zpclrcov\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point from median of all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"zpmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Median color of all PS1 photometric calibrators used from science image processing [mag]: for filter (fid) = 1, 2, 3, PS1 color used = g-r, g-r, r-i respectively\",\"name\":\"clrmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS color (deviation from average) of all PS1 photometric calibrators used from science image processing [mag]\",\"name\":\"clrrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [mag]\",\"name\":\"maggaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [mag]\",\"name\":\"maggaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Integration time of camera exposure [sec]\",\"name\":\"exptime\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Deep-Learning-based classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"drb\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of Deep-Learning-based classifier model used to assign RealBogus (drb) quality score\",\"name\":\"drbversion\",\"type\":\"string\"}],\"name\":\"candidate\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"4.02\"}},{\"default\":null,\"name\":\"prv_candidates\",\"type\":[\"null\",{\"items\":{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for image\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":[\"null\",\"long\"]},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":[\"null\",\"float\"]},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of RealBogus model/classifier used to assign rb quality score\",\"name\":\"rbversion\",\"type\":\"string\"}],\"name\":\"prv_candidate\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"4.02\"},\"type\":\"array\"}]},{\"default\":null,\"name\":\"fp_hists\",\"type\":[\"null\",{\"items\":{\"doc\":\"avro alert schema\",\"fields\":[{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for image\",\"name\":\"pid\",\"type\":\"long\"},{\"doc\":\"Processing ID for reference image to facilitate archive retrieval\",\"name\":\"rfid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Effective FWHM of sci image [pixels]\",\"name\":\"sciinpseeing\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Background level in sci image [DN]\",\"name\":\"scibckgnd\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Robust sigma per pixel in sci image [DN]\",\"name\":\"scisigpix\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Integration time of camera exposure [sec]\",\"name\":\"exptime\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full sci image astrometric RMS along R.A. with respect to Gaia1 [arcsec]\",\"name\":\"adpctdif1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full sci image astrometric RMS along Dec. with respect to Gaia1 [arcsec]\",\"name\":\"adpctdif2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"default\":null,\"doc\":\"Forced difference image PSF-fit flux [DN]\",\"name\":\"forcediffimflux\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in forcediffimflux [DN]\",\"name\":\"forcediffimfluxunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Forced photometry processing status codes (0 =\\u003e no warnings); see documentation\",\"name\":\"procstatus\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [arcsec]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":\"double\"},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":\"double\"},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]}],\"name\":\"fp_hist\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"4.02\"},\"type\":\"array\"}]},{\"default\":null,\"name\":\"cutoutScience\",\"type\":[\"null\",{\"doc\":\"avro alert schema\",\"fields\":[{\"name\":\"fileName\",\"type\":\"string\"},{\"doc\":\"fits.gz\",\"name\":\"stampData\",\"type\":\"bytes\"}],\"name\":\"cutout\",\"namespace\":\"ztf.alert\",\"type\":\"record\",\"version\":\"4.02\"}]},{\"default\":null,\"name\":\"cutoutTemplate\",\"type\":[\"null\",\"ztf.alert.cutout\"]},{\"default\":null,\"name\":\"cutoutDifference\",\"type\":[\"null\",\"ztf.alert.cutout\"]}],\"name\":\"ztf.alert\",\"type\":\"record\",\"version\":\"4.02\"}" } func (r *Alert) SchemaName() string { @@ -225,6 +236,15 @@ func (r *Alert) Get(i int) types.Field { case 6: + r.Fp_hists = NewUnionNullArrayFp_hist() + + + + return r.Fp_hists + + + case 7: + r.CutoutScience = NewUnionNullCutout() @@ -232,7 +252,7 @@ func (r *Alert) Get(i int) types.Field { return r.CutoutScience - case 7: + case 8: r.CutoutTemplate = NewUnionNullCutout() @@ -241,7 +261,7 @@ func (r *Alert) Get(i int) types.Field { return r.CutoutTemplate - case 8: + case 9: r.CutoutDifference = NewUnionNullCutout() @@ -276,20 +296,27 @@ func (r *Alert) SetDefault(i int) { case 6: - r.CutoutScience = NewUnionNullCutout() + r.Fp_hists = NewUnionNullArrayFp_hist() return case 7: - r.CutoutTemplate = NewUnionNullCutout() + r.CutoutScience = NewUnionNullCutout() return case 8: + r.CutoutTemplate = NewUnionNullCutout() + + return + + + + case 9: r.CutoutDifference = NewUnionNullCutout() return diff --git a/schema/alert_container.go b/schema/alert_container.go index ac0ce02..00906bd 100644 --- a/schema/alert_container.go +++ b/schema/alert_container.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/array_fp_hist.go b/schema/array_fp_hist.go new file mode 100644 index 0000000..8bc198e --- /dev/null +++ b/schema/array_fp_hist.go @@ -0,0 +1,59 @@ +// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT. +/* + * SOURCES: + * alert.avsc + * candidate.avsc + * cutout.avsc + * fp_hist.avsc + * prv_candidate.avsc + */ +package schema + +import ( + "io" + + "github.com/actgardner/gogen-avro/vm/types" + "github.com/actgardner/gogen-avro/vm" +) + +func writeArrayFp_hist(r []*Fp_hist, w io.Writer) error { + err := vm.WriteLong(int64(len(r)),w) + if err != nil || len(r) == 0 { + return err + } + for _, e := range r { + err = writeFp_hist(e, w) + if err != nil { + return err + } + } + return vm.WriteLong(0,w) +} + + + +type ArrayFp_histWrapper []*Fp_hist + +func (_ *ArrayFp_histWrapper) SetBoolean(v bool) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetInt(v int32) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetLong(v int64) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetFloat(v float32) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetDouble(v float64) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetBytes(v []byte) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetString(v string) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) SetUnionElem(v int64) { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) Get(i int) types.Field { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) AppendMap(key string) types.Field { panic("Unsupported operation") } +func (_ *ArrayFp_histWrapper) Finalize() { } +func (_ *ArrayFp_histWrapper) SetDefault(i int) { panic("Unsupported operation") } +func (r *ArrayFp_histWrapper) AppendArray() types.Field { + var v *Fp_hist + + v = NewFp_hist() + + + *r = append(*r, v) + + return (*r)[len(*r)-1] + +} diff --git a/schema/array_prv_candidate.go b/schema/array_prv_candidate.go index bf6c288..4c85b4f 100644 --- a/schema/array_prv_candidate.go +++ b/schema/array_prv_candidate.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/candidate.go b/schema/candidate.go index 91bf328..8904432 100644 --- a/schema/candidate.go +++ b/schema/candidate.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema @@ -411,7 +412,7 @@ type Candidate struct { - // Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted + // Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted. All raw detections down to a photometric S/N of ~ 3 are included. Ndethist int32 @@ -1302,7 +1303,7 @@ func (r *Candidate) Serialize(w io.Writer) error { } func (r *Candidate) Schema() string { - return "{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for science image to facilitate archive retrieval\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":\"long\"},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":\"double\"},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":\"double\"},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":\"float\"},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":\"float\"},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Random Forest classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":\"double\"},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":\"double\"},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr1\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted\",\"name\":\"ndethist\",\"type\":\"int\"},{\"doc\":\"Number of times input candidate position fell on any field and readout-channel going back to beginning of survey\",\"name\":\"ncovhist\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Earliest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdstarthist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Latest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdendhist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":0,\"doc\":\"1 =\\u003e candidate is from a Target-of-Opportunity (ToO) exposure; 0 =\\u003e candidate is from a non-ToO exposure\",\"name\":\"tooflag\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Object ID of closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps1\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Object ID of second closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps2\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of second closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to second closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Object ID of third closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps3\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of third closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to third closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr3\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of source matches from PS1 catalog falling within 30 arcsec\",\"name\":\"nmtchps\",\"type\":\"int\"},{\"doc\":\"Processing ID for reference image to facilitate archive retrieval\",\"name\":\"rfid\",\"type\":\"long\"},{\"doc\":\"Observation Julian date of earliest exposure used to generate reference image [days]\",\"name\":\"jdstartref\",\"type\":\"double\"},{\"doc\":\"Observation Julian date of latest exposure used to generate reference image [days]\",\"name\":\"jdendref\",\"type\":\"double\"},{\"doc\":\"Number of frames (epochal images) used to generate reference image\",\"name\":\"nframesref\",\"type\":\"int\"},{\"doc\":\"version of Random Forest classifier model used to assign RealBogus (rb) quality score\",\"name\":\"rbversion\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Ratio: D/stddev(D) on event position where D = difference image\",\"name\":\"dsnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: S/stddev(S) on event position where S = image of convolution: D (x) PSF(D)\",\"name\":\"ssnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference of statistics: dsnrms - ssnrms\",\"name\":\"dsdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of PS1 photometric calibrators used to calibrate science image from science image processing\",\"name\":\"nmatches\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Covariance in magzpsci and clrcoeff from science image processing [mag^2]\",\"name\":\"zpclrcov\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point from median of all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"zpmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Median color of all PS1 photometric calibrators used from science image processing [mag]: for filter (fid) = 1, 2, 3, PS1 color used = g-r, g-r, r-i respectively\",\"name\":\"clrmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS color (deviation from average) of all PS1 photometric calibrators used from science image processing [mag]\",\"name\":\"clrrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [mag]\",\"name\":\"maggaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [mag]\",\"name\":\"maggaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Integration time of camera exposure [sec]\",\"name\":\"exptime\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Deep-Learning-based classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"drb\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of Deep-Learning-based classifier model used to assign RealBogus (drb) quality score\",\"name\":\"drbversion\",\"type\":\"string\"}],\"name\":\"ztf.alert.candidate\",\"type\":\"record\",\"version\":\"3.3\"}" + return "{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for science image to facilitate archive retrieval\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":\"long\"},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":\"double\"},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":\"double\"},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":\"float\"},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":\"float\"},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Random Forest classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":\"double\"},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":\"double\"},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr1\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted. All raw detections down to a photometric S/N of ~ 3 are included.\",\"name\":\"ndethist\",\"type\":\"int\"},{\"doc\":\"Number of times input candidate position fell on any field and readout-channel going back to beginning of survey\",\"name\":\"ncovhist\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Earliest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdstarthist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Latest Julian date of epoch corresponding to ndethist [days]\",\"name\":\"jdendhist\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"1 =\\u003e candidate is from a Target-of-Opportunity (ToO) exposure; 0 =\\u003e candidate is from a non-ToO exposure\",\"name\":\"tooflag\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Object ID of closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps1\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Object ID of second closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps2\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of second closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to second closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Object ID of third closest source from PS1 catalog; if exists within 30 arcsec\",\"name\":\"objectidps3\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"g-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"sgmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"r-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"srmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"i-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"simag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"z-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]\",\"name\":\"szmag3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy score of third closest source from PS1 catalog; if exists within 30 arcsec: 0 \\u003c= sgscore \\u003c= 1 where closer to 1 implies higher likelihood of being a star\",\"name\":\"sgscore3\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to third closest source from PS1 catalog; if exists within 30 arcsec [arcsec]\",\"name\":\"distpsnr3\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of source matches from PS1 catalog falling within 30 arcsec\",\"name\":\"nmtchps\",\"type\":\"int\"},{\"doc\":\"Processing ID for reference image to facilitate archive retrieval\",\"name\":\"rfid\",\"type\":\"long\"},{\"doc\":\"Observation Julian date of earliest exposure used to generate reference image [days]\",\"name\":\"jdstartref\",\"type\":\"double\"},{\"doc\":\"Observation Julian date of latest exposure used to generate reference image [days]\",\"name\":\"jdendref\",\"type\":\"double\"},{\"doc\":\"Number of frames (epochal images) used to generate reference image\",\"name\":\"nframesref\",\"type\":\"int\"},{\"doc\":\"version of Random Forest classifier model used to assign RealBogus (rb) quality score\",\"name\":\"rbversion\",\"type\":\"string\"},{\"default\":null,\"doc\":\"Ratio: D/stddev(D) on event position where D = difference image\",\"name\":\"dsnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: S/stddev(S) on event position where S = image of convolution: D (x) PSF(D)\",\"name\":\"ssnrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference of statistics: dsnrms - ssnrms\",\"name\":\"dsdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Number of PS1 photometric calibrators used to calibrate science image from science image processing\",\"name\":\"nmatches\",\"type\":\"int\"},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Covariance in magzpsci and clrcoeff from science image processing [mag^2]\",\"name\":\"zpclrcov\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point from median of all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"zpmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Median color of all PS1 photometric calibrators used from science image processing [mag]: for filter (fid) = 1, 2, 3, PS1 color used = g-r, g-r, r-i respectively\",\"name\":\"clrmed\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS color (deviation from average) of all PS1 photometric calibrators used from science image processing [mag]\",\"name\":\"clrrms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [arcsec]\",\"name\":\"neargaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [mag]\",\"name\":\"maggaia\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Gaia (G-band) magnitude of closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [mag]\",\"name\":\"maggaiabright\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Integration time of camera exposure [sec]\",\"name\":\"exptime\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RealBogus quality score from Deep-Learning-based classifier; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"drb\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of Deep-Learning-based classifier model used to assign RealBogus (drb) quality score\",\"name\":\"drbversion\",\"type\":\"string\"}],\"name\":\"ztf.alert.candidate\",\"type\":\"record\",\"version\":\"4.02\"}" } func (r *Candidate) SchemaName() string { diff --git a/schema/candidate_container.go b/schema/candidate_container.go index 51e58ca..ad6c64b 100644 --- a/schema/candidate_container.go +++ b/schema/candidate_container.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/cutout.go b/schema/cutout.go index a43dc92..30d0869 100644 --- a/schema/cutout.go +++ b/schema/cutout.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema @@ -88,7 +89,7 @@ func (r *Cutout) Serialize(w io.Writer) error { } func (r *Cutout) Schema() string { - return "{\"doc\":\"avro alert schema\",\"fields\":[{\"name\":\"fileName\",\"type\":\"string\"},{\"doc\":\"fits.gz\",\"name\":\"stampData\",\"type\":\"bytes\"}],\"name\":\"ztf.alert.cutout\",\"type\":\"record\",\"version\":\"3.3\"}" + return "{\"doc\":\"avro alert schema\",\"fields\":[{\"name\":\"fileName\",\"type\":\"string\"},{\"doc\":\"fits.gz\",\"name\":\"stampData\",\"type\":\"bytes\"}],\"name\":\"ztf.alert.cutout\",\"type\":\"record\",\"version\":\"4.02\"}" } func (r *Cutout) SchemaName() string { diff --git a/schema/cutout_container.go b/schema/cutout_container.go index d69dd1c..820b9a9 100644 --- a/schema/cutout_container.go +++ b/schema/cutout_container.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/fp_hist.go b/schema/fp_hist.go new file mode 100644 index 0000000..eb3b59b --- /dev/null +++ b/schema/fp_hist.go @@ -0,0 +1,863 @@ +// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT. +/* + * SOURCES: + * alert.avsc + * candidate.avsc + * cutout.avsc + * fp_hist.avsc + * prv_candidate.avsc + */ +package schema + +import ( + "io" + "github.com/actgardner/gogen-avro/vm/types" + "github.com/actgardner/gogen-avro/vm" + "github.com/actgardner/gogen-avro/compiler" +) + +// avro alert schema +type Fp_hist struct { + + + // ZTF field ID + + + Field *UnionNullInt + + + + // Readout channel ID [00 .. 63] + + + Rcid *UnionNullInt + + + + // Filter ID (1=g; 2=R; 3=i) + + + Fid int32 + + + + // Processing ID for image + + + Pid int64 + + + + // Processing ID for reference image to facilitate archive retrieval + + + Rfid int64 + + + + // Effective FWHM of sci image [pixels] + + + Sciinpseeing *UnionNullFloat + + + + // Background level in sci image [DN] + + + Scibckgnd *UnionNullFloat + + + + // Robust sigma per pixel in sci image [DN] + + + Scisigpix *UnionNullFloat + + + + // Magnitude zero point for photometry estimates [mag] + + + Magzpsci *UnionNullFloat + + + + // Magnitude zero point uncertainty (in magzpsci) [mag] + + + Magzpsciunc *UnionNullFloat + + + + // RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag] + + + Magzpscirms *UnionNullFloat + + + + // Color coefficient from linear fit from photometric calibration of science image + + + Clrcoeff *UnionNullFloat + + + + // Color coefficient uncertainty from linear fit (corresponding to clrcoeff) + + + Clrcounc *UnionNullFloat + + + + // Integration time of camera exposure [sec] + + + Exptime *UnionNullFloat + + + + // Full sci image astrometric RMS along R.A. with respect to Gaia1 [arcsec] + + + Adpctdif1 *UnionNullFloat + + + + // Full sci image astrometric RMS along Dec. with respect to Gaia1 [arcsec] + + + Adpctdif2 *UnionNullFloat + + + + // Expected 5-sigma mag limit in difference image based on global noise estimate [mag] + + + Diffmaglim *UnionNullFloat + + + + // Program ID: encodes either public, collab, or caltech mode + + + Programid int32 + + + + // Observation Julian date at start of exposure [days] + + + Jd float64 + + + + // Forced difference image PSF-fit flux [DN] + + + Forcediffimflux *UnionNullFloat + + + + // 1-sigma uncertainty in forcediffimflux [DN] + + + Forcediffimfluxunc *UnionNullFloat + + + + // Forced photometry processing status codes (0 => no warnings); see documentation + + + Procstatus *UnionNullString + + + + // distance to nearest source in reference image PSF-catalog [arcsec] + + + Distnr *UnionNullFloat + + + + // Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg] + + + Ranr float64 + + + + // Declination of nearest source in reference image PSF-catalog; J2000 [deg] + + + Decnr float64 + + + + // magnitude of nearest source in reference image PSF-catalog [mag] + + + Magnr *UnionNullFloat + + + + // 1-sigma uncertainty in magnr [mag] + + + Sigmagnr *UnionNullFloat + + + + // DAOPhot chi parameter of nearest source in reference image PSF-catalog + + + Chinr *UnionNullFloat + + + + // DAOPhot sharp parameter of nearest source in reference image PSF-catalog + + + Sharpnr *UnionNullFloat + + +} + +const Fp_histAvroCRC64Fingerprint = "lսiy\x19\xa2g" + +func NewFp_hist() (*Fp_hist) { + return &Fp_hist{} +} + +func DeserializeFp_hist(r io.Reader) (*Fp_hist, error) { + t := NewFp_hist() + deser, err := compiler.CompileSchemaBytes([]byte(t.Schema()), []byte(t.Schema())) + if err != nil { + return nil, err + } + + err = vm.Eval(r, deser, t) + if err != nil { + return nil, err + } + return t, err +} + +func DeserializeFp_histFromSchema(r io.Reader, schema string) (*Fp_hist, error) { + t := NewFp_hist() + + deser, err := compiler.CompileSchemaBytes([]byte(schema), []byte(t.Schema())) + if err != nil { + return nil, err + } + + err = vm.Eval(r, deser, t) + if err != nil { + return nil, err + } + return t, err +} + +func writeFp_hist(r *Fp_hist, w io.Writer) error { + var err error + + err = writeUnionNullInt( r.Field, w) + if err != nil { + return err + } + + err = writeUnionNullInt( r.Rcid, w) + if err != nil { + return err + } + + err = vm.WriteInt( r.Fid, w) + if err != nil { + return err + } + + err = vm.WriteLong( r.Pid, w) + if err != nil { + return err + } + + err = vm.WriteLong( r.Rfid, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Sciinpseeing, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Scibckgnd, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Scisigpix, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Magzpsci, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Magzpsciunc, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Magzpscirms, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Clrcoeff, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Clrcounc, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Exptime, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Adpctdif1, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Adpctdif2, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Diffmaglim, w) + if err != nil { + return err + } + + err = vm.WriteInt( r.Programid, w) + if err != nil { + return err + } + + err = vm.WriteDouble( r.Jd, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Forcediffimflux, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Forcediffimfluxunc, w) + if err != nil { + return err + } + + err = writeUnionNullString( r.Procstatus, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Distnr, w) + if err != nil { + return err + } + + err = vm.WriteDouble( r.Ranr, w) + if err != nil { + return err + } + + err = vm.WriteDouble( r.Decnr, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Magnr, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Sigmagnr, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Chinr, w) + if err != nil { + return err + } + + err = writeUnionNullFloat( r.Sharpnr, w) + if err != nil { + return err + } + + return err +} + +func (r *Fp_hist) Serialize(w io.Writer) error { + return writeFp_hist(r, w) +} + +func (r *Fp_hist) Schema() string { + return "{\"doc\":\"avro alert schema\",\"fields\":[{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for image\",\"name\":\"pid\",\"type\":\"long\"},{\"doc\":\"Processing ID for reference image to facilitate archive retrieval\",\"name\":\"rfid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Effective FWHM of sci image [pixels]\",\"name\":\"sciinpseeing\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Background level in sci image [DN]\",\"name\":\"scibckgnd\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Robust sigma per pixel in sci image [DN]\",\"name\":\"scisigpix\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Integration time of camera exposure [sec]\",\"name\":\"exptime\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full sci image astrometric RMS along R.A. with respect to Gaia1 [arcsec]\",\"name\":\"adpctdif1\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full sci image astrometric RMS along Dec. with respect to Gaia1 [arcsec]\",\"name\":\"adpctdif2\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"default\":null,\"doc\":\"Forced difference image PSF-fit flux [DN]\",\"name\":\"forcediffimflux\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in forcediffimflux [DN]\",\"name\":\"forcediffimfluxunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Forced photometry processing status codes (0 =\\u003e no warnings); see documentation\",\"name\":\"procstatus\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [arcsec]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":\"double\"},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":\"double\"},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]}],\"name\":\"ztf.alert.fp_hist\",\"type\":\"record\",\"version\":\"4.02\"}" +} + +func (r *Fp_hist) SchemaName() string { + return "ztf.alert.fp_hist" +} + +func (_ *Fp_hist) SetBoolean(v bool) { panic("Unsupported operation") } +func (_ *Fp_hist) SetInt(v int32) { panic("Unsupported operation") } +func (_ *Fp_hist) SetLong(v int64) { panic("Unsupported operation") } +func (_ *Fp_hist) SetFloat(v float32) { panic("Unsupported operation") } +func (_ *Fp_hist) SetDouble(v float64) { panic("Unsupported operation") } +func (_ *Fp_hist) SetBytes(v []byte) { panic("Unsupported operation") } +func (_ *Fp_hist) SetString(v string) { panic("Unsupported operation") } +func (_ *Fp_hist) SetUnionElem(v int64) { panic("Unsupported operation") } + +func (r *Fp_hist) Get(i int) types.Field { + switch (i) { + + case 0: + + r.Field = NewUnionNullInt() + + + + return r.Field + + + case 1: + + r.Rcid = NewUnionNullInt() + + + + return r.Rcid + + + case 2: + + + return (*types.Int)(&r.Fid) + + + case 3: + + + return (*types.Long)(&r.Pid) + + + case 4: + + + return (*types.Long)(&r.Rfid) + + + case 5: + + r.Sciinpseeing = NewUnionNullFloat() + + + + return r.Sciinpseeing + + + case 6: + + r.Scibckgnd = NewUnionNullFloat() + + + + return r.Scibckgnd + + + case 7: + + r.Scisigpix = NewUnionNullFloat() + + + + return r.Scisigpix + + + case 8: + + r.Magzpsci = NewUnionNullFloat() + + + + return r.Magzpsci + + + case 9: + + r.Magzpsciunc = NewUnionNullFloat() + + + + return r.Magzpsciunc + + + case 10: + + r.Magzpscirms = NewUnionNullFloat() + + + + return r.Magzpscirms + + + case 11: + + r.Clrcoeff = NewUnionNullFloat() + + + + return r.Clrcoeff + + + case 12: + + r.Clrcounc = NewUnionNullFloat() + + + + return r.Clrcounc + + + case 13: + + r.Exptime = NewUnionNullFloat() + + + + return r.Exptime + + + case 14: + + r.Adpctdif1 = NewUnionNullFloat() + + + + return r.Adpctdif1 + + + case 15: + + r.Adpctdif2 = NewUnionNullFloat() + + + + return r.Adpctdif2 + + + case 16: + + r.Diffmaglim = NewUnionNullFloat() + + + + return r.Diffmaglim + + + case 17: + + + return (*types.Int)(&r.Programid) + + + case 18: + + + return (*types.Double)(&r.Jd) + + + case 19: + + r.Forcediffimflux = NewUnionNullFloat() + + + + return r.Forcediffimflux + + + case 20: + + r.Forcediffimfluxunc = NewUnionNullFloat() + + + + return r.Forcediffimfluxunc + + + case 21: + + r.Procstatus = NewUnionNullString() + + + + return r.Procstatus + + + case 22: + + r.Distnr = NewUnionNullFloat() + + + + return r.Distnr + + + case 23: + + + return (*types.Double)(&r.Ranr) + + + case 24: + + + return (*types.Double)(&r.Decnr) + + + case 25: + + r.Magnr = NewUnionNullFloat() + + + + return r.Magnr + + + case 26: + + r.Sigmagnr = NewUnionNullFloat() + + + + return r.Sigmagnr + + + case 27: + + r.Chinr = NewUnionNullFloat() + + + + return r.Chinr + + + case 28: + + r.Sharpnr = NewUnionNullFloat() + + + + return r.Sharpnr + + + } + panic("Unknown field index") +} + +func (r *Fp_hist) SetDefault(i int) { + switch (i) { + + + case 0: + r.Field = NewUnionNullInt() + + return + + + + case 1: + r.Rcid = NewUnionNullInt() + + return + + + + + + + + + + case 5: + r.Sciinpseeing = NewUnionNullFloat() + + return + + + + case 6: + r.Scibckgnd = NewUnionNullFloat() + + return + + + + case 7: + r.Scisigpix = NewUnionNullFloat() + + return + + + + case 8: + r.Magzpsci = NewUnionNullFloat() + + return + + + + case 9: + r.Magzpsciunc = NewUnionNullFloat() + + return + + + + case 10: + r.Magzpscirms = NewUnionNullFloat() + + return + + + + case 11: + r.Clrcoeff = NewUnionNullFloat() + + return + + + + case 12: + r.Clrcounc = NewUnionNullFloat() + + return + + + + case 13: + r.Exptime = NewUnionNullFloat() + + return + + + + case 14: + r.Adpctdif1 = NewUnionNullFloat() + + return + + + + case 15: + r.Adpctdif2 = NewUnionNullFloat() + + return + + + + case 16: + r.Diffmaglim = NewUnionNullFloat() + + return + + + + + + + + case 19: + r.Forcediffimflux = NewUnionNullFloat() + + return + + + + case 20: + r.Forcediffimfluxunc = NewUnionNullFloat() + + return + + + + case 21: + r.Procstatus = NewUnionNullString() + + return + + + + case 22: + r.Distnr = NewUnionNullFloat() + + return + + + + + + + + case 25: + r.Magnr = NewUnionNullFloat() + + return + + + + case 26: + r.Sigmagnr = NewUnionNullFloat() + + return + + + + case 27: + r.Chinr = NewUnionNullFloat() + + return + + + + case 28: + r.Sharpnr = NewUnionNullFloat() + + return + + + } + panic("Unknown field index") +} + +func (_ *Fp_hist) AppendMap(key string) types.Field { panic("Unsupported operation") } +func (_ *Fp_hist) AppendArray() types.Field { panic("Unsupported operation") } +func (_ *Fp_hist) Finalize() { } + + +func (_ *Fp_hist) AvroCRC64Fingerprint() []byte { + return []byte(Fp_histAvroCRC64Fingerprint) +} diff --git a/schema/fp_hist_container.go b/schema/fp_hist_container.go new file mode 100644 index 0000000..6f52ee4 --- /dev/null +++ b/schema/fp_hist_container.go @@ -0,0 +1,53 @@ +// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT. +/* + * SOURCES: + * alert.avsc + * candidate.avsc + * cutout.avsc + * fp_hist.avsc + * prv_candidate.avsc + */ +package schema + +import ( + "io" + + "github.com/actgardner/gogen-avro/container" + "github.com/actgardner/gogen-avro/vm" + "github.com/actgardner/gogen-avro/compiler" +) + +func NewFp_histWriter(writer io.Writer, codec container.Codec, recordsPerBlock int64) (*container.Writer, error) { + str := NewFp_hist() + return container.NewWriter(writer, codec, recordsPerBlock, str.Schema()) +} + +// container reader +type Fp_histReader struct { + r io.Reader + p *vm.Program +} + +func NewFp_histReader(r io.Reader) (*Fp_histReader, error){ + containerReader, err := container.NewReader(r) + if err != nil { + return nil, err + } + + t := NewFp_hist() + deser, err := compiler.CompileSchemaBytes([]byte(containerReader.AvroContainerSchema()), []byte(t.Schema())) + if err != nil { + return nil, err + } + + return &Fp_histReader { + r: containerReader, + p: deser, + }, nil +} + +func (r Fp_histReader) Read() (*Fp_hist, error) { + t := NewFp_hist() + err := vm.Eval(r.r, r.p, t) + return t, err +} diff --git a/schema/prv_candidate.go b/schema/prv_candidate.go index 2b0b2e8..e09b205 100644 --- a/schema/prv_candidate.go +++ b/schema/prv_candidate.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema @@ -750,7 +751,7 @@ func (r *Prv_candidate) Serialize(w io.Writer) error { } func (r *Prv_candidate) Schema() string { - return "{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for image\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":[\"null\",\"long\"]},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":[\"null\",\"float\"]},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of RealBogus model/classifier used to assign rb quality score\",\"name\":\"rbversion\",\"type\":\"string\"}],\"name\":\"ztf.alert.prv_candidate\",\"type\":\"record\",\"version\":\"3.3\"}" + return "{\"doc\":\"avro alert schema\",\"fields\":[{\"doc\":\"Observation Julian date at start of exposure [days]\",\"name\":\"jd\",\"type\":\"double\"},{\"doc\":\"Filter ID (1=g; 2=R; 3=i)\",\"name\":\"fid\",\"type\":\"int\"},{\"doc\":\"Processing ID for image\",\"name\":\"pid\",\"type\":\"long\"},{\"default\":null,\"doc\":\"Expected 5-sigma mag limit in difference image based on global noise estimate [mag]\",\"name\":\"diffmaglim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"filename of positive (sci minus ref) difference image\",\"name\":\"pdiffimfilename\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Principal investigator attached to program ID\",\"name\":\"programpi\",\"type\":[\"null\",\"string\"]},{\"doc\":\"Program ID: encodes either public, collab, or caltech mode\",\"name\":\"programid\",\"type\":\"int\"},{\"doc\":\"Candidate ID from operations DB\",\"name\":\"candid\",\"type\":[\"null\",\"long\"]},{\"doc\":\"t or 1 =\\u003e candidate is from positive (sci minus ref) subtraction; f or 0 =\\u003e candidate is from negative (ref minus sci) subtraction\",\"name\":\"isdiffpos\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Internal pipeline table extraction ID\",\"name\":\"tblid\",\"type\":[\"null\",\"long\"]},{\"default\":null,\"doc\":\"Night ID\",\"name\":\"nid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"Readout channel ID [00 .. 63]\",\"name\":\"rcid\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"ZTF field ID\",\"name\":\"field\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"x-image position of candidate [pixels]\",\"name\":\"xpos\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"y-image position of candidate [pixels]\",\"name\":\"ypos\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of candidate; J2000 [deg]\",\"name\":\"ra\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of candidate; J2000 [deg]\",\"name\":\"dec\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Magnitude from PSF-fit photometry [mag]\",\"name\":\"magpsf\",\"type\":[\"null\",\"float\"]},{\"doc\":\"1-sigma uncertainty in magpsf [mag]\",\"name\":\"sigmapsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Reduced chi-square for PSF-fit\",\"name\":\"chipsf\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 14 pixel diameter aperture [mag]\",\"name\":\"magap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magap [mag]\",\"name\":\"sigmagap\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest source in reference image PSF-catalog [pixels]\",\"name\":\"distnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest source in reference image PSF-catalog [mag]\",\"name\":\"magnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magnr [mag]\",\"name\":\"sigmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot chi parameter of nearest source in reference image PSF-catalog\",\"name\":\"chinr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"DAOPhot sharp parameter of nearest source in reference image PSF-catalog\",\"name\":\"sharpnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Local sky background estimate [DN]\",\"name\":\"sky\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: magap - magpsf [mag]\",\"name\":\"magdiff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]\",\"name\":\"fwhm\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Star/Galaxy classification score from SExtractor\",\"name\":\"classtar\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Distance to nearest edge in image [pixels]\",\"name\":\"mindtoedge\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Difference: diffmaglim - magap [mag]\",\"name\":\"magfromlim\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: difffwhm / fwhm\",\"name\":\"seeratio\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat major axis from SExtractor [pixels]\",\"name\":\"aimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Windowed profile RMS afloat minor axis from SExtractor [pixels]\",\"name\":\"bimage\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / fwhm\",\"name\":\"aimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: bimage / fwhm\",\"name\":\"bimagerat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Ratio: aimage / bimage\",\"name\":\"elong\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"number of negative pixels in a 5 x 5 pixel stamp\",\"name\":\"nneg\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"number of prior-tagged bad pixels in a 5 x 5 pixel stamp\",\"name\":\"nbad\",\"type\":[\"null\",\"int\"]},{\"default\":null,\"doc\":\"RealBogus quality score; range is 0 to 1 where closer to 1 is more reliable\",\"name\":\"rb\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"distance to nearest known solar system object if exists within 30 arcsec [arcsec]\",\"name\":\"ssdistnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]\",\"name\":\"ssmagnr\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"name of nearest known solar system object if exists within 30 arcsec (from MPC archive)\",\"name\":\"ssnamenr\",\"type\":[\"null\",\"string\"]},{\"default\":null,\"doc\":\"Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers\",\"name\":\"sumrat\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Aperture mag using 18 pixel diameter aperture [mag]\",\"name\":\"magapbig\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"1-sigma uncertainty in magapbig [mag]\",\"name\":\"sigmagapbig\",\"type\":[\"null\",\"float\"]},{\"doc\":\"Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"ranr\",\"type\":[\"null\",\"double\"]},{\"doc\":\"Declination of nearest source in reference image PSF-catalog; J2000 [deg]\",\"name\":\"decnr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Peak-pixel signal-to-noise ratio in point source matched-filtered detection image\",\"name\":\"scorr\",\"type\":[\"null\",\"double\"]},{\"default\":null,\"doc\":\"Magnitude zero point for photometry estimates [mag]\",\"name\":\"magzpsci\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Magnitude zero point uncertainty (in magzpsci) [mag]\",\"name\":\"magzpsciunc\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]\",\"name\":\"magzpscirms\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient from linear fit from photometric calibration of science image\",\"name\":\"clrcoeff\",\"type\":[\"null\",\"float\"]},{\"default\":null,\"doc\":\"Color coefficient uncertainty from linear fit (corresponding to clrcoeff)\",\"name\":\"clrcounc\",\"type\":[\"null\",\"float\"]},{\"doc\":\"version of RealBogus model/classifier used to assign rb quality score\",\"name\":\"rbversion\",\"type\":\"string\"}],\"name\":\"ztf.alert.prv_candidate\",\"type\":\"record\",\"version\":\"4.02\"}" } func (r *Prv_candidate) SchemaName() string { diff --git a/schema/prv_candidate_container.go b/schema/prv_candidate_container.go index db87249..e3506b4 100644 --- a/schema/prv_candidate_container.go +++ b/schema/prv_candidate_container.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/schema-avro/alert.avsc b/schema/schema-avro/alert.avsc index a9dcef8..1c37678 100644 --- a/schema/schema-avro/alert.avsc +++ b/schema/schema-avro/alert.avsc @@ -1,21 +1,23 @@ { - "namespace": "ztf", - "type": "record", - "name": "alert", - "doc": "avro alert schema for ZTF (www.ztf.caltech.edu)", - "version": "3.3", - "fields": [ - {"name": "schemavsn", "type": "string", "doc": "schema version used"}, - {"name": "publisher", "type": "string", "doc": "origin of alert packet"}, - {"name": "objectId", "type": "string", "doc": "object identifier or name"}, - {"name": "candid", "type": "long"}, - {"name": "candidate", "type": "ztf.alert.candidate"}, - {"name": "prv_candidates", "type": [ - "null", { - "type": "array", - "items": "ztf.alert.prv_candidate"}], "default": null}, - {"name": "cutoutScience", "type": ["null", "ztf.alert.cutout"], "default": null}, - {"name": "cutoutTemplate", "type": ["null", "ztf.alert.cutout"], "default": null}, - {"name": "cutoutDifference", "type": ["null", "ztf.alert.cutout"], "default": null} - ] + "namespace": "ztf", + "type": "record", + "name": "alert", + "doc": "avro alert schema for ZTF (www.ztf.caltech.edu)", + "version": "4.02", + "fields": [ + {"name": "schemavsn", "type": "string", "doc": "schema version used"}, + {"name": "publisher", "type": "string", "doc": "origin of alert packet"}, + {"name": "objectId", "type": "string", "doc": "object identifier or name"}, + {"name": "candid", "type": "long"}, + {"name": "candidate", "type": "ztf.alert.candidate"}, + {"name": "prv_candidates", "type": ["null", { + "type": "array", + "items": "ztf.alert.prv_candidate"}], "default": null}, + {"name": "fp_hists", "type": ["null", { + "type": "array", + "items": "ztf.alert.fp_hist"}], "default": null}, + {"name": "cutoutScience", "type": ["null", "ztf.alert.cutout"], "default": null}, + {"name": "cutoutTemplate", "type": ["null", "ztf.alert.cutout"], "default": null}, + {"name": "cutoutDifference", "type": ["null", "ztf.alert.cutout"], "default": null} + ] } diff --git a/schema/schema-avro/candidate.avsc b/schema/schema-avro/candidate.avsc index 0fb50d8..0b071f8 100644 --- a/schema/schema-avro/candidate.avsc +++ b/schema/schema-avro/candidate.avsc @@ -1,112 +1,112 @@ { - "namespace": "ztf.alert", - "name": "candidate", - "doc": "avro alert schema", - "version": "3.3", - "type": "record", - "fields": [ - {"name": "jd", "type": "double", "doc": "Observation Julian date at start of exposure [days]"}, - {"name": "fid", "type": "int", "doc": "Filter ID (1=g; 2=R; 3=i)"}, - {"name": "pid", "type": "long", "doc": "Processing ID for science image to facilitate archive retrieval"}, - {"name": "diffmaglim", "type": [ "null", "float"], "default": null, "doc": "Expected 5-sigma mag limit in difference image based on global noise estimate [mag]"}, - {"name": "pdiffimfilename", "type": ["null", "string"], "default": null, "doc": "filename of positive (sci minus ref) difference image"}, - {"name": "programpi", "type": ["null", "string"], "default": null, "doc": "Principal investigator attached to program ID"}, - {"name": "programid", "type": "int", "doc": "Program ID: encodes either public, collab, or caltech mode"}, - {"name": "candid", "type": "long", "doc": "Candidate ID from operations DB"}, - {"name": "isdiffpos", "type": "string", "doc": "t or 1 => candidate is from positive (sci minus ref) subtraction; f or 0 => candidate is from negative (ref minus sci) subtraction"}, - {"name": "tblid", "type": ["null", "long"], "default": null, "doc": "Internal pipeline table extraction ID"}, - {"name": "nid", "type": ["null", "int"], "default": null, "doc": "Night ID"}, - {"name": "rcid", "type": ["null", "int"], "default": null, "doc": "Readout channel ID [00 .. 63]"}, - {"name": "field", "type": ["null", "int"], "default": null, "doc": "ZTF field ID"}, - {"name": "xpos", "type": ["null", "float"], "default": null, "doc": "x-image position of candidate [pixels]"}, - {"name": "ypos", "type": ["null", "float"], "default": null, "doc": "y-image position of candidate [pixels]"}, - {"name": "ra", "type": "double", "doc": "Right Ascension of candidate; J2000 [deg]"}, - {"name": "dec", "type": "double", "doc": "Declination of candidate; J2000 [deg]"}, - {"name": "magpsf", "type": "float", "doc": "Magnitude from PSF-fit photometry [mag]"}, - {"name": "sigmapsf", "type": "float", "doc": "1-sigma uncertainty in magpsf [mag]"}, - {"name": "chipsf", "type": ["null", "float"], "default": null, "doc": "Reduced chi-square for PSF-fit"}, - {"name": "magap", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 14 pixel diameter aperture [mag]"}, - {"name": "sigmagap", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magap [mag]"}, - {"name": "distnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest source in reference image PSF-catalog [pixels]"}, - {"name": "magnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest source in reference image PSF-catalog [mag]"}, - {"name": "sigmagnr", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magnr [mag]"}, - {"name": "chinr", "type": ["null", "float"], "default": null, "doc": "DAOPhot chi parameter of nearest source in reference image PSF-catalog"}, - {"name": "sharpnr", "type": ["null", "float"], "default": null, "doc": "DAOPhot sharp parameter of nearest source in reference image PSF-catalog"}, - {"name": "sky", "type": ["null", "float"], "default": null, "doc": "Local sky background estimate [DN]"}, - {"name": "magdiff", "type": ["null", "float"], "default": null, "doc": "Difference: magap - magpsf [mag]"}, - {"name": "fwhm", "type": ["null", "float"], "default": null, "doc": "Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]"}, - {"name": "classtar", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy classification score from SExtractor"}, - {"name": "mindtoedge", "type": ["null", "float"], "default": null, "doc": "Distance to nearest edge in image [pixels]"}, - {"name": "magfromlim", "type": ["null", "float"], "default": null, "doc": "Difference: diffmaglim - magap [mag]"}, - {"name": "seeratio", "type": ["null", "float"], "default": null, "doc": "Ratio: difffwhm / fwhm"}, - {"name": "aimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat major axis from SExtractor [pixels]"}, - {"name": "bimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat minor axis from SExtractor [pixels]"}, - {"name": "aimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / fwhm"}, - {"name": "bimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: bimage / fwhm"}, - {"name": "elong", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / bimage"}, - {"name": "nneg", "type": ["null", "int"], "default": null, "doc": "number of negative pixels in a 5 x 5 pixel stamp"}, - {"name": "nbad", "type": ["null", "int"], "default": null, "doc": "number of prior-tagged bad pixels in a 5 x 5 pixel stamp"}, - {"name": "rb", "type": ["null", "float"], "default": null, "doc": "RealBogus quality score from Random Forest classifier; range is 0 to 1 where closer to 1 is more reliable"}, - {"name": "ssdistnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest known solar system object if exists within 30 arcsec [arcsec]"}, - {"name": "ssmagnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]"}, - {"name": "ssnamenr", "type": ["null", "string"], "default": null, "doc": "name of nearest known solar system object if exists within 30 arcsec (from MPC archive)"}, - {"name": "sumrat", "type": ["null", "float"], "default": null, "doc": "Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers"}, - {"name": "magapbig", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 18 pixel diameter aperture [mag]"}, - {"name": "sigmagapbig", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magapbig [mag]"}, - {"name": "ranr", "type": "double", "doc": "Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]"}, - {"name": "decnr", "type": "double", "doc": "Declination of nearest source in reference image PSF-catalog; J2000 [deg]"}, - {"name": "sgmag1", "type": ["null", "float"], "default": null, "doc": "g-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "srmag1", "type": ["null", "float"], "default": null, "doc": "r-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "simag1", "type": ["null", "float"], "default": null, "doc": "i-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "szmag1", "type": ["null", "float"], "default": null, "doc": "z-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "sgscore1", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy score of closest source from PS1 catalog; if exists within 30 arcsec: 0 <= sgscore <= 1 where closer to 1 implies higher likelihood of being a star"}, - {"name": "distpsnr1", "type": ["null", "float"], "default": null, "doc": "Distance to closest source from PS1 catalog; if exists within 30 arcsec [arcsec]"}, - {"name": "ndethist", "type": "int", "doc": "Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted"}, - {"name": "ncovhist", "type": "int", "doc": "Number of times input candidate position fell on any field and readout-channel going back to beginning of survey"}, - {"name": "jdstarthist", "type": ["null", "double"], "default": null, "doc": "Earliest Julian date of epoch corresponding to ndethist [days]"}, - {"name": "jdendhist", "type": ["null", "double"], "default": null, "doc": "Latest Julian date of epoch corresponding to ndethist [days]"}, - {"name": "scorr", "type": ["null", "double"], "default": null, "doc": "Peak-pixel signal-to-noise ratio in point source matched-filtered detection image"}, - {"name": "tooflag", "type": ["null", "int"], "default": 0, "doc": "1 => candidate is from a Target-of-Opportunity (ToO) exposure; 0 => candidate is from a non-ToO exposure"}, - {"name": "objectidps1", "type": ["null", "long"], "default": null, "doc": "Object ID of closest source from PS1 catalog; if exists within 30 arcsec"}, - {"name": "objectidps2", "type": ["null", "long"], "default": null, "doc": "Object ID of second closest source from PS1 catalog; if exists within 30 arcsec"}, - {"name": "sgmag2", "type": ["null", "float"], "default": null, "doc": "g-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "srmag2", "type": ["null", "float"], "default": null, "doc": "r-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "simag2", "type": ["null", "float"], "default": null, "doc": "i-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "szmag2", "type": ["null", "float"], "default": null, "doc": "z-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "sgscore2", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy score of second closest source from PS1 catalog; if exists within 30 arcsec: 0 <= sgscore <= 1 where closer to 1 implies higher likelihood of being a star"}, - {"name": "distpsnr2", "type": ["null", "float"], "default": null, "doc": "Distance to second closest source from PS1 catalog; if exists within 30 arcsec [arcsec]"}, - {"name": "objectidps3", "type": ["null", "long"], "default": null, "doc": "Object ID of third closest source from PS1 catalog; if exists within 30 arcsec"}, - {"name": "sgmag3", "type": ["null", "float"], "default": null, "doc": "g-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "srmag3", "type": ["null", "float"], "default": null, "doc": "r-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "simag3", "type": ["null", "float"], "default": null, "doc": "i-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "szmag3", "type": ["null", "float"], "default": null, "doc": "z-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, - {"name": "sgscore3", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy score of third closest source from PS1 catalog; if exists within 30 arcsec: 0 <= sgscore <= 1 where closer to 1 implies higher likelihood of being a star"}, - {"name": "distpsnr3", "type": ["null", "float"], "default": null, "doc": "Distance to third closest source from PS1 catalog; if exists within 30 arcsec [arcsec]"}, - {"name": "nmtchps", "type": "int", "doc": "Number of source matches from PS1 catalog falling within 30 arcsec"}, - {"name": "rfid", "type": "long", "doc": "Processing ID for reference image to facilitate archive retrieval"}, - {"name": "jdstartref", "type": "double", "doc": "Observation Julian date of earliest exposure used to generate reference image [days]"}, - {"name": "jdendref", "type": "double", "doc": "Observation Julian date of latest exposure used to generate reference image [days]"}, - {"name": "nframesref", "type": "int", "doc": "Number of frames (epochal images) used to generate reference image"}, - {"name": "rbversion", "type": "string", "doc": "version of Random Forest classifier model used to assign RealBogus (rb) quality score"}, - {"name": "dsnrms", "type": ["null", "float"], "default": null, "doc": "Ratio: D/stddev(D) on event position where D = difference image"}, - {"name": "ssnrms", "type": ["null", "float"], "default": null, "doc": "Ratio: S/stddev(S) on event position where S = image of convolution: D (x) PSF(D)"}, - {"name": "dsdiff", "type": ["null", "float"], "default": null, "doc": "Difference of statistics: dsnrms - ssnrms"}, - {"name": "magzpsci", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point for photometry estimates [mag]"}, - {"name": "magzpsciunc", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point uncertainty (in magzpsci) [mag]"}, - {"name": "magzpscirms", "type": ["null", "float"], "default": null, "doc": "RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, - {"name": "nmatches", "type": "int", "doc": "Number of PS1 photometric calibrators used to calibrate science image from science image processing"}, - {"name": "clrcoeff", "type": ["null", "float"], "default": null, "doc": "Color coefficient from linear fit from photometric calibration of science image"}, - {"name": "clrcounc", "type": ["null", "float"], "default": null, "doc": "Color coefficient uncertainty from linear fit (corresponding to clrcoeff)"}, - {"name": "zpclrcov", "type": ["null", "float"], "default": null, "doc": "Covariance in magzpsci and clrcoeff from science image processing [mag^2]"}, - {"name": "zpmed", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point from median of all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, - {"name": "clrmed", "type": ["null", "float"], "default": null, "doc": "Median color of all PS1 photometric calibrators used from science image processing [mag]: for filter (fid) = 1, 2, 3, PS1 color used = g-r, g-r, r-i respectively"}, - {"name": "clrrms", "type": ["null", "float"], "default": null, "doc": "RMS color (deviation from average) of all PS1 photometric calibrators used from science image processing [mag]"}, - {"name": "neargaia", "type": ["null", "float"], "default": null, "doc": "Distance to closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [arcsec]"}, - {"name": "neargaiabright", "type": ["null", "float"], "default": null, "doc": "Distance to closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [arcsec]"}, - {"name": "maggaia", "type": ["null", "float"], "default": null, "doc": "Gaia (G-band) magnitude of closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [mag]"}, - {"name": "maggaiabright", "type": ["null", "float"], "default": null, "doc": "Gaia (G-band) magnitude of closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [mag]"}, - {"name": "exptime", "type": ["null", "float"], "default": null, "doc": "Integration time of camera exposure [sec]"}, - {"name": "drb", "type": ["null", "float"], "default": null, "doc": "RealBogus quality score from Deep-Learning-based classifier; range is 0 to 1 where closer to 1 is more reliable"}, - {"name": "drbversion", "type": "string", "doc": "version of Deep-Learning-based classifier model used to assign RealBogus (drb) quality score"} - ] + "namespace": "ztf.alert", + "name": "candidate", + "doc": "avro alert schema", + "version": "4.02", + "type": "record", + "fields": [ + {"name": "jd", "type": "double", "doc": "Observation Julian date at start of exposure [days]"}, + {"name": "fid", "type": "int", "doc": "Filter ID (1=g; 2=R; 3=i)"}, + {"name": "pid", "type": "long", "doc": "Processing ID for science image to facilitate archive retrieval"}, + {"name": "diffmaglim", "type": ["null", "float"], "default": null, "doc": "Expected 5-sigma mag limit in difference image based on global noise estimate [mag]"}, + {"name": "pdiffimfilename", "type": ["null", "string"], "default": null, "doc": "filename of positive (sci minus ref) difference image"}, + {"name": "programpi", "type": ["null", "string"], "default": null, "doc": "Principal investigator attached to program ID"}, + {"name": "programid", "type": "int", "doc": "Program ID: encodes either public, collab, or caltech mode"}, + {"name": "candid", "type": "long", "doc": "Candidate ID from operations DB"}, + {"name": "isdiffpos", "type": "string", "doc": "t or 1 => candidate is from positive (sci minus ref) subtraction; f or 0 => candidate is from negative (ref minus sci) subtraction"}, + {"name": "tblid", "type": ["null", "long"], "default": null, "doc": "Internal pipeline table extraction ID"}, + {"name": "nid", "type": ["null", "int"], "default": null, "doc": "Night ID"}, + {"name": "rcid", "type": ["null", "int"], "default": null, "doc": "Readout channel ID [00 .. 63]"}, + {"name": "field", "type": ["null", "int"], "default": null, "doc": "ZTF field ID"}, + {"name": "xpos", "type": ["null", "float"], "default": null, "doc": "x-image position of candidate [pixels]"}, + {"name": "ypos", "type": ["null", "float"], "default": null, "doc": "y-image position of candidate [pixels]"}, + {"name": "ra", "type": "double", "doc": "Right Ascension of candidate; J2000 [deg]"}, + {"name": "dec", "type": "double", "doc": "Declination of candidate; J2000 [deg]"}, + {"name": "magpsf", "type": "float", "doc": "Magnitude from PSF-fit photometry [mag]"}, + {"name": "sigmapsf", "type": "float", "doc": "1-sigma uncertainty in magpsf [mag]"}, + {"name": "chipsf", "type": ["null", "float"], "default": null, "doc": "Reduced chi-square for PSF-fit"}, + {"name": "magap", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 14 pixel diameter aperture [mag]"}, + {"name": "sigmagap", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magap [mag]"}, + {"name": "distnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest source in reference image PSF-catalog [pixels]"}, + {"name": "magnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest source in reference image PSF-catalog [mag]"}, + {"name": "sigmagnr", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magnr [mag]"}, + {"name": "chinr", "type": ["null", "float"], "default": null, "doc": "DAOPhot chi parameter of nearest source in reference image PSF-catalog"}, + {"name": "sharpnr", "type": ["null", "float"], "default": null, "doc": "DAOPhot sharp parameter of nearest source in reference image PSF-catalog"}, + {"name": "sky", "type": ["null", "float"], "default": null, "doc": "Local sky background estimate [DN]"}, + {"name": "magdiff", "type": ["null", "float"], "default": null, "doc": "Difference: magap - magpsf [mag]"}, + {"name": "fwhm", "type": ["null", "float"], "default": null, "doc": "Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]"}, + {"name": "classtar", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy classification score from SExtractor"}, + {"name": "mindtoedge", "type": ["null", "float"], "default": null, "doc": "Distance to nearest edge in image [pixels]"}, + {"name": "magfromlim", "type": ["null", "float"], "default": null, "doc": "Difference: diffmaglim - magap [mag]"}, + {"name": "seeratio", "type": ["null", "float"], "default": null, "doc": "Ratio: difffwhm / fwhm"}, + {"name": "aimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat major axis from SExtractor [pixels]"}, + {"name": "bimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat minor axis from SExtractor [pixels]"}, + {"name": "aimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / fwhm"}, + {"name": "bimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: bimage / fwhm"}, + {"name": "elong", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / bimage"}, + {"name": "nneg", "type": ["null", "int"], "default": null, "doc": "number of negative pixels in a 5 x 5 pixel stamp"}, + {"name": "nbad", "type": ["null", "int"], "default": null, "doc": "number of prior-tagged bad pixels in a 5 x 5 pixel stamp"}, + {"name": "rb", "type": ["null", "float"], "default": null, "doc": "RealBogus quality score from Random Forest classifier; range is 0 to 1 where closer to 1 is more reliable"}, + {"name": "ssdistnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest known solar system object if exists within 30 arcsec [arcsec]"}, + {"name": "ssmagnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]"}, + {"name": "ssnamenr", "type": ["null", "string"], "default": null, "doc": "name of nearest known solar system object if exists within 30 arcsec (from MPC archive)"}, + {"name": "sumrat", "type": ["null", "float"], "default": null, "doc": "Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers"}, + {"name": "magapbig", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 18 pixel diameter aperture [mag]"}, + {"name": "sigmagapbig", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magapbig [mag]"}, + {"name": "ranr", "type": "double", "doc": "Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]"}, + {"name": "decnr", "type": "double", "doc": "Declination of nearest source in reference image PSF-catalog; J2000 [deg]"}, + {"name": "sgmag1", "type": ["null", "float"], "default": null, "doc": "g-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "srmag1", "type": ["null", "float"], "default": null, "doc": "r-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "simag1", "type": ["null", "float"], "default": null, "doc": "i-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "szmag1", "type": ["null", "float"], "default": null, "doc": "z-band PSF-fit magnitude of closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "sgscore1", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy score of closest source from PS1 catalog; if exists within 30 arcsec: 0 <= sgscore <= 1 where closer to 1 implies higher likelihood of being a star"}, + {"name": "distpsnr1", "type": ["null", "float"], "default": null, "doc": "Distance to closest source from PS1 catalog; if exists within 30 arcsec [arcsec]"}, + {"name": "ndethist", "type": "int", "doc": "Number of spatially-coincident detections falling within 1.5 arcsec going back to beginning of survey; only detections that fell on the same field and readout-channel ID where the input candidate was observed are counted. All raw detections down to a photometric S/N of ~ 3 are included."}, + {"name": "ncovhist", "type": "int", "doc": "Number of times input candidate position fell on any field and readout-channel going back to beginning of survey"}, + {"name": "jdstarthist", "type": ["null", "double"], "default": null, "doc": "Earliest Julian date of epoch corresponding to ndethist [days]"}, + {"name": "jdendhist", "type": ["null", "double"], "default": null, "doc": "Latest Julian date of epoch corresponding to ndethist [days]"}, + {"name": "scorr", "type": ["null", "double"], "default": null, "doc": "Peak-pixel signal-to-noise ratio in point source matched-filtered detection image"}, + {"name": "tooflag", "type": ["null", "int"], "default": null, "doc": "1 => candidate is from a Target-of-Opportunity (ToO) exposure; 0 => candidate is from a non-ToO exposure"}, + {"name": "objectidps1", "type": ["null", "long"], "default": null, "doc": "Object ID of closest source from PS1 catalog; if exists within 30 arcsec"}, + {"name": "objectidps2", "type": ["null", "long"], "default": null, "doc": "Object ID of second closest source from PS1 catalog; if exists within 30 arcsec"}, + {"name": "sgmag2", "type": ["null", "float"], "default": null, "doc": "g-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "srmag2", "type": ["null", "float"], "default": null, "doc": "r-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "simag2", "type": ["null", "float"], "default": null, "doc": "i-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "szmag2", "type": ["null", "float"], "default": null, "doc": "z-band PSF-fit magnitude of second closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "sgscore2", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy score of second closest source from PS1 catalog; if exists within 30 arcsec: 0 <= sgscore <= 1 where closer to 1 implies higher likelihood of being a star"}, + {"name": "distpsnr2", "type": ["null", "float"], "default": null, "doc": "Distance to second closest source from PS1 catalog; if exists within 30 arcsec [arcsec]"}, + {"name": "objectidps3", "type": ["null", "long"], "default": null, "doc": "Object ID of third closest source from PS1 catalog; if exists within 30 arcsec"}, + {"name": "sgmag3", "type": ["null", "float"], "default": null, "doc": "g-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "srmag3", "type": ["null", "float"], "default": null, "doc": "r-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "simag3", "type": ["null", "float"], "default": null, "doc": "i-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "szmag3", "type": ["null", "float"], "default": null, "doc": "z-band PSF-fit magnitude of third closest source from PS1 catalog; if exists within 30 arcsec [mag]"}, + {"name": "sgscore3", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy score of third closest source from PS1 catalog; if exists within 30 arcsec: 0 <= sgscore <= 1 where closer to 1 implies higher likelihood of being a star"}, + {"name": "distpsnr3", "type": ["null", "float"], "default": null, "doc": "Distance to third closest source from PS1 catalog; if exists within 30 arcsec [arcsec]"}, + {"name": "nmtchps", "type": "int", "doc": "Number of source matches from PS1 catalog falling within 30 arcsec"}, + {"name": "rfid", "type": "long", "doc": "Processing ID for reference image to facilitate archive retrieval"}, + {"name": "jdstartref", "type": "double", "doc": "Observation Julian date of earliest exposure used to generate reference image [days]"}, + {"name": "jdendref", "type": "double", "doc": "Observation Julian date of latest exposure used to generate reference image [days]"}, + {"name": "nframesref", "type": "int", "doc": "Number of frames (epochal images) used to generate reference image"}, + {"name": "rbversion", "type": "string", "doc": "version of Random Forest classifier model used to assign RealBogus (rb) quality score"}, + {"name": "dsnrms", "type": ["null", "float"], "default": null, "doc": "Ratio: D/stddev(D) on event position where D = difference image"}, + {"name": "ssnrms", "type": ["null", "float"], "default": null, "doc": "Ratio: S/stddev(S) on event position where S = image of convolution: D (x) PSF(D)"}, + {"name": "dsdiff", "type": ["null", "float"], "default": null, "doc": "Difference of statistics: dsnrms - ssnrms"}, + {"name": "magzpsci", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point for photometry estimates [mag]"}, + {"name": "magzpsciunc", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point uncertainty (in magzpsci) [mag]"}, + {"name": "magzpscirms", "type": ["null", "float"], "default": null, "doc": "RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, + {"name": "nmatches", "type": "int", "doc": "Number of PS1 photometric calibrators used to calibrate science image from science image processing"}, + {"name": "clrcoeff", "type": ["null", "float"], "default": null, "doc": "Color coefficient from linear fit from photometric calibration of science image"}, + {"name": "clrcounc", "type": ["null", "float"], "default": null, "doc": "Color coefficient uncertainty from linear fit (corresponding to clrcoeff)"}, + {"name": "zpclrcov", "type": ["null", "float"], "default": null, "doc": "Covariance in magzpsci and clrcoeff from science image processing [mag^2]"}, + {"name": "zpmed", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point from median of all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, + {"name": "clrmed", "type": ["null", "float"], "default": null, "doc": "Median color of all PS1 photometric calibrators used from science image processing [mag]: for filter (fid) = 1, 2, 3, PS1 color used = g-r, g-r, r-i respectively"}, + {"name": "clrrms", "type": ["null", "float"], "default": null, "doc": "RMS color (deviation from average) of all PS1 photometric calibrators used from science image processing [mag]"}, + {"name": "neargaia", "type": ["null", "float"], "default": null, "doc": "Distance to closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [arcsec]"}, + {"name": "neargaiabright", "type": ["null", "float"], "default": null, "doc": "Distance to closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [arcsec]"}, + {"name": "maggaia", "type": ["null", "float"], "default": null, "doc": "Gaia (G-band) magnitude of closest source from Gaia DR1 catalog irrespective of magnitude; if exists within 90 arcsec [mag]"}, + {"name": "maggaiabright", "type": ["null", "float"], "default": null, "doc": "Gaia (G-band) magnitude of closest source from Gaia DR1 catalog brighter than magnitude 14; if exists within 90 arcsec [mag]"}, + {"name": "exptime", "type": ["null", "float"], "default": null, "doc": "Integration time of camera exposure [sec]"}, + {"name": "drb", "type": ["null", "float"], "default": null, "doc": "RealBogus quality score from Deep-Learning-based classifier; range is 0 to 1 where closer to 1 is more reliable"}, + {"name": "drbversion", "type": "string", "doc": "version of Deep-Learning-based classifier model used to assign RealBogus (drb) quality score"} + ] } diff --git a/schema/schema-avro/cutout.avsc b/schema/schema-avro/cutout.avsc index 43fe382..1891b34 100644 --- a/schema/schema-avro/cutout.avsc +++ b/schema/schema-avro/cutout.avsc @@ -3,7 +3,7 @@ "type": "record", "name": "cutout", "doc": "avro alert schema", - "version": "3.3", + "version": "4.02", "fields": [ {"name": "fileName", "type": "string"}, {"name": "stampData", "type": "bytes", "doc": "fits.gz"} diff --git a/schema/schema-avro/fp_hist.avsc b/schema/schema-avro/fp_hist.avsc new file mode 100644 index 0000000..ba75ff7 --- /dev/null +++ b/schema/schema-avro/fp_hist.avsc @@ -0,0 +1,38 @@ +{ + "namespace": "ztf.alert", + "name": "fp_hist", + "doc": "avro alert schema", + "version": "4.02", + "type": "record", + "fields": [ + {"name": "field", "type": ["null", "int"], "default": null, "doc": "ZTF field ID"}, + {"name": "rcid", "type": ["null", "int"], "default": null, "doc": "Readout channel ID [00 .. 63]"}, + {"name": "fid", "type": "int", "doc": "Filter ID (1=g; 2=R; 3=i)"}, + {"name": "pid", "type": "long", "doc": "Processing ID for image"}, + {"name": "rfid", "type": "long", "doc": "Processing ID for reference image to facilitate archive retrieval"}, + {"name": "sciinpseeing", "type": ["null", "float"], "default": null, "doc": "Effective FWHM of sci image [pixels]"}, + {"name": "scibckgnd", "type": ["null", "float"], "default": null, "doc": "Background level in sci image [DN]"}, + {"name": "scisigpix", "type": ["null", "float"], "default": null, "doc": "Robust sigma per pixel in sci image [DN]"}, + {"name": "magzpsci", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point for photometry estimates [mag]"}, + {"name": "magzpsciunc", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point uncertainty (in magzpsci) [mag]"}, + {"name": "magzpscirms", "type": ["null", "float"], "default": null, "doc": "RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, + {"name": "clrcoeff", "type": ["null", "float"], "default": null, "doc": "Color coefficient from linear fit from photometric calibration of science image"}, + {"name": "clrcounc", "type": ["null", "float"], "default": null, "doc": "Color coefficient uncertainty from linear fit (corresponding to clrcoeff)"}, + {"name": "exptime", "type": ["null", "float"], "default": null, "doc": "Integration time of camera exposure [sec]"}, + {"name": "adpctdif1", "type": ["null", "float"], "default": null, "doc": "Full sci image astrometric RMS along R.A. with respect to Gaia1 [arcsec]"}, + {"name": "adpctdif2", "type": ["null", "float"], "default": null, "doc": "Full sci image astrometric RMS along Dec. with respect to Gaia1 [arcsec]"}, + {"name": "diffmaglim", "type": ["null", "float"], "default": null, "doc": "Expected 5-sigma mag limit in difference image based on global noise estimate [mag]"}, + {"name": "programid", "type": "int", "doc": "Program ID: encodes either public, collab, or caltech mode"}, + {"name": "jd", "type": "double", "doc": "Observation Julian date at start of exposure [days]"}, + {"name": "forcediffimflux", "type": ["null", "float"], "default": null, "doc": "Forced difference image PSF-fit flux [DN]"}, + {"name": "forcediffimfluxunc", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in forcediffimflux [DN]"}, + {"name": "procstatus", "type": ["null", "string"], "default": null, "doc": "Forced photometry processing status codes (0 => no warnings); see documentation"}, + {"name": "distnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest source in reference image PSF-catalog [arcsec]"}, + {"name": "ranr", "type": "double", "doc": "Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]"}, + {"name": "decnr", "type": "double", "doc": "Declination of nearest source in reference image PSF-catalog; J2000 [deg]"}, + {"name": "magnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest source in reference image PSF-catalog [mag]"}, + {"name": "sigmagnr", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magnr [mag]"}, + {"name": "chinr", "type": ["null", "float"], "default": null, "doc": "DAOPhot chi parameter of nearest source in reference image PSF-catalog"}, + {"name": "sharpnr", "type": ["null", "float"], "default": null, "doc": "DAOPhot sharp parameter of nearest source in reference image PSF-catalog"} + ] +} diff --git a/schema/schema-avro/prv_candidate.avsc b/schema/schema-avro/prv_candidate.avsc index 2e44245..4565cfe 100644 --- a/schema/schema-avro/prv_candidate.avsc +++ b/schema/schema-avro/prv_candidate.avsc @@ -2,65 +2,65 @@ "namespace": "ztf.alert", "name": "prv_candidate", "doc": "avro alert schema", - "version": "3.3", + "version": "4.02", "type": "record", "fields": [ {"name": "jd", "type": "double", "doc": "Observation Julian date at start of exposure [days]"}, {"name": "fid", "type": "int", "doc": "Filter ID (1=g; 2=R; 3=i)"}, {"name": "pid", "type": "long", "doc": "Processing ID for image"}, - {"name": "diffmaglim", "type": ["null", "float"], "default": null, "doc": "Expected 5-sigma mag limit in difference image based on global noise estimate [mag]"}, - {"name": "pdiffimfilename", "type": ["null", "string"], "default": null, "doc": "filename of positive (sci minus ref) difference image"}, - {"name": "programpi", "type": ["null", "string"], "default": null, "doc": "Principal investigator attached to program ID"}, + {"name": "diffmaglim", "type": ["null", "float"], "default": null, "doc": "Expected 5-sigma mag limit in difference image based on global noise estimate [mag]"}, + {"name": "pdiffimfilename", "type": ["null", "string"], "default": null, "doc": "filename of positive (sci minus ref) difference image"}, + {"name": "programpi", "type": ["null", "string"], "default": null, "doc": "Principal investigator attached to program ID"}, {"name": "programid", "type": "int", "doc": "Program ID: encodes either public, collab, or caltech mode"}, - {"name": "candid", "type": ["null", "long"], "doc": "Candidate ID from operations DB"}, - {"name": "isdiffpos", "type": ["null", "string"], "doc": "t or 1 => candidate is from positive (sci minus ref) subtraction; f or 0 => candidate is from negative (ref minus sci) subtraction"}, - {"name": "tblid", "type": ["null", "long"], "default": null, "doc": "Internal pipeline table extraction ID"}, - {"name": "nid", "type": ["null", "int"], "default": null, "doc": "Night ID"}, - {"name": "rcid", "type": ["null", "int"], "default": null, "doc": "Readout channel ID [00 .. 63]"}, - {"name": "field", "type": ["null", "int"], "default": null, "doc": "ZTF field ID"}, - {"name": "xpos", "type": ["null", "float"], "default": null, "doc": "x-image position of candidate [pixels]"}, - {"name": "ypos", "type": ["null", "float"], "default": null, "doc": "y-image position of candidate [pixels]"}, - {"name": "ra", "type": ["null", "double"], "doc": "Right Ascension of candidate; J2000 [deg]"}, - {"name": "dec", "type": ["null", "double"], "doc": "Declination of candidate; J2000 [deg]"}, - {"name": "magpsf", "type": ["null", "float"], "doc": "Magnitude from PSF-fit photometry [mag]"}, - {"name": "sigmapsf", "type": ["null", "float"], "doc": "1-sigma uncertainty in magpsf [mag]"}, - {"name": "chipsf", "type": ["null", "float"], "default": null, "doc": "Reduced chi-square for PSF-fit"}, - {"name": "magap", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 14 pixel diameter aperture [mag]"}, - {"name": "sigmagap", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magap [mag]"}, - {"name": "distnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest source in reference image PSF-catalog [pixels]"}, - {"name": "magnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest source in reference image PSF-catalog [mag]"}, - {"name": "sigmagnr", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magnr [mag]"}, - {"name": "chinr", "type": ["null", "float"], "default": null, "doc": "DAOPhot chi parameter of nearest source in reference image PSF-catalog"}, - {"name": "sharpnr", "type": ["null", "float"], "default": null, "doc": "DAOPhot sharp parameter of nearest source in reference image PSF-catalog"}, - {"name": "sky", "type": ["null", "float"], "default": null, "doc": "Local sky background estimate [DN]"}, - {"name": "magdiff", "type": ["null", "float"], "default": null, "doc": "Difference: magap - magpsf [mag]"}, - {"name": "fwhm", "type": ["null", "float"], "default": null, "doc": "Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]"}, - {"name": "classtar", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy classification score from SExtractor"}, - {"name": "mindtoedge", "type": ["null", "float"], "default": null, "doc": "Distance to nearest edge in image [pixels]"}, - {"name": "magfromlim", "type": ["null", "float"], "default": null, "doc": "Difference: diffmaglim - magap [mag]"}, - {"name": "seeratio", "type": ["null", "float"], "default": null, "doc": "Ratio: difffwhm / fwhm"}, - {"name": "aimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat major axis from SExtractor [pixels]"}, - {"name": "bimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat minor axis from SExtractor [pixels]"}, - {"name": "aimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / fwhm"}, - {"name": "bimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: bimage / fwhm"}, - {"name": "elong", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / bimage"}, - {"name": "nneg", "type": ["null", "int"], "default": null, "doc": "number of negative pixels in a 5 x 5 pixel stamp"}, - {"name": "nbad", "type": ["null", "int"], "default": null, "doc": "number of prior-tagged bad pixels in a 5 x 5 pixel stamp"}, - {"name": "rb", "type": ["null", "float"], "default": null, "doc": "RealBogus quality score; range is 0 to 1 where closer to 1 is more reliable"}, - {"name": "ssdistnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest known solar system object if exists within 30 arcsec [arcsec]"}, - {"name": "ssmagnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]"}, - {"name": "ssnamenr", "type": ["null", "string"], "default": null, "doc": "name of nearest known solar system object if exists within 30 arcsec (from MPC archive)"}, - {"name": "sumrat", "type": ["null", "float"], "default": null, "doc": "Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers"}, - {"name": "magapbig", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 18 pixel diameter aperture [mag]"}, - {"name": "sigmagapbig", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magapbig [mag]"}, - {"name": "ranr", "type": ["null", "double"], "doc": "Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]"}, - {"name": "decnr", "type": ["null", "double"], "doc": "Declination of nearest source in reference image PSF-catalog; J2000 [deg]"}, - {"name": "scorr", "type": ["null", "double"], "default": null, "doc": "Peak-pixel signal-to-noise ratio in point source matched-filtered detection image"}, - {"name": "magzpsci", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point for photometry estimates [mag]"}, - {"name": "magzpsciunc", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point uncertainty (in magzpsci) [mag]"}, - {"name": "magzpscirms", "type": ["null", "float"], "default": null, "doc": "RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, - {"name": "clrcoeff", "type": ["null", "float"], "default": null, "doc": "Color coefficient from linear fit from photometric calibration of science image"}, - {"name": "clrcounc", "type": ["null", "float"], "default": null, "doc": "Color coefficient uncertainty from linear fit (corresponding to clrcoeff)"}, + {"name": "candid", "type": ["null", "long"], "doc": "Candidate ID from operations DB"}, + {"name": "isdiffpos", "type": ["null", "string"], "doc": "t or 1 => candidate is from positive (sci minus ref) subtraction; f or 0 => candidate is from negative (ref minus sci) subtraction"}, + {"name": "tblid", "type": ["null", "long"], "default": null, "doc": "Internal pipeline table extraction ID"}, + {"name": "nid", "type": ["null", "int"], "default": null, "doc": "Night ID"}, + {"name": "rcid", "type": ["null", "int"], "default": null, "doc": "Readout channel ID [00 .. 63]"}, + {"name": "field", "type": ["null", "int"], "default": null, "doc": "ZTF field ID"}, + {"name": "xpos", "type": ["null", "float"], "default": null, "doc": "x-image position of candidate [pixels]"}, + {"name": "ypos", "type": ["null", "float"], "default": null, "doc": "y-image position of candidate [pixels]"}, + {"name": "ra", "type": ["null", "double"], "doc": "Right Ascension of candidate; J2000 [deg]"}, + {"name": "dec", "type": ["null", "double"], "doc": "Declination of candidate; J2000 [deg]"}, + {"name": "magpsf", "type": ["null", "float"], "doc": "Magnitude from PSF-fit photometry [mag]"}, + {"name": "sigmapsf", "type": ["null", "float"], "doc": "1-sigma uncertainty in magpsf [mag]"}, + {"name": "chipsf", "type": ["null", "float"], "default": null, "doc": "Reduced chi-square for PSF-fit"}, + {"name": "magap", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 14 pixel diameter aperture [mag]"}, + {"name": "sigmagap", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magap [mag]"}, + {"name": "distnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest source in reference image PSF-catalog [pixels]"}, + {"name": "magnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest source in reference image PSF-catalog [mag]"}, + {"name": "sigmagnr", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magnr [mag]"}, + {"name": "chinr", "type": ["null", "float"], "default": null, "doc": "DAOPhot chi parameter of nearest source in reference image PSF-catalog"}, + {"name": "sharpnr", "type": ["null", "float"], "default": null, "doc": "DAOPhot sharp parameter of nearest source in reference image PSF-catalog"}, + {"name": "sky", "type": ["null", "float"], "default": null, "doc": "Local sky background estimate [DN]"}, + {"name": "magdiff", "type": ["null", "float"], "default": null, "doc": "Difference: magap - magpsf [mag]"}, + {"name": "fwhm", "type": ["null", "float"], "default": null, "doc": "Full Width Half Max assuming a Gaussian core, from SExtractor [pixels]"}, + {"name": "classtar", "type": ["null", "float"], "default": null, "doc": "Star/Galaxy classification score from SExtractor"}, + {"name": "mindtoedge", "type": ["null", "float"], "default": null, "doc": "Distance to nearest edge in image [pixels]"}, + {"name": "magfromlim", "type": ["null", "float"], "default": null, "doc": "Difference: diffmaglim - magap [mag]"}, + {"name": "seeratio", "type": ["null", "float"], "default": null, "doc": "Ratio: difffwhm / fwhm"}, + {"name": "aimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat major axis from SExtractor [pixels]"}, + {"name": "bimage", "type": ["null", "float"], "default": null, "doc": "Windowed profile RMS afloat minor axis from SExtractor [pixels]"}, + {"name": "aimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / fwhm"}, + {"name": "bimagerat", "type": ["null", "float"], "default": null, "doc": "Ratio: bimage / fwhm"}, + {"name": "elong", "type": ["null", "float"], "default": null, "doc": "Ratio: aimage / bimage"}, + {"name": "nneg", "type": ["null", "int"], "default": null, "doc": "number of negative pixels in a 5 x 5 pixel stamp"}, + {"name": "nbad", "type": ["null", "int"], "default": null, "doc": "number of prior-tagged bad pixels in a 5 x 5 pixel stamp"}, + {"name": "rb", "type": ["null", "float"], "default": null, "doc": "RealBogus quality score; range is 0 to 1 where closer to 1 is more reliable"}, + {"name": "ssdistnr", "type": ["null", "float"], "default": null, "doc": "distance to nearest known solar system object if exists within 30 arcsec [arcsec]"}, + {"name": "ssmagnr", "type": ["null", "float"], "default": null, "doc": "magnitude of nearest known solar system object if exists within 30 arcsec (usually V-band from MPC archive) [mag]"}, + {"name": "ssnamenr", "type": ["null", "string"], "default": null, "doc": "name of nearest known solar system object if exists within 30 arcsec (from MPC archive)"}, + {"name": "sumrat", "type": ["null", "float"], "default": null, "doc": "Ratio: sum(pixels) / sum(|pixels|) in a 5 x 5 pixel stamp where stamp is first median-filtered to mitigate outliers"}, + {"name": "magapbig", "type": ["null", "float"], "default": null, "doc": "Aperture mag using 18 pixel diameter aperture [mag]"}, + {"name": "sigmagapbig", "type": ["null", "float"], "default": null, "doc": "1-sigma uncertainty in magapbig [mag]"}, + {"name": "ranr", "type": ["null", "double"], "doc": "Right Ascension of nearest source in reference image PSF-catalog; J2000 [deg]"}, + {"name": "decnr", "type": ["null", "double"], "doc": "Declination of nearest source in reference image PSF-catalog; J2000 [deg]"}, + {"name": "scorr", "type": ["null", "double"], "default": null, "doc": "Peak-pixel signal-to-noise ratio in point source matched-filtered detection image"}, + {"name": "magzpsci", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point for photometry estimates [mag]"}, + {"name": "magzpsciunc", "type": ["null", "float"], "default": null, "doc": "Magnitude zero point uncertainty (in magzpsci) [mag]"}, + {"name": "magzpscirms", "type": ["null", "float"], "default": null, "doc": "RMS (deviation from average) in all differences between instrumental photometry and matched photometric calibrators from science image processing [mag]"}, + {"name": "clrcoeff", "type": ["null", "float"], "default": null, "doc": "Color coefficient from linear fit from photometric calibration of science image"}, + {"name": "clrcounc", "type": ["null", "float"], "default": null, "doc": "Color coefficient uncertainty from linear fit (corresponding to clrcoeff)"}, {"name": "rbversion", "type": "string", "doc": "version of RealBogus model/classifier used to assign rb quality score"} ] } diff --git a/schema/union_null_array_fp_hist.go b/schema/union_null_array_fp_hist.go new file mode 100644 index 0000000..271a7ce --- /dev/null +++ b/schema/union_null_array_fp_hist.go @@ -0,0 +1,92 @@ +// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT. +/* + * SOURCES: + * alert.avsc + * candidate.avsc + * cutout.avsc + * fp_hist.avsc + * prv_candidate.avsc + */ +package schema + +import ( + "io" + "fmt" + + "github.com/actgardner/gogen-avro/vm" + "github.com/actgardner/gogen-avro/vm/types" +) + + +type UnionNullArrayFp_histTypeEnum int +const ( + + UnionNullArrayFp_histTypeEnumNull UnionNullArrayFp_histTypeEnum = 0 + + UnionNullArrayFp_histTypeEnumArrayFp_hist UnionNullArrayFp_histTypeEnum = 1 + +) + +type UnionNullArrayFp_hist struct { + + Null *types.NullVal + + ArrayFp_hist []*Fp_hist + + UnionType UnionNullArrayFp_histTypeEnum +} + +func writeUnionNullArrayFp_hist(r *UnionNullArrayFp_hist, w io.Writer) error { + err := vm.WriteLong(int64(r.UnionType), w) + if err != nil { + return err + } + switch r.UnionType{ + + case UnionNullArrayFp_histTypeEnumNull: + return vm.WriteNull(r.Null, w) + + case UnionNullArrayFp_histTypeEnumArrayFp_hist: + return writeArrayFp_hist(r.ArrayFp_hist, w) + + } + return fmt.Errorf("invalid value for *UnionNullArrayFp_hist") +} + +func NewUnionNullArrayFp_hist() *UnionNullArrayFp_hist { + return &UnionNullArrayFp_hist{} +} + +func (_ *UnionNullArrayFp_hist) SetBoolean(v bool) { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) SetInt(v int32) { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) SetFloat(v float32) { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) SetDouble(v float64) { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) SetBytes(v []byte) { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) SetString(v string) { panic("Unsupported operation") } +func (r *UnionNullArrayFp_hist) SetLong(v int64) { + r.UnionType = (UnionNullArrayFp_histTypeEnum)(v) +} +func (r *UnionNullArrayFp_hist) Get(i int) types.Field { + switch (i) { + + case 0: + + + return r.Null + + + case 1: + + r.ArrayFp_hist = make([]*Fp_hist, 0) + + + return (*ArrayFp_histWrapper)(&r.ArrayFp_hist) + + + } + panic("Unknown field index") +} +func (_ *UnionNullArrayFp_hist) SetDefault(i int) { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) AppendMap(key string) types.Field { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) AppendArray() types.Field { panic("Unsupported operation") } +func (_ *UnionNullArrayFp_hist) Finalize() { } diff --git a/schema/union_null_array_prv_candidate.go b/schema/union_null_array_prv_candidate.go index 089fde6..1544c83 100644 --- a/schema/union_null_array_prv_candidate.go +++ b/schema/union_null_array_prv_candidate.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/union_null_cutout.go b/schema/union_null_cutout.go index 32a9689..3b87c2f 100644 --- a/schema/union_null_cutout.go +++ b/schema/union_null_cutout.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/union_null_double.go b/schema/union_null_double.go index 04dfff6..8f1c2b3 100644 --- a/schema/union_null_double.go +++ b/schema/union_null_double.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/union_null_float.go b/schema/union_null_float.go index f172cbb..66b04ff 100644 --- a/schema/union_null_float.go +++ b/schema/union_null_float.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/union_null_int.go b/schema/union_null_int.go index b383b17..5dacf0c 100644 --- a/schema/union_null_int.go +++ b/schema/union_null_int.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/union_null_long.go b/schema/union_null_long.go index d8a4f51..a58031b 100644 --- a/schema/union_null_long.go +++ b/schema/union_null_long.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema diff --git a/schema/union_null_string.go b/schema/union_null_string.go index b25cc12..43fda05 100644 --- a/schema/union_null_string.go +++ b/schema/union_null_string.go @@ -4,6 +4,7 @@ * alert.avsc * candidate.avsc * cutout.avsc + * fp_hist.avsc * prv_candidate.avsc */ package schema