igrins / plp

IGRINS pipeline package v3
18 stars 16 forks source link

plp - can not produce interactive html page #17

Open timur-sahin opened 8 years ago

timur-sahin commented 8 years ago

Hi Guys,

I've struggled with running plp. It was difficult to figure out which versions of the required packages were compatible. At some stage, I was getting the following error message:

Now generating figures Traceback (most recent call last): File "igr_pipe.py", line 58, in argh.dispatch(parser) File "./external/argh/argh/dispatching.py", line 125, in dispatch for line in lines: File "./external/argh/argh/dispatching.py", line 202, in _execute_command for line in result: File "./external/argh/argh/dispatching.py", line 185, in _call result = args.function(_positional, *_keywords) File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/recipes/recipe_extract.py", line 37, in extract subtract_interorder_background=subtract_interorder_background, File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/recipes/recipe_extract.py", line 106, in abba_all obsids, frametypes, File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/recipes/recipe_extract.py", line 492, in process wvl) File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/recipes/recipe_extract.py", line 782, in get_a0v_flattened figout=figout) File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/recipes/libs/a0v_flatten.py", line 569, in get_a0v_flattened plot_flattend_a0v(spec_flattener, wvl, s_list, orderflat_response, data_list, fout=figout) File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/libs/a0v_flatten.py", line 477, in plot_flattend_a0v ax1=ax1, ax2=ax2) File "/home/sahin/postdoc_UT/IGRIN/plp-2.1-alpha.2/recipes/libs/a0v_flatten.py", line 288, in plot_fitted color1 = ax1._get_lines.color_cycle.next() AttributeError: '_process_plot_var_args' object has no attribute 'color_cycle'

With Greg's and Monika's suggestions, I've tried to install several different version of the packages to see which one would help me run the code without any error messages. I've found out that matplotlib ver.1.4.0 and pandas' latest versions to be compatible. Then I've run the script to produce interactive webpage, however, it produces and error message (please see attached pdf for both example output for the plp run in my laptop and error message that I get for interactive web page creation stage).

I would be glad if one of you guys are comment on the content of the log file for plp run and error message for producing html page. I'm curious to see whether the code runs ok! and the output is expected.

Thank you Timur Sahin

EXAMPLE_OUTPUT_22_JAN_2016.pdf

kfkaplan commented 8 years ago

We just went over this issue and the problem was the first frame numbers for the science target and sky frames were the same in the recipe file. This caused a conflict since the PLP uses the first frame number to track each reduced file. Swapping the first and second frame for SKY in the recipe file and rerunning the PLP fixed the issue.

kfkaplan commented 8 years ago

I was able to fix the issue by commenting out all instances of "color1" in libs/a0v_flatten.py like this from line 280:

def plot_fitted(self, w1, s1_orig, s_a0v, tt,
                msk_i, msk_sv, fitted_continuum,
                ax1=None, ax2=None):

    fl = s1_orig / fitted_continuum # s1m : normalization factor
    ratio = s1_orig/tt # model corrected spec
    if ax1:
        # plot raw spec
        #color1 = ax1._get_lines.color_cycle.next() #COMMENTED OUT MAY 4, 2016 BY KYLE KAPLAN TO FIX https://github.com/igrins/plp/issues/17
        ax1.plot(w1, s1_orig, alpha=0.3)#, color=color1)
        # plot mask
        ax1.plot(w1,
                 np.ma.array(ratio, mask=msk_i).filled(np.nan),
                 lw=5, alpha=0.2)#, color=color1)

        # show model corrected raw spec
        ax1.plot(w1,
                 np.ma.array(ratio, mask=msk_sv).filled(np.nan),
                 lw=3, alpha=0.5)#, color=color1)

        # show fitted continuum
        ax1.plot(w1, fitted_continuum/s_a0v, lw=1.5, alpha=0.3, color="0.3")
        ax1.plot(w1, fitted_continuum, color="k")
        #plot(w1, s1_new)

    if ax2:
        # plot telluric model
        ax2.plot(w1, tt, alpha=0.2, lw=3)#, color=color1)
        # plot flattened spec
        ax2.plot(w1,
                 np.ma.array(fl,mask=fitted_continuum<0.05).filled(np.nan))#,
                 #color=color1)