def get_stereo_opts(session='rpc',threads=4,ba_prefix=None,align='Affineepipolar',xcorr=2,std_mask=0.5,std_kernel=-1,lv=5,corr_kernel=[21,21],rfne_kernel=[35,35],stereo_mode=0,spm=1,cost_mode=2,corr_tile_size=1024,mvs=False):
    """
    prepares stereo cmd for ASP
    See ASP's stereo documentation here: https://stereopipeline.readthedocs.io/en/latest/correlation.html
    Parameters
    ----------
    session: str
        camera model with which stereo steps (preprocessing, triangulation will be performed (default: rpc)
    threads: int
        number of threads to use for each stereo job (default: 4)
    ba_prefix: str
        if rpc, read adjustment to rpc files from this path
    align: str 
        alignment method to be used befor correlation (default: Affineepipolar). Note will only be relevant if non-ortho images are used for correlation
    xcorr: int 
        Whether to perform cross-check (forward+backward search during stereo), default is 2, so check for disparity first from left to right and then from right to left
    std_mask: int
        this does not perform what is expected, so omitted now
    std_kernel: int 
        omitted for now
    lv: int
        number of pyramidal overview levels for stereo correlation, defualt is 5 levels
    corr_kernel: list
        tempelate window size for stereo correlation (default is [21,21])
    rfne_kernel: list
        tempelate window size for sub-pixel optimization (default is [35,35])
    stereo_mode: int
        0 for block matching, 1 for SGM, 2 for MGM (default is 0)
    spm: int
        subpixel mode, 0 for parabolic localisation, 1 for adaptavie affine and 2 for simple affine (default is 1)
    cost_mode: int
        Cost function to determine match scores, depends on stereo_mode, defualt is 2 (Normalised cross correlation) for block matching
    corr_tile_size: int
        tile sizes for stereo correlation, default is ASP default size of 1024, for SGM/MGM this is changed to 6400 for skysat
    mvs: bool
        if true, prepare arguments for experimental multiview video stereo

    Returns
    ----------
    stereo_opt: list
        a set of stereo arguments as list to be run using subprocess command.
    """
    stereo_opt = []
    # session_args
    stereo_opt.extend(['-t', session])
    stereo_opt.extend(['--threads', str(threads)])
    if ba_prefix:
        stereo_opt.extend(['--bundle-adjust-prefix', ba_prefix])
    # stereo is a python wrapper for 3/4 stages
    # stereo_pprc args : This is for preprocessing (adjusting image dynamic
    # range, alignment using ip matches etc)
    stereo_opt.extend(['--individually-normalize'])
    stereo_opt.extend(['--alignment-method', align])
    stereo_opt.extend(['--ip-per-tile', '8000'])
    stereo_opt.extend(['--ip-num-ransac-iterations','2000'])
    #stereo_opt.extend(['--ip-detect-method', '1'])
    stereo_opt.extend(['--force-reuse-match-files'])
    stereo_opt.extend(['--skip-rough-homography'])
    # mask out completely feature less area using a std filter, to avoid gross MGM errors
    # this is experimental and needs more testing
    stereo_opt.extend(['--stddev-mask-thresh', str(std_mask)])
    stereo_opt.extend(['--stddev-mask-kernel', str(std_kernel)])
    # stereo_corr_args:
    # parallel stereo is generally not required with input SkySat imagery
    # So all the mgm/sgm calls are done without it.
    stereo_opt.extend(['--stereo-algorithm', str(stereo_mode)])
    # the kernel size would depend on the algorithm
    stereo_opt.extend(['--corr-kernel', str(corr_kernel[0]), str(corr_kernel[1])])
    stereo_opt.extend(['--corr-tile-size', str(corr_tile_size)])
    stereo_opt.extend(['--cost-mode', str(cost_mode)])
    stereo_opt.extend(['--corr-max-levels', str(lv)])
    # stereo_rfne_args:
    stereo_opt.extend(['--subpixel-mode', str(spm)])
    stereo_opt.extend(['--subpixel-kernel', str(rfne_kernel[0]), str(rfne_kernel[1])])
    stereo_opt.extend(['--xcorr-threshold', str(xcorr)])
    # stereo_fltr_args:
    """
    Nothing for now,going with default can include somethings like:
    - median-filter-size, --texture-smooth-size (I guess these are set to some defualts for sgm/mgm ?)
    """
    # stereo_tri_args:
    disp_trip = 10000
    if not mvs:
        stereo_opt.extend(['--num-matches-from-disp-triplets', str(disp_trip)])
        stereo_opt.extend(['--unalign-disparity'])
    return stereo_opt