Roman-Supernova-PIT / diff-img

1 stars 0 forks source link

xy axis orientation problem #11

Closed laldoroty closed 3 months ago

laldoroty commented 3 months ago

There is some confusion over the x-y axis orientation. Previously, there was an issue causing the difference images to be mirrored and misaligned (https://github.com/laldoroty/phrosty/issues/8), but this clearly still persists in the mk_lc.py function. The bad news is I'm not sure why the difference images are now aligned and fine.

In DS9, I'm seeing 3 "options" for axis orientation. 4k cutout of my coadd (and everything else I've aligned with SWarp, including the image I'm getting the stars for the zeropoint from): image

Original image, SCA ID%3 != 0: image

Original image, SCA ID%3 = 0: image

Showing up as this error:

Traceback (most recent call last):
  File "/hpc/group/cosmology/lna18/rsim_photometry/mk_lc.py", line 233, in <module>
    main(sys.argv)
  File "/hpc/group/cosmology/lna18/rsim_photometry/mk_lc.py", line 230, in main
    lc(o_id,band)
  File "/hpc/group/cosmology/lna18/rsim_photometry/mk_lc.py", line 172, in lc
    xm = crossmatch(res, stars)
         ^^^^^^^^^^^^^^^^^^^^^^
  File "/hpc/group/cosmology/lna18/phrosty/phrosty/photometry.py", line 219, in crossmatch
    ti_x_pi = join(ti,ti_pi_reduced,join_type='outer')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/hpc/group/cosmology/lna18/miniconda3/envs/repeatability/lib/python3.11/site-packages/astropy/table/operations.py", line 415, in join
    out = _join(
          ^^^^^^
  File "/hpc/group/cosmology/lna18/miniconda3/envs/repeatability/lib/python3.11/site-packages/astropy/table/operations.py", line 1222, in _join
    raise ValueError("input tables for join must both have at least one row")
ValueError: input tables for join must both have at least one row

...because it thinks that there are no stars that both tables share.

@wmwv, can you post that plot you made showing that the stars don't overlap, but appear to be mirror imaged?

laldoroty commented 3 months ago

Fixed it. We need to always make sure we're aligning to the 4k cutout of the coadd.

image