def det_to_sci(image, detid):
    """Detector to science orientation
    
    Reorient image from detector coordinates to 'sci' coordinate system.
    This places +V3 up and +V2 to the LEFT. Detector pixel (0,0) is assumed 
    to be in the bottom left. Simply performs axes flips.
    
    Parameters
    ----------
    image : ndarray
        Input image to tranform.
    detid : int or str
        NIRCam detector/SCA ID, either 481-490 or A1-B5.
    """
    
    # Check if SCA ID (481-489) where passed through detname rather than A1-B5
    try:
        detid = int(detid)
    except ValueError:
        detname = detid
    else:
        scaids = {481:'A1', 482:'A2', 483:'A3', 484:'A4', 485:'A5',
                  486:'B1', 487:'B2', 488:'B3', 489:'B4', 490:'B5'}
        detname = scaids[detid]
    
    xflip = ['A1','A3','A5','B2','B4']
    yflip = ['A2','A4','B1','B3','B5']
    
    for s in xflip:
        if detname in s:
            image = image[:,::-1] 
    for s in yflip:
        if detname in s:
            image = image[::-1,:] 
    
    return image