suncasa.utils.stackplotX
Attributes
Classes
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
get the cross correlation map along y axis |
|
|
|
|
|
Get values at a slice |
|
smooth the data using a window with requested size. |
|
Convert 3 column data to matplotlib grid |
|
Module Contents
- suncasa.utils.stackplotX.runningmean(data, window, mode, ix)[source]
- Parameters:
data
window
ix
mode – available options are ratio and diff
- Returns:
- suncasa.utils.stackplotX.XCorrStackplt(z, x, y, doxscale=True)[source]
get the cross correlation map along y axis :param z: data :param x: x axis :param y: y axis :return:
- suncasa.utils.stackplotX.FitSlit(xx, yy, cutwidth, cutang, cutlength, s=None, method='Polyfit', ascending=False)[source]
- suncasa.utils.stackplotX.getimprofile(data, cutslit, xrange=None, yrange=None, get_peak=False, verbose=False)[source]
Get values at a slice
- Inputs:
data: input image data. Dimension: (ny, nx) or (ny, nx, nwv). nwv is the number of wavelengths/frequencies cutslit: cutslit generated from CutslitBuilder().cutslitplt xrange: [min(xs), max(xs)], where xs is the x coordinate values of the input image data.
If None (default), assume pixel coordinate values in cutslit
- yrange: [min(ys), max(ys)], where ys is the y coordinate values of the input image data.
If None (default), assume pixel coordinate values in cutslit
- get_peak: If True, return the peak of all pixels across the slit within the slit width.
If False (default), return the average value.
verbose: If True, print out more details in command line. Default is False
- Returns:
- distance from min(cutslit[‘xcen’]), min(cutslit[‘ycen’])
’y’: value on the cut, the shape is (len(cutslit[‘xcen’], [nwv])}
- Return type:
A dictionary of {‘x’
- suncasa.utils.stackplotX.smooth(x, window_len=11, window='hanning')[source]
smooth the data using a window with requested size.
This method is based on the convolution of a scaled window with the signal. The signal is prepared by introducing reflected copies of the signal (with the window size) in both ends so that transient parts are minimized in the begining and end part of the output signal.
- input:
x: the input signal window_len: the dimension of the smoothing window; should be an odd integer window: the type of window from ‘flat’, ‘hanning’, ‘hamming’, ‘bartlett’, ‘blackman’
flat window will produce a moving average smoothing.
- output:
the smoothed signal
example:
t=linspace(-2,2,0.1) x=sin(t)+randn(len(t))*0.1 y=smooth(x)
see also:
numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve scipy.signal.lfilter
NOTE: length(output) != length(input), to correct this: return y[(window_len/2-1):-(window_len/2)] instead of just y.
- suncasa.utils.stackplotX.grid(x, y, z, resX=20, resY=40)[source]
Convert 3 column data to matplotlib grid
- class suncasa.utils.stackplotX.SpaceTimeSlitBuilder(axes, dspec, cutlength=80, cutsmooth=10.0, scale=1.0, color='white')[source]
- class suncasa.utils.stackplotX.CutslitBuilder(axes, cutwidth=5.0, cutlength=150, cutang=0.0, cutsmooth=10.0, scale=1.0)[source]
- class suncasa.utils.stackplotX.Stackplot(infile=None)[source]
-
- plot_map(smap, dspec=None, diff=False, norm=None, cmap=None, SymLogNorm=False, linthresh=0.5, returnImAx=False, layout_vert=False, uni_cm=False, draw_limb=False, draw_grid=False, colortitle=None, title=['observatory', 'detector', 'wavelength', 'time'], fov=fov, *args, **kwargs)[source]
- make_mapseq(trange, outfile=None, fov=None, wavelength='171', binpix=1, dt_data=1, derotate=False, tosave=True, hdf5=False, superpixel=False, aia_prep=False, mapinterp=False, overwrite=False, dtype=None, normalize=True)[source]
- mapseq_mkdiff(mode='rdiff', dt=36.0, medfilt=None, gaussfilt=None, bfilter=False, lowcut=1 / 10 / 60.0, highcut=1 / 1 / 60.0, window=[None, None], outfile=None, tosave=False, dtype=None, hdf5=False, normalize=True)[source]
- Parameters:
mode – accept modes: rdiff, rratio, bdiff, bratio, dtrend, dtrend_diff, dtrend_ratio
dt – time difference in second between frames when [rdiff, rratio, bdiff, bratio] is invoked
medfilt
gaussfilt
bfilter – do butter bandpass filter
lowcut – low cutoff frequency in Hz
highcut – high cutoff frequency in Hz
outfile
tosave
- Returns:
- plot_mapseq(mapseq=None, hdr=False, norm=None, vmax=None, vmin=None, cmap=None, diff=False, sav_img=False, out_dir=None, dpi=100, anim=False, silent=False, draw_limb=False, draw_grid=False, colortitle=None, title=['observatory', 'detector', 'wavelength', 'time'], fov=[], fps=15)[source]
- Parameters:
mapseq
hdr
vmax
vmin
diff
sav_img
out_dir
dpi
anim
- Returns:
- make_stackplot(mapseq, frm_range=[], threshold=None, gamma=1.0, get_peak=False, trackslit_diffrot=False, negval=False, movingcut=[])[source]
movingcut: [x,y]. x and y are an array of offset in X and Y direction, respectively. the length of x/y is nframes
- plot_stackplot(mapseq=None, fov=None, hdr=False, norm=None, vmax=None, vmin=None, cmap=None, layout_vert=False, diff=False, uni_cm=True, sav_img=False, out_dir=None, dpi=100, anim=False, frm_range=[], cutslitplt=None, silent=False, refresh=True, threshold=None, gamma=1.0, get_peak=False, trackslit_diffrot=False, negval=False, movingcut=[])[source]