June 16, 2012 description of codes used in REU 2011 project to read IDM files 1) ~emery/reu11/newCRB.m reads the IDM files in /hao/aim3/dmsp/dmsp_idm_4s in monthly YYMM files a) Boundaries = 1 makes the lN(S)##YYMMBoundaries_Bz.txt file (for whole month) b) MLTPlot = 1 makes a single global plot (usually for 1 day - NOT WHOLE MONTH!) with all orbits Will not have both MLTPlot=1 and makePlots=1 at the same time (sets makePlots=0!) c) makePlots = 1 if each orbit, original, detrended (and sometimes with Weimer) is plotted with the 20s aves of CRBs and Vyx (max equatorward velocities plotted). Have about 16 orbits per day * 30 days or about 480 plots per month. Use these plots to determine good/bad. d) Copy over Boundaries_Bz.txt files to another place and then delete lines where 1 or more sides have bad CRB or Vyx determination (tedius - so replace with flag in (2)) 2) Need to revise lN(S)##YYMMBoundaries_Bz.txt output to include 4 flags for CRB and Vyx for each dawn and dusk crossing of the aurora. These flags are +1 initially, and are set to -1 if plot from newCRB is bad for any of the 4 values (CRB,Vyx dawn and CRB,Vyx dusk). Thus, do not have to toss ~40% of the orbits when 1-4 are bad and 3-0 are good. If Plotboundaries is used again, can just use values where flag=+1 and ignore data with flags=-1. For E (with IGRFB) or QJ (with SSJ4) calcs, can use ALL IDM (but spurious bad! - mostly SH equ) 3) Would like to revised OMNI part to be 20min ave sliding every 5 min to change for each side of the oval (by ~10 min) instead of a constant IMF over whole polar cap used Not so important, so skip for now. 4) PlotBoundaries.m plots the (4 good only now) boundaries catted together for all months 5) CompareCrossings.m compares Weimer vs IDM (where Weimer found by Barbara in fortran codes and printed out in text files) For 2012 QJ study: 1) Revise newCRB to call fortran IGRF to get B along IDM track every 4 sec and calc E (Vi = ExB/B^2, Vi=Vx+Vy+Vz and only have Vy and Vz in IDM files where B mostly Bz, so can ignore Vz (mostly, although is rel large!) and Vx is from RPA and is missing 2) make sure Nancy can write into /hao/aim3/dmsp/dmsp_rich/txt_dmspssj (emery dmsp) or into dmspssjtxt (liamk visitor) 3) Can revise and run MainCRBpeakFlux.m to make 1 day of ssj at a time (not a year until it works) Calls createCenergyText2.m to list out 1sec ssj4 elec and ion data (consider listing only 4sec av?) 4) Then revise a read code (which?) to average 4sec to be same as IDM, calc solar zenith angle to get EUV conductance, and use Eflux,mean to get Robinson auroral conductance. Possible codes are: plot_ssj4.m and maybe satelliteTrackPlot.m