desihub / gpu_specter

Scratch work for porting spectroperfectionism extractions to GPUs
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Add test script for comparing output #36

Closed dmargala closed 4 years ago

dmargala commented 4 years ago

Adding a script to compare the output from different versions of spex or desi_extract_spectra. It takes two fits files as input and prints out the percentage of pixels within np.isclose and the cumulative distribution of the pull statistic (f_a - f_b)/sqrt(var_a + var_b).

$ python py/gpu_specter/test/parity.py -a $SCRATCH/spex_extract.fits -b $SCRATCH/desi_extract.fits
(f_a, f_b):
  isclose:   70.17%
(f_a - f_b)/sqrt(var_a + var_b):
    1e-05:   60.38%
   0.0001:   73.73%
    0.001:   84.80%
     0.01:   94.74%
      0.1:   99.88%
      1.0:  100.00%

I've also added some notes to the test subdirectory to codify some example testing practices.