Module Expr Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Import alias identifier ImportFrom alias alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad attr Return TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad Num body Expr Str If BoolOpOr CompareNotEq NameLoad Str CompareNotEq NameLoad Num body Raise Call NameLoad Str If NameLoad body If CompareNotEq NameLoad Str body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad For NameStore NameLoad body If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Index Num orelse If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Slice SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num attr If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad Assign NameStore Dict For NameStore AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Return NameLoad decorator_list
N/A N/A  Various dataframe-compatible reference utilities.  N/A __author__ Adam Hughes N/A __copyright__ Copyright 2012, GWU Physics N/A __license__ Free BSD N/A __maintainer__ Adam Hughes N/A __email__ hugadams@gwmail.gwu.edu N/A __status__ Development N/A numpy np pandas DataFrame Series N/A logging N/A logger N/A N/A logging getLogger __name__ _find_nearest N/A N/A array value N/A N/A N/A Find nearest value in an array, return index and array value N/A idx N/A N/A N/A N/A np abs N/A array value argmin N/A N/A idx N/A array N/A idx N/A dynamic_baseline N/A N/A df slices style weightstyle axis N/A linear None 1 N/A N/A Applies a dynamically calculated reference correction to a dataframe.  User passes in index values, either ranges
    or points, then a linear fit is applied through these points.  Each column in the dataframe is scaled its corresponding
    curve, which is then subracted off.  Essentially, this subracts a reference that can be lopsided- useful for assymetric data, and
    is usually how crude ATR-IR reference correction is performed.  
    
    For now, program only works for index values as the reference.
    
    df- DataFrame.
    
    slice- List of points or ranges at which the reference data is sampled.  For example, 
           ( (300.0, 500.0), 900.0 ).  Curve will take all index values of the dataframe between
           300.0:500.0 (nanometers in my case), and also take the closest index value there is to 900.0. 
           A fit is then drawn between these points.
           
    style- Fitting style to connect the dots between slice regions.  For now, only linear fit is used.  Not sure if higher order
           will ever be useful, so I left this in here as a reminder.
           
    axis-  Axis overwhich to do this reference correction.  For now, ONLY INDEX IS IMPLEMENTED.
    
    weightstyle- Tries to account for idea that if I pass slices, and one slice contains more points, then the line of best fit will be weighted
                 more strongly to this region.  For now, I haven't implemented this, but would have to actually use poly1d to call more points to the
                 other regions, or some other solution?  This does have an option, mean, which will take the mean if each range so that each range gets 
                 a single fit point; however, I think this is useless as this can be passed in anyway.  And it's the mean of the x-values, not even the 
                 mean of the data along that axis anyway.
                 
    returns-
       DataFrame of fitted references. N/A N/A N/A style linear N/A axis 1 N/A N/A N/A NotImplementedError reference correction only support linear fitting style and index axis iteration only. N/A weightstyle N/A N/A N/A weightstyle midpoint N/A N/A N/A NotImplemented N/A weightstyle attribute in reference_correction must be either None or "midpoint" but %s was entered weightstyle N/A xp N/A N/A N/A N/A logger info N/A Applying dynamic baseline (style=%s) style N/A val slices N/A N/A N/A N/A len val 1 N/A N/A N/A N/A xp append N/A N/A _find_nearest N/A df index val N/A 1 N/A N/A N/A N/A len val 2 N/A N/A xvals N/A N/A np asarray N/A N/A N/A df ix N/A N/A val N/A 0 N/A val N/A 1 index N/A N/A weightstyle mean N/A N/A N/A N/A xp append N/A N/A np mean xvals N/A N/A xp N/A xp N/A list xvals N/A N/A N/A AttributeError N/A In reference correction, slices must 1 or 2 items;received %s of len %s N/A val N/A len val N/A bout N/A N/A col N/A df columns N/A N/A curve N/A df N/A col N/A z N/A N/A np polyfit xp N/A curve N/A xp 1 N/A p N/A N/A np poly1d z N/A array N/A p N/A N/A np asarray N/A list N/A curve index N/A reference N/A Series array name col index N/A curve index N/A N/A bout N/A col reference N/A bout N/A DataFrame bout N/A N/A N/A bout reindex columns N/A df columns N/A bout N/A