Data Analysis Utilities
zeustools.numba_reduction module
- zeustools.numba_reduction.calculate_chunk_hash_std(chunks)
- zeustools.numba_reduction.calculate_chunk_weights(chunks)
- zeustools.numba_reduction.chunk_data(chop, cube)
Collect each data set associated with a single chop/wobble phase into a more manageable format.
- Parameters
chop – numpy array of chop phase for each data point
cube – MCE time series data file [rows,cols,timepts]
- Returns
list of chunks, where each chunk is a numpy array with shape [rows,cols,numpts] list of phases, representing the phase of the chunk.
- e.g.
if you have data like [[[1,2,3,4]]] (i.e. one pixel on the mce) with chop like [1,1,0,0] you will get back list([[[1,2]]],[[[3,4]]]),list(1,0)
- zeustools.numba_reduction.chunk_data_1d(chop, ts)
Collect each data set associated with a single chop/wobble phase into a more manageable format.
- Parameters
chop – numpy array of chop phase for each data point
ts – 1-d time series
- Returns
lists of floats instead of the arrays returned by
chunk_data()
- zeustools.numba_reduction.numba_mean(args)
- zeustools.numba_reduction.numba_median(args)
- zeustools.numba_reduction.numba_std(args)
- zeustools.numba_reduction.offset_chunk_data(chop, cube)
Instead of chunking entire phases, chunk half-phases. otherwise, this is the same as
chunk_data()
- zeustools.numba_reduction.offset_data_reduction(chop, cube, lophase=1)
- zeustools.numba_reduction.offset_subtract_chunks(chunks, phases, lophase=0, weights=None)
similar to subtract_chunks, but instead of doing on-off, we do average(half_of_on - half_of_off, -half_of_off + half_of_next_on) to remove snakes.
- Parameters
chunks – list of ‘chunks’, first element returned by
offset_chunk_data().phases – list of phases, second element of offset_chunk_data return
lophase – which chop phase to treat as “off” chop, i.e. the sign. usually 1, I think.
weights – weights to associate with chunks of data, can be obtained with
calculate_chunk_weights()
- zeustools.numba_reduction.reduce_chunks(chunks, fn=CPUDispatcher(<function numba_median>))
- zeustools.numba_reduction.reduce_chunks_1d(chunks, fn=CPUDispatcher(<function numba_mean>))
- zeustools.numba_reduction.simple_data_reduction(chop, cube)
- zeustools.numba_reduction.subtract_all_model_snake(cube, snake)
- zeustools.numba_reduction.subtract_chunks(reduced_chunks, phases, lowphase=0)
zeustools.reduction_tools module
- zeustools.reduction_tools.hk_matcher(ts)
Given an array of timestamps from the .ts files, this function returns an array of timestamps (in GPS time to match the .ts files) and the corresponding array of detector temperatures
- zeustools.reduction_tools.nod_concat(nod_arr)
Given an array of the format generated by nod_loader concatenate all the time series to generate one huge time stream returns a tuple (ts, mce_data) This is mostly useful just for inspecting the atmospheric variations over long time lengths or doing lombscargles.
- zeustools.reduction_tools.nod_loader(filename, number_range)
Filename should include a {num} format string so that we can build numbered filenames. Number_range should be a range or iterable of integers Returns a list of tuples (mce_data object, time series array, mce_data array, wobbler phase, nod sign)