예제 #1
0
파일: process_flat.py 프로젝트: zyajay/plp
def trace_solutions(trace_products):

    from storage_descriptions import FLATCENTROIDS_JSON_DESC

    centroids_dict = trace_products[FLATCENTROIDS_JSON_DESC]
    bottom_centroids = centroids_dict["bottom_centroids"]
    up_centroids = centroids_dict["up_centroids"]

    nx = IGRINSDetector.nx

    _ = trace_centroids_chevyshev(bottom_centroids,
                                  up_centroids,
                                  domain=[0, nx],
                                  ref_x=nx / 2)

    bottom_up_solutions_full, bottom_up_solutions, bottom_up_centroids = _

    assert len(bottom_up_solutions_full) != 0

    from numpy.polynomial import Polynomial
    bottom_up_solutions_as_list = []
    for b, d in bottom_up_solutions_full:

        bb, dd = b.convert(kind=Polynomial), d.convert(kind=Polynomial)
        bb_ = ("poly", bb.coef)
        dd_ = ("poly", dd.coef)
        bottom_up_solutions_as_list.append((bb_, dd_))

    from storage_descriptions import FLATCENTROID_SOL_JSON_DESC

    r = PipelineProducts("order trace solutions")
    r.add(
        FLATCENTROID_SOL_JSON_DESC,
        PipelineDict(
            orders=[],
            #bottom_up_centroids=bottom_up_centroids,
            #bottom_up_solutions=bottom_up_solutions,
            bottom_up_solutions=bottom_up_solutions_as_list,
        ))

    r2 = PipelineProducts("order trace solutions")
    r2.add(
        FLATCENTROID_SOL_JSON_DESC,
        PipelineDict(  #orders=[],
            bottom_up_centroids=bottom_up_centroids,
            bottom_up_solutions=bottom_up_solutions,
            #bottom_up_solutions_full=bottom_up_solutions_as_list,
        ))

    return r, r2
예제 #2
0
파일: process_flat.py 프로젝트: igrins/plp
def trace_solutions(trace_products):


    from storage_descriptions import FLATCENTROIDS_JSON_DESC

    centroids_dict = trace_products[FLATCENTROIDS_JSON_DESC]
    bottom_centroids = centroids_dict["bottom_centroids"]
    up_centroids = centroids_dict["up_centroids"]

    nx = IGRINSDetector.nx

    _ = trace_centroids_chevyshev(bottom_centroids,
                                  up_centroids,
                                  domain=[0, nx],
                                  ref_x=nx/2)

    bottom_up_solutions_full, bottom_up_solutions, bottom_up_centroids = _

    assert len(bottom_up_solutions_full) != 0

    from numpy.polynomial import Polynomial
    bottom_up_solutions_as_list = []
    for b, d in bottom_up_solutions_full:

        bb, dd = b.convert(kind=Polynomial), d.convert(kind=Polynomial)
        bb_ = ("poly", bb.coef)
        dd_ = ("poly", dd.coef)
        bottom_up_solutions_as_list.append((bb_, dd_))



    from storage_descriptions import FLATCENTROID_SOL_JSON_DESC

    r = PipelineProducts("order trace solutions")
    r.add(FLATCENTROID_SOL_JSON_DESC,
          PipelineDict(orders=[],
                       #bottom_up_centroids=bottom_up_centroids,
                       #bottom_up_solutions=bottom_up_solutions,
                       bottom_up_solutions=bottom_up_solutions_as_list,
                       ))

    r2 = PipelineProducts("order trace solutions")
    r2.add(FLATCENTROID_SOL_JSON_DESC,
           PipelineDict(#orders=[],
                        bottom_up_centroids=bottom_up_centroids,
                        bottom_up_solutions=bottom_up_solutions,
                        #bottom_up_solutions_full=bottom_up_solutions_as_list,
                        ))

    return r, r2
예제 #3
0
파일: process_flat.py 프로젝트: gully/plp
    from libs.trace_flat import plot_solutions1, plot_solutions2
    fig2 = plot_solutions1(flat_normed,
                           bottom_up_solutions)

    _d = trace_solution_products_plot[FLATCENTROID_SOL_JSON_DESC]
    fig3 = plot_solutions2(_d["bottom_up_centroids"],
                           _d["bottom_up_solutions"])

    return fig2, fig3



if 0:
    if 1: # chevyshev
        _ = trace_centroids_chevyshev(cent_bottom_list,
                                      cent_up_list,
                                      domain=[0, 2048],
                                      ref_x=nx/2)

    if 0:
        order = 5
        func_fitter = get_line_fiiter(order)

        _ = trace_centroids(cent_bottom_list,
                            cent_up_list,
                            func_fitter=func_fitter,
                            ref_x=nx/2)

    bottom_up_solutions, bottom_up_centroids = _

    if 0:
        plot_sollutions(flat_normed,
예제 #4
0
파일: process_flat.py 프로젝트: zyajay/plp
        bottom_up_solutions.append((bp, dp))

    from trace_flat import plot_solutions1, plot_solutions2
    fig2 = plot_solutions1(flat_normed, bottom_up_solutions)

    _d = trace_solution_products_plot[FLATCENTROID_SOL_JSON_DESC]
    fig3 = plot_solutions2(_d["bottom_up_centroids"],
                           _d["bottom_up_solutions"])

    return fig2, fig3


if 0:
    if 1:  # chevyshev
        _ = trace_centroids_chevyshev(cent_bottom_list,
                                      cent_up_list,
                                      domain=[0, 2048],
                                      ref_x=nx / 2)

    if 0:
        order = 5
        func_fitter = get_line_fiiter(order)

        _ = trace_centroids(cent_bottom_list,
                            cent_up_list,
                            func_fitter=func_fitter,
                            ref_x=nx / 2)

    bottom_up_solutions, bottom_up_centroids = _

    if 0:
        plot_sollutions(flat_normed, bottom_up_centroids, bottom_up_solutions)