Updated global_sig to calculate chi-squared. Added module with linear regression.
Added calfiles for two basic arrays, one that inherits from phs and one that inherits from amp.
In global_sig.py I moved file reading to its own file, added a function to fit the global signal with a line through the origin in place of a linear fit. In the test_regress_vary_* functions I added a filter to only plot points with good reduced chi-squared fits.

I put the calfiles, figures, and coeff data in their own folders.

In useful_functions.py I fixed the reduced chi-squared calculation so that it divided by the correct degrees of freedom and I added functions to fit lines through the origin, power laws, and legendre functions.
In global_sig.py I changed the chi restriction to a boolean flag and I changed the functions to accept baselines and coefficients instead of calfiles
Did more fitting
Merge branch 'master' of https://github.com/dannyjacobs/capo
Merge branch 'master' of https://github.com/mpresley42/capo

Getting Morgan's updates.
Pull practice
Added new linear fitting method and fixed gsm loading and power spectrum fitting
Added comments on rest of global_sig.py functions. Changed locations of antennae in basic_amp_array.py so that they have smaller baselines. This decreased the error in the global signal calculation by an order of magnitude, but we still need to eliminate a couple more orders.
Added error computation to the linear fit
Added functions to useful_functions.py that would calculate the standard deviation error of the fits. Added a function that would fit a general polynomial using the least squares method. Changed functions in global_sig.py to utilize new fitting abilities.
Added a new file for the functions that generalize the coefficient calculation to any spherical harmonic and do stuff with the full Q matrix. It's not yet reproducing the results for l,m=0,0, so it's still in progress.
Found and marked where the code is messing up.... just don't know why.
Fixed the problem with the coefficient calculation. Now the code will calculate the Q matrix for a set of baselines for as many spherical harmonics as desired. Note that to get one entry in the Q matrix is ~33 sec, so it will take a long time to run.

Also made a function to plot the Q matrix entry as a function of l and colored according to m.
Added functions to sph_harm_coeffs.py that calculate the information matrix for a given Q (working) and N and test a linear regression recovery of the global signal (not yet working). I also created a new file, basic_amp_aa_circle.py which sets up a circular arrangement of antennas.
Modified coefficient calculation and Q matrix calculation in sph_harm_coeffs.py so that only specified baselines will enter the calculation (instead of all of the baselines for an array). Also added a function that returns a specified number of the smallest baselines for a given array. Added to the info_matrix function plots for the eigenvalues, eigenvectors, and first row. Added a function to calculate a window function for an M specified within the function and to plot the first row of the W matrix.

In useful_functions.py I modified the general_lstsq_fit_with_err() function so that it has the option of using a pseudo inverse in the calculation.
Added a new calfile with an array with antennas in a grid pattern. Also changed the functions in sph_harm_coeff.py so that the number of antennas was calculated instead of inputted.
Merge branch 'master' of https://github.com/mpresley42/capo