December8, 2022 plotting_scripts/phase_space_to_hist.gnu modified to read bin_average_rms_6,7,8.dat (generated by phase_space_to_histogram.f90 using s.p to get spin angle) and to use 1/sqrt(N) as error in fit. (Continues to plot using rms as error bar). Add timestamp and label. Also at directory label using /plotting_scripts/directory_label.gnu - 2D_hist_test.gnu modified to use 1/sqrt(number of points) as error in fit and with directory info December 7, 2022 Include parameter in input file. Passed to read_phase_space, and read_Dmuons. First nmuon_first muons are skipped. nmuons is the total number read Download Emerey's 1.6E6 events from doc-db 17800, file = files/muons/EndofM5_Valetov_withInit.dat. commit to repository - add name to softlink_lnx - modify read_phase_space to read the format (almost the same as the format that bmad writes for phase space files December 6, 2022 Subroutine bin_spin_angle_by_time(turn, unit, nmuons,muons, dphi_dp_ext, dphi_dp_err_ext) is part of file compute_moments.f90 and is called from subroutine compute_moments and alternatively from compute_moments_vs_time. In the input file bin_width - time bin width (20ns) pbin_width, & ! if >0 bin spin according to time and momentum. this is the width of the momentum bin (0.0002) time_binning !chacter*100, 'position_slice': binned by time at the end of the lattice( compute_moments_vs_time),'momentum_slice': binned by momentum (through compute_moments) December 9, 2022 increase array size to 1e6 line 166 energy_vs_time.f90 - if(.not. allocated(muon_alive))allocate(muon_alive(1:1000000)). Also in same program line 125 change format since integer at end was too big write(lun2,'(i10, 1x, 4es16.8,1x,i16)')muon_000(j)%muon_numb, muon_000(j)%pz, muon_000(j)%time, muon_000(j)%x, muon_000(j)%xp, muon_000(j)%ix Plot with ps/2D_hist_test.gnu - modified to include error on slope and name output by =4,5,or 6 December 13, 2022 Using compute_moments_vs_time, position_time mode, unallocated array in compute_moments_vs_time. Repair After some debugging - since using it in loop mode need to deallocate and reallocate more carefully. Looks OK programs/phase_space_to_histogram.f90 - fix it up so that it can read Eremey style phase space file directly December 15, 2022 Create a version of 2D_hist_test.gnu -> 2D_hist_test_quad.gnu that fits a quadratic to the phi-x,phi-x', phi-delta arrays Modify energy_time_to_2D_hist.f90 Recall this program writes binned data into bin_rms_average_4,5,6.dat Add polynomial fit with mrqmin and write coefficients to 2D_hist_input.dat so they are read with 2D_hist_test.gnu Modify 2D_hist_test.gnu to read the coefficients and plot the fit function along with the data. December 16, 2022 Find and fix bug in phase_space_to_histogram.f90 - yconvert flaw. No effect on slopes.