Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign the verify method of the aperture class #249

Open
mgennaro opened this issue Jun 1, 2022 · 0 comments
Open

Redesign the verify method of the aperture class #249

mgennaro opened this issue Jun 1, 2022 · 0 comments

Comments

@mgennaro
Copy link
Contributor

mgennaro commented Jun 1, 2022

The verify() method:

def verify(self):

is seemingly used to verify that the X/YDetRef and X/YSciRef, however that verification seems to fail multiple times, possibly due to issues with the code itself.

I have a straw-man code below that could be used to build a more robust verify method:

def self_consistency_check(aperture):
    try:
        XrDet  = aperture.XDetRef
        YrDet  = aperture.YDetRef
        XrSci  = aperture.XSciRef
        YrSci  = aperture.YSciRef
        Xsz    = aperture.XSciSize
        Ysz    = aperture.YSciSize
        XcDet,YcDet = aperture.dms_corner()
         
        if aperture.DetSciYAngle == 0:
            Xrdms_full = 2049. - XrDet
            Yrdms_full = YrDet
            Xcdms_tmp = 2050. - XcDet - Xsz
            Ycdms_tmp = YcDet

        else:
            Xrdms_full = XrDet
            Yrdms_full = 2049. - YrDet
            Xcdms_tmp = XcDet
            Ycdms_tmp = 2050. - YcDet - Ysz
        
        Xcheck = Xrdms_full - Xcdms_tmp+1
        Ycheck = Yrdms_full - Ycdms_tmp+1
    
        dx = Xcheck-XrSci
        dy = Ycheck-YrSci
        
        print('{:30} {:9.7f} {:9.7f}'.format(aperture.AperName,dx,dy))
        
    except:
        print(aperture.AperName,aperture.AperType)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant