Skip to content

Commit

Permalink
Merge pull request #46 from ambarb/v2_common_essential_modules
Browse files Browse the repository at this point in the history
V2 common essential modules for _commonspeckle
  • Loading branch information
afluerasu authored Nov 5, 2020
2 parents 5477bbc + 5cf2ec0 commit 2ecdacf
Show file tree
Hide file tree
Showing 17 changed files with 1,149 additions and 57 deletions.
2 changes: 1 addition & 1 deletion pyCHX/XPCS_XSVS_SAXS_Multi_2017_V4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#python XPCS_XSVS_SAXS_Multi_2017_V4.py


from pyCHX.chx_packages import *
from pyCHX.chx_packages import *
from pyCHX.chx_xpcs_xsvs_jupyter import run_xpcs_xsvs_single

def XPCS_XSVS_SAXS_Multi( start_time, stop_time, run_pargs, suf_ids = None,
Expand Down
4 changes: 3 additions & 1 deletion pyCHX/v2/_commonspeckle/DataGonio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import skbeam.core.roi as roi
import skbeam.core.correlation as corr
import skbeam.core.utils as utils
from pyCHX.chx_generic_functions import average_array_withNan
from pyCHX.v2._commonspeckle.chx_generic_functions import (
average_array_withNan,
) # common


def convert_Qmap(
Expand Down
8 changes: 6 additions & 2 deletions pyCHX/v2/_commonspeckle/SAXS.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
# import matplotlib as mpl
# import matplotlib.pyplot as plt
# from matplotlib.colors import LogNorm
from pyCHX.chx_libs import *
from pyCHX.chx_generic_functions import show_img, plot1D, find_index
from pyCHX.v2._commonspeckle.chx_libs import * # common
from pyCHX.v2._commonspeckle.chx_generic_functions import (
show_img,
plot1D,
find_index,
) # common
from scipy.special import gamma, gammaln
from scipy.optimize import leastsq, curve_fit, least_squares

Expand Down
17 changes: 12 additions & 5 deletions pyCHX/v2/_commonspeckle/Stitching.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import numpy as np
from scipy.signal import savgol_filter as sf
import matplotlib.pyplot as plt
from pyCHX.chx_generic_functions import show_img, plot1D
from pyCHX.DataGonio import convert_Qmap
from pyCHX.v2._commonspeckle.chx_generic_functions import show_img, plot1D # common
from pyCHX.v2._commonspeckle.DataGonio import (
convert_Qmap,
) # common #TODO how much overlap with skbeam.core.recip


def get_base_all_filenames(inDir, base_filename_cut_length=-7):
Expand Down Expand Up @@ -253,12 +255,17 @@ def stitch_WAXS_in_Qspace(
return Intensity_map, qxs, qzs


def plot_qmap_in_folder(inDir):
def plot_qmap_in_folder(inDir): # TODO is this made for SMI as per docstring?
"""YG. Sep 27@SMI
Plot Qmap data from inDir, which contains qmap data and extent data
"""
from pyCHX.chx_generic_functions import show_img
from pyCHX.chx_libs import cmap_vge_hdr, plt
from pyCHX.v2._commonspeckle.chx_generic_functions import (
show_img,
) # common #TODO why importing in a function?
from pyCHX.v2._commonspeckle.chx_libs import (
cmap_vge_hdr,
plt,
) # common #TODO why importing in a function?
import pickle as cpl

fp = get_base_all_filenames(inDir, base_filename_cut_length=-10)
Expand Down
9 changes: 7 additions & 2 deletions pyCHX/v2/_commonspeckle/Two_Time_Correlation_Function.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import itertools
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from pyCHX.chx_libs import (
from pyCHX.v2._commonspeckle.chx_libs import (
colors as colors_array,
markers as markers_array,
markers_copy,
Expand All @@ -26,7 +26,12 @@
) # common

# from pyCHX.chx_libs import colors_ as mcolors, markers_ as markers
from pyCHX.chx_libs import mcolors, markers, multi_tau_lags, colors # common
from pyCHX.v2._commonspeckle.chx_libs import (
mcolors,
markers,
multi_tau_lags,
colors,
) # common

# from modest_image import ModestImage, imshow #common

Expand Down
8 changes: 4 additions & 4 deletions pyCHX/v2/_commonspeckle/XPCS_GiSAXS.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
This module is for the GiSAXS XPCS analysis
"""

from pyCHX.chx_generic_functions import *
from pyCHX.chx_compress import ( compress_eigerdata, read_compressed_eigerdata,init_compress_eigerdata, get_avg_imgc,Multifile)
from pyCHX.chx_correlationc import ( cal_g2c )
from pyCHX.chx_libs import ( colors, markers, colors_, markers_)
from pyCHX.v2._commonspeckle.chx_generic_functions import * #common
from pyCHX.v2._commonspeckle.chx_compress import ( compress_eigerdata, read_compressed_eigerdata,init_compress_eigerdata, get_avg_imgc,Multifile) #common
from pyCHX.v2._commonspeckle.chx_correlationc import ( cal_g2c ) #common
from pyCHX.v2._commonspeckle.chx_libs import ( colors, markers, colors_, markers_) #common
from skbeam.core.accumulators.binned_statistic import BinnedStatistic2D,BinnedStatistic1D


Expand Down
16 changes: 8 additions & 8 deletions pyCHX/v2/_commonspeckle/XPCS_SAXS.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
This module is for the SAXS XPCS analysis
"""

from pyCHX.chx_libs import ( colors, colors_copy, markers, markers_copy,
colors_, markers_, )
from pyCHX.v2._commonspeckle.chx_libs import ( colors, colors_copy, markers, markers_copy,
colors_, markers_, ) #common

from pyCHX.chx_libs import ( Figure, RUN_GUI )
from pyCHX.v2._commonspeckle.chx_libs import ( Figure, RUN_GUI ) #common

from pyCHX.chx_generic_functions import *
from pyCHX.v2._commonspeckle.chx_generic_functions import * #common
from scipy.special import erf

from pyCHX.chx_compress_analysis import ( compress_eigerdata, read_compressed_eigerdata,
from pyCHX.v2._commonspeckle.chx_compress_analysis import ( compress_eigerdata, read_compressed_eigerdata,
init_compress_eigerdata,
Multifile,get_each_ring_mean_intensityc,get_avg_imgc, mean_intensityc )
Multifile,get_each_ring_mean_intensityc,get_avg_imgc, mean_intensityc ) #common

from pyCHX.chx_correlationc import ( cal_g2c,Get_Pixel_Arrayc,auto_two_Arrayc,get_pixelist_interp_iq,)
from pyCHX.chx_correlationp import ( cal_g2p)
from pyCHX.v2._commonspeckle.chx_correlationc import ( cal_g2c,Get_Pixel_Arrayc,auto_two_Arrayc,get_pixelist_interp_iq,) #common
from pyCHX.v2._commonspeckle.chx_correlationp import ( cal_g2p) #common


from pandas import DataFrame
Expand Down
Loading

0 comments on commit 2ecdacf

Please sign in to comment.