{
  "schema_version": 1,
  "task": "jdp-real-aperture",
  "status": "OK",
  "label": "real SPOC sector 56 product comparison",
  "synthetic": false,
  "target": {
    "name": "HD 209458 b",
    "tic_id": 420814525,
    "sector": 56,
    "camera": 1,
    "ccd": 2
  },
  "inputs": {
    "tpf": {
      "path": "research/tess-timing/data/real-run/tpf.fits",
      "filename": "tpf.fits",
      "sha256": "2b5bd6ee4747cfe0c5405c869b871064fd74e4b5f0521c4e6be9fdc2b5c96030",
      "size_bytes": 58026240,
      "synthetic": false,
      "shape": {
        "cadences": 20079,
        "rows": 13,
        "cols": 11
      },
      "metadata": {
        "TICID": 420814525,
        "SECTOR": 56,
        "CAMERA": 1,
        "CCD": 2,
        "OBJECT": "TIC 420814525",
        "TELESCOP": "TESS"
      }
    },
    "lightcurve": {
      "path": "research/tess-timing/data/real-run/lightcurve.fits",
      "filename": "lightcurve.fits",
      "sha256": "1b76b4a4b73e24954fa6e29a7e28a174685113ecdbad1bf10ef0e7b766ce99e9",
      "size_bytes": 2039040,
      "synthetic": false
    }
  },
  "quality_mask": {
    "mask_value": 175,
    "mask_bits": 175,
    "bits": [
      1,
      2,
      4,
      8,
      32,
      128
    ],
    "bit_table": [
      {
        "bit": 1,
        "name": "attitude tweak"
      },
      {
        "bit": 2,
        "name": "safe mode"
      },
      {
        "bit": 4,
        "name": "coarse point"
      },
      {
        "bit": 8,
        "name": "earth point"
      },
      {
        "bit": 32,
        "name": "desaturation event"
      },
      {
        "bit": 128,
        "name": "manual exclude"
      }
    ],
    "policy": "A cadence is excluded when (QUALITY & mask_value) != 0."
  },
  "config": {
    "threshold_fraction": 0.05,
    "inner_radius_pixels": 2.0,
    "outer_radius_pixels": 3.5,
    "time_tolerance_seconds": 60.0
  },
  "aperture": {
    "centroid_method": "flux_weighted_excess_on_threshold_aperture",
    "centroid_row": 5.590477,
    "centroid_col": 5.089302,
    "threshold_fraction_of_peak_excess": 0.05,
    "threshold_flux": 2537.830982971,
    "background_flux": 500.332366943,
    "peak_excess_flux": 40749.972320557,
    "aperture_pixel_count": 14,
    "aperture_mask": [
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        1,
        1,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        1,
        1,
        1,
        1,
        1,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        1,
        1,
        1,
        1,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        1,
        1,
        1,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    ],
    "aperture_rows": [
      4,
      4,
      5,
      5,
      5,
      5,
      5,
      6,
      6,
      6,
      6,
      7,
      7,
      7
    ],
    "aperture_cols": [
      5,
      6,
      3,
      4,
      5,
      6,
      7,
      3,
      4,
      5,
      6,
      4,
      5,
      6
    ],
    "aperture_bounds": {
      "row_min": 4,
      "row_max": 7,
      "col_min": 3,
      "col_max": 7
    },
    "aperture_touches_image_edge": false,
    "annulus_radii_pixels": {
      "inner": 2.0,
      "outer": 3.5,
      "inner_inclusive": true,
      "outer_inclusive": false
    },
    "annulus_pixel_count": 23,
    "annulus_excludes_aperture": true,
    "annulus_fallback_used": false,
    "annulus_rows": [
      3,
      3,
      3,
      3,
      3,
      4,
      4,
      4,
      4,
      5,
      5,
      6,
      6,
      7,
      7,
      7,
      7,
      8,
      8,
      8,
      8,
      8,
      9
    ],
    "annulus_cols": [
      3,
      4,
      5,
      6,
      7,
      2,
      3,
      7,
      8,
      2,
      8,
      2,
      8,
      2,
      3,
      7,
      8,
      3,
      4,
      5,
      6,
      7,
      5
    ]
  },
  "cadence_counts": {
    "input_cadences": 20079,
    "quality_pass": 19612,
    "retained": 19612,
    "rejected_by_quality_mask": 467,
    "rejected_nonfinite_pixel": 0,
    "rejected_zero_weight_pixel": 0,
    "rejected_background": 0
  },
  "retained_cadence_count": 19612,
  "comparison": {
    "common_mask": "TESS QUALITY passes the same mask on both inputs, the TPF photometry is valid, and TIME pairs within the stated tolerance.",
    "common_cadence_count": 18792,
    "matched_pairs": 18792,
    "unmatched_aperture_cadences": 820,
    "unmatched_mission_cadences": 0,
    "max_time_offset_seconds": 0.0,
    "time_tolerance_seconds": 60.0,
    "normalization": "The aperture series and each mission series are divided by their median on the common mask before the difference metrics. Raw mission medians come from the light-curve loader before that loader's own normalization.",
    "medians": {
      "aperture_raw_flux": 195041.7751159668,
      "sap_raw_flux": 214427.296875,
      "pdcsap_raw_flux": 225077.4375
    },
    "sap": {
      "n_points": 18792,
      "pearson_r": 0.9615756722500743,
      "r_squared": 0.9246277734631824,
      "mean_difference": -0.00011867352115270264,
      "median_difference": 4.05761454924658e-06,
      "rms_difference": 0.0007905643303690548,
      "rms_difference_ppm": 790.5643303690548,
      "max_absolute_difference": 0.004457590727014016,
      "correlation_defined": true
    },
    "pdcsap": {
      "n_points": 18792,
      "pearson_r": 0.9338923739882716,
      "r_squared": 0.8721549661934498,
      "mean_difference": -8.769036467039824e-05,
      "median_difference": 4.369803100429115e-05,
      "rms_difference": 0.0010194262744242953,
      "rms_difference_ppm": 1019.4262744242952,
      "max_absolute_difference": 0.005744503190702743,
      "correlation_defined": true
    }
  },
  "software": {
    "python": "3.12.1",
    "numpy": "1.26.4",
    "astropy": "7.2.0",
    "tess_timing": "0.1.0"
  },
  "limits": [
    "This is a real SPOC product comparison with no detrending, no transit fit, and no timing measurement.",
    "The comparison is a diagnostic on one common quality mask, not a validation of the SPOC pipeline.",
    "No transit, depth, duration, period, ephemeris, or mid-transit time is measured or claimed.",
    "The aperture series and each mission series are divided by their median on the common mask before the difference metrics and the CSV.",
    "The CSV has one row per common-mask cadence, in time order. The aperture uncertainty is the extracted uncertainty divided by the same aperture median."
  ]
}
