Recent Changes - MACCS Magnetometer Arrayhttp://maccs.wikispot.org/Recent_ChangesRecent Changes on MACCS Magnetometer Array.en-us Peoplehttp://maccs.wikispot.org/People2007-09-19 17:41:10eriksteinmetz <div id="content" class="wikipage content"> Differences for People<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 5: </td> <td> Line 5: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + Erik Steinmetz<br> + Research Scientist<br> + Computer Science Department<br> + Augsburg College<br> + steinmee@augsburg.edu<br> + (612) 330-1062</span> </td> </tr> </table> </div> Users/maccshttp://maccs.wikispot.org/Users/maccs2007-09-11 20:13:24PhilipNeustromnote to you about style <div id="content" class="wikipage content"> Differences for Users/maccs<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ [[Comments]]<br> + <br> + Hey there, I just wanted to let you know that you can surround code in braces, like this:<br> + <br> + {{{<br> + #Get the current year, julian day and previous 6 days in UTC<br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + #NDAY=`echo $DAY + 1 | bc`<br> + PDAY=`echo $DAY - 1 | bc`<br> + P2DAY=`echo $DAY - 2 | bc`<br> + P3DAY=`echo $DAY - 3 | bc`<br> + P4DAY=`echo $DAY - 4 | bc`<br> + P5DAY=`echo $DAY - 5 | bc`<br> + P6DAY=`echo $DAY - 6 | bc`<br> + }}}<br> + <br> + To have it display nicer. It will remove all of the extra formatting for you. You can also upload source code as files to a page (Edit -&gt; Upload Files) and then use the {{{[[File(name)]]}}} macro to refer to the file on the page.<br> + <br> + Best, ["Users/PhilipNeustrom"]</span> </td> </tr> </table> </div> linex7.prohttp://maccs.wikispot.org/linex7.pro2007-09-04 19:40:04maccs <div id="content" class="wikipage content"> Differences for linex7.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 704: </td> <td> Line 704: </td> </tr> <tr> <td> <span>- </span> set_plot, 'ps'<br> <span>- </span> device, filename=fnameseq,/landscape<br> <span>- </span> !p.multi=[0,1,3]<br> <span>- <br> - </span> !x.style=1<br> <span>- </span> !x.margin=[10,10]<br> <span>- </span> !x.style=1<br> <span>- </span> !y.margin=[2,2]<br> <span>- <br> - <br> - </span>plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> <span>- </span>xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Mag H',$<br> <span>- </span>xtickformat='xticks', ystyle=18<br> <span>- </span>;!Y.TITLE = STRMID(LAB,63,4)<br> <span>- </span>plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> <span>- </span>xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='Mag z',$<br> <span>- </span>xtickformat='xticks', ystyle=18<br> <span>- </span>;!Y.TITLE = STRMID(LAB,67,4)<br> <span>- </span>plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> <span>- </span>xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Mag H',$<br> <span>- </span>xtickformat='xticks', ystyle=18<br> <span>- </span> device, /close_file </td> <td> <span>+ ;</span> set_plot, 'ps'<br> <span>+ ;</span> device, filename=fnameseq,/landscape<br> <span>+ ;</span> !p.multi=[0,1,3]<br> <span>+ <br> + ;</span> !x.style=1<br> <span>+ ;</span> !x.margin=[10,10]<br> <span>+ ;</span> !x.style=1<br> <span>+ ;</span> !y.margin=[2,2]<br> <span>+ <br> + <br> + ;</span>plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> <span>+ ;</span>xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Mag H',$<br> <span>+ ;</span>xtickformat='xticks', ystyle=18<br> <span>+ ;</span>;!Y.TITLE = STRMID(LAB,63,4)<br> <span>+ ;</span>plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> <span>+ ;</span>xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='Mag z',$<br> <span>+ ;</span>xtickformat='xticks', ystyle=18<br> <span>+ ;</span>;!Y.TITLE = STRMID(LAB,67,4)<br> <span>+ ;</span>plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> <span>+ ;</span>xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Mag H',$<br> <span>+ ;</span>xtickformat='xticks', ystyle=18<br> <span>+ ;</span> device, /close_file </td> </tr> <tr> <td> Line 736: </td> <td> Line 736: </td> </tr> <tr> <td> <span>- ;</span>set_plot, 'ps'<br> <span>- ;</span>device, filename=fnamelp,/landscape<br> <span>- ;</span>!p.multi=[0,1,3]<br> <span>- <br> - ;</span>!x.style=1<br> <span>- ;</span>!x.margin=[10,10]<br> <span>-</span> ;<span>!x.style=1<br> - ;!y.margin=[2,2]<br> - ;;</span>************U***This is the spot that controls titles for the postscript plots***********************<br> <span>- <br> - ;</span>plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> <span>- ;</span>xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$<br> <span>- ;</span>xtickformat='xticks', xminor=5,ystyle=18<br> <span>- ;</span>;!Y.TITLE = STRMID(LAB,63,4)<br> <span>- ;</span>plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> <span>- ;</span>xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$<br> <span>- ;</span>xtickformat='xticks',xminor=5, ystyle=18<br> <span>- ;</span>;!Y.TITLE = STRMID(LAB,67,4)<br> <span>- ;</span>plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> <span>- ;</span>xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$<br> <span>- ;</span>xtickformat='xticks',xminor=5, ystyle=18<br> <span>- ;</span>device, /close_file<br> <span>- <br> -</span> ;Use Z-buffer </td> <td> <span>+ </span>set_plot, 'ps'<br> <span>+ </span>device, filename=fnamelp,/landscape<br> <span>+ </span>!p.multi=[0,1,3]<br> <span>+ <br> + </span>!x.style=1<br> <span>+ </span>!x.margin=[10,10]<br> <span>+ !x.style=1<br> + !y.margin=[2,2]<br> +</span> ;************U***This is the spot that controls titles for the postscript plots***********************<br> <span>+ <br> + </span>plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> <span>+ </span>xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$<br> <span>+ </span>xtickformat='xticks', xminor=5,ystyle=18<br> <span>+ </span>;!Y.TITLE = STRMID(LAB,63,4)<br> <span>+ </span>plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> <span>+ </span>xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$<br> <span>+ </span>xtickformat='xticks',xminor=5, ystyle=18<br> <span>+ </span>;!Y.TITLE = STRMID(LAB,67,4)<br> <span>+ </span>plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> <span>+ </span>xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$<br> <span>+ </span>xtickformat='xticks',xminor=5, ystyle=18<br> <span>+ </span>device, /close_file<br> <span>+ <br> +</span> ;Use Z-buffer<span>&nbsp;to make .png plot</span> </td> </tr> </table> </div> datareq.prohttp://maccs.wikispot.org/datareq.pro2007-09-04 16:54:43maccs <div id="content" class="wikipage content"> Differences for datareq.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ;*******************************************************************************<br> + function header<br> + <br> + html = '&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"' $<br> + + string(10B) + '"http://www.w3.org/TR/html4/loose.dtd"&gt;' $<br> + + string(10B) + '&lt;HTML LANG="en-US"&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function start_html, title=title, bgcolor=bgcolor<br> + <br> + html = '&lt;HEAD&gt;' $<br> + + '&lt;TITLE&gt;' + title + '&lt;/TITLE&gt;' $<br> + + '&lt;/HEAD&gt;' $<br> + + '&lt;BODY BGCOLOR="' + bgcolor + '"&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function end_html<br> + <br> + html = '&lt;/BODY&gt;&lt;/HTML&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function a, href=href, content=content<br> + <br> + html = '&lt;A HREF="' + href + '"&gt;' + content + '&lt;/A&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function br<br> + <br> + html = '&lt;BR&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function h1, align=align, content<br> + <br> + if keyword_set(align) then begin<br> + html = '&lt;H1 ALIGN = "' + align + '"&gt;' + content + '&lt;/H1&gt;' + string(10B)<br> + endif else begin<br> + html = '&lt;H1&gt;' + content + '&lt;/H1&gt;' + string(10B)<br> + endelse<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function h2, align=align, content<br> + <br> + if keyword_set(align) then begin<br> + html = '&lt;H2 ALIGN = "' + align + '"&gt;' + content + '&lt;/H2&gt;' + string(10B)<br> + endif else begin<br> + html = '&lt;H2&gt;' + content + '&lt;/H2&gt;' + string(10B)<br> + endelse<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function h3, align=align, content<br> + <br> + if keyword_set(align) then begin<br> + html = '&lt;H3 ALIGN = "' + align + '"&gt;' + content + '&lt;/H3&gt;' + string(10B)<br> + endif else begin<br> + html = '&lt;H3&gt;' + content + '&lt;/H3&gt;' + string(10B)<br> + endelse<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function h4, align=align, content<br> + <br> + if keyword_set(align) then begin<br> + html = '&lt;H4 ALIGN = "' + align + '"&gt;' + content + '&lt;/H4&gt;' + string(10B)<br> + endif else begin<br> + html = '&lt;H4&gt;' + content + '&lt;/H4&gt;' + string(10B)<br> + endelse<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function h5, align=align, content<br> + <br> + if keyword_set(align) then begin<br> + html = '&lt;H5 ALIGN = "' + align + '"&gt;' + content + '&lt;/H5&gt;' + string(10B)<br> + endif else begin<br> + html = '&lt;H5&gt;' + content + '&lt;/H5&gt;' + string(10B)<br> + endelse<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function table, align=align, border=border, cellpadding=cellpadding, width=width, $<br> + bgcolor=bgcolor, content=content<br> + <br> + html = '&lt;TABLE ALIGN="' + align + '" BORDER="' + border + '" CELLPADDING="' + cellpadding + $<br> + '" WIDTH="' + width + '" BGCOLOR="' + bgcolor + '"&gt;' + string(10B) $<br> + + content + '&lt;/TABLE&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function tr, align=align, valign=valign, content=content<br> + <br> + html = '&lt;TR ALIGN="' + align + '" VALIGN="' + valign + '"&gt;' + string(10B) $<br> + + content + '&lt;/TR&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function th, content<br> + <br> + html = '&lt;TH&gt;' + content + '&lt;/TH&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + ;*******************************************************************************<br> + function img, src=src, alt=alt, content=content, border=border<br> + <br> + html = '&lt;IMG SRC="' + src + '" ALT="' + alt + '" BORDER="' + border + '"&gt;' + string(10B)<br> + <br> + return, html<br> + end<br> + <br> + <br> + ;*******************************************************************************<br> + pro doDataRequest, outputTypes, component, beginDateTime, endDateTime, stations, $<br> + inputPathPrefix, inputURLPrefix, outputPathPrefix, outputURLPrefix, $<br> + sessionID, htmlFilePath<br> + <br> + ; globals<br> + common HtmlFileCommons, gHtmlFile, gHtmlFileLUN<br> + common OutputsCommons, gMakeBin, gMakeIAGA, gMakePNG, gMakePS, gBx, gBy, gBz<br> + <br> + ; ===== CONSTANTS<br> + <br> + ; kMaxInputFiles = total number of binary data files for all stations; if, for<br> + ; example, 9 stations are selected and two days of data are requested, then 18<br> + ; files would be needed...<br> + kMaxInputFiles = 100<br> + <br> + ; ===== STRUCTURE DEFINITIONS<br> + <br> + ; StationPropStruct - station properties (name, IAGA code, etc.)<br> + stationProp = {StationPropStruct, maccsName:'', maccsCode:'', iagaName:'', iagaCode:'', latitude:0.0D, longitude:0.0D}<br> + ; InputFileStruct - data file properties (name, path, associated station, Julian day number of file, etc)<br> + inputFile = {InputFileStruct, exists:0, name:'', pathPrefix:'', urlPrefix:'', jdn:0.0D, stationProp:stationProp}<br> + <br> + ; ===== OUTPUT TYPES<br> + <br> + ; convert comma-delimited outputTypes list to array<br> + outputs = str_sep(outputTypes, ', ')<br> + <br> + gMakeBin = 0<br> + gMakeIAGA = 0<br> + gMakePNG = 0<br> + gMakePS = 0<br> + foo = where(outputs, outputsCount)<br> + if outputsCount ne 0 then begin<br> + for i = 0, outputsCount - 1 do begin<br> + case outputs[i] of<br> + 'bin': begin<br> + gMakeBin = 1<br> + end<br> + 'iaga': begin<br> + gMakeIAGA = 1<br> + end<br> + 'png': begin<br> + gMakePNG = 1<br> + end<br> + 'ps': begin<br> + gMakePS = 1<br> + end<br> + endcase<br> + endfor<br> + endif<br> + <br> + ; ===== COMPONENT<br> + <br> + gBx = 0<br> + gBy = 0<br> + gBz = 0<br> + case component of<br> + 'Bx': begin<br> + gBx = 1<br> + end<br> + 'By': begin<br> + gBy = 1<br> + end<br> + 'Bz': begin<br> + gBz = 1<br> + end<br> + endcase<br> + <br> + ; ===== STATIONS<br> + <br> + ; convert comma-delimited station code list to stations array<br> + stations = str_sep(stations, ', ')<br> + foo = where(stations, stationsCount)<br> + if stationsCount ne 0 then begin<br> + ;; prepare array of StationPropStruct structures<br> + stationProps = replicate(stationProp, stationsCount)<br> + for i = 0, stationsCount - 1 do begin<br> + stationName = stations[i]<br> + ;; fill in the rest of the information<br> + case stationName of<br> + 'Cape Dorset': begin<br> + maccsName = stationName<br> + maccsCode = 'CDR'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'CDR'<br> + latitude = '64.2'<br> + longitude = '283.4'<br> + end<br> + 'Coral Harbour': begin<br> + maccsName = stationName<br> + maccsCode = 'CHB'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'CHB'<br> + latitude = '64.1'<br> + longitude = '276.8'<br> + end<br> + 'Clyde River': begin<br> + maccsName = stationName<br> + maccsCode = 'CRV'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'CRV'<br> + latitude = '70.5'<br> + longitude = '291.4'<br> + end<br> + 'Gjoa Haven': begin<br> + maccsName = stationName<br> + maccsCode = 'GJO'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'GJO'<br> + latitude = '68.6'<br> + longitude = '264.1'<br> + end<br> + 'Igloolik': begin<br> + maccsName = stationName<br> + maccsCode = 'IGL'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'IGL'<br> + latitude = '69.3'<br> + longitude = '278.2'<br> + end<br> + 'Nain': begin<br> + maccsName = stationName<br> + maccsCode = 'NAN'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'NAN'<br> + latitude = '56.4'<br> + longitude = '298.3'<br> + end<br> + 'Pelly Bay': begin<br> + maccsName = stationName<br> + maccsCode = 'PEB'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'PEB'<br> + latitude = '68.5'<br> + longitude = '270.3'<br> + end<br> + 'Pangnirtung': begin<br> + maccsName = stationName<br> + maccsCode = 'PGG'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'PGG'<br> + latitude = '66.1'<br> + longitude = '294.2'<br> + end<br> + 'Repulse Bay': begin<br> + maccsName = stationName<br> + maccsCode = 'RBY'<br> + iagaName = stationName + ', Canada'<br> + iagaCode = 'RBY'<br> + latitude = '66.5'<br> + longitude = '273.8'<br> + end<br> + else: begin<br> + maccsName = 'Unknown'<br> + maccsCode = '???'<br> + iagaName = 'Unknown'<br> + iagaCode = '???'<br> + latitude = '999.9'<br> + longitude = '999.9'<br> + end<br> + endcase<br> + stationProps[i].maccsName = maccsName<br> + stationProps[i].maccsCode = maccsCode<br> + stationProps[i].iagaName = iagaName<br> + stationProps[i].iagaCode = iagaCode<br> + stationProps[i].latitude = latitude<br> + stationProps[i].longitude = longitude<br> + endfor<br> + endif<br> + <br> + ; ===== DATE-TIMES<br> + <br> + ; prepare begining and ending julian day numbers<br> + beginDT = str_sep(beginDateTime, ', ')<br> + beginJDN = julday(beginDT[1], beginDT[2], beginDT[0], beginDT[3])<br> + caldat, beginJDN, month, day, year, hour<br> + <br> + endDT = str_sep(endDateTime, ', ')<br> + endJDN = julday(endDT[1], endDT[2], endDT[0], endDT[3])<br> + caldat, endJDN, month, day, year, hour<br> + <br> + ; ===== INPUT FILES<br> + <br> + ; prepare array of InputFileStruct structures<br> + inputFilesArrayTemp = replicate(inputFile, kMaxInputFiles)<br> + ; fill the 'inputFilesArrayTemp' array<br> + fillInputFileArray, inputFilesArrayTemp, inputPathPrefix, inputURLPrefix, $<br> + stationProps, beginJDN, endJDN<br> + ; get 'inputFilesArrayTemp' array size<br> + inputsCount = 0<br> + for i = 0, kMaxInputFiles - 1 do begin<br> + if inputFilesArrayTemp[i].stationProp.maccsCode ne '' then begin<br> + inputsCount = inputsCount + 1<br> + endif<br> + endfor<br> + ; resize the 'inputFilesArray' array to simplify results of sort()<br> + if inputsCount gt 0 then begin<br> + inputFilesArray = replicate(inputFile, inputsCount)<br> + stationFilesCount = 0<br> + for i = 0, inputsCount - 1 do begin<br> + inputFilesArray[i] = inputFilesArrayTemp[i]<br> + if inputFilesArray[i].exists then begin<br> + stationFilesCount = stationFilesCount + 1<br> + endif<br> + endfor<br> + endif<br> + <br> + ; ===== HTML OUTPUT<br> + <br> + gHtmlFile = htmlFilePath<br> + openw, gHtmlFileLUN, gHtmlFile, /get_lun<br> + printf, gHtmlFileLUN, header()<br> + printf, gHtmlFileLUN, start_html(title="MACCS Data Request Results", bgcolor="#ffffff")<br> + printf, gHtmlFileLUN, h3("MACCS Data Request Results", align = "center")<br> + <br> + if stationFilesCount eq 0 then begin<br> + printf, gHtmlFileLUN, h5('No data were found for the specified stations and times.')<br> + endif else begin<br> + kMaxStationFiles = 20<br> + if (stationFilesCount gt kMaxStationFiles) and (gMakeIAGA) then begin<br> + stationFilesCountString = string(format='(i)', kMaxStationFiles)<br> + stationFilesHtmlString = 'No more than ' + stationFilesCountString + ' ' $<br> + + 'station-days can be processed for IAGA ASCII output. Please ' $<br> + + 'return to the form and select fewer stations or a smaller time interval.'<br> + printf, gHtmlFileLUN, h5(stationFilesHtmlString)<br> + endif else begin<br> + processInputFiles, inputFilesArray, beginJDN, endJDN, $<br> + outputPathPrefix, outputURLPrefix, sessionID<br> + endelse<br> + endelse<br> + <br> + printf, gHtmlFileLUN, end_html()<br> + close, gHtmlFileLUN<br> + <br> + end<br> + <br> + ;*******************************************************************************<br> + pro fillInputFileArray, inputFilesArray, inputPathPrefix, inputURLPrefix, $<br> + stationProps, beginJDN, endJDN<br> + <br> + ; construct data file names; here's a sample to illustrate:<br> + ; &lt;----------------path prefix---------------&gt;<br> + ; &lt;-url prefix -&gt;<br> + ; /var/apache/htdocs/space/webdata/cd/92/cd92223.bin<br> + <br> + ; data file extension<br> + inputFileExtension = '.bin'<br> + <br> + sizeArray = size(inputFilesArray)<br> + numInputFiles = sizeArray[1]<br> + if numInputFiles eq 0 then goto, TheEnd<br> + sizeStationProps = size(stationProps)<br> + numStationProps = sizeStationProps[1]<br> + if numStationProps eq 0 then goto, TheEnd<br> + <br> + fileIndex = 0<br> + for stationIndex = 0, numStationProps - 1 do begin<br> + caldat, beginJDN, month, day, year<br> + theJDN = julday(month, day, year, 0, 0, 0)<br> + ; non-inclusive of end julian day number<br> + while theJDN lt endJDN do begin<br> + <br> + ;; day of year 001 to 365 or so...remembering to round down the julian day<br> + ;; number to the nearest day<br> + caldat, theJDN, month, day, year<br> + <br> + ;; for julian day numbers, 0.0 corresponds to noon; hence, we need to subtract 0.5<br> + dayNumber = floor(theJDN - 0.5) - floor(julday(1, 1, year, 0, 0, 0) - 0.5) + 1<br> + dayOfYear = string(format='(i3.3)', dayNumber)<br> + <br> + twoDigitYear = strmid(string(format='(i4)', year), 2, 2)<br> + <br> + ;; construct file name<br> + ;; Unix<br> + kDirDelimiter = '/'<br> + ;; Windows<br> + ; kDirDelimiter = '\'<br> + maccsCode = strlowcase(stationProps[stationIndex].maccsCode)<br> + inputPathSuffix = maccsCode + kDirDelimiter + twoDigitYear + kDirDelimiter<br> + inputURLSuffix = maccsCode + '/' + twoDigitYear + '/'<br> + fileName = maccsCode + twoDigitYear + dayOfYear + inputFileExtension<br> + filePath = inputPathPrefix + inputPathSuffix + fileName<br> + <br> + ;; test for existence of file; use get_lun and free_lun since openr,<br> + ;; /get_lun might not give us a valid LUN with which to use close,...<br> + get_lun, ourLUN<br> + openr, ourLUN, filePath, error=err<br> + free_lun, ourLUN<br> + if err eq 0 then begin<br> + ;; no error occurred; assume file exists<br> + inputFilesArray[fileIndex].exists = 1<br> + endif<br> + <br> + inputFilesArray[fileIndex].name = fileName<br> + inputFilesArray[fileIndex].pathPrefix = inputPathPrefix + inputPathSuffix<br> + inputFilesArray[fileIndex].urlPrefix = inputURLPrefix + inputPathSuffix<br> + inputFilesArray[fileIndex].jdn = theJDN<br> + inputFilesArray[fileIndex].stationProp = stationProps[stationIndex]<br> + <br> + fileIndex = fileIndex + 1<br> + <br> + ;; make sure we have engough space to put our stations and files<br> + if fileIndex ge numInputFiles then goto, TheEnd<br> + <br> + ;; increment day<br> + theJDN = theJDN + 1<br> + <br> + endwhile<br> + endfor<br> + <br> + TheEnd:<br> + <br> + end<br> + <br> + ;*******************************************************************************<br> + pro processInputFiles, inputFilesArray, beginJDN, endJDN, $<br> + outputPathPrefix, outputURLPrefix, sessionID<br> + <br> + common HtmlFileCommons<br> + common OutputsCommons<br> + <br> + sizeArray = size(inputFilesArray)<br> + numInputFiles = sizeArray[1]<br> + <br> + ; HTML strings for each of the table cells<br> + dummyString = ''<br> + kMaxStationDays = 100<br> + stationHtml = replicate(dummyString, kMaxStationDays)<br> + binHtml = replicate(dummyString, kMaxStationDays)<br> + iagaHtml = replicate(dummyString, kMaxStationDays)<br> + <br> + ; loop over input files; group stations together<br> + kNumStations = 9<br> + requestedStations = strarr(kNumStations)<br> + availableStations = strarr(kNumStations)<br> + availableStationIndex = -1<br> + stationCode = 'InitialNonEmptyStationCode'<br> + stationIndex = -1<br> + <br> + firstFileForThisStation = 1<br> + lastFileForThisStation = 0<br> + fileNumberForThisStation = 0<br> + <br> + sizeArray = size(inputFilesArray)<br> + numInputFiles = sizeArray[1]<br> + <br> + firstFileIndex = 0<br> + lastFileIndex = numInputFiles - 1<br> + <br> + for fileIndex = firstFileIndex, lastFileIndex do begin<br> + thisFile = inputFilesArray[fileIndex]<br> + thisMaccsCode = thisFile.stationProp.maccsCode<br> + thisMaccsName = thisFile.stationProp.maccsName<br> + <br> + fileNumberForThisStation = fileNumberForThisStation + 1<br> + <br> + ;; see if this file exists<br> + if thisFile.exists then begin<br> + thisFileExists = 1<br> + endif else begin<br> + thisFileExists = 0<br> + endelse<br> + <br> + ;; see if this is the last file for this station<br> + if fileIndex lt lastFileIndex then begin<br> + nextFile = inputFilesArray[fileIndex + 1]<br> + nextMaccsCode = nextFile.stationProp.maccsCode<br> + nextMaccsName = nextFile.stationProp.maccsName<br> + <br> + if nextMaccsCode ne thisMaccsCode then begin<br> + lastFileForThisStation = 1<br> + endif<br> + endif else begin<br> + lastFileForThisStation = 1<br> + endelse<br> + <br> + ;; see if this is the first file for this station<br> + if firstFileForThisStation then begin<br> + stationIndex = stationIndex + 1<br> + requestedStations[stationIndex] = thisMaccsCode<br> + stationHtml[stationIndex] = stationHtml[stationIndex] + h5(thisMaccsName)<br> + firstFileForThisStation = 0<br> + endif<br> + <br> + if thisFile.exists then begin<br> + thisStationIsAvailableAndItsNotInTheListOfAvailableStations = 1<br> + for index = 0, kNumStations - 1 do begin<br> + if availableStations[index] eq thisMaccsCode then begin<br> + thisStationIsAvailableAndItsNotInTheListOfAvailableStations = 0<br> + endif<br> + endfor<br> + if thisStationIsAvailableAndItsNotInTheListOfAvailableStations then begin<br> + availableStationIndex = availableStationIndex + 1<br> + availableStations[availableStationIndex] = thisMaccsCode<br> + endif<br> + endif<br> + <br> + jdn1 = thisFile.jdn<br> + caldat, jdn1, month1, day1, year1<br> + jdn2 = jdn1 + 1<br> + caldat, jdn2, month2, day2, year2<br> + <br> + ;; new file (same station or new station)<br> + if gMakeBin then begin<br> + fileName = thisFile.name<br> + ;; ammend html<br> + href = thisFile.urlPrefix + fileName<br> + if thisFile.exists then begin<br> + binHtml[stationIndex] = binHtml[stationIndex] + a(href=href, content=fileName)<br> + binHtml[stationIndex] = binHtml[stationIndex] + br()<br> + endif else begin<br> + binHtml[stationIndex] = binHtml[stationIndex] + fileName + ' (unavailable)'<br> + binHtml[stationIndex] = binHtml[stationIndex] + br()<br> + endelse<br> + endif<br> + <br> + if gMakeIAGA then begin<br> + ;; build IAGA-format file name<br> + iagaCode = thisFile.stationProp.iagaCode<br> + iagaFileName = string(format='(i4.4,i2.2,i2.2,i2.2)', year1, month1, day1, day2) + 'SC.' + iagaCode<br> + iagaFilePath = outputPathPrefix + iagaFileName<br> + <br> + ;; ammend html<br> + href = outputURLPrefix + iagaFileName<br> + if thisFile.exists then begin<br> + iagaHtml[stationIndex] = iagaHtml[stationIndex] + a(href=href, content=iagaFileName)<br> + iagaHtml[stationIndex] = iagaHtml[stationIndex] + br()<br> + ;; process data<br> + writeIAGAFile, iagaFilePath, thisFile<br> + endif else begin<br> + iagaHtml[stationIndex] = iagaHtml[stationIndex] + iagaFileName + ' (unavailable)'<br> + iagaHtml[stationIndex] = iagaHtml[stationIndex] + br()<br> + endelse<br> + endif<br> + <br> + if lastFileForThisStation then begin<br> + ;; ...when i get to the bottom i go back to the top of the slide...<br> + firstFileForThisStation = 1<br> + lastFileForThisStation = 0<br> + endif<br> + <br> + endfor<br> + <br> + caldat, beginJDN, month1, day1, year1, hour1<br> + caldat, endJDN, month2, day2, year2, hour2<br> + <br> + if gMakePNG or gMakePS then begin<br> + ;; build a string of station names<br> + stationString = ''<br> + for index = 0, kNumStations - 1 do begin<br> + if requestedStations[index] ne '' then begin<br> + stationString = stationString + requestedStations[index] + '_'<br> + endif<br> + endfor<br> + <br> + if gBx eq 1 then begin<br> + compName = 'Bx'<br> + endif<br> + if gBy eq 1 then begin<br> + compName = 'By'<br> + endif<br> + if gBz eq 1 then begin<br> + compName = 'Bz'<br> + endif<br> + <br> + plotFileName = stationString $<br> + + string(format='(i4.4,i2.2,i2.2,i2.2)', year1, month1, day1, hour1) + '-' $<br> + + string(format='(i4.4,i2.2,i2.2,i2.2)', year2, month2, day2, hour2) + '_' $<br> + + compName<br> + <br> + endif<br> + <br> + if gMakePNG then begin<br> + pngFileName = plotFileName + '.png'<br> + pngFilePath = outputPathPrefix + pngFileName<br> + pngFileURL = outputURLPrefix + pngFileName<br> + <br> + content = img(src=pngFileURL, alt=pngFileName, border='0')<br> + pngHtml = '&lt;CENTER&gt;' + a(href=pngFileURL, content=content) + '&lt;/CENTER&gt;'<br> + ;; process data<br> + writePlotFile, 'PNG', pngFilePath, inputFilesArray, beginJDN, endJDN, availableStations<br> + endif<br> + <br> + if gMakePS then begin<br> + psFileName = plotFileName + '.ps'<br> + psFilePath = outputPathPrefix + psFileName<br> + psFileURL = outputURLPrefix + psFileName<br> + psHtml = a(href=psFileURL, content=psFileName)<br> + ;; process data<br> + writePlotFile, 'PS', psFilePath, inputFilesArray, beginJDN, endJDN, availableStations<br> + endif<br> + <br> + if gMakeBin or gMakeIAGA then begin<br> + columnHeadings = th('Station')<br> + if gMakeBin then begin<br> + columnHeadings = columnHeadings + th('Binary Data File')<br> + endif<br> + <br> + if gMakeIAGA then begin<br> + columnHeadings = columnHeadings + th('IAGA ASCII Data File')<br> + endif<br> + <br> + tableContent = tr(align='center', valign='top', content=columnHeadings)<br> + index = 0<br> + while stationHtml[index] ne '' do begin<br> + <br> + columnContent = th(stationHtml[index])<br> + if gMakeBin then begin<br> + columnContent = columnContent + th(binHtml[index])<br> + endif<br> + if gMakeIAGA then begin<br> + columnContent = columnContent + th(iagaHtml[index])<br> + endif<br> + <br> + tableContent = tableContent + tr(align='left', valign='top', content=columnContent)<br> + index = index + 1<br> + endwhile<br> + tableHtml = table(align='center', border='1', cellpadding='10', width='768', $<br> + bgcolor='#ffffff', content=tableContent)<br> + printf, gHtmlFileLUN, tableHtml<br> + endif<br> + <br> + if gMakePNG then begin<br> + printf, gHtmlFileLUN, pngHtml<br> + endif<br> + <br> + if gMakePS then begin<br> + printf, gHtmlFileLUN, psHtml<br> + endif<br> + <br> + end<br> + <br> + ;*******************************************************************************<br> + pro writeIAGAFile, iagaFilePath, inFileStruct<br> + <br> + ;; open IAGA output file<br> + openw, iagaFileLUN, iagaFilePath, /get_lun<br> + <br> + stationProp = inFileStruct.stationProp<br> + iagaName = stationProp.iagaName<br> + iagaCode = stationProp.iagaCode<br> + latitude = string(format='(f5.1)', stationProp.latitude)<br> + longitude = string(format='(f5.1)', stationProp.longitude)<br> + <br> + ; data column headings<br> + Hx = " " + iagaCode + "X"<br> + Hy = " " + iagaCode + "Y"<br> + Hz = " " + iagaCode + "Z"<br> + <br> + time = systime(0)<br> + <br> + ; pad with spaces<br> + totalChars = 36<br> + padString, iagaName, totalChars<br> + padString, iagaCode, totalChars<br> + padString, latitude, totalChars<br> + padString, longitude, totalChars<br> + totalChars = 40<br> + padString, time, totalChars<br> + <br> + printf, iagaFileLUN, " Format | IAGA2000 |"<br> + printf, iagaFileLUN, " Station | " + iagaName + "|"<br> + printf, iagaFileLUN, " IAGA Code | " + iagaCode + "|"<br> + printf, iagaFileLUN, " Geodetic Latitude | " + latitude + "|"<br> + printf, iagaFileLUN, " Geodetic Longitude | " + longitude + "|"<br> + printf, iagaFileLUN, " Elevation | |"<br> + printf, iagaFileLUN, " Observed | XYZ |"<br> + printf, iagaFileLUN, " Digital Sampling | 0.5 seconds |"<br> + printf, iagaFileLUN, " Data Interval | Average 5-second centered |"<br> + printf, iagaFileLUN, " Data type | Variation |"<br> + printf, iagaFileLUN, " Variables | 9 |"<br> + printf, iagaFileLUN, " # This file was written by the MACCS Data Request Web |"<br> + printf, iagaFileLUN, " # Application on " + time + "|"<br> + printf, iagaFileLUN, " # For more information visit http://space.augsburg.edu |"<br> + ; " Year| MT| DY| HR| MN| SC| ???X| ???Y| ???Z|"<br> + ; " 2000| 1| 1| 0| 0| 0| 15262.9| 974.9| 48404.2|"<br> + printf, iagaFileLUN, " Year| MT| DY| HR| MN| SC|" + Hx + "|" + Hy + "|" + Hz + "|"<br> + <br> + fillMagneticFieldArrays, bx, by, bz, hour, minute, second, inFileStruct<br> + sizeArray = size(bx)<br> + count = sizeArray[1]<br> + <br> + month = indgen(count)<br> + day = indgen(count)<br> + year = indgen(count)<br> + <br> + caldat, inFileStruct.jdn, m, d, y<br> + <br> + month[*] = m<br> + day[*] = d<br> + year[*] = y<br> + <br> + table = findgen(9, count)<br> + table[0, *] = year<br> + table[1, *] = month<br> + table[2, *] = day<br> + table[3, *] = hour<br> + table[4, *] = minute<br> + table[5, *] = second<br> + table[6, *] = bx<br> + table[7, *] = by<br> + table[8, *] = bz<br> + <br> + printf, format='(((x, i4, "|"), 5(x, i2, "|"), 3(x, f9.2, "|")))', iagaFileLUN, $<br> + table<br> + <br> + printf, iagaFileLUN, "EOF"<br> + <br> + free_lun, iagaFileLUN<br> + <br> + end<br> + <br> + ;*******************************************************************************<br> + ; plotType is 'PNG' or 'PS'<br> + ;<br> + pro writePlotFile, plotType, plotFilePath, inputFilesArray, beginJDN, endJDN, availableStations<br> + <br> + common OutputsCommons<br> + <br> + kMissing = 32767.0<br> + kRecordCount = 17280<br> + <br> + if plotType eq 'PNG' then begin<br> + ;; prepare PNG<br> + openw, pngFileLUN, plotFilePath, /get_lun<br> + set_plot, 'z'<br> + device, set_resolution=[700,550], set_colors=2<br> + !p.font=0<br> + !p.charsize=1<br> + !p.background=255<br> + !p.color=0<br> + endif<br> + if plotType eq 'PS' then begin<br> + ;; prepare PostScript<br> + xs = 8.5*2.54<br> + ys = 11.0*2.54<br> + set_plot, 'ps'<br> + device, filename=plotFilePath, /portrait, xoffset=1, yoffset=1, xsize=xs-2, ysize=ys-2, font_size=15<br> + !p.font=-1<br> + psxdpi = !d.x_size/8.5<br> + psydpi = !d.y_size/11.0<br> + endif<br> + <br> + caldat, beginJDN, month1, day1, year1, hour1, minute1<br> + caldat, endJDN, month2, day2, year2, hour2, minute2<br> + hours = round((endJDN - beginJDN)*24.0)<br> + <br> + case 1 of<br> + (hours gt 0) and (hours le 6): begin<br> + ;; tph = ticks per hour<br> + tph = 1.0<br> + majors = round(tph * hours)<br> + minors = 4<br> + end<br> + (hours gt 6) and (hours le 12): begin<br> + tph = 1.0<br> + majors = round(tph * hours)<br> + minors = 4<br> + end<br> + (hours gt 12) and (hours le 18): begin<br> + tph = 1.0<br> + majors = round(tph * hours)<br> + minors = 2<br> + end<br> + (hours gt 18) and (hours le 24): begin<br> + tph = 0.5<br> + majors = round(tph * hours)<br> + minors = 4<br> + end<br> + (hours gt 24) and (hours le 36): begin<br> + tph = 0.5<br> + majors = round(tph * hours)<br> + minors = 2<br> + end<br> + (hours gt 24) and (hours le 48): begin<br> + tph = 0.5<br> + majors = round(tph * hours)<br> + minors = 2<br> + end<br> + (hours gt 48) and (hours le 72): begin<br> + tph = 0.25<br> + majors = round(tph * hours)<br> + minors = 2<br> + end<br> + (hours gt 72) and (hours le 96): begin<br> + tph = 0.125<br> + majors = round(tph * hours)<br> + minors = 4<br> + end<br> + (hours gt 96) and (hours le 120): begin<br> + tph = 0.1<br> + majors = round(tph * hours)<br> + minors = 2<br> + end<br> + else: begin<br> + ;; ten days max<br> + hours = 240<br> + tph = 0.1<br> + majors = round(tph * hours)<br> + minors = 2<br> + end<br> + endcase<br> + <br> + step = round(1/tph)<br> + for i=0, majors do begin<br> + hour = (hour1 + step*i)<br> + hourmod = hour mod 24<br> + if hourmod eq 0 then begin<br> + hourname = string(format='(i1)', hourmod)<br> + jdn = beginJDN + round(hour/24)<br> + xtickname = '!S' + ' ' + hourname + '!R!L' + string(format='(C(CMOI2.2, "/", CDI2.2))', jdn)<br> + endif else begin<br> + if hourmod lt 10 then begin<br> + hourname = string(format='(i1)', hourmod)<br> + endif else begin<br> + hourname = string(format='(i2)', hourmod)<br> + endelse<br> + xtickname = hourname<br> + endelse<br> + !x.tickname[i] = xtickname<br> + endfor<br> + !x.range = [hour1, hour1 + hours]<br> + !x.ticks=majors<br> + !x.minor=minors<br> + !x.style=1<br> + <br> + sizeArray = size(availableStations)<br> + numAvailableStations = sizeArray[1]<br> + stationCount = 0<br> + for index = 0, (numAvailableStations - 1) do begin<br> + if availableStations[index] ne '' then begin<br> + stationCount = stationCount + 1<br> + endif<br> + endfor<br> + <br> + yticks = stationCount + 1<br> + yticknames = strarr(yticks + 1)<br> + yticknames[0] = ' '<br> + yticknames[yticks] = ' '<br> + orderedTicknames = ['CHB', 'CDR', 'PGG', 'RBY', 'PEB', 'GJO', 'IGL', 'CRV', 'NAN']<br> + yticknameIndex = 1<br> + for orderIndex = 0, 8 do begin<br> + for stationIndex = 0, (numAvailableStations - 1) do begin<br> + station = availableStations[stationIndex]<br> + if station eq orderedTicknames[orderIndex] then begin<br> + yticknames[yticknameIndex] = station<br> + yticknameIndex = yticknameIndex + 1<br> + endif<br> + endfor<br> + endfor<br> + <br> + yscale = 200 ; todo calculate yscale?<br> + yrange = yscale*yticks<br> + !y.ticks=yticks<br> + !y.tickname=yticknames<br> + !y.range=[0, yrange]<br> + !y.minor=-1<br> + !y.style=1<br> + <br> + plotInitialized = 0<br> + firstFileForThisStation = 1<br> + lastFileForThisStation = 0<br> + fileNumberForThisStation = 0<br> + <br> + sizeArray = size(inputFilesArray)<br> + numInputFiles = sizeArray[1]<br> + <br> + firstFileIndex = 0<br> + lastFileIndex = numInputFiles - 1<br> + <br> + for fileIndex = firstFileIndex, lastFileIndex do begin<br> + thisFile = inputFilesArray[fileIndex]<br> + thisMaccsCode = thisFile.stationProp.maccsCode<br> + <br> + fileNumberForThisStation = fileNumberForThisStation + 1<br> + <br> + ;; see if this file exists<br> + if thisFile.exists then begin<br> + thisFileExists = 1<br> + endif else begin<br> + thisFileExists = 0<br> + endelse<br> + <br> + ;; see if this is the last file for this station<br> + if fileIndex lt lastFileIndex then begin<br> + nextFile = inputFilesArray[fileIndex + 1]<br> + nextMaccsCode = nextFile.stationProp.maccsCode<br> + if nextMaccsCode ne thisMaccsCode then begin<br> + lastFileForThisStation = 1<br> + endif<br> + endif else begin<br> + lastFileForThisStation = 1<br> + endelse<br> + <br> + <br> + if thisFileExists then begin<br> + <br> + ;; get data<br> + fillMagneticFieldArrays, bx, by, bz, hour, minute, second, thisFile<br> + <br> + if gBx eq 1 then begin<br> + b = bx<br> + endif<br> + if gBy eq 1 then begin<br> + b = by<br> + endif<br> + if gBz eq 1 then begin<br> + b = bz<br> + endif<br> + <br> + sizeArray = size(b)<br> + bCount = sizeArray[1]<br> + x = findgen(bCount)<br> + day = fileNumberForThisStation - 1<br> + x = day*24.0 + hour + minute/(60.0) + second/(60.0 * 60.0)<br> + <br> + endif else begin<br> + b = findgen(kRecordCount)<br> + b[*] = kMissing<br> + x = findgen(kRecordCount)<br> + day = fileNumberForThisStation - 1<br> + x = day*24.0 + x*24.0/kRecordCount<br> + endelse<br> + <br> + ;; figure out which tick mark this data corresponds to<br> + ytick = 1<br> + for i=1, yticks - 1 do begin<br> + if yticknames[i] eq thisMaccsCode then begin<br> + ytick = i<br> + endif<br> + endfor<br> + <br> + if firstFileForThisStation then begin<br> + ;; assuming b and x arrays have same size<br> + samplingRate = 1.0/5.0<br> + lag = beginJDN - thisFile.jdn<br> + firstIndex = round(lag * 24.0 * 60.0 * 60.0 * samplingRate)<br> + <br> + bAll = b[firstIndex:*]<br> + xAll = x[firstIndex:*]<br> + firstFileForThisStation = 0<br> + endif else begin<br> + bAll = [bAll, b]<br> + xAll = [xAll, x]<br> + endelse<br> + <br> + if lastFileForThisStation then begin<br> + <br> + bGood = where(bAll ne kMissing, bGoodCount)<br> + if (bGoodCount ne 0) then begin<br> + bAvg = total(bAll(bGood))/bGoodCount<br> + endif else begin<br> + bAvg = !values.d_nan<br> + endelse<br> + <br> + ;; filter out missing data by assigning NaN<br> + bBad = where(bAll eq kMissing, bBadCount)<br> + if (bBadCount ne 0) then begin<br> + bAll(bBad) = !values.d_nan<br> + endif<br> + <br> + kMaxVal = 10000.0<br> + kMinVal = -10000.0<br> + if plotInitialized then begin<br> + oplot, xAll, (bAll - bAvg + ytick*yscale), max_value=kMaxVal, min_value=kMinVal<br> + endif else begin<br> + if plotType eq 'PS' then begin<br> + ;; We need to specify 6.5" time axis width, but there's no<br> + ;; apparently easy way to do this. The 'xmargin' keyword of<br> + ;; the 'axis' procedure allows the width to be specified in<br> + ;; character units only. The 'position' keyword in 'plot'<br> + ;; procedure doesn't specify actual axis length since it<br> + ;; includes the label areas. We'll just have to fudge.<br> + ;; Using a ruler, the label area was measured to be 5/8 of<br> + ;; an inch. We'll just excise it from the right margin...<br> + fudge = 5.0/8.0<br> + pos = [1.0*psxdpi, 1.0*psydpi, (7.5 + fudge)*psxdpi, 10.0*psydpi]<br> + plot, xAll, (bAll - bAvg + ytick*yscale), position=pos, /device, max_value=kMaxVal, min_value=kMinVal<br> + endif else begin<br> + plot, xAll, (bAll - bAvg + ytick*yscale), max_value=kMaxVal, min_value=kMinVal<br> + endelse<br> + plotInitialized = 1<br> + endelse<br> + <br> + endif ;;lastFileForThisStation<br> + <br> + if lastFileForThisStation then begin<br> + ;; ...when i get to the bottom i go back to the top of the slide...<br> + firstFileForThisStation = 1<br> + lastFileForThisStation = 0<br> + fileNumberForThisStation = 0<br> + endif<br> + <br> + endfor<br> + <br> + TheEnd:<br> + <br> + if gBx eq 1 then begin<br> + compName = 'Bx'<br> + endif<br> + if gBy eq 1 then begin<br> + compName = 'By'<br> + endif<br> + if gBz eq 1 then begin<br> + compName = 'Bz'<br> + endif<br> + <br> + title = 'MACCS ' + compName + ' ' $<br> + + string(format='(C(CYI4.4, "/", CMOI2.2, "/", CDI2.2, X, CHI2.2))', beginJDN) $<br> + + ' to ' $<br> + + string(format='(C(CYI4.4, "/", CMOI2.2, "/", CDI2.2, X, CHI2.2))', endJDN)<br> + xyouts, 0.50, 0.98, '!N!3'+title, align=0.5, /normal<br> + xyouts, 0.06, 0.50, '!N!3' + 'Station Code', orientation=90, align=0.5, size=1.0, /normal<br> + xyouts, 0.50, 0.02, '!N!3' + 'UT', align=0.5, size=1.0, /normal<br> + xyouts, 0.04, 0.00, '!N!3'+'SCALE: '+strcompress(string(yscale))+'nT/TickMark', align=0.0, size=0.8, /normal<br> + xyouts, 0.98, 0.02, '!N!3BOSTON UNIVERSITY', align=1.0, size=0.8, /normal<br> + xyouts, 0.98, 0.00, '!N!3AUGSBURG COLLEGE', align=1.0, size=0.8, /normal<br> + <br> + if plotType eq 'PNG' then begin<br> + ;; toggle top-to-bottom transfer order<br> + ; !order = not !order ; bug fixed in IDL 5.4<br> + theImage=tvrd()<br> + ;; retore top-to-bottom transfer order<br> + ; !order = not !order ; bug fixed in IDL 5.4<br> + write_png, plotFilePath, theImage<br> + <br> + free_lun, pngFileLUN<br> + device, /close<br> + endif<br> + if plotType eq 'PS' then begin<br> + device, /close_file<br> + endif<br> + <br> + <br> + end<br> + <br> + ;*******************************************************************************<br> + ; returns bx, by, and bz arrays for the specified input file<br> + pro fillMagneticFieldArrays, bx, by, bz, hour, minute, second, inFileStruct<br> + <br> + kRecordSize=15<br> + kRecordCount=17280<br> + ; to speed up for testing...<br> + ; kRecordCount=kRecordCount/12<br> + <br> + inFileName = inFileStruct.pathPrefix + inFileStruct.name<br> + openr, inFileLUN, inFileName, /get_lun<br> + data = bytarr(kRecordSize, kRecordCount)<br> + readu, inFileLUN, data<br> + free_lun, inFileLUN<br> + <br> + ; extract time value arrays from the file data array<br> + hour = data(0,*)<br> + minute = data(1,*)<br> + second = data(2,*)<br> + ; extract field value arrays from the file data array<br> + bx = long(data( 3: 6, *), 0, 1, kRecordCount)<br> + by = long(data( 7:10, *), 0, 1, kRecordCount)<br> + bz = long(data(11:14, *), 0, 1, kRecordCount)<br> + ; swap bytes if big-endian (necessary for solaris on sparc since data is little<br> + ;<br> + ; non-student version<br> + ;<br> + byteorder, bx, /lswap, /swap_if_big_endian<br> + byteorder, by, /lswap, /swap_if_big_endian<br> + byteorder, bz, /lswap, /swap_if_big_endian<br> + ; divide field values by 1000. to get nanotesla<br> + bx = bx/1000.<br> + by = by/1000.<br> + bz = bz/1000.<br> + <br> + ; flatten arrays into one dimension<br> + hour = reform(hour, kRecordCount, /overwrite)<br> + minute = reform(minute, kRecordCount, /overwrite)<br> + second = reform(second, kRecordCount, /overwrite)<br> + bx = reform(bx, kRecordCount, /overwrite)<br> + by = reform(by, kRecordCount, /overwrite)<br> + bz = reform(bz, kRecordCount, /overwrite)<br> + <br> + end<br> + <br> + ;*******************************************************************************<br> + ; pads the specified string with spaces<br> + pro padString, str, chars<br> + <br> + if strlen(str) gt chars then begin<br> + ;; truncate<br> + str = strmid(str, 0, chars)<br> + goto, TheEnd<br> + endif else begin<br> + ;; pad<br> + while strlen(str) lt chars do begin<br> + str = str + ' '<br> + endwhile<br> + endelse<br> + <br> + TheEnd:<br> + theString = str<br> + <br> + end</span> </td> </tr> </table> </div> datareqhttp://maccs.wikispot.org/datareq2007-09-04 16:53:48maccs <div id="content" class="wikipage content"> Differences for datareq<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ #!/usr/bin/perl<br> + # modified to fix directories with new rsi application<br> + # NJP 11-12-04<br> + #!C:/perl/bin/perl<br> + <br> + # could possibly be loosened<br> + require 5.004;<br> + # these are a good idea<br> + use strict;<br> + use English;<br> + use CGI qw( :standard );<br> + # CGI::Pretty is the same as CGI.pm but makes html human-readable<br> + # 2000-11-20 CGI::Pretty is now broken (tables are missing parameters)<br> + #use CGI::Pretty qw( :standard );<br> + <br> + # our entry point<br> + &amp;::main;<br> + <br> + ################################################################################<br> + sub main<br> + {<br> + &amp;::Initialize;<br> + <br> + if (!CGI::ReadParse()) {<br> + &amp;::PrintForm;<br> + }<br> + else {<br> + &amp;::ProcessForm;<br> + }<br> + }<br> + <br> + ################################################################################<br> + sub Initialize<br> + {<br> + <br> + # CGI.pm initializaton<br> + # $CGI::Pretty::INDENT = " ";<br> + <br> + # paths to IDL, temporary directory, etc.<br> + <br> + ##### Unix<br> + <br> + $::idlExecutable = '/Applications/rsi/idl/bin/idl';<br> + $::cgiTmpDir = '/Library/WebServer/CGI-Executables/maccs/tmp/';<br> + $::cgiTmpURL = '/Library/WebServer/CGI-Executables/maccs/tmp/';<br> + $::htmlTmpDir = '/Library/WebServer/Documents/maccs/tmp/';<br> + $::htmlTmpURL = '/maccs/tmp/';<br> + $::htmlDataDir = '/Library/WebServer/Documents/maccs/Webdata/';<br> + $::htmlDataURL = '/maccs/Webdata/';<br> + <br> + ##### Windows<br> + <br> + # $::idlExecutable = 'C:\\RSI\\idl50sv\\idlde.exe';<br> + # $::cgiTmpDir = 'C:\\WWW\\cgi-bin\\maccs\\tmp\\';<br> + # $::cgiTmpURL = '/cgi-bin/maccs/tmp/';<br> + # $::htmlTmpDir = 'C:\\WWW\\htdocs\\maccs\\tmp\\';<br> + # $::htmlTmpURL = '/htdocs/tmp/';<br> + # $::htmlDataDir = 'C:\\WWW\\htdocs\\space\\webdata\\';<br> + # $::htmlDataURL = '/space/webdata/';<br> + <br> + # cgi parameter names passed upon html form submission<br> + $::stationParam = 'stn';<br> + $::beginParam = 'beg';<br> + $::endParam = 'end';<br> + $::outputTypeParam = 'output';<br> + $::componentParam = 'comp';<br> + # $::binParam = 'bin';<br> + # $::iagaParam = 'iaga';<br> + # $::pngParam = 'png';<br> + # $::psParam = 'ps';<br> + <br> + # station names<br> + @::stationNames = (<br> + 'Cape Dorset',<br> + 'Coral Harbour',<br> + 'Clyde River',<br> + 'Gjoa Haven',<br> + 'Igloolik',<br> + 'Nain',<br> + 'Pelly Bay',<br> + 'Pangnirtung',<br> + 'Repulse Bay');<br> + <br> + $::binName = 'Binary Data';<br> + $::iagaName = 'IAGA ASCII Data';<br> + $::pngName = 'PNG Plot';<br> + $::psName = 'PostScript Plot';<br> + <br> + $::bxName = 'Bx';<br> + $::byName = 'By';<br> + $::bzName = 'Bz';<br> + <br> + # @::yearNames = qw( 1992 1993 1994 1995 1996 1997 1998 Other );<br> + <br> + # @::monthNames = qw( January February March April May June July August<br> + # September October November December );<br> + <br> + # @::dayNames = qw( 1 2 3 4 5 6 7<br> + # 8 9 10 11 12 13 14<br> + # 15 16 17 18 19 20 21<br> + # 22 23 24 25 26 27 28<br> + # 29 30 31);<br> + <br> + $::formName = 'dataRequestForm';<br> + <br> + # JavaScript test<br> + $::javaScript=&lt;&lt;END;<br> + function selectAllStations(bSelect)<br> + {<br> + var frm = document.$::formName;<br> + for (i=0;i&lt;9; i++)<br> + {<br> + frm.elements[i].checked = bSelect;<br> + }<br> + }<br> + END<br> + <br> + }<br> + <br> + ################################################################################<br> + sub PrintForm<br> + {<br> + print<br> + &amp;header,<br> + &amp;start_html({-title=&gt;'MACCS Data Request Application',<br> + -bgcolor=&gt;'#ffffff',<br> + -link=&gt;"#000099",<br> + -vlink=&gt;"#336600",<br> + -alink=&gt;"#993300",<br> + -script=&gt;$::javaScript});<br> + <br> + print &lt;&lt;END;<br> + &lt;center&gt;<br> + &lt;table width="100%" border="0"&gt;<br> + &lt;tr&gt;<br> + &lt;td height="50" bgcolor="#140766"&gt;&lt;font size="+3" color="#FFFFFF" face="Arial, Helvetica, sans-serif"&gt;Data Request Application&lt;/font&gt;&lt;/td&gt;<br> + &lt;/tr&gt;<br> + &lt;/table&gt;<br> + <br> + &lt;/center&gt;<br> + <br> + &lt;table bgcolor="#ffffff" border="0" align="center" cellpadding="10" width="768" height="73"&gt;<br> + &lt;tr&gt;<br> + &lt;td&gt; &lt;font face="Arial, Helvetica, sans-serif"&gt;Use the following form to determine<br> + data availability and download binary files; generate and download IAGA<br> + 2000 ASCII-formatted data files; and generate, view and download plots in<br> + PNG or PostScript format. For more information, see the &lt;a href="http://space.augsburg.edu/space/map.html"&gt;Data<br> + Availability Page&lt;/a&gt; and the &lt;a<br> + <br> + href="http://space.augsburg.edu/space/read_data.html"&gt; Read Me Page&lt;/a&gt;.&lt;/font&gt;<br> + &lt;/tr&gt;<br> + <br> + &lt;/table&gt;<br> + END<br> + <br> + print<br> + &amp;startform({-name=&gt;$::formName, -method=&gt;'get'});<br> + my $scrollLines = 12;<br> + <br> + # TODO - figure out how to get hashes working in checkbox_group<br> + my $stationCell = &amp;h4('Station')<br> + .&amp;checkbox_group({-name=&gt;$::stationParam,<br> + -values=&gt;\@::stationNames,<br> + -linebreak=&gt;'true'})<br> + .&amp;br<br> + .&amp;button({-name=&gt;'selectAllStationsButton',<br> + -value=&gt;'Select All',<br> + -onClick=&gt;"selectAllStations(true)"})<br> + .'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'<br> + .&amp;button({-name=&gt;'clearStationsButton',<br> + -value=&gt;'Clear',<br> + -onClick=&gt;"selectAllStations(false)"});<br> + # .&amp;scrolling_list({-name=&gt;$::stationParam,<br> + # -values =&gt;\@::stationNames,<br> + # -size=&gt;$scrollLines}); # single selection<br> + # -size=&gt;$scrollLines,<br> + # -multiple=&gt;'true'}); # multiple selection<br> + <br> + my $beginEndCell = &amp;h4('Beginning and Ending Times')<br> + .&amp;h5('Beginning Time')<br> + .&amp;code('(YYYY/MM/DD HH)').&amp;br<br> + .&amp;textfield({-name=&gt;$::beginParam,<br> + -default=&gt;'1995/01/01 00',<br> + -maxlength=&gt;13}).&amp;br.&amp;br<br> + .&amp;h5('Ending Time')<br> + .&amp;code('(YYYY/MM/DD HH)').&amp;br<br> + .&amp;textfield(-name=&gt;$::endParam,<br> + -default=&gt;'1995/01/02 00',<br> + -maxlength=&gt;13);<br> + <br> + # my $outputTypeCell = &amp;h4('Output Type')<br> + # .&amp;font({-color=&gt;'#ff0000', -size=&gt;'-1'}, 'PNG and PostScript &lt;br&gt; are under construction.')<br> + # .&amp;radio_group({-name=&gt;$::outputTypeParam,<br> + my $outputTypeCell = &amp;h4('Output Type')<br> + .&amp;radio_group({-name=&gt;$::outputTypeParam,<br> + -values=&gt;[$::binName, $::iagaName, $::pngName, $::psName],<br> + -default=&gt;$::binName,<br> + -columns=&gt;1});<br> + <br> + my $componentCell = &amp;h4('Plot Component')<br> + .&amp;radio_group({-name=&gt;$::componentParam,<br> + -values=&gt;[$::bxName, $::byName, $::bzName],<br> + -default=&gt;$::bxName,<br> + -columns=&gt;1})<br> + .&amp;font({-size=&gt;'-1'}, '&lt;br&gt; Bx = geographic north &lt;br&gt; By = geographic east &lt;br&gt; Bz = vertical down &lt;br&gt;');<br> + <br> + # print<br> + # &amp;table({-bgcolor=&gt;'#ffffff', -border=&gt;'1', -width=&gt;600, -align=&gt;'center', -cellpadding=&gt;10},<br> + # &amp;TR({-align=&gt;'left', -valign=&gt;'top'},<br> + # [&amp;th({-align=&gt;'left', -valign=&gt;'top'}, [$stationCell, $beginEndCell, $outputTypeCell])]) );<br> + print<br> + &amp;table({-bgcolor=&gt;'#ffffff',<br> + -border=&gt;'1',<br> + -width=&gt;768,<br> + -align=&gt;'center',<br> + -cellpadding=&gt;10},<br> + &amp;TR({-align=&gt;'left', -valign=&gt;'top'},<br> + [&amp;th({-align=&gt;'left', -valign=&gt;'top'},<br> + [$stationCell, $beginEndCell, $outputTypeCell, $componentCell])]) );<br> + <br> + print<br> + &amp;br,<br> + '&lt;CENTER&gt;',<br> + &amp;submit({-name=&gt;'Submit'}),<br> + '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;',<br> + &amp;reset({-name=&gt;'Reset'}),<br> + # '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;',<br> + # &amp;button({-name=&gt;'jsbutton',<br> + # -value=&gt;'JavaScript Button',<br> + # -onClick=&gt;"showAlert()"}),<br> + '&lt;/CENTER&gt;',<br> + &amp;endform();<br> + <br> + print &lt;&lt;END;<br> + <br> + &lt;ul&gt;<br> + &lt;li&gt;<br> + &lt;div align="left"&gt; &lt;font face="Arial, Helvetica, sans-serif"&gt;&lt;u&gt;&lt;a href="http://space.augsburg.edu/space/dataavail.htm"&gt;Data<br> + availability&lt;/a&gt;&lt;/u&gt; list of days available from each station&lt;/font&gt;&lt;/div&gt;<br> + &lt;/li&gt;<br> + &lt;/ul&gt;<br> + <br> + END<br> + <br> + print<br> + &amp;end_html;<br> + <br> + }<br> + <br> + ################################################################################<br> + sub ProcessForm<br> + {<br> + # get CGI form data parameters<br> + <br> + my @stations = &amp;param($::stationParam);<br> + my $beginTime = &amp;param($::beginParam);<br> + my $endTime = &amp;param($::endParam);<br> + my $outputType = &amp;param($::outputTypeParam);<br> + my $binData = $outputType eq $::binName;<br> + my $iagaData = $outputType eq $::iagaName;<br> + my $pngPlot = $outputType eq $::pngName;<br> + my $psPlot = $outputType eq $::psName;<br> + my $component = &amp;param($::componentParam);<br> + <br> + # &amp;::PrintDiagnosticMessage("stations: @stations, beginTime: $beginTime, endTime: $endTime, "<br> + # ."binData: $binData, iagaData: $iagaData, "<br> + # ."pngPlot: $pngPlot, psPlot: $psPlot");<br> + <br> + # boolean values to determine if form is complete<br> + <br> + my $hasStation = 1;<br> + my $hasBeginTime = 1;<br> + my $hasEndTime = 1;<br> + my $hasOutput = 1;<br> + <br> + if (!$stations[0]) {<br> + $hasStation = 0;<br> + }<br> + <br> + if (!$beginTime) {<br> + $hasBeginTime = 0;<br> + }<br> + <br> + if (!$endTime) {<br> + $hasEndTime = 0;<br> + }<br> + <br> + if (!$binData &amp;&amp; !$iagaData &amp;&amp; !$pngPlot &amp;&amp; !$psPlot) {<br> + $hasOutput = 0;<br> + }<br> + <br> + # &amp;::PrintDiagnosticMessage("hasBeginTime: $hasBeginTime");<br> + <br> + # inform user if form is incomplete<br> + <br> + if (!$hasStation || !$hasBeginTime || !$hasEndTime || !$hasOutput) {<br> + &amp;::PrintErrorMessage('Please return to the form and make sure station, '<br> + .'beginning time, ending time, and output type have been specified.');<br> + }<br> + <br> + my $beginYear;<br> + my $beginMonth;<br> + my $beginDay;<br> + my $beginHour;<br> + my $beginMinute;<br> + my $beginSecond;<br> + <br> + my $endYear;<br> + my $endMonth;<br> + my $endDay;<br> + my $endHour;<br> + my $endMinute;<br> + my $endSecond;<br> + <br> + # use pattern matching to find the year, month, etc. allowing for user input errors<br> + # '\d' is any numeric character; '\D' is any non-numeric character; '+' is one or more<br> + <br> + # ($beginYear, $beginMonth, $beginDay, $beginHour, $beginMinute, $beginSecond)<br> + # = ($beginTime =~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/);<br> + # ($endYear, $endMonth, $endDay, $endHour, $endMinute, $endSecond)<br> + # = ($endTime =~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/);<br> + <br> + # my $isValidBeginTime = &amp;::IsValidDateTime($beginSecond, $beginMinute, $beginHour,<br> + # $beginDay, $beginMonth, $beginYear);<br> + # my $isValidEndTime = &amp;::IsValidDateTime($endSecond, $endMinute, $endHour,<br> + # $endDay, $endMonth, $endYear);<br> + <br> + ($beginYear, $beginMonth, $beginDay, $beginHour)<br> + = ($beginTime =~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/);<br> + ($endYear, $endMonth, $endDay, $endHour)<br> + = ($endTime =~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/);<br> + <br> + # &amp;::PrintDiagnosticMessage("Begin YMDH: $beginYear, $beginMonth, $beginDay, $beginHour, "<br> + # ."End YMDH: $endYear, $endMonth, $endDay, $endHour");<br> + <br> + my $isValidBeginTime = &amp;::IsValidDateTime($beginHour, $beginDay, $beginMonth, $beginYear);<br> + my $isValidEndTime = &amp;::IsValidDateTime($endHour, $endDay, $endMonth, $endYear);<br> + <br> + if (!$isValidBeginTime || !$isValidEndTime) {<br> + &amp;::PrintErrorMessage('Please return to the form and make sure '<br> + .'the entered dates and times are valid.');<br> + }<br> + <br> + # prepare to create the IDL batch file...<br> + <br> + # specify filename bases (prefixes) and extensions (suffixes)<br> + my $batchBase = 'idl';<br> + my $batchExt = '.pro';<br> + my $outBase = 'idl';<br> + my $outExt = '.out';<br> + my $htmlBase = '';<br> + my $htmlExt = '.html';<br> + <br> + # get time for making filename time stamp<br> + <br> + my ($sec, $min, $hour, $mday, $foo) = localtime;<br> + my $timestamp = sprintf("%02d%02d%02d", $hour, $min, $sec);<br> + # remove the following comment if we need day number as well...<br> + # my $timestamp = sprintf("%02d%02d%02d%02d", $mday, $hour, $min, $sec);<br> + # test the version letter algorithm by setting timestamp to nearest minute<br> + # my $timestamp = sprintf("%02d%02d", $hour, $min);<br> + <br> + # chances are this time stamp will give us a unique filename, but just in case<br> + # more than one IDL batch file is created in a given second, we append a<br> + # version letter ('a' to 'z') to our time stamp, incrementing it if the file<br> + # already exists...<br> + my $fileID = "";<br> + my $file = "";<br> + my $version = "";<br> + # my $count = 0;<br> + my $count = ord('a');<br> + do {<br> + # $version = sprintf("%02d", $count);<br> + $version = chr($count);<br> + $fileID = $timestamp.$version;<br> + # use batch file for existence (-e $file) test below<br> + $file = $::cgiTmpDir.$batchBase.$fileID.$batchExt;<br> + $count++;<br> + if ($count &gt; (ord('z') + 1)) {<br> + &amp;::PrintErrorMessage('Please re-submit the form.');<br> + }<br> + } while (-e $file);<br> + <br> + my $batchFile = $::cgiTmpDir.$batchBase.$fileID.$batchExt;<br> + my $outFile = $::cgiTmpDir.$outBase.$fileID.$outExt;<br> + <br> + # open batch file; inform user if batch file couldn't be opened<br> + # "&gt;" means "open for output and truncate if necessary"<br> + <br> + # system("whoami");<br> + if (!open(IDLBATCHFILE, "&gt; $batchFile")) {<br> + # &amp;::PrintErrorMessage("Unable to create IDL batch file.");<br> + &amp;::PrintErrorMessage("Unable to create $batchFile.");<br> + }<br> + <br> + # my @beginDateTime = ($beginYear, $beginMonth, $beginDay,<br> + # $beginHour, $beginMinute, $beginSecond);<br> + <br> + # my @endDateTime = ($endYear, $endMonth, $endDay,<br> + # $endHour, $endMinute, $endSecond);<br> + <br> + my @beginDateTime = ($beginYear, $beginMonth, $beginDay, $beginHour);<br> + my @endDateTime = ($endYear, $endMonth, $endDay, $endHour);<br> + <br> + my @outputTypes;<br> + <br> + if ($binData) {<br> + @outputTypes = (@outputTypes, 'bin');<br> + }<br> + <br> + if ($iagaData) {<br> + @outputTypes = (@outputTypes, 'iaga');<br> + }<br> + <br> + if ($pngPlot) {<br> + @outputTypes = (@outputTypes, 'png');<br> + }<br> + <br> + if ($psPlot) {<br> + @outputTypes = (@outputTypes, 'ps');<br> + }<br> + <br> + my $htmlFilePath = $::htmlTmpDir.$htmlBase.$fileID.$htmlExt;<br> + <br> + # IDL student version under Windows doesn't allow creation of .sav files<br> + # Our workaround is to just compile datareq.pro every time--which is actually<br> + # convenient for testing. This might impact performance, but it might not.<br> + # print IDLBATCHFILE "restore, 'datareq.sav'\n";<br> + print IDLBATCHFILE ".compile datareq.pro\n";<br> + <br> + # separator for interpolation-printed arrays (e.g., "@foobar")<br> + $LIST_SEPARATOR = ', ';<br> + <br> + print IDLBATCHFILE "doDataRequest, ";<br> + print IDLBATCHFILE "\'@outputTypes\', ";<br> + print IDLBATCHFILE "\'$component\', ";<br> + print IDLBATCHFILE "\'@beginDateTime\', ";<br> + print IDLBATCHFILE "\'@endDateTime\', ";<br> + print IDLBATCHFILE "\'@stations\', ";<br> + print IDLBATCHFILE "\'$::htmlDataDir\', ";<br> + print IDLBATCHFILE "\'$::htmlDataURL\', ";<br> + print IDLBATCHFILE "\'$::htmlTmpDir\', ";<br> + print IDLBATCHFILE "\'$::htmlTmpURL\', ";<br> + print IDLBATCHFILE "\'$fileID\', ";<br> + print IDLBATCHFILE "\'$htmlFilePath\'";<br> + print IDLBATCHFILE "\n";<br> + <br> + print IDLBATCHFILE "exit";<br> + print IDLBATCHFILE "\n";<br> + <br> + close(IDLBATCHFILE);<br> + <br> + ##### Unix<br> + # execute idl procedure; "&gt;" means "redirect standard output to file"<br> + # "2&gt;&amp;1" means "redirect standard error to file also"<br> + <br> + # redirecting 'standard out' and 'standard error' doesn't seem to work since upgrading<br> + # to IDL 5.4; this could be due to changes in IDL or the license manager or something else<br> + # system("$::idlExecutable $batchFile &gt; $outFile 2&gt;&amp;1");<br> + <br> + # it would be nice to have the errors issued somewhere so we can debug; at<br> + # this point, we'll jst let it all hang out...<br> + # system("$::idlExecutable $batchFile &gt; /dev/null 2&gt;&amp;1");<br> + system("$::idlExecutable $batchFile &gt; output.txt");<br> + <br> + ##### Windows<br> + # my $process = "$::idlExecutable";<br> + # my $command = " "."\@"."$batchFile";<br> + # my $pid = 0;<br> + # &amp;Win32::Spawn($process, $command, $pid);<br> + <br> + # HTML output<br> + print &amp;redirect(-location=&gt;$::htmlTmpURL.$htmlBase.$fileID.$htmlExt);<br> + <br> + # keep size of temporary file directories at the specified size in megs:<br> + &amp;PruneDirectory("$::htmlTmpDir", 200);<br> + &amp;PruneDirectory("$::cgiTmpDir", 10);<br> + <br> + }<br> + <br> + ################################################################################<br> + # returns false if any of the values in the specified date is not in the allowed<br> + # range; parameter order follows that of localtime(), timelocal(), etc.<br> + sub IsValidDateTime<br> + {<br> + # my $second = $_[0];<br> + # my $minute = $_[1];<br> + # my $hour = $_[2];<br> + # my $day = $_[3];<br> + # my $month = $_[4];<br> + # my $year = $_[5];<br> + <br> + my $hour = $_[0];<br> + my $day = $_[1];<br> + my $month = $_[2];<br> + my $year = $_[3];<br> + <br> + # if ($second &lt; 0 || $second &gt; 59) {<br> + # return 0;<br> + # }<br> + # if ($minute &lt; 0 || $minute &gt; 59) {<br> + # return 0;<br> + # }<br> + <br> + if ($hour &lt; 0 || $hour &gt; 23) {<br> + return 0;<br> + }<br> + if ($day &lt; 1 || $day &gt; 31) {<br> + return 0;<br> + }<br> + if ($month &lt; 1 || $month &gt; 12) {<br> + return 0;<br> + }<br> + if ($year &lt; 1970 || $year &gt; 2050) {<br> + return 0;<br> + }<br> + <br> + return 1;<br> + }<br> + <br> + ################################################################################<br> + sub PrintDiagnosticMessage<br> + {<br> + <br> + my $theMessage = $_[0];<br> + <br> + # prevent the CGI.pm functions called herein from losing their minds; they seem<br> + # to rely on the @_ array ($_[0], $_[1], etc.; maybe there's a better way to do<br> + # this?<br> + local @_;<br> + <br> + print &amp;header;<br> + print &amp;start_html(-title=&gt;'Diagnostic', -bgcolor=&gt;'#ffffcc');<br> + print &amp;h3('Diagnostic');<br> + print &amp;h5("$theMessage");<br> + print &amp;end_html;<br> + <br> + # print '&lt;HTML&gt;';<br> + # print '&lt;HEAD&gt;';<br> + # print ' &lt;TITLE&gt;Test&lt;/TITLE&gt;';<br> + # print '&lt;/HEAD&gt;';<br> + # print '&lt;BODY bgcolor=white link="#000080"&gt;';<br> + # print '&lt;/BODY&gt;';<br> + # print '&lt;/HTML&gt;';<br> + <br> + exit(0);<br> + }<br> + <br> + ################################################################################<br> + sub PrintErrorMessage<br> + {<br> + <br> + my $theMessage = $_[0];<br> + <br> + # prevent the CGI.pm functions called herein from losing their minds; they seem<br> + # to rely on the @_ array ($_[0], $_[1], etc.; maybe there's a better way to do<br> + # this?<br> + local @_;<br> + <br> + print &amp;header;<br> + print &amp;start_html(-title=&gt;'Error', -bgcolor=&gt;'#ffffff');<br> + print &amp;h3('Error');<br> + print &amp;h5("$theMessage");<br> + print &amp;end_html;<br> + <br> + # print '&lt;HTML&gt;';<br> + # print '&lt;HEAD&gt;';<br> + # print ' &lt;TITLE&gt;Test&lt;/TITLE&gt;';<br> + # print '&lt;/HEAD&gt;';<br> + # print '&lt;BODY bgcolor=white link="#000080"&gt;';<br> + # print '&lt;/BODY&gt;';<br> + # print '&lt;/HTML&gt;';<br> + <br> + exit(0);<br> + }<br> + <br> + <br> + ################################################################################<br> + # removes files from the specified directory making the total size of the<br> + # directory equal to or less than the specified size in megabytes<br> + sub PruneDirectory<br> + {<br> + <br> + my $dirName = $_[0];<br> + my $maxMegabytes = $_[1];<br> + <br> + my $maxBytes = $maxMegabytes * 1048576;<br> + <br> + my $fileName;<br> + my $filePath;<br> + my @status;<br> + my $accessTime;<br> + my $bytes;<br> + my $oldestTime;<br> + my $totalBytes;<br> + <br> + do {<br> + <br> + # determine access time of oldest file<br> + opendir(DIR, $dirName) or die "Unable to open $dirName. ($!)\n";<br> + $oldestTime = time();<br> + $totalBytes = 0;<br> + while (defined($fileName = readdir(DIR))) {<br> + next if $fileName =~ /^\.\.?$/; # skip '.' and '..'<br> + $filePath = $dirName.$fileName;<br> + @status = stat($filePath);<br> + $accessTime = $status[8];<br> + $bytes = $status[7];<br> + $totalBytes += $bytes;<br> + <br> + if ($accessTime &lt; $oldestTime) {<br> + $oldestTime = $accessTime;<br> + }<br> + }<br> + closedir DIR;<br> + <br> + if ($totalBytes &gt; $maxBytes) {<br> + <br> + # my $theLocalTime = localtime($oldestTime);<br> + # print "OLDEST FILE: $theLocalTime | TOTAL BYTES: $totalBytes bytes\n";<br> + <br> + # repeat; delete files with access time equal to that of oldest file<br> + opendir(DIR, $dirName) or die "Unable to open $dirName. ($!)\n";<br> + $totalBytes = 0;<br> + while (defined($fileName = readdir(DIR))) {<br> + next if $fileName =~ /^\.\.?$/; # skip '.' and '..'<br> + $filePath = $dirName.'/'.$fileName;<br> + @status = stat($filePath);<br> + $accessTime = $status[8];<br> + $bytes = $status[7];<br> + $totalBytes += $bytes;<br> + if ($accessTime &lt;= $oldestTime) {<br> + # my $theAccessTime = localtime($accessTime);<br> + # print " DELETING '$filePath'\n $theAccessTime\n";<br> + unlink($filePath) or die "Unable to delete $filePath. ($!)\n";<br> + }<br> + }<br> + <br> + }<br> + closedir DIR;<br> + # ++$oldestTime;<br> + } while ($totalBytes &gt; $maxBytes)<br> + <br> + }</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-09-04 16:51:06maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 53: </td> <td> Line 53: </td> </tr> <tr> <td> <span>-</span> [http://space/space/index.html<span>&nbsp;index.html</span>] </td> <td> <span>+</span> [http://space/space/index.html] </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-09-04 16:50:38maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 53: </td> <td> Line 53: </td> </tr> <tr> <td> <span>- ["index.html"]</span> </td> <td> <span>+ [http://space/space/index.html index.html]</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-09-04 16:47:33maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 51: </td> <td> Line 51: </td> </tr> <tr> <td> <span>-</span> =Augsburg WebServer <span>Pr</span>o<span>grams</span>= </td> <td> <span>+</span> =Augsburg WebServer <span>Date Request Applicati</span>o<span>n</span>= </td> </tr> <tr> <td> Line 54: </td> <td> Line 54: </td> </tr> <tr> <td> <span>-</span> This is the webpage for the space/space MACCS data interactive request form. This site can be used to obtain binary data, IAGA ASCII data, png plots, or postscript plots of this data. The Data Request Application is created by the perl script datareq which calls the idl program datareq.pro upon form submission. Location: /Library/WebServer/Documents/space/. </td> <td> <span>+</span> This is the web<span>&nbsp;</span>page for the space/space MACCS data interactive request form. This site can be used to obtain binary data, IAGA ASCII data, png plots, or postscript plots of this data. The Data Request Application is created by the perl script datareq which calls the idl program datareq.pro upon form submission. Location: /Library/WebServer/Documents/space/. </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-09-04 16:45:07maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 51: </td> <td> Line 51: </td> </tr> <tr> <td> </td> <td> <span>+ =Augsburg WebServer Programs=<br> + <br> + ["index.html"]<br> + This is the webpage for the space/space MACCS data interactive request form. This site can be used to obtain binary data, IAGA ASCII data, png plots, or postscript plots of this data. The Data Request Application is created by the perl script datareq which calls the idl program datareq.pro upon form submission. Location: /Library/WebServer/Documents/space/.<br> + <br> + ["datareq"]<br> + This is the perl script that generates the Data Request Application web page. It calls datareq.pro upon sumbission of the form. Location: /Library/WebServer/CGI-Executables/maccs/<br> + <br> + ["datareq.pro"]<br> + This program is called by datareq to display the requested data or graphs on the website. Location: /Library/WebServer/CGI-Executables/maccs/<br> + </span> </td> </tr> </table> </div> processNA.shhttp://maccs.wikispot.org/processNA.sh2007-09-04 16:39:03maccs <div id="content" class="wikipage content"> Differences for processNA.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # Shell Script: processNA.sh<br> + # Created by Erik Johnson July 2007<br> + # Last Modified 9/4/07 by Erik Johnson<br> + # This script can be used to process a raw Nain data file.<br> + # The default day is the current UTC day.<br> + <br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + <br> + # If the day you want to process is not the current day, remove the comments from this section and change YEAR and DAY to the day you want to process.<br> + # YEAR=2007<br> + # DAY=230<br> + <br> + NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/Iridium/'${YEAR}'ir/'<br> + NAAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/NA/'${YEAR}'ir/'<br> + <br> + cd $NAdir<br> + if [ -f "NA${YY}${DAY}.dat" ]; then<br> + echo "Processing NA${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> </table> </div> processCD.shhttp://maccs.wikispot.org/processCD.sh2007-09-04 16:37:04maccs <div id="content" class="wikipage content"> Differences for processCD.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # Shell Script: processCD.sh<br> + # Created by Erik Johnson July 2007<br> + # Last Modified 9/4/07 by Erik Johnson<br> + # This script can be used to process a raw Cape Dorset data file.<br> + # The default day is the current UTC day.<br> + <br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + <br> + # If the day you want to process is not the current day, remove the comments from this section and change YEAR and DAY to the day you want to process.<br> + # YEAR=2007<br> + # DAY=242<br> + <br> + <br> + CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/Iridium/'${YEAR}'ir/'<br> + CDAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/'${YEAR}'ir/'<br> + <br> + cd $CDdir<br> + if [ -f "CD${YY}${DAY}.dat" ]; then<br> + echo "Processing CD${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> </table> </div> maccsprocessing.shhttp://maccs.wikispot.org/maccsprocessing.sh2007-09-04 16:36:29maccs <div id="content" class="wikipage content"> Differences for maccsprocessing.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # Shell Script : maccsprocessing.sh<br> + # Execute : ./maccsprocessing.sh<br> + # Name : Erik Johnson &amp; Jesse Docken<br> + # Created : 08/17/2007<br> + # Last Modified : 08/31/2007<br> + # Purpose : Convert the CD and NA iridium data into ASCII files<br> + # and line plots a year at a time.<br> + <br> + YEAR=`date -u +%Y`<br> + #YEAR=2005<br> + <br> + #for j in 2007<br> + #do<br> + #YEAR=$j<br> + <br> + CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/Iridium/'${YEAR}'ir/'<br> + NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/Iridium/'${YEAR}'ir/'<br> + CDAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/'${YEAR}'ir/'<br> + NAAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/NA/'${YEAR}'ir/'<br> + <br> + #if [ 0 -eq 1 ]; then<br> + <br> + cd $CDdir<br> + for i in *<br> + do<br> + echo "$i"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "$i"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "$i"<br> + exit<br> + END_SCRIPT<br> + done<br> + <br> + if [ -d "$NAdir" ]; then<br> + cd $NAdir<br> + for i in *<br> + do<br> + echo "$i"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "$i"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "$i"<br> + exit<br> + END_SCRIPT<br> + done<br> + fi<br> + <br> + <br> + <br> + cd ${CDAdir}<br> + for i in *<br> + do<br> + echo "$CDAdir$i"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"$i",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + done<br> + <br> + #fi<br> + <br> + if [ -d "$NAAdir" ]; then<br> + echo nain<br> + cd $NAAdir<br> + for i in *<br> + do<br> + echo "$NAAdir$i"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"$i",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + done<br> + fi<br> + <br> + done</span> </td> </tr> </table> </div> goodNAtoday.shhttp://maccs.wikispot.org/goodNAtoday.sh2007-09-04 16:33:37maccs <div id="content" class="wikipage content"> Differences for goodNAtoday.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # This script removes the warning from the Today's Plots webpage that there is a problem with the data.<br> + # Written By Erik Johnson 8/30/2007<br> + # Last Modified 8/30/07<br> + <br> + # Change the iridium today website to the version without a warning<br> + cd /Library/WebServer/Documents/space/<br> + mv iridiumtoday.html iridiumtoday.html.badNA<br> + mv iridiumtoday.html.good iridiumtoday.html</span> </td> </tr> </table> </div> badNA.shhttp://maccs.wikispot.org/badNA.sh2007-09-04 16:31:50maccs <div id="content" class="wikipage content"> Differences for badNA.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # badNA.sh<br> + # This script moves the current day's raw and processed NA files to the Problem_Data/ folders.<br> + # It also adds a warning to iridiumtoday.html that there is a problem with the NA data.<br> + # It can also be used to move other day's files to the Problem_Data/ folders.<br> + # Written By Erik Johnson 8/29/2007<br> + # Last Modified 9/4/07<br> + <br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + DAY=189<br> + <br> + NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/Iridium/'${YEAR}'ir/'<br> + NAAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/NA/'${YEAR}'ir/'<br> + NAIdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/NA/'${YEAR}'ir/'<br> + NALdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PostScript/NA/'${YEAR}'ir/'<br> + NAL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/NA/'${YEAR}'ir/'<br> + <br> + NAPdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/Iridium/'${YEAR}'ir/Problem_Data/'<br> + NAAPdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/NA/'${YEAR}'ir/Problem_Data/'<br> + NAIPdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/NA/'${YEAR}'ir/Problem_Data/'<br> + NALPdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PostScript/NA/'${YEAR}'ir/Problem_Data/'<br> + NAL2Pdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/NA/'${YEAR}'ir/Problem_Data/'<br> + <br> + # Move DAY's NA files to Problem_Data folders<br> + mv ${NAdir}NA${YY}${DAY}.dat ${NAPdir}NA${YY}${DAY}.dat<br> + mv ${NAAdir}NA${YY}${DAY}.dat ${NAAPdir}NA${YY}${DAY}.dat<br> + mv ${NAIdir}NA${YY}${DAY}.dat ${NAIPdir}NA${YY}${DAY}.dat<br> + mv ${NALdir}na${YY}${DAY}.ps ${NALPdir}na${YY}${DAY}.ps<br> + mv ${NAL2dir}na${YY}${DAY}.png ${NAL2Pdir}na${YY}${DAY}.png<br> + <br> + # Changes the iridium today website to the version with the NA warning<br> + # Remove the comment symbols from this section if the new data is bad and the warning has not been added to the website<br> + # Add the comment symbols back after running<br> + # To remove the warning, run goodNAtoday.sh<br> + <br> + # cd /Library/WebServer/Documents/space/<br> + # mv iridiumtoday.html iridiumtoday.html.good<br> + # mv iridiumtoday.html.badNA iridiumtoday.html</span> </td> </tr> </table> </div> goodCDtoday.shhttp://maccs.wikispot.org/goodCDtoday.sh2007-09-04 16:31:04maccs <div id="content" class="wikipage content"> Differences for goodCDtoday.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 5: </td> <td> Line 5: </td> </tr> <tr> <td> <span>-</span> # Change the iridium today website to the version with <span>the </span>no warning </td> <td> <span>+</span> # Change the iridium today website to the version with no warning </td> </tr> </table> </div> goodCDtoday.shhttp://maccs.wikispot.org/goodCDtoday.sh2007-09-04 16:30:45maccs <div id="content" class="wikipage content"> Differences for goodCDtoday.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # This script removes the warning from the Today's Plots webpage that there is a problem with the data.<br> + # Written By Erik Johnson 8/30/2007<br> + # Last Modified 8/30/07<br> + <br> + # Change the iridium today website to the version with the no warning<br> + cd /Library/WebServer/Documents/space/<br> + mv iridiumtoday.html iridiumtoday.html.badCD<br> + mv iridiumtoday.html.good iridiumtoday.html</span> </td> </tr> </table> </div> badCD.shhttp://maccs.wikispot.org/badCD.sh2007-09-04 16:30:03maccs <div id="content" class="wikipage content"> Differences for badCD.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # badCD.sh<br> + # This script moves the current day's raw and processed CD files to the Problem_Data/ folders. It also adds a warning to the Today's Plots webpage that there is a problem with the data.<br> + # It can also be used to move other day's files to the Problem_Data/ folders.<br> + # Written By Erik Johnson 8/27/2007<br> + # Last Modified 9/4/07<br> + <br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + #DAY=241<br> + <br> + CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/Iridium/'${YEAR}'ir/'<br> + CDAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/'${YEAR}'ir/'<br> + CDIdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/CD/'${YEAR}'ir/'<br> + CDLdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PostScript/CD/'${YEAR}'ir/'<br> + CDL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/CD/'${YEAR}'ir/'<br> + <br> + CDPdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/Iridium/'${YEAR}'ir/Problem_Data/'<br> + CDAPdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/'${YEAR}'ir/Problem_Data/'<br> + CDIPdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/CD/'${YEAR}'ir/Problem_Data/'<br> + CDLPdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PostScript/CD/'${YEAR}'ir/Problem_Data/'<br> + CDL2Pdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/CD/'${YEAR}'ir/Problem_Data/'<br> + # Move DAY's CD files to Problem_Data folders<br> + mv ${CDdir}CD${YY}${DAY}.dat ${CDPdir}CD${YY}${DAY}.dat<br> + mv ${CDAdir}CD${YY}${DAY}.dat ${CDAPdir}CD${YY}${DAY}.dat<br> + mv ${CDIdir}CD${YY}${DAY}.dat ${CDIPdir}CD${YY}${DAY}.dat<br> + mv ${CDLdir}cd${YY}${DAY}.ps ${CDLPdir}cd${YY}${DAY}.ps<br> + mv ${CDL2dir}cd${YY}${DAY}.png ${CDL2Pdir}cd${YY}${DAY}.png<br> + <br> + # Changes the iridium today website to the version with the CD warning<br> + # Remove the comment symbols from this section if the new data is bad and the warning has not been added to the website<br> + # Add the comment symbols back after running<br> + # To remove the warning, run goodCDtoday.sh<br> + <br> + # cd /Library/WebServer/Documents/space/<br> + # mv iridiumtoday.html iridiumtoday.html.good<br> + # mv iridiumtoday.html.badCD iridiumtoday.html</span> </td> </tr> </table> </div> NoNA.txthttp://maccs.wikispot.org/NoNA.txt2007-09-04 16:28:50maccs <div id="content" class="wikipage content"> Differences for NoNA.txt<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ There is no Nain data from the previous 24 hours.</span> </td> </tr> </table> </div> BadNA.txthttp://maccs.wikispot.org/BadNA.txt2007-09-04 16:28:08maccs <div id="content" class="wikipage content"> Differences for BadNA.txt<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ There is a problem with the Nain data from the last 24 hour period.</span> </td> </tr> </table> </div> NoCD.txthttp://maccs.wikispot.org/NoCD.txt2007-09-04 16:27:25maccs <div id="content" class="wikipage content"> Differences for NoCD.txt<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ There is no Cape Dorset data from the previous 24 hours.</span> </td> </tr> </table> </div> BadCD.txthttp://maccs.wikispot.org/BadCD.txt2007-09-04 16:26:15maccs <div id="content" class="wikipage content"> Differences for BadCD.txt<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ There is a problem with the Cape Dorset data from the last 24 hour period.</span> </td> </tr> </table> </div> checkMACCSir.shhttp://maccs.wikispot.org/checkMACCSir.sh2007-09-04 16:25:29maccs <div id="content" class="wikipage content"> Differences for checkMACCSir.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 31: </td> <td> Line 31: </td> </tr> <tr> <td> <span>-</span> (cat BadCD.txt; uuencode ${CDL2Pdir}cd${YY}${PDAY}.png cd${YY}${PDAY}.png) | mailx -s "Problem With Latest Cape Dorset Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> <td> <span>+</span> (cat <span>["</span>BadCD.txt<span>"]</span>; uuencode ${CDL2Pdir}cd${YY}${PDAY}.png cd${YY}${PDAY}.png) | mailx -s "Problem With Latest Cape Dorset Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> </tr> <tr> <td> Line 34: </td> <td> Line 34: </td> </tr> <tr> <td> <span>-</span> cat NoCD.txt | mailx -s "No Cape Dorset Data For Today" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> <td> <span>+</span> cat <span>["</span>NoCD.txt<span>"]</span> | mailx -s "No Cape Dorset Data For Today" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> </tr> <tr> <td> Line 42: </td> <td> Line 42: </td> </tr> <tr> <td> <span>-</span> (cat BadNA.txt; uuencode ${NAL2Pdir}na${YY}${PDAY}.png na${YY}${PDAY}.png) | mailx -s "Problem With Latest Nain Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> <td> <span>+</span> (cat <span>["</span>BadNA.txt<span>"]</span>; uuencode ${NAL2Pdir}na${YY}${PDAY}.png na${YY}${PDAY}.png) | mailx -s "Problem With Latest Nain Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> </tr> <tr> <td> Line 45: </td> <td> Line 45: </td> </tr> <tr> <td> <span>-</span> cat NoNA.txt | mailx -s "No Nain Data For Today" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> <td> <span>+</span> cat <span>["</span>NoNA.txt<span>"]</span> | mailx -s "No Nain Data For Today" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu </td> </tr> </table> </div> checkMACCSir.shhttp://maccs.wikispot.org/checkMACCSir.sh2007-09-04 16:23:21maccs <div id="content" class="wikipage content"> Differences for checkMACCSir.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # This script is run at 19:35 by the maccs user crontab.<br> + # It emails the newest MACCS Iridium data line plot files to the listed users.<br> + # If there is no new data it sends an email to report the missing data.<br> + # Written By Erik Johnson 8/23/07<br> + # Last Modified 8/29/07<br> + <br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + PDAY=`echo $DAY - 1 | bc`<br> + #PDAY=233<br> + <br> + # Insert the necessary leading zeros for PDAY<br> + if [ $PDAY -lt 10 ]; then<br> + PDAY=00$PDAY<br> + elif [ $PDAY -lt 100 ]; then<br> + PDAY=0$PDAY<br> + fi<br> + <br> + CDL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/CD/'${YEAR}'ir/'<br> + NAL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/NA/'${YEAR}'ir/'<br> + CDL2Pdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/CD/'${YEAR}'ir/Problem_Data/'<br> + NAL2Pdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/NA/'${YEAR}'ir/Problem_Data/'<br> + SOURCEdir='/Volumes/physics_data/Code/MACCS_Code/'<br> + <br> + cd $CDL2dir<br> + if [ -f "${CDL2dir}cd${YY}${PDAY}.png" ]; then<br> + uuencode cd${YY}${PDAY}.png cd${YY}${PDAY}.png | mailx -s "Latest Cape Dorset Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu<br> + elif [ -f "${CDL2Pdir}cd${YY}${PDAY}.png" ]; then<br> + cd $SOURCEdir<br> + (cat BadCD.txt; uuencode ${CDL2Pdir}cd${YY}${PDAY}.png cd${YY}${PDAY}.png) | mailx -s "Problem With Latest Cape Dorset Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu<br> + else<br> + cd $SOURCEdir<br> + cat NoCD.txt | mailx -s "No Cape Dorset Data For Today" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu<br> + fi<br> + <br> + cd $NAL2dir<br> + if [ -f "${NAL2dir}na${YY}${PDAY}.png" ]; then<br> + uuencode na${YY}${PDAY}.png na${YY}${PDAY}.png | mailx -s "Latest Nain Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu<br> + elif [ -f "${NAL2Pdir}na${YY}${PDAY}.png" ]; then<br> + cd $SOURCEdir<br> + (cat BadNA.txt; uuencode ${NAL2Pdir}na${YY}${PDAY}.png na${YY}${PDAY}.png) | mailx -s "Problem With Latest Nain Plot" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu<br> + else<br> + cd $SOURCEdir<br> + cat NoNA.txt | mailx -s "No Nain Data For Today" teakjohnson@embarqmail.com,engebret@augsburg.edu,steinmee@augsburg.edu,dockenj@augsburg.edu,petit@augsburg.edu<br> + fi</span> </td> </tr> </table> </div> todaysdata.shhttp://maccs.wikispot.org/todaysdata.sh2007-09-04 16:22:32maccs <div id="content" class="wikipage content"> Differences for todaysdata.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # This script is run by ftpsri.sh at :00, :15, :30, :45 past every hour of every day<br> + # It copies the current day's line plot files to the web server and renames them.<br> + # These files are made available on the MACCS Iridium Today's Data Plots webpage<br> + # Written By Erik Johnson 8/21/2007<br> + # Last Modified 8/30/07<br> + <br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + <br> + CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/Iridium/'${YEAR}'ir/'<br> + NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/Iridium/'${YEAR}'ir/'<br> + CDAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/'${YEAR}'ir/'<br> + NAAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/NA/'${YEAR}'ir/'<br> + CDIdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/CD/'${YEAR}'ir/'<br> + NAIdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/NA/'${YEAR}'ir/'<br> + CDLdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PostScript/CD/'${YEAR}'ir/'<br> + NALdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PostScript/NA/'${YEAR}'ir/'<br> + CDL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/CD/'${YEAR}'ir/'<br> + NAL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/NA/'${YEAR}'ir/'<br> + TODAYdir='/Library/WebServer/Documents/space/'<br> + <br> + # Update Cape Dorset data for the Today's Data webpage<br> + #cp ${CDdir}CD${YY}${DAY}.dat ${TODAYdir}CDRawToday.dat<br> + #cp ${CDAdir}CD${YY}${DAY}.dat ${TODAYdir}CDAugASCIIToday.dat<br> + #cp ${CDIdir}CD${YY}${DAY}.dat ${TODAYdir}CDIAGA2000Today.dat<br> + <br> + if [ -f "${CDLdir}cd${YY}${DAY}.ps" ]; then<br> + cp ${CDLdir}cd${YY}${DAY}.ps ${TODAYdir}CDPSToday.ps<br> + elif [ -f "${CDLdir}/Problem_Data/cd${YY}${DAY}.ps" ]; then<br> + cp ${CDLdir}/Problem_Data/cd${YY}${DAY}.ps ${TODAYdir}CDPSToday.ps<br> + fi<br> + <br> + if [ -f "${CDL2dir}cd${YY}${DAY}.png" ]; then<br> + cp ${CDL2dir}cd${YY}${DAY}.png ${TODAYdir}CDPNGToday.png<br> + elif [ -f "${CDL2dir}/Problem_Data/cd${YY}${DAY}.png" ]; then<br> + cp ${CDL2dir}/Problem_Data/cd${YY}${DAY}.png ${TODAYdir}CDPNGToday.png<br> + fi<br> + <br> + # Update Nain data for the Today's Data webpage<br> + #cp ${NAdir}NA${YY}${DAY}.dat ${TODAYdir}NARawToday.dat<br> + #cp ${NAAdir}NA${YY}${DAY}.dat ${TODAYdir}NAAugASCIIToday.dat<br> + #cp ${NAIdir}NA${YY}${DAY}.dat ${TODAYdir}NAIAGA2000Today.dat<br> + if [ -f "${NALdir}na${YY}${DAY}.ps" ]; then<br> + cp ${NALdir}na${YY}${DAY}.ps ${TODAYdir}NAPSToday.ps<br> + elif [ -f "${NALdir}/Problem_Data/na${YY}${DAY}.ps" ]; then<br> + cp ${NALdir}na${YY}${DAY}.ps ${TODAYdir}NAPSToday.ps<br> + fi<br> + <br> + if [ -f "${NAL2dir}na${YY}${DAY}.png" ]; then<br> + cp ${NAL2dir}na${YY}${DAY}.png ${TODAYdir}NAPNGToday.png<br> + elif [ -f "${NAL2dir}/Problem_Data/na${YY}${DAY}.png" ]; then<br> + cp ${NAL2dir}na${YY}${DAY}.png ${TODAYdir}NAPNGToday.ps<br> + fi</span> </td> </tr> </table> </div> linex7.prohttp://maccs.wikispot.org/linex7.pro2007-09-04 16:21:30maccs <div id="content" class="wikipage content"> Differences for linex7.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 11: </td> <td> Line 11: </td> </tr> <tr> <td> </td> <td> <span>+ ; MODIFIED BY Erik Johnson August 31, 2007 to output .png line plot files</span> </td> </tr> </table> </div> linex7.prohttp://maccs.wikispot.org/linex7.pro2007-09-04 16:15:36maccs <div id="content" class="wikipage content"> Differences for linex7.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 618: </td> <td> Line 618: </td> </tr> <tr> <td> <span>-</span> fnamelp= '/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/'+strupcase(site)+'/200'+yrday+'ir/'+site+syrday+'.ps' </td> <td> <span>+</span> fnamelp= '/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/<span>PostScript/</span>'+strupcase(site)+'/200'+yrday+'ir/'+site+syrday+'.ps' </td> </tr> <tr> <td> Line 702: </td> <td> Line 702: </td> </tr> <tr> <td> <span>-</span> fnameseq='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/'+site+'/200'+IYR+'ir/'+site+syrday + strcompress(seqnum,/remove_all) +'.ps' </td> <td> <span>+</span> fnameseq='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots<span>/PostScript</span>/'+site+'/200'+IYR+'ir/'+site+syrday + strcompress(seqnum,/remove_all) +'.ps' </td> </tr> <tr> <td> Line 735: </td> <td> Line 735: </td> </tr> <tr> <td> <span>- set_plot, 'ps'<br> - device, filename=fnamelp,/landscape</span> </td> <td> <span>+ ;set_plot, 'ps'<br> + ;device, filename=fnamelp,/landscape<br> + ;!p.multi=[0,1,3]<br> + <br> + ;!x.style=1<br> + ;!x.margin=[10,10]<br> + ;!x.style=1<br> + ;!y.margin=[2,2]<br> + ;;************U***This is the spot that controls titles for the postscript plots***********************<br> + <br> + ;plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> + ;xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$<br> + ;xtickformat='xticks', xminor=5,ystyle=18<br> + ;;!Y.TITLE = STRMID(LAB,63,4)<br> + ;plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> + ;xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$<br> + ;xtickformat='xticks',xminor=5, ystyle=18<br> + ;;!Y.TITLE = STRMID(LAB,67,4)<br> + ;plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> + ;xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$<br> + ;xtickformat='xticks',xminor=5, ystyle=18<br> + ;device, /close_file<br> + <br> + ;Use Z-buffer<br> + set_plot, 'Z'<br> + ;device, filename=fnamelp2<br> + !p.background=255<br> + !p.color=0</span> </td> </tr> <tr> <td> Line 738: </td> <td> Line 764: </td> </tr> <tr> <td> <span>- </span> </td> <td> </td> </tr> <tr> <td> Line 740: </td> <td> Line 765: </td> </tr> <tr> <td> <span>-</span> !x.margin=[1<span>0</span>,<span>10</span>] </td> <td> <span>+</span> !x.margin=[1<span>4</span>,<span>5</span>] </td> </tr> <tr> <td> Line 746: </td> <td> Line 771: </td> </tr> <tr> <td> <span>-</span> xticks=<span>tick</span>,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$ </td> <td> <span>+</span> xticks=<span>6</span>,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$ </td> </tr> <tr> <td> Line 750: </td> <td> Line 775: </td> </tr> <tr> <td> <span>-</span> xticks=<span>tick</span>,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$ </td> <td> <span>+</span> xticks=<span>6</span>,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$ </td> </tr> <tr> <td> Line 754: </td> <td> Line 779: </td> </tr> <tr> <td> <span>-</span> xticks=<span>tick</span>, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$ </td> <td> <span>+</span> xticks=<span>6</span>, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$ </td> </tr> <tr> <td> Line 756: </td> <td> Line 781: </td> </tr> <tr> <td> <span>- device, /close_file</span> </td> <td> <span>+ image = tvrd()<br> + write_png, '/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/'+strupcase(site)+'/200'+yrday+'ir/'+site+syrday+'.png', image<br> + <br> + </span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-09-04 16:11:53maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # Shell Script: ftpsri.sh<br> + # Execute: ./ftpsri.sh</span> </td> </tr> <tr> <td> Line 6: </td> <td> Line 8: </td> </tr> <tr> <td> <span>-</span> # It runs todaysdata.sh which copies today's <span>da</span>t<span>a</span> files to the web server for the Today's Real-Time Data page </td> <td> <span>+</span> # It runs <span>["</span>todaysdata.sh<span>"]</span> which copies today's <span>line plo</span>t files to the web server for the Today's Real-Time Data <span>Plots web </span>page </td> </tr> <tr> <td> Line 8: </td> <td> Line 10: </td> </tr> <tr> <td> <span>-</span> # IridiumMaccs2.pro to make Augsburg Format ASCII files which are used by linex7.pro<br> <span>-</span> # IridiumMaccs3.pro to make IAGA2000 Format ASCII files which are made available on the MACCS iridium website<br> <span>-</span> # linex7.pro to make line plots of the data which are made available on the MACCS iridium website </td> <td> <span>+</span> # <span>["</span>IridiumMaccs2.pro<span>"]</span> to make Augsburg Format ASCII files which are used by <span>["</span>linex7.pro<span>"]</span><br> <span>+</span> # <span>["</span>IridiumMaccs3.pro<span>"]</span> to make IAGA2000 Format ASCII files which are made available on the MACCS iridium website<br> <span>+</span> # <span>["</span>linex7.pro<span>"]</span> to make line plots of the data which are made available on the MACCS iridium website </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-09-04 16:08:43maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>- {{{</span> </td> <td> </td> </tr> <tr> <td> Line 3: </td> <td> Line 2: </td> </tr> <tr> <td> <span>-</span> # Last Modified 8/2<span>1</span>/07 by Erik Johnson </td> <td> <span>+</span> # Last Modified 8/2<span>3</span>/07 by Erik Johnson </td> </tr> <tr> <td> Line 7: </td> <td> Line 6: </td> </tr> <tr> <td> </td> <td> <span>+ # It runs todaysdata.sh which copies today's data files to the web server for the Today's Real-Time Data page</span> </td> </tr> <tr> <td> Line 24: </td> <td> Line 24: </td> </tr> <tr> <td> </td> <td> <span>+ SOURCEdir='/Volumes/physics_data/Code/MACCS_Code/'</span> </td> </tr> <tr> <td> Line 25: </td> <td> Line 26: </td> </tr> <tr> <td> <span>-</span> NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/'${YEAR}'ir/' </td> <td> <span>+</span> NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/<span>Iridium/</span>'${YEAR}'ir/' </td> </tr> <tr> <td> Line 30: </td> <td> Line 31: </td> </tr> <tr> <td> <span>-</span> CDLdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/CD/'${YEAR}'ir/'<br> <span>-</span> NALdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/NA/'${YEAR}'ir/' </td> <td> <span>+</span> CDLdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots<span>/PostScript</span>/CD/'${YEAR}'ir/'<br> <span>+</span> NALdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots<span>/PostScript</span>/NA/'${YEAR}'ir/'<span><br> + CDL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/CD/'${YEAR}'ir/'<br> + NAL2dir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/PNG/NA/'${YEAR}'ir/'</span> </td> </tr> <tr> <td> Line 82: </td> <td> Line 85: </td> </tr> <tr> <td> </td> <td> <span>+ #If the data has been moved into the Problem_Data folder, set PROB=1 else set PROB=0</span> </td> </tr> <tr> <td> Line 91: </td> <td> Line 95: </td> </tr> <tr> <td> </td> <td> <span>+ P6DAYPROB=0</span> </td> </tr> <tr> <td> Line 102: </td> <td> Line 107: </td> </tr> <tr> <td> </td> <td> <span>+ P5DAYPROB=0</span> </td> </tr> <tr> <td> Line 113: </td> <td> Line 119: </td> </tr> <tr> <td> </td> <td> <span>+ P4DAYPROB=0</span> </td> </tr> <tr> <td> Line 124: </td> <td> Line 131: </td> </tr> <tr> <td> </td> <td> <span>+ P3DAYPROB=0</span> </td> </tr> <tr> <td> Line 135: </td> <td> Line 143: </td> </tr> <tr> <td> </td> <td> <span>+ P2DAYPROB=0</span> </td> </tr> <tr> <td> Line 146: </td> <td> Line 155: </td> </tr> <tr> <td> </td> <td> <span>+ PDAYPROB=0</span> </td> </tr> <tr> <td> Line 147: </td> <td> Line 157: </td> </tr> <tr> <td> </td> <td> <span>+ fi<br> + cd $CDdir<br> + if [ -f "Problem_Data/CD${YY}${DAY}.dat" ]; then<br> + CDDAYPROB=1<br> + else<br> + CDDAYPROB=0<br> + fi<br> + cd $NAdir<br> + if [ -f "Problem_Data/NA${YY}${DAY}.dat" ]; then<br> + NADAYPROB=1<br> + else<br> + NADAYPROB=0</span> </td> </tr> <tr> <td> Line 186: </td> <td> Line 208: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDL2dir<br> + mv cd${YY}${P6DAY}.png Proble_Data/</span> </td> </tr> <tr> <td> Line 227: </td> <td> Line 251: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDL2dir<br> + mv cd${YY}${P5DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 268: </td> <td> Line 294: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDL2dir<br> + mv cd${YY}${P4DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 309: </td> <td> Line 337: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDL2dir<br> + mv cd${YY}${P3DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 350: </td> <td> Line 380: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDL2dir<br> + mv cd${YY}${P2DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 391: </td> <td> Line 423: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDL2dir<br> + mv cd${YY}${PDAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 397: </td> <td> Line 431: </td> </tr> <tr> <td> <span>- ftp -n &lt;&lt; END_SCRIPT<br> - open 128.18.144.24<br> - user anonymous teakjohnson@embarqmail.com<br> - epsv4<br> - cd pub/maccs/CD/magnetometer/<br> - get CD${YY}${DAY}.dat<br> - lcd $CDdir<br> - cd ../../NA/magnetometer/<br> - get NA${YY}${DAY}.dat<br> - bye<br> - END_SCRIPT</span> </td> <td> <span>+ if [ "$CDDAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi<br> + if [ "$NADAYPROB" = 0 ]; then<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${DAY}.dat<br> + lcd $NAdir<br> + cd ../../NA/magnetometer/<br> + get NA${YY}${DAY}.dat<br> + bye<br> + END_SCRIPT<br> + else<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${DAY}.dat<br> + bye<br> + END_SCRIPT<br> + cd ${NAdir}Problem_Data/<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 426: </td> <td> Line 483: </td> </tr> <tr> <td> </td> <td> <span>+ elif [ "$CDDAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + echo "Processing CD${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + mv CD${YY}${DAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${DAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${DAY}.ps Problem_Data/<br> + cd $CDL2dir<br> + mv cd${YY}${DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 445: </td> <td> Line 527: </td> </tr> <tr> <td> </td> <td> <span>+ elif [ "$NADAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + echo "Processing NA${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + mv NA${YY}${DAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${DAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${DAY}.ps Problem_Data/<br> + cd $NAL2dir<br> + mv na${YY}${DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 457: </td> <td> Line 564: </td> </tr> <tr> <td> </td> <td> <span>+ P6DAYPROB=0</span> </td> </tr> <tr> <td> Line 468: </td> <td> Line 576: </td> </tr> <tr> <td> </td> <td> <span>+ P5DAYPROB=0</span> </td> </tr> <tr> <td> Line 479: </td> <td> Line 588: </td> </tr> <tr> <td> </td> <td> <span>+ P4DAYPROB=0</span> </td> </tr> <tr> <td> Line 490: </td> <td> Line 600: </td> </tr> <tr> <td> </td> <td> <span>+ P3DAYPROB=0</span> </td> </tr> <tr> <td> Line 501: </td> <td> Line 612: </td> </tr> <tr> <td> </td> <td> <span>+ P2DAYPROB=0</span> </td> </tr> <tr> <td> Line 512: </td> <td> Line 624: </td> </tr> <tr> <td> </td> <td> <span>+ PDAYPROB=0</span> </td> </tr> <tr> <td> Line 553: </td> <td> Line 666: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAL2dir<br> + mv na${YY}${P6DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 594: </td> <td> Line 709: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAL2dir<br> + mv na${YY}${P5DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 635: </td> <td> Line 752: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAL2dir<br> + mv na${YY}${P4DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 676: </td> <td> Line 795: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAL2dir<br> + mv na${YY}${P3DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 717: </td> <td> Line 838: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAL2dir<br> + mv na${YY}${P2DAY}.png Problem_Data/</span> </td> </tr> <tr> <td> Line 758: </td> <td> Line 881: </td> </tr> <tr> <td> <span>- fi<br> - fi<br> - fi}}}</span> </td> <td> <span>+ cd $NAL2dir<br> + mv na${YY}${PDAY}.png Problem_Data/<br> + fi<br> + fi<br> + fi<br> + <br> + cd $SOURCEdir<br> + ./todaysdata.sh</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-09-04 16:04:26maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>- Describe Processing Software here.</span> </td> <td> <span>+ =MACCS Iridium Data Processing At Augsburg=</span> </td> </tr> <tr> <td> Line 3: </td> <td> Line 3: </td> </tr> <tr> <td> <span>- MACCS Iridium Data Processing At Augsburg</span> </td> <td> <span>+ ==Crontab Scripts &amp; Programs==</span> </td> </tr> <tr> <td> Line 5: </td> <td> Line 5: </td> </tr> <tr> <td> <span>- *The shell script used to download and process the raw data files<br> - ["ftpsri.sh"]<br> - *The idl program used to make Augsburg format ASCII files<br> - ["IridiumMaccs2.pro"]<br> - *The idl program used to make IAGA2000 format ASCII files<br> - ["IridiumMaccs3.pro"]<br> - *The idl program used to make line plots<br> - ["linex7.pro"]</span> </td> <td> <span>+ Listing of maccs user crontab:</span> </td> </tr> <tr> <td> Line 14: </td> <td> Line 7: </td> </tr> <tr> <td> <span>- 2004 Boston University MACCS Data Processing</span> </td> <td> <span>+ 0,15,30,45 * * * * /Volumes/physics_data/Code/MACCS_Code/ftpsri.sh<br> + 35 19 * * * /Volumes/physics_data/Code/MACCS_Code/checkMACCSir.sh<br> + <br> + ["ftpsri.sh"]<br> + This program runs at :00, :15, :30, :45 of every hour of every day. It downloads the latest MACCS iridium raw data files from SRI's ftp site and files them into the MACCS_DATA/Raw/ folder. Then it makes ASCII files and line plots of the data it downloaded. It calls the following idl programs (from the /Volumes/physics_data/Code/MACCS_Code/ directory) to process the data: IridiumMaccs2.pro to make Augsburg Format ASCII files which are used by linex7.pro, IridiumMaccs3.pro to make IAGA2000 Format ASCII files which are made available on the MACCS iridium website, and linex7.pro to make line plots of the data which are made available on the MACCS iridium website. It finishes by running the todaysdata.sh shell script which make copies of the line plots for the Today's Real-Time Data Plots web page.<br> + <br> + ["IridiumMaccs3.pro"]<br> + This program is run by ftpsri.sh at :00, :15, :30, and :45 past every hour of every day. It creates IAGA2000 format ASCII files from the raw iridium data.<br> + <br> + ["IridiumMaccs2.pro"]<br> + This program is run by ftpsri.sh at :00, :15, :30, and :45 past every hour of every day. It makes Augsburg format ASCII files from the raw iridium data.<br> + <br> + ["linex7.pro"]<br> + This program is run by ftpsri.sh at :00, :15, :30, and :45 past every hour of every day. It run on the Augsburg format ASCII files created by IridiumMaccs2.pro. It creates line graphs of the iridium data.<br> + <br> + ["todaysdata.sh"]<br> + This script is run by ftpsri.sh at :00, :15, :30, :45 past every hour of every day. It copies the current day's line plot files to the web server and renames them. These files are made available on the Today's Real-Time Data Plots web page.<br> + <br> + ["checkMACCSir.sh"]<br> + This script runs at 19:35. It emails the newest MACCS Iridium data line plot files to the listed users. If there is no new data it sends an email to report the missing data.<br> + <br> + ==Non-Crontab Scripts==<br> + <br> + ["badCD.sh"]<br> + This script should be run on days when there is a problem with the Cape Dorset data. It moves the current day's raw and processed CD files to the Problem_Data/ folders. It can also be used to move other day's files to the Problem_Data/ folders. If the new data has just gone bad, uncomment the last section of the script to add a warning to the Today's Real-Time Data Plots web page.<br> + <br> + ["goodCDtoday.sh"]<br> + This script should be run the UTC day after the problem with the Cape Dorset data has been fixed. It removes the warning from the Today's Real-Time Data Plots web page.<br> + <br> + ["badNA.sh"]<br> + This script should be run on days when there is a problem with the Nain data. It moves the current day's raw and processed NA files to the Problem_Data/ folders. It can also be used to move other day's files to the Problem_Data/ folders. If the new data has just gone bad, uncomment the last section of the script to add a warning to the Today's Real-Time Data Plots web page.<br> + <br> + ["goodNAtoday.sh"]<br> + This script should be run the UTC day after the problem with the Nain data has been fixed. It removes the warning from the Today's Real-Time Data Plots web page.<br> + <br> + ["maccsprocessing.sh"]<br> + Convert the CD and NA iridium data into ASCII files and line plots a year at a time.<br> + <br> + ["processCD.sh"]<br> + This script can be used to process a single raw Cape Dorset data file. The defult day is the current UTC day.<br> + <br> + ["processNA.sh"]<br> + This script can be used to process a single raw Nain data file. The defult day is the current UTC day.<br> + <br> + <br> + =2004 Boston University MACCS Data Processing=</span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-09-04 15:03:58maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 3: </td> <td> Line 3: </td> </tr> <tr> <td> </td> <td> <span>+ </span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-09-04 15:03:31maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> =Learn About=<br> <span>-</span> <span>*</span> ["Processing Software"]<br> <span>-</span> <span>&nbsp;*</span> ["Data Collection"] </td> <td> <span>+</span> =Learn About<span>&nbsp;MACCS</span>=<br> <span>+</span> <span>[[Image(pang1.jpg,</span> <span>left, thumbnail)]]<br> +</span> ["Processing Software"]<br> <span>+</span> <span><br> +</span> ["Data Collection"] </td> </tr> <tr> <td> Line 10: </td> <td> Line 12: </td> </tr> <tr> <td> <span>- [[Image(pang1.jpg)]]</span> </td> <td> <span>+ </span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-09-04 14:38:34maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 10: </td> <td> Line 10: </td> </tr> <tr> <td> <span>- </span> </td> <td> </td> </tr> <tr> <td> Line 12: </td> <td> Line 11: </td> </tr> <tr> <td> <span>- </span> </td> <td> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-09-04 14:30:07maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 8: </td> <td> Line 8: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + [http://space.augsburg.edu/space/index.html Visit The Augsburg MACCS Website]</span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-08-24 20:29:13maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> =Learn <span>More </span>About= </td> <td> <span>+</span> =Learn About= </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-08-24 20:28:42maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> <span>[[Image(pang1.jpg)]]<br> - <br> - </span>Learn More About </td> <td> <span>+</span> <span>=</span>Learn More About<span>=</span> </td> </tr> <tr> <td> Line 10: </td> <td> Line 8: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + [[Image(pang1.jpg)]]</span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-08-24 20:26:39maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>- Welcome to your new wiki! This is your wiki's Front Page. So what do you do now?</span> </td> <td> <span>+ [[Image(pang1.jpg)]]</span> </td> </tr> <tr> <td> Line 3: </td> <td> Line 3: </td> </tr> <tr> <td> <span>- [[Image(pang1.jpg)]]</span> </td> <td> <span>+ Learn More About<br> + * ["Processing Software"]<br> + * ["Data Collection"]<br> + <br> + ["Realtime Plots" View A Realtime Plot]<br> + <br> + ["People" Get Contact Information]</span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-22 03:00:32PhilipNeustromexample of braces - you can put code in braces or upload the file 4 better look <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ {{{</span> </td> </tr> <tr> <td> Line 759: </td> <td> Line 760: </td> </tr> <tr> <td> <span>-</span> fi </td> <td> <span>+</span> fi<span>}}}</span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-21 17:12:39maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 23: </td> <td> Line 23: </td> </tr> <tr> <td> <span>- SOURCE='/Volumes/physics_data/Ftp/MACCS_DATA/Raw'<br> -</span> CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/'${YEAR}'ir/' </td> <td> <span>+</span> CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/<span>Iridium/</span>'${YEAR}'ir/' </td> </tr> <tr> <td> Line 396: </td> <td> Line 395: </td> </tr> <tr> <td> <span>- cd $SOURCE/CD/${YEAR}ir/</span> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 403: </td> <td> Line 402: </td> </tr> <tr> <td> <span>- lcd $SOURCE/NA/${YEAR}ir/</span> </td> <td> <span>+ lcd $CDdir</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-08-21 15:47:26maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 14: </td> <td> Line 14: </td> </tr> <tr> <td> <span>-</span> Boston University MACCS Data Processing </td> <td> <span>+ 2004</span> Boston University MACCS Data Processing </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-21 15:03:50maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 2: </td> <td> Line 2: </td> </tr> <tr> <td> <span>-</span> # Last Modified 8/2<span>0</span>/07 by Erik Johnson </td> <td> <span>+</span> # Last Modified 8/2<span>1</span>/07 by Erik Johnson </td> </tr> <tr> <td> Line 28: </td> <td> Line 28: </td> </tr> <tr> <td> </td> <td> <span>+ CDIdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/CD/'${YEAR}'ir/'<br> + NAIdir='/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/NA/'${YEAR}'ir/'<br> + CDLdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/CD/'${YEAR}'ir/'<br> + NALdir='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/NA/'${YEAR}'ir/'</span> </td> </tr> <tr> <td> Line 77: </td> <td> Line 81: </td> </tr> <tr> <td> <span>- cd $SOURCE/CD/${YEAR}ir/<br> - </span> </td> <td> </td> </tr> <tr> <td> Line 80: </td> <td> Line 82: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 82: </td> <td> Line 85: </td> </tr> <tr> <td> </td> <td> <span>+ P6DAYPROB=0<br> + elif [ -f "Problem_Data/CD${YY}${P6DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P6DAYPROB=1<br> + P6DAYSIZE=`stat -f "%z" CD${YY}${P6DAY}.dat`</span> </td> </tr> <tr> <td> Line 85: </td> <td> Line 93: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 87: </td> <td> Line 96: </td> </tr> <tr> <td> </td> <td> <span>+ P5DAYPROB=0<br> + elif [ -f "Problem_Data/CD${YY}${P5DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P5DAYPROB=1<br> + P5DAYSIZE=`stat -f "%z" CD${YY}${P5DAY}.dat`</span> </td> </tr> <tr> <td> Line 90: </td> <td> Line 104: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 92: </td> <td> Line 107: </td> </tr> <tr> <td> </td> <td> <span>+ P4DAYPROB=0<br> + elif [ -f "Problem_Data/CD${YY}${P4DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P4DAYPROB=1<br> + P4DAYSIZE=`stat -f "%z" CD${YY}${P4DAY}.dat`</span> </td> </tr> <tr> <td> Line 95: </td> <td> Line 115: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 97: </td> <td> Line 118: </td> </tr> <tr> <td> </td> <td> <span>+ P3DAYPROB=0<br> + elif [ -f "Problem_Data/CD${YY}${P3DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P3DAYPROB=1<br> + P3DAYSIZE=`stat -f "%z" CD${YY}${P3DAY}.dat`</span> </td> </tr> <tr> <td> Line 100: </td> <td> Line 126: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 102: </td> <td> Line 129: </td> </tr> <tr> <td> </td> <td> <span>+ P2DAYPROB=0<br> + elif [ -f "Problem_Data/CD${YY}${P2DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P2DAYPROB=1<br> + P2DAYSIZE=`stat -f "%z" CD${YY}${P2DAY}.dat`</span> </td> </tr> <tr> <td> Line 105: </td> <td> Line 137: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir</span> </td> </tr> <tr> <td> Line 107: </td> <td> Line 140: </td> </tr> <tr> <td> </td> <td> <span>+ PDAYPROB=0<br> + elif [ -f "Problem_Data/CD${YY}${PDAY}.dat" ]; then<br> + cd Problem_Data/<br> + PDAYPROB=1<br> + PDAYSIZE=`stat -f "%z" CD${YY}${PDAY}.dat`</span> </td> </tr> <tr> <td> Line 112: </td> <td> Line 150: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ "$P6DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 121: </td> <td> Line 163: </td> </tr> <tr> <td> <span>- cd $CDdir</span> </td> <td> </td> </tr> <tr> <td> Line 138: </td> <td> Line 179: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P6DAYPROB" = 1 ]; then<br> + cd $CDAdir<br> + mv CD${YY}${P6DAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${P6DAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${P6DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 142: </td> <td> Line 191: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ "$P5DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 151: </td> <td> Line 204: </td> </tr> <tr> <td> <span>- cd $CDdir</span> </td> <td> </td> </tr> <tr> <td> Line 168: </td> <td> Line 220: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P5DAYPROB" = 1 ]; then<br> + cd $CDAdir<br> + mv CD${YY}${P5DAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${P5DAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${P5DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 172: </td> <td> Line 232: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ "$P4DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 181: </td> <td> Line 245: </td> </tr> <tr> <td> <span>- cd $CDdir</span> </td> <td> </td> </tr> <tr> <td> Line 198: </td> <td> Line 261: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P4DAYPROB" = 1 ]; then<br> + cd $CDAdir<br> + mv CD${YY}${P4DAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${P4DAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${P4DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 202: </td> <td> Line 273: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ "$P3DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 211: </td> <td> Line 286: </td> </tr> <tr> <td> <span>- cd $CDdir</span> </td> <td> </td> </tr> <tr> <td> Line 228: </td> <td> Line 302: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P3DAYPROB" = 1 ]; then<br> + cd $CDAdir<br> + mv CD${YY}${P3DAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${P3DAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${P3DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 232: </td> <td> Line 314: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ "$P2DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 241: </td> <td> Line 327: </td> </tr> <tr> <td> <span>- cd $CDdir</span> </td> <td> </td> </tr> <tr> <td> Line 258: </td> <td> Line 343: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P2DAYPROB" = 1 ]; then<br> + cd $CDAdir<br> + mv CD${YY}${P2DAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${P2DAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${P2DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 262: </td> <td> Line 355: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ "$PDAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 271: </td> <td> Line 368: </td> </tr> <tr> <td> <span>- cd $CDdir</span> </td> <td> </td> </tr> <tr> <td> Line 288: </td> <td> Line 384: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$PDAYPROB" = 1 ]; then<br> + cd $CDAdir<br> + mv CD${YY}${PDAY}.dat Problem_Data/<br> + cd $CDIdir<br> + mv CD${YY}${PDAY}.dat Problem_Data/<br> + cd $CDLdir<br> + mv cd${YY}${PDAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 297: </td> <td> Line 401: </td> </tr> <tr> <td> <span>- </span> </td> <td> </td> </tr> <tr> <td> Line 300: </td> <td> Line 403: </td> </tr> <tr> <td> <span>- #get CD${YY}${NDAY}.dat<br> - </span> </td> <td> </td> </tr> <tr> <td> Line 305: </td> <td> Line 406: </td> </tr> <tr> <td> <span>- #get NA${YY}${NDAY}.dat<br> - </span> </td> <td> </td> </tr> <tr> <td> Line 348: </td> <td> Line 447: </td> </tr> <tr> <td> <span>- cd $SOURCE/NA/${YEAR}ir/<br> - <br> - #Get the sizes of our NA files if they exits</span> </td> <td> <span>+ #Get the sizes of our NA files if they exits and test if the data is in the Problem_Data folder<br> + cd $NAdir</span> </td> </tr> <tr> <td> Line 353: </td> <td> Line 451: </td> </tr> <tr> <td> </td> <td> <span>+ P6DAYPROB=0<br> + elif [ -f "Problem_Data/NA${YY}${P6DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P6DAYPROB=1<br> + P6DAYSIZE=`stat -f "%z" NA${YY}${P6DAY}.dat`</span> </td> </tr> <tr> <td> Line 356: </td> <td> Line 459: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir</span> </td> </tr> <tr> <td> Line 358: </td> <td> Line 462: </td> </tr> <tr> <td> </td> <td> <span>+ P5DAYPROB=0<br> + elif [ -f "Problem_Data/NA${YY}${P5DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P5DAYPROB=1<br> + P5DAYSIZE=`stat -f "%z" NA${YY}${P5DAY}.dat`</span> </td> </tr> <tr> <td> Line 361: </td> <td> Line 470: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir</span> </td> </tr> <tr> <td> Line 363: </td> <td> Line 473: </td> </tr> <tr> <td> </td> <td> <span>+ P4DAYPROB=0<br> + elif [ -f "Problem_Data/NA${YY}${P4DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P4DAYPROB=1<br> + P4DAYSIZE=`stat -f "%z" NA${YY}${P4DAY}.dat`</span> </td> </tr> <tr> <td> Line 366: </td> <td> Line 481: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir</span> </td> </tr> <tr> <td> Line 368: </td> <td> Line 484: </td> </tr> <tr> <td> </td> <td> <span>+ P3DAYPROB=0<br> + elif [ -f "Problem_Data/NA${YY}${P3DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P3DAYPROB=1<br> + P3DAYSIZE=`stat -f "%z" NA${YY}${P3DAY}.dat`</span> </td> </tr> <tr> <td> Line 371: </td> <td> Line 492: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir</span> </td> </tr> <tr> <td> Line 373: </td> <td> Line 495: </td> </tr> <tr> <td> </td> <td> <span>+ P2DAYPROB=0<br> + elif [ -f "Problem_Data/NA${YY}${P2DAY}.dat" ]; then<br> + cd Problem_Data/<br> + P2DAYPROB=1<br> + P2DAYSIZE=`stat -f "%z" NA${YY}${P2DAY}.dat`</span> </td> </tr> <tr> <td> Line 376: </td> <td> Line 503: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir</span> </td> </tr> <tr> <td> Line 378: </td> <td> Line 506: </td> </tr> <tr> <td> </td> <td> <span>+ PDAYPROB=0<br> + elif [ -f "Problem_Data/NA${YY}${PDAY}.dat" ]; then<br> + cd Problem_Data/<br> + PDAYPROB=1<br> + PDAYSIZE=`stat -f "%z" NA${YY}${PDAY}.dat`</span> </td> </tr> <tr> <td> Line 383: </td> <td> Line 516: </td> </tr> <tr> <td> <span>- </span> </td> <td> </td> </tr> <tr> <td> Line 385: </td> <td> Line 517: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir<br> + if [ "$P6DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 410: </td> <td> Line 546: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P6DAYPROB" = 1 ]; then<br> + cd $NAAdir<br> + mv NA${YY}${P6DAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${P6DAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${P6DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 414: </td> <td> Line 558: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir<br> + if [ "$P5DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 439: </td> <td> Line 587: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P5DAYPROB" = 1 ]; then<br> + cd $NAAdir<br> + mv NA${YY}${P5DAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${P5DAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${P5DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 443: </td> <td> Line 599: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir<br> + if [ "$P4DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 468: </td> <td> Line 628: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P4DAYPROB" = 1 ]; then<br> + cd $NAAdir<br> + mv NA${YY}${P4DAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${P4DAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${P4DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 472: </td> <td> Line 640: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir<br> + if [ "$P3DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 497: </td> <td> Line 669: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P3DAYPROB" = 1 ]; then<br> + cd $NAAdir<br> + mv NA${YY}${P3DAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${P3DAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${P3DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 501: </td> <td> Line 681: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir<br> + if [ "$P2DAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 526: </td> <td> Line 710: </td> </tr> <tr> <td> </td> <td> <span>+ if [ "$P2DAYPROB" = 1 ]; then<br> + cd $NAAdir<br> + mv NA${YY}${P2DAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${P2DAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${P2DAY}.ps Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 530: </td> <td> Line 722: </td> </tr> <tr> <td> </td> <td> <span>+ cd $NAdir<br> + if [ "$PDAYPROB" = 1 ]; then<br> + cd Problem_Data/<br> + fi</span> </td> </tr> <tr> <td> Line 555: </td> <td> Line 751: </td> </tr> <tr> <td> <span>- fi<br> - fi</span> </td> <td> <span>+ if [ "$PDAYPROB" = 1 ]; then<br> + cd $NAAdir<br> + mv NA${YY}${PDAY}.dat Problem_Data/<br> + cd $NAIdir<br> + mv NA${YY}${PDAY}.dat Problem_Data/<br> + cd $NALdir<br> + mv na${YY}${PDAY}.ps Problem_Data/<br> + fi<br> + fi<br> + fi</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-08-20 19:28:10maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 2: </td> <td> Line 2: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + MACCS Iridium Data Processing At Augsburg<br> + <br> + *The shell script used to download and process the raw data files<br> + ["ftpsri.sh"]<br> + *The idl program used to make Augsburg format ASCII files<br> + ["IridiumMaccs2.pro"]<br> + *The idl program used to make IAGA2000 format ASCII files<br> + ["IridiumMaccs3.pro"]<br> + *The idl program used to make line plots<br> + ["linex7.pro"]<br> + <br> + Boston University MACCS Data Processing</span> </td> </tr> </table> </div> linex7.prohttp://maccs.wikispot.org/linex7.pro2007-08-20 19:16:06maccs <div id="content" class="wikipage content"> Differences for linex7.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ PRO linex7,inFil,startHou,startMinut,startSecon,endHou,endMinut,endSecon,sit,forma,sequentia,postscrip,bxmi,bxma,bymi,byma,bzmi,bzma,tic,intervalHou,intervalMinut,intervalSecon<br> + <br> + ;This program is run by ftpsri.sh at :00, :15, :30, and :45 past every hour of every day.<br> + ;It inputs Augsburg format ASCII files and creates line plots of the raw MACCS Iridium data.<br> + <br> + ;This program modified by Jake Kern and Ryan Cobian 6/2/99<br> + ; MODIFIED BY Mark Engebretson July 14, 2004 for Y2K and huge data files.<br> + ; MODIFIED BY Michael Murphy August 1, 2007 to include Nain and Cape Dorset accomidations<br> + ; MODIFIED BY Jesse Docken August 16, 2007 to make it command-line friendly<br> + ; MODIFIED BY Erik Johnson August 17, 2007 to fix some minor bugs<br> + <br> + common aa, idoc,lenh,issec,dtime,x,y,z<br> + common bb,MINVALx,MINVALy,MINVALz,MAXVALx,MAXVALy,MAXVALz<br> + common cc,esca<br> + common dd,inFile,startHour,startMinute,startSecond,endHour,endMinute,endSecond,site,format,sequential,postscript,bxmin,bxmax,bymin,bymax,bzmin,bzmax,tick,intervalHour,intervalMinute,intervalSecond<br> + inFile = inFil<br> + startHour = startHou<br> + startMinute = startMinut<br> + startSecond = startSecon<br> + endHour = endHou<br> + endMinute = endMinut<br> + endSecond = endSecon<br> + site = sit<br> + format = forma<br> + sequential = sequentia<br> + postscript = postscrip<br> + bxmin = bxmi<br> + bxmax = bxma<br> + bymin = bymi<br> + bymax = byma<br> + bzmin = bzmi<br> + bzmax = bzma<br> + tick = tic<br> + intervalHour = intervalHou<br> + intervalMinute = intervalMinut<br> + intervalSecond = intervalSecon<br> + IDOC = LONARR(24)<br> + <br> + SETUP,IDATUNIT,lab<br> + <br> + END<br> + <br> + <br> + PRO SETUP,IDATUNIT,lab<br> + common aa;, idoc,lenh,issec,dtime,x,y,z<br> + common bb;,MINVALx,MINVALy,MINVALz,MAXVALx,MAXVALy,MAXVALz,tick<br> + common cc;,esca<br> + common dd;,inFile,startHour,startMinute,startSecond,endHour,endMinute,endSecond,site,format,sequential,postscript,bxmin,bxmax,bymin,bymax,bzmin,bzmax,tick,intervalHour,intervalMinute,intervalSecond<br> + <br> + ;IDATFILNM = ''<br> + <br> + <br> + ;This first widget allows user to specify time range of plot<br> + ;and it contains an option for sequential plotting and an option<br> + ;an option for postcripts.<br> + PRINT,' Lineplot Input Routine'<br> + PRINT,' '<br> + <br> + ;desc = [ $<br> + ; '0, Label, Lineplot Routine, center', $<br> + <br> + ; '1, Base,, Row', $<br> + ; '0, integer,0, Label_left = Start Hour:, width=3, tag=hour', $<br> + ; '2, integer,0, Label_left = Start Minute:, width=3, tag=iminute', $<br> + ; '1, Base,, Row', $<br> + ; '0, integer,24, Label_left = End Hour:, width=3, tag=endhour', $<br> + ; '2, integer,0, Label_left = End Minute:, width=3,column, tag=endminute', $<br> + ; '1, Base,, Row', $<br> + ; '0, bUTTON, Asci|Raw Binary|Clean Binary, Frame, Label_Top=File Type,exclusive,set_value=0, tag=bin', $<br> + ; '2, button, Single File|Multiple Files, Label_Top=Files, exclusive, set_value=0, frame, tag=filnum',$<br> + ; '1, Base,, Row', $<br> + ; '0, button, No|Yes,Frame,Label_Top=Sequential Plots, exclusive, set_value=0,tag=seq',$<br> + ; '1, Base,,Row',$<br> + ; '0, button, No|Yes,Frame,Label_Top=Postscripts, exclusive, set_value=1, tag=pst',$<br> + ; '1, Base,, Row', $<br> + ; '0, Button, OK, Quit , tag = ok', $<br> + <br> + ; '2, Button, Cancel, quit, tag=endsetup']<br> + ;atitle='Lineplot INPUT'<br> + <br> + ; a=cw_form(desc, /column,title= atitle)<br> + ; if (a.endsetup eq 1) then begin<br> + ; goto, endsetup<br> + ; endif<br> + <br> + esca=1<br> + ; bin=format<br> + ; seq=sequential<br> + ; pst=postscript<br> + ; ihour=startHour<br> + ; imin=startMinute<br> + issec= 0.0<br> + ISSEC = ((startHour*3600) + (startMinute*60))<br> + <br> + endhour=endHour<br> + endminute=endMinute<br> + lenh=0.0<br> + lenh=(endhour +(endminute/60.)) - (issec/3600.)<br> + <br> + tick = 12 ;First plot always contains 12 ticks<br> + minvalx =''<br> + minvaly ='' ;x,y,and z min and max values are null to start(they are autoscaled).<br> + minvalz =''<br> + maxvalx =''<br> + maxvaly =''<br> + maxvalz =''<br> + <br> + ;idatfil= findfile('/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/2007ir/*.*')<br> + endi=size(idatfil)<br> + if 1 eq 1 then begin<br> + ; idatfilnm=dialog_pickfile (path='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/2007ir/')<br> + <br> + <br> + OPENR,IDATUNIT,inFile,/GET_LUN<br> + DATREAD,IDATUNIT,PREV,lab<br> + free_lun,IDATUNIT<br> + <br> + esc = 1<br> + <br> + IF sequential eq 0 then begin<br> + <br> + WHILE esc ge 1 DO BEGIN<br> + DPLOT,PWR,TIMER,LAB<br> + free_lun,IDATUNIT<br> + ;This widget appears if user does not select sequential<br> + ;plotting. x,y,and z min and max values as well as the<br> + ;time range and number of ticks can be set manually.<br> + ;desc = [ $<br> + ; '0, Label, Lineplot Routine, center', $<br> + <br> + ; '1, Base,, Row', $<br> + ; '0, float,0, Label_left = Start Hour:, width=3, tag=hour', $<br> + ; '2, integer,0, Label_left = Start Minute:, width=3, tag=iminute', $<br> + ; '1, Base,, Row', $<br> + ; '0, float,24, Label_left = End Hour:, width=3, tag=endhour', $<br> + ; '2, integer,10, Label_left = End Minute:, width=3,column, tag=endminute', $<br> + ; '1, Base,, Row', $<br> + ; '0, text,, Label_left = BXmin:, width=4,tag=bxmin',$<br> + ; '2, text,, Label_left = BXmax:, width=4, tag=bxmax',$<br> + ; '1, Base,,Row',$<br> + ; '0, text,,Label_left = BYmin:, width=4, tag=bymin',$<br> + ; '2, text,, Label_left = BYmax:, width=4, tag=bymax',$<br> + ; '1, Base,,Row',$<br> + ; '0, text,,Label_left = BZmin:, width=4, tag=bzmin',$<br> + ; '2, text,, Label_left = BZmax:, width=4, tag=bzmax',$<br> + ; '1, Base,,Row',$<br> + ; '0, integer,5, Label_left = Xticks:, width=4, tag=tick',$<br> + ; '1, Base,,Row',$<br> + <br> + <br> + ; '0, Button, OK, Quit , tag = ok', $<br> + <br> + ; '2, Button, Quit, quit, tag=endsetup']<br> + <br> + <br> + <br> + ;atitle='Lineplot INPUT'<br> + <br> + ; a=cw_form(desc, /column,title= atitle)<br> + ; if (a.endsetup eq 1) then begin<br> + ; goto, endsetup<br> + ; endif<br> + <br> + esca=1<br> + ; intvlhr=0<br> + ; intervalMinute=0<br> + ; intvlsec=0<br> + esc=1<br> + <br> + ; ihour=startHour<br> + ; imin=startMinute<br> + issec= 0.0<br> + ISSEC = ((startHour*3600) + (startMinute*60))<br> + <br> + endhour=endHour<br> + endminute=endMinute<br> + lenh=0.0<br> + lenh=(endhour +(endminute/60.)) - (issec/3600.)<br> + MINVALx = bxmin<br> + MAXVALx = bxmax<br> + MINVALy = bymin ;Here x,y,z min and max values can be set manually in widget.<br> + MAXVALy = bymax<br> + MINVALz = bzmin<br> + MAXVALz = bzmax<br> + tick = tick<br> + ENDWHILE<br> + <br> + endif else begin<br> + ;This widget appears if the user chooses sequential<br> + ;plotting. A start and end time is chosen and an interval<br> + ;is selected(interval can be as small as one second).<br> + free_lun,IDATUNIT<br> + <br> + ;desc = [ $<br> + ; '0, Label, Lineplot Routine, center', $<br> + <br> + ; '1, Base,, Row', $<br> + ; '0, float,0, Label_left = Start Hour:, width=3, tag=hour', $<br> + ; '2, integer,0, Label_left = Start Minute:, width=3, tag=iminute', $<br> + ; '4, integer,0, Label_left = Start Second:, width=3, tag=isecond', $<br> + ; '1, Base,, Row', $<br> + ; '0, float,24, Label_left = End Hour:, width=3, tag=endhour', $<br> + ; '2, integer,0, Label_left = End Minute:, width=3, tag=endminute', $<br> + ; '4, integer,0, Label_left = End Second:, width=3, tag=endsecond', $<br> + ; '1, Base,, Row', $<br> + ; '0, text,, Label_left = BXmin:, width=4,tag=bxmin',$<br> + ; '2, text,, Label_left = BXmax:, width=4, tag=bxmax',$<br> + ; '1, Base,,Row',$<br> + ; '0, text,,Label_left = BYmin:, width=4, tag=bymin',$<br> + ; '2, text,, Label_left = BYmax:, width=4, tag=bymax',$<br> + ; '1, Base,,Row',$<br> + ; '0, text,,Label_left = BZmin:, width=4, tag=bzmin',$<br> + ; '2, text,, Label_left = BZmax:, width=4, tag=bzmax',$<br> + ; '1, Base,,Row',$<br> + ; '0, integer,8, Label_left = Xticks:, width=3, tag=tick',$<br> + ; '1, Base,,Row',$<br> + ; '0, integer,0, Label_left = Interval(mins), width=3, tag=intvlmin', $<br> + ; '2, integer,0, Label_left = Interval(secs), width=3,tag=intvlsec',$<br> + ; '4, integer,0, Label_left = Interval(hours), width=3, tag=intvlhr',$<br> + ; '1, Base,, Row', $<br> + ; '0, Button, OK|Quit, Frame, Label_Top=Graph,exclusive,set_value=1, tag=esca', $<br> + ; '1, Base,,Row',$<br> + ; '0, Button, OK, Quit , tag = ok']<br> + <br> + <br> + <br> + <br> + ;atitle='Lineplot INPUT'<br> + <br> + ; a=cw_form(desc, /column,title= atitle)<br> + ;esca=0<br> + ;intvlhr=0<br> + ;intvlmin=0<br> + ;intvlsec=0<br> + ;esca=a.esca<br> + ;intvlhr=a.intvlhr<br> + ;intvlmin=a.intvlmin<br> + ;intvlsec=a.intvlsec<br> + ;isecond=a.isecond<br> + ;endsecond=a.endsecond<br> + ;ihour=startHour<br> + ;imin=startMinute<br> + issec= 0.0<br> + ISSEC = ((startHour*3600) + (startMinute*60))+startSecond<br> + <br> + ; endhour=endHour<br> + ; endminute=endMinute<br> + lenh=0.0<br> + lenh=(endhour +(endminute/60.)+(endSecond/3600.)) - (issec/3600.)<br> + MINVALx = BXmin<br> + MAXVALx = BXmax<br> + MINVALy = BYmin ;Here x,y,z min and max values can be set manually in widget.<br> + MAXVALy = BYmax<br> + MINVALz = BZmin<br> + MAXVALz = BZmax<br> + ; tick = tick<br> + <br> + DPLOT,PWR,TIMER,LAB<br> + endelse<br> + <br> + endif else begin<br> + for i=2, endi(3)-1 do begin<br> + <br> + inFile=idatfil(i)<br> + <br> + OPENR,IDATUNIT,inFile,/GET_LUN<br> + DATREAD,IDATUNIT,PREV,lab<br> + free_lun,IDATUNIT<br> + DPLOT,PWR,TIMER,LAB<br> + free_lun,IDATUNIT<br> + <br> + endfor<br> + endelse<br> + endsetup:<br> + END<br> + <br> + <br> + <br> + PRO DATREAD,IDATUNIT,PREV,lab<br> + common aa;, idoc,lenh,issec,dtime,x,y,z<br> + common bb;,MINVALx,MINVALy,MINVALz,MAXVALx,MAXVALy,MAXVALz,tick<br> + common cc;,esca<br> + common dd;,inFile,startHour,startMinute,startSecond,endHour,endMinute,endSecond,site,format,sequential,postscript,bxmin,bxmax,bymin,bymax,bzmin,bzmax,tick,intervalHour,intervalMinute,intervalSecond<br> + if format ne 0 then begin<br> + <br> + ; set the keyword raw to 1 for raw maccs and to 2 for raw gsc<br> + <br> + ; x and y are the byte dimensions of the file. The order for the different<br> + <br> + ; types is raw maccs, raw gsc, cleaned maccs, cleaned gsc, 5 sec, and 1 min<br> + ; (the raw files do not have fixed length)<br> + <br> + x = [35, 21, 28, 15, 15, 14]<br> + y = [00, 00, 86400L, 86400L, 17280L, 1440L]<br> + sizes = [00, 00, 2419200L, 1296000L, 259200L, 20160L]<br> + if format eq 1 then raw=1 else raw = 0<br> + ; Open file and get file size<br> + <br> + ;This section determines file name and year/day from the binary file's name<br> + dottest= ' '<br> + dotcount=0<br> + While dottest ne "." do begin<br> + dottest= strmid(inFile, dotcount,1)<br> + dotcount=dotcount+1<br> + <br> + endwhile<br> + if raw eq 1 then begin<br> + print,"It's raw, I'm going in..."<br> + ;statcode= strmid(inFile, dotcount-5, 2)<br> + statcode = strmid(strlowcase(inFile), 0, 2)<br> + print,format="(%'I\'ve found a statcode, it appears to be... %s.')", statcode<br> + ;year= strmid(inFile, dotcount-3, 2)<br> + year = strmid(inFile, 2, 2)<br> + print,format="(%'Got a year here, looks like %s.')",year<br> + ;day= strmid(inFile, dotcount, 3)<br> + day = strmid(inFile, 4, 3)<br> + print,format="(%'Found a day, it\'s %s.')",day<br> + idoc(4)= 0L<br> + iyr=0L<br> + idy=0L<br> + ;print, statcode, 'STAT', year, 'year', day, 'day'<br> + iyr=float(year)<br> + idy=float(day)<br> + idoc(4)= (iyr*1000+idy)<br> + endif else begin<br> + statcode=strmid(inFile, dotcount-8, 2)<br> + idoc(4)=float(strmid(inFile, dotcount-6, 5))<br> + endelse<br> + ;print, idoc(4), 'idoc4'<br> + CASE statcode of<br> + 'na': idoc(3)=[122]<br> + 'pg': idoc(3)=[111]<br> + 'cy': idoc(3)=[112]<br> + 'iq': idoc(3)=[117]<br> + 'cd': idoc(3)=[104]<br> + 'ig': idoc(3)=[109]<br> + 'ch': idoc(3)=[103]<br> + 'rb': idoc(3)=[118]<br> + 'pb': idoc(3)=[116]<br> + 'gh': idoc(3)=[110]<br> + 're': idoc(3)=[119]<br> + 'cb': idoc(3)=[120]<br> + 'bl': idoc(3)=[121]<br> + 'ca': idoc(3)=[301]<br> + <br> + <br> + <br> + ELSE : begin ;unknown station<br> + print,'Unacceptable Station Code'<br> + <br> + ENDELSE<br> + endcase<br> + <br> + <br> + unit=idatunit<br> + <br> + file_info = fstat(unit)<br> + file_size = file_info.size<br> + <br> + print,file_size<br> + <br> + if keyword_set(raw) then begin<br> + type = raw - 1<br> + if raw eq 1 then y(0) = file_size / x(0)<br> + if raw eq 2 then y(1) = file_size / x(1)<br> + endif else begin<br> + type = where(file_size eq sizes, count)<br> + ;print,type<br> + if count eq 0 then begin<br> + ;print,'Error in file size.'<br> + stop<br> + endif else type = type(0)<br> + endelse<br> + <br> + <br> + print,'Now processing ';,filename<br> + data_array = bytarr(x(type),y(type))<br> + readu,unit,data_array<br> + <br> + <br> + offset = [3, 2, 1, 0, 0, 0]<br> + <br> + hh = data_array(offset(type) + 0,*)<br> + mm = data_array(offset(type) + 1,*)<br> + offset(5) = -1<br> + bx1 = long(data_array(offset(type) + 3:offset(type) + 6,*),0,1,y(type))/1000.<br> + by1 = long(data_array(offset(type) + 7:offset(type) + 10,*),0,1,y(type))/1000.<br> + bz1 = long(data_array(offset(type) + 11:offset(type) + 14,*),0,1,y(type))/1000.<br> + <br> + case type of<br> + 5: ss = 0<br> + 4: ss = data_array(2,*) ; 5 sec<br> + 3: ss = data_array(2,*) ; gsc clean<br> + 2: begin ; maccs clean<br> + tf1 = data_array(0,*)<br> + ss = data_array(3,*)<br> + bx1 = long(data_array(04:07,*),0,1,y(type))/1000.<br> + bx2 = long(data_array(08:11,*),0,1,y(type))/1000.<br> + by1 = long(data_array(12:15,*),0,1,y(type))/1000.<br> + by2 = long(data_array(16:19,*),0,1,y(type))/1000.<br> + bz1 = long(data_array(20:23,*),0,1,y(type))/1000.<br> + bz2 = long(data_array(24:27,*),0,1,y(type))/1000.<br> + end<br> + 1: begin ; gsc raw<br> + dd = fix (data_array( 0: 1,*),0,1,y(type))<br> + ss = data_array(4,*)<br> + end<br> + 0: begin ; maccs raw<br> + header= data_array( 0,*)<br> + dd = fix (data_array( 1: 2,*),0,1,y(type))<br> + ss = data_array(5,*)<br> + bx2 = long(data_array(18:21,*),0,1,y(type))/1000.<br> + by2 = long(data_array(22:25,*),0,1,y(type))/1000.<br> + bz2 = long(data_array(26:29,*),0,1,y(type))/1000.<br> + tf1 = data_array(30,*)<br> + tf2 = data_array(31,*)<br> + block = data_array(32,*)<br> + status= data_array(33,*)<br> + house = data_array(34,*)<br> + end<br> + endcase<br> + <br> + <br> + bx1=extrac(bx1,0,1,1,86400)<br> + bx2=extrac(bx2,0,1,1,86400)<br> + <br> + by1=extrac(by1,0,1,1,86400)<br> + by2=extrac(by2,0,1,1,86400)<br> + <br> + bz1=extrac(bz1,0,1,1,86400)<br> + bz2=extrac(bz2,0,1,1,86400)<br> + <br> + n=findgen(file_size/x(type))<br> + nstep=n<br> + n=n*2<br> + x=fltarr(172800L)<br> + y=x<br> + z=x<br> + <br> + x[n]=Bx1[nstep+50]<br> + x[n+1]= bx2[nstep+50]<br> + <br> + y[n]=By1[nstep+50]<br> + y[n+1]=By2[nstep+50]<br> + <br> + z[n]=Bz1[nstep+50]<br> + z[n+1]=Bz2[nstep+50]<br> + <br> + timeX = hh*3600. + mm*60. + ss<br> + timex=extrac(timex,0,1,1,86400)<br> + Dtime=dblarr(172800)<br> + Dtime[n]=timex[nstep+50]- 0.75<br> + Dtime[n+1]= timex[nstep+50]- 0.250<br> + <br> + endif<br> + <br> + if format eq 0 then begin<br> + <br> + BAD = 32767<br> + TIME = FINDGEN(50)<br> + <br> + LABEL = ''<br> + <br> + <br> + READF,idatunit, format = '(12(i8),/,12(i8))', IDOC<br> + READF,IDATUNIT,format = '(a)', LABEL<br> + PRINT, 'LABEL = ', LABEL<br> + lab=label<br> + <br> + DTIME = fltARR(900000)<br> + dtime2=dtime<br> + X = FLTARR(900000)<br> + Y = X<br> + Z = X<br> + I=0L<br> + WHILE (NOT EOF (IDATUNIT)) DO BEGIN<br> + ;readf,IDATUNIT,format='(f15, 3(f12))' ,FTIME,FX,FY,FZ ;formats A80 Fluxgate<br> + ;readf,IDATUNIT,format='(g15, 3(g12))' ,FTIME,FX,FY,FZ ;formats Sondy search coil<br> + readf,IDATUNIT ,FTIME,FX,FY,FZ<br> + <br> + DTIME(I)= FTIME<br> + X(I)= FX<br> + Y(I) = FY<br> + Z(I) = FZ<br> + <br> + ;print, 'ftime, fx, fy, fz = ', ftime, fx, fy, fz<br> + <br> + I=I+1<br> + <br> + ENDWHILE<br> + ;DTIME=FLTARR(I)<br> + ;X=DTIME<br> + ;Y=DTIME<br> + ;Z=DTIME<br> + <br> + ;DTIME=EXTRAC(DDTIME,0,I)<br> + ;X=EXTRAC(XX,0,I)<br> + ;Y=EXTRAC(YY,0,I)<br> + ;Z=EXTRAC(ZZ,0,I)<br> + <br> + <br> + <br> + endif<br> + <br> + end<br> + <br> + <br> + PRO DPLOT,PWR,TIMER,LAB<br> + common aa;, idoc,lenh,issec,dtime,x,y,z<br> + common bb;,MINVALx,MINVALy,MINVALz,MAXVALx,MAXVALy,MAXVALz,tick<br> + common cc;,esca<br> + common dd;,inFile,startHour,startMinute,startSecond,endHour,endMinute,endSecond,site,format,sequential,postscript,bxmin,bxmax,bymin,bymax,bzmin,bzmax,tick,intervalHour,intervalMinute,intervalSecond<br> + <br> + ; MENU = ['','']<br> + TLAB = ''<br> + <br> + CASE idoc(3) OF<br> + 0: sitename='IRM Data'<br> + 101: sitename='PANGNIRTUNG'<br> + 112: sitename='CLYDE RIVER'<br> + 117: sitename='IQALUIT'<br> + 104: sitename='CAPE DORSET'<br> + 109: sitename='IGLOOLIK'<br> + 103: sitename='CORAL HARBOUR'<br> + 118: sitename='REPULSE BAY'<br> + <br> + 116: sitename='PELLY BAY'<br> + 110: sitename='GJOA HAVEN'<br> + 119: sitename='RESOLUTE BAY'<br> + 120: sitename='CAMBRIDGE BAY'<br> + 121: sitename='BAKER LAKE'<br> + 122: sitename='NAIN'<br> + <br> + 201: sitename='AGO P1'<br> + 202: sitename='AGO P2'<br> + 203: sitename='AGO P3'<br> + 204: sitename='AGO P4'<br> + 205: sitename='AGO P5'<br> + 206: sitename='AGO P6'<br> + 15: sitename='Sondrestromfjord'<br> + 16: sitename='South Pole'<br> + <br> + 277: sitename='AGO A77'<br> + 276: sitename='Halley'<br> + 280: sitename='AGO A80'<br> + 281: sitename='AGO A81'<br> + 284: sitename='AGO A84'<br> + 301: sitename='Cambridge'<br> + <br> + <br> + 1: sitename='Air Force Academy'<br> + 3: sitename='Jicamarca'<br> + 4: sitename='Los Alamos '<br> + 5: sitename='San Gabriel '<br> + <br> + 300: sitename='Korea'<br> + <br> + 700: sitename='Kotelnyy'<br> + 701: sitename='Tixie'<br> + 702: sitename='Chokurdakh'<br> + 703: sitename='Zyryanka'<br> + 704: sitename='Chichijima'<br> + 705: sitename='Ewa Beach'<br> + 706: sitename='St. Patatunka'<br> + 707: sitename='Lunping'<br> + 708: sitename='Muntinlupa'<br> + 709: sitename='Onagawa'<br> + 710: sitename='Popov Island'<br> + 711: sitename='Moshiri'<br> + <br> + 600: sitename='Fort Churchill'<br> + 601: sitename='Contwoyto Lake'<br> + 602: sitename='Dawson'<br> + 603: sitename='Eskimo Point'<br> + 604: sitename='Gillam'<br> + 605: sitename='Island Lake'<br> + 606: sitename='Fort McMurray'<br> + 607: sitename='Pinawa'<br> + 608: sitename='Rabbit Lake'<br> + 609: sitename='Rankin Inlet'<br> + 610: sitename='Fort Simpson'<br> + 611: sitename='Fort Smith'<br> + 612: sitename='Taloyoak'<br> + <br> + <br> + <br> + ELSE : begin ;unknown station<br> + PRINT,'Unknown Station. Enter the name of the station.'<br> + mentemp=' '<br> + READ, mentemp<br> + sitename= mentemp<br> + <br> + ENDELSE<br> + endcase<br> + <br> + YRDAY = IDOC(4)<br> + <br> + <br> + ; COMPOSE TITLE FOR PLOT<br> + print,YRDAY<br> + MMDD, YRDAY, MON, DAY, IYR<br> + <br> + YRDIVTH = YRDAY/1000<br> + <br> + IF YRDIVTH LE 80 THEN BEGIN<br> + IHEAD = STRING(FORMAT="(5X,'YEARDAY = ',I5,13X,A3,' ',I2,', 200',I1,' ')", $<br> + YRDAY,MON,DAY,IYR)<br> + ENDIF ELSE BEGIN<br> + IHEAD = STRING(FORMAT="(5X,'YEARDAY = ',I5,13X,A3,' ',I2,', 19',I2,' ')", $<br> + YRDAY,MON,DAY,IYR)<br> + ENDELSE<br> + IHEAD = sitename + IHEAD<br> + length=lenh<br> + T1 = issec / 3600.<br> + T2 = T1 + LENH<br> + syrday = STRING(FORMAT="(I05)", YRDAY)<br> + yrday = strmid(IYR,7,1)<br> + fnamelp= '/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/'+strupcase(site)+'/200'+yrday+'ir/'+site+syrday+'.ps'<br> + ;fnamelp= '~/'+site+syrday+'lp'+'.ps'<br> + set_plot, 'x'<br> + ; window,0,xpos=0,ypos=0,xsize=800,ysize=500<br> + !p.multi=[0,1,3]<br> + !x.style=1<br> + !x.margin=[10,10]<br> + !x.style=1<br> + !y.margin=[2,2]<br> + <br> + IF esca ne 0 then Begin<br> + <br> + ;plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> + ;xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Mag H',$<br> + ;xtickformat='xticks', ystyle=18<br> + ;!Y.TITLE = STRMID(LAB,63,4)<br> + ;plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> + ;xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='Mag H',$<br> + ;xtickformat='xticks', ystyle=18<br> + ;!Y.TITLE = STRMID(LAB,67,4)<br> + ;plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> + ;xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Mag H',$<br> + ;xtickformat='xticks', ystyle=18<br> + <br> + endif else begin ;This is the beginning of the sequential plotting loop.<br> + increment = intervalHour + (intervalMinute/60.) + (intervalSecond/3600.)<br> + testend = (t2-t1)/increment<br> + auto=0<br> + if minvalx eq '' then auto=1<br> + for test=0,testend-1 do begin<br> + <br> + t2= t1 + increment<br> + <br> + set_plot, 'win'<br> + window,0,xpos=0,ypos=0,xsize=800,ysize=500<br> + !p.multi=[0,1,3]<br> + !x.style=1<br> + !x.margin=[10,10]<br> + !x.style=1<br> + !y.margin=[2,2]<br> + timestep=dtime(1)-dtime(0)<br> + te1=t1*3600/timestep<br> + te2=t2*3600/timestep<br> + if auto eq 1 then begin<br> + minvalx=min(x(te1:te2)) ;This aids in autoscaling.<br> + maxvalx=max(x(te1:te2))<br> + minvaly=min(y(te1:te2))<br> + maxvaly=max(y(te1:te2))<br> + minvalz=min(z(te1:te2))<br> + maxvalz=max(z(te1:te2))<br> + endif<br> + plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> + xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$<br> + xtickformat='xticks', ystyle=18<br> + <br> + plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> + xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$<br> + xtickformat='xticks', ystyle=18<br> + <br> + plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> + xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$<br> + xtickformat='xticks', ystyle=18<br> + <br> + <br> + ;desc = [ $<br> + ; '0, Label, Lineplot Routine, center', $<br> + ; '1, Base,, Row', $<br> + ; '0, Button, NEXT, Quit , tag = ok', $<br> + <br> + ; '2, Button, QUIT, quit, tag=endprog']<br> + ;atitle='Lineplot INPUT'<br> + <br> + ; a=cw_form(desc, /column,title= atitle)<br> + <br> + ; if (a.endprog eq 1) then begin<br> + ; goto, endloop<br> + ; endif<br> + <br> + <br> + <br> + <br> + if (postscript eq 1) then begin<br> + seqnum= STRING(FORMAT="(I03)", test+1)<br> + <br> + fnameseq='/Volumes/physics_data/Ftp/MACCS_DATA/LinePlots/'+site+'/200'+IYR+'ir/'+site+syrday + strcompress(seqnum,/remove_all) +'.ps'<br> + set_plot, 'ps'<br> + device, filename=fnameseq,/landscape<br> + !p.multi=[0,1,3]<br> + <br> + !x.style=1<br> + !x.margin=[10,10]<br> + !x.style=1<br> + !y.margin=[2,2]<br> + <br> + <br> + plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> + xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Mag H',$<br> + xtickformat='xticks', ystyle=18<br> + ;!Y.TITLE = STRMID(LAB,63,4)<br> + plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> + xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='Mag z',$<br> + xtickformat='xticks', ystyle=18<br> + ;!Y.TITLE = STRMID(LAB,67,4)<br> + plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> + xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Mag H',$<br> + xtickformat='xticks', ystyle=18<br> + device, /close_file<br> + endif<br> + <br> + t1 = t1 + increment<br> + endfor<br> + endelse<br> + if (postscript eq 0) then begin<br> + goto, endprogram<br> + endif<br> + <br> + <br> + set_plot, 'ps'<br> + device, filename=fnamelp,/landscape<br> + !p.multi=[0,1,3]<br> + <br> + !x.style=1<br> + !x.margin=[10,10]<br> + !x.style=1<br> + !y.margin=[2,2]<br> + ;************U***This is the spot that controls titles for the postscript plots***********************<br> + <br> + plot,Dtime(where ((fix(x) ne 32767) and (x ne 0.0)))/3600,x(where((fix(x) ne 32767)and (x ne 0.0))),$<br> + xticks=tick,xrange = [t1,t2], yrange=[MINVALx,MAXVALx],title = ihead,charsize=2.0,ytitle='Bx',$<br> + xtickformat='xticks', xminor=5,ystyle=18<br> + ;!Y.TITLE = STRMID(LAB,63,4)<br> + plot,Dtime(where ((fix(y) ne 32767) and (y ne 0.0)))/3600,y(where((fix(y) ne 32767)and (y ne 0.0))),$<br> + xticks=tick,xrange = [t1,t2], charsize=2.0,yrange=[minvaly, maxvaly],ytitle='By',$<br> + xtickformat='xticks',xminor=5, ystyle=18<br> + ;!Y.TITLE = STRMID(LAB,67,4)<br> + plot,Dtime(where ((fix(z) ne 32767) and (z ne 0.0)))/3600,z(where((fix(z) ne 32767)and (z ne 0.0))),$<br> + xticks=tick, xrange = [t1,t2], charsize=2.0,yrange=[minvalz, maxvalz],ytitle='Bz',$<br> + xtickformat='xticks',xminor=5, ystyle=18<br> + device, /close_file<br> + endloop:<br> + endprogram:<br> + END<br> + <br> + <br> + <br> + <br> + PRO MMDD,YRDAY,MONTH,MNTHDA,IYR<br> + <br> + ; 11 NOV 85 S FAVIN<br> + ; GIVEN YRDAY LIKE 85199<br> + ; RETURNS WITH CHARACTER MONTH AND DAY NUMBER IN MONTH<br> + <br> + LEAPYR = [0,0,31,60,91,121,152,182,213,244,274,305,335,366]<br> + NOLEAP = [0,0,31,59,90,120,151,181,212,243,273,304,334,365]<br> + CHARM = ['','JAN','FEB','MAR','APR','MAY','JUN', $<br> + 'JUL','AUG','SEP','OCT','NOV','DEC']<br> + MONTH = ''<br> + <br> + IYEAR = FIX(YRDAY/1000)<br> + IDAY = FIX(YRDAY - IYEAR*1000)<br> + MON= FIX(IDAY/30+1)<br> + IF((IYEAR MOD 100) EQ 0) THEN GOTO, A366<br> + IF((IYEAR MOD 4) EQ 0) THEN GOTO, A366<br> + IF((IDAY-NOLEAP(MON)) LE 0) THEN MON = MON -1<br> + MNTHDA=IDAY-NOLEAP(MON)<br> + A365: MONTH = CHARM(MON)<br> + IYR=IYEAR<br> + RETURN<br> + A366: IF((IDAY-LEAPYR(MON)) LE 0) THEN MON = MON - 1<br> + MNTHDA=IDAY-LEAPYR(MON)<br> + GOTO, A365<br> + END<br> + <br> + function xticks, axis, index, value<br> + on_error,1<br> + <br> + if keyword_set(help) then begin<br> + helpdir = 'c:\rsi\idl40\help\user'<br> + helpfile = helpdir + '\xticks.txt'<br> + xdisplayfile, helpfile<br> + return, 0<br> + endif<br> + <br> + ;hour = fix(value+.5)<br> + hour = fix(value)<br> + if hour gt 23 then hour = hour -24<br> + min = fix(value*60. mod 60.)<br> + sec = fix(value*3600. mod 60. + .5)<br> + <br> + if sec eq 60 then begin<br> + sec = 0<br> + min = min + 1<br> + if min eq 60 then begin<br> + min = 0<br> + hour = hour+1<br> + endif<br> + endif<br> + if sec eq 0 then begin ;Seconds are not shown on time scale if they are zero.<br> + return, string(format = '(i2.2,":",i2.2)',hour,min)<br> + endif<br> + <br> + ;min = fix(value*60. mod 60. + .5)<br> + ;if min eq 60 then begin<br> + ; min = 0<br> + ; hour = hour+1<br> + ;endif<br> + ;sec = fix(value*3600. mod 60. + .5)<br> + ;if sec eq 60 then sec = 0<br> + return, string(format = '(i2.2,":",i2.2,":",i2.2)', hour, min, sec)<br> + end</span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-20 19:15:28maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>- {{{<br> -</span> # <span>W</span>r<span>it</span>te<span>n</span> by Erik Johnson July 2007<br> <span>-</span> # Last Modified 8/<span>13</span>/07<br> <span>-</span> # This program is run at :00, :15, :30, :45 of every hour of every day. </td> <td> <span>+</span> # <span>C</span>r<span>ea</span>te<span>d</span> by Erik Johnson July 2007<br> <span>+</span> # Last Modified 8/<span>20</span>/07<span>&nbsp;by Erik Johnson</span><br> <span>+</span> # This program is run at :00, :15, :30, :45 of every hour of every day<span>&nbsp;by the maccs user crontab</span>. </td> </tr> <tr> <td> Line 6: </td> <td> Line 5: </td> </tr> <tr> <td> <span>- <br> - SOURCE='/Volumes/physics_data/Ftp/MACCS_DATA/Raw'<br> - YEAR=`date +%Y`<br> - YY=`date +%y`<br> - DAY=`date +%j`<br> - NDAY=`echo $DAY + 1 | bc`</span> </td> <td> <span>+ # Then it makes ASCII files and line plots of the data it downloaded.<br> + # It calls the following idl programs (from the /Volumes/physics_data/Code/MACCS_Code/ directory) to process the data:<br> + # IridiumMaccs2.pro to make Augsburg Format ASCII files which are used by linex7.pro<br> + # IridiumMaccs3.pro to make IAGA2000 Format ASCII files which are made available on the MACCS iridium website<br> + # linex7.pro to make line plots of the data which are made available on the MACCS iridium website<br> + <br> + #Get the current year, julian day and previous 6 days in UTC<br> + YEAR=`date -u +%Y`<br> + YY=`date -u +%y`<br> + DAY=`date -u +%j`<br> + #NDAY=`echo $DAY + 1 | bc`</span> </td> </tr> <tr> <td> Line 19: </td> <td> Line 23: </td> </tr> <tr> <td> </td> <td> <span>+ SOURCE='/Volumes/physics_data/Ftp/MACCS_DATA/Raw'<br> + CDdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/'${YEAR}'ir/'<br> + NAdir='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/NA/'${YEAR}'ir/'<br> + CDAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/CD/'${YEAR}'ir/'<br> + NAAdir='/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/NA/'${YEAR}'ir/'<br> + </span> </td> </tr> <tr> <td> Line 26: </td> <td> Line 36: </td> </tr> <tr> <td> <span>-</span> if [ $NDAY -lt 10 ]; then<br> <span>-</span> NDAY=00$NDAY<br> <span>-</span> elif [ $NDAY -lt 100 ]; then<br> <span>-</span> NDAY=0$NDAY<br> <span>-</span> fi </td> <td> <span>+</span> <span>#</span>if [ $NDAY -lt 10 ]; then<br> <span>+</span> <span>#</span> NDAY=00$NDAY<br> <span>+</span> <span>#</span>elif [ $NDAY -lt 100 ]; then<br> <span>+</span> <span>#</span> NDAY=0$NDAY<br> <span>+</span> <span>#</span>fi </td> </tr> <tr> <td> Line 63: </td> <td> Line 73: </td> </tr> <tr> <td> <span>- #get the files from SRI if they are different in file size from the ones we have</span> </td> <td> <span>+ #Get the maccs iridium raw data files from SRI if they are different in file size from the ones we have.<br> + #If a new file was downloaded, make an Augsburg format ASCII file, a IAGA2000 format ASCII file,<br> + #and a line plot of the data.</span> </td> </tr> <tr> <td> Line 109: </td> <td> Line 121: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ -f "CD${YY}${P6DAY}.dat" ]; then<br> + echo "Processing $CD${YY}${P6DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${P6DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${P6DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${P6DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${P6DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 121: </td> <td> Line 151: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ -f "CD${YY}${P5DAY}.dat" ]; then<br> + echo "Processing CD${YY}${P5DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${P5DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${P5DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${P5DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${P5DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 133: </td> <td> Line 181: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ -f "CD${YY}${P4DAY}.dat" ]; then<br> + echo "Processing CD${YY}${P4DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${P4DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${P4DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${P4DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${P4DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 145: </td> <td> Line 211: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ -f "CD${YY}${P3DAY}.dat" ]; then<br> + echo "Processing CD${YY}${P3DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${P3DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${P3DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${P3DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${P3DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 157: </td> <td> Line 241: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ -f "CD${YY}${P2DAY}.dat" ]; then<br> + echo "Processing CD${YY}${P2DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${P2DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${P2DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${P2DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${P2DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 169: </td> <td> Line 271: </td> </tr> <tr> <td> </td> <td> <span>+ cd $CDdir<br> + if [ -f "CD${YY}${PDAY}.dat" ]; then<br> + echo "Processing CD${YY}${PDAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${PDAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${PDAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${PDAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${PDAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 172: </td> <td> Line 292: </td> </tr> <tr> <td> <span>-</span> <br> <span>-</span> ftp -n &lt;&lt; END_SCRIPT<br> <span>-</span> open 128.18.144.24<br> <span>-</span> user anonymous teakjohnson@embarqmail.com<br> <span>- <br> -</span> epsv4<br> <span>-</span> cd pub/maccs/CD/magnetometer/<span><br> - </span> </td> <td> <span>+</span> <span>cd $SOURCE/CD/${YEAR}ir/</span><br> <span>+</span> ftp -n &lt;&lt; END_SCRIPT<br> <span>+</span> open 128.18.144.24<br> <span>+</span> user anonymous teakjohnson@embarqmail.com<br> <span>+</span> epsv4<br> <span>+ <br> +</span> cd pub/maccs/CD/magnetometer/ </td> </tr> <tr> <td> Line 181: </td> <td> Line 300: </td> </tr> <tr> <td> <span>-</span> get CD${YY}${NDAY}.dat </td> <td> <span>+</span> <span>#</span>get CD${YY}${NDAY}.dat </td> </tr> <tr> <td> Line 186: </td> <td> Line 305: </td> </tr> <tr> <td> <span>- get NA${YY}${NDAY}.dat<br> - <br> - bye<br> - END_SCRIPT</span> </td> <td> <span>+ #get NA${YY}${NDAY}.dat<br> + <br> + bye<br> + END_SCRIPT<br> + <br> + cd $CDdir<br> + if [ -f "CD${YY}${DAY}.dat" ]; then<br> + echo "Processing CD${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "CD${YY}${DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "CD${YY}${DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $CDAdir<br> + echo "Plotting ${CDAdir}CD${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"CD${YY}${DAY}.dat",0,0,0,0,0,0,"cd",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi<br> + <br> + cd $NAdir<br> + if [ -f "NA${YY}${DAY}.dat" ]; then<br> + echo "Processing NA${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 226: </td> <td> Line 383: </td> </tr> <tr> <td> </td> <td> <span>+ </span> </td> </tr> <tr> <td> Line 236: </td> <td> Line 394: </td> </tr> <tr> <td> </td> <td> <span>+ if [ -f "NA${YY}${P6DAY}.dat" ]; then<br> + echo "Processing NA${YY}${P6DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${P6DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${P6DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${P6DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${P6DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 248: </td> <td> Line 423: </td> </tr> <tr> <td> </td> <td> <span>+ if [ -f "NA${YY}${P5DAY}.dat" ]; then<br> + echo "Processing NA${YY}${P5DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${P5DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${P5DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${P5DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${P5DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 260: </td> <td> Line 452: </td> </tr> <tr> <td> </td> <td> <span>+ if [ -f "NA${YY}${P4DAY}.dat" ]; then<br> + echo "Processing NA${YY}${P4DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${P4DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${P4DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${P4DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${P4DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 272: </td> <td> Line 481: </td> </tr> <tr> <td> </td> <td> <span>+ if [ -f "NA${YY}${P3DAY}.dat" ]; then<br> + echo "Processing NA${YY}${P3DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${P3DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${P3DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${P3DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${P3DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 284: </td> <td> Line 510: </td> </tr> <tr> <td> </td> <td> <span>+ if [ -f "NA${YY}${P2DAY}.dat" ]; then<br> + echo "Processing NA${YY}${P2DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${P2DAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${P2DAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${P2DAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${P2DAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi</span> </td> </tr> <tr> <td> Line 296: </td> <td> Line 539: </td> </tr> <tr> <td> <span>- fi<br> - }}}</span> </td> <td> <span>+ if [ -f "NA${YY}${PDAY}.dat" ]; then<br> + echo "Processing NA${YY}${PDAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs2.pro<br> + IridiumMaccs2, "NA${YY}${PDAY}.dat"<br> + .compile /Volumes/physics_data/Code/MACCS_Code/IridiumMaccs3.pro<br> + IridiumMaccs3, "NA${YY}${PDAY}.dat"<br> + exit<br> + END_SCRIPT<br> + cd $NAAdir<br> + echo "Plotting ${NAAdir}NA${YY}${PDAY}.dat"<br> + idl &lt;&lt; END_SCRIPT<br> + .compile /Volumes/physics_data/Code/MACCS_Code/linex7.pro<br> + linex7,"NA${YY}${PDAY}.dat",0,0,0,0,0,0,"na",0,1,1,"","","","","","",5,2,0,0<br> + exit<br> + END_SCRIPT<br> + fi<br> + fi</span> </td> </tr> </table> </div> IridiumMaccs3.prohttp://maccs.wikispot.org/IridiumMaccs3.pro2007-08-20 19:13:30maccs <div id="content" class="wikipage content"> Differences for IridiumMaccs3.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ PRO IridiumMACCS3,filename<br> + <br> + <br> + <br> + ;This program is run by ftpsri.sh at :00, :15, :30, and :45 past every hour of every day.<br> + <br> + ;It creates IAGA2000 format ASCII files from the raw MACCS Iridium data.<br> + <br> + <br> + <br> + ;Overhaul Modifications by Michael Murphy Augsut 1, 2007 to begin working for 2 Maccs station<br> + <br> + ;Modifications by Erik Johnson August 15, 2007 to run on yspace from a script (maccsprocessing.sh)<br> + <br> + ;Modifications by Erik Johnson August 16, 2007 to comply with the IAGA2000 Data Exchange Format<br> + <br> + <br> + <br> + close, /all<br> + <br> + ;filename='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/*.dat'<br> + <br> + ;print, filename<br> + <br> + openr,unit,filename,error=err,/get_lun<br> + <br> + test_array = bytarr(11)<br> + <br> + readu,unit,test_array<br> + <br> + reclen=test_array(10)+9<br> + <br> + free_lun,unit<br> + <br> + <br> + <br> + openr,unit,filename,error=err,/get_lun<br> + <br> + file_info = fstat(unit)<br> + <br> + file_size = file_info.size/reclen<br> + <br> + data_array = bytarr(reclen,file_size)<br> + <br> + if (err eq 0) then begin<br> + <br> + print,'Now processing ',filename<br> + <br> + readu,unit,data_array<br> + <br> + free_lun,unit<br> + <br> + endif else begin<br> + <br> + print,'An error has occurred while trying to read ',filename<br> + <br> + stop<br> + <br> + endelse<br> + <br> + <br> + <br> + numsamples=(test_array(10)-9)/3/3<br> + <br> + <br> + <br> + xvalue=fltarr(numsamples,file_size)<br> + <br> + yvalue=fltarr(numsamples,file_size)<br> + <br> + zvalue=fltarr(numsamples,file_size)<br> + <br> + timevalue=data_array(4,*)*3600.0+data_array(5,*)*60.0+data_array(6,*)<br> + <br> + FOR i=0,numsamples-1 DO BEGIN<br> + <br> + xvalue(i,*)=(data_array(18+(i*9),*)*65536l+data_array(19+(i*9),*)*256l+data_array(20+(i*9),*))*0.025<br> + <br> + yvalue(i,*)=(data_array(21+(i*9),*)*65536l+data_array(22+(i*9),*)*256l+data_array(23+(i*9),*))*0.025<br> + <br> + zvalue(i,*)=(data_array(24+(i*9),*)*65536l+data_array(25+(i*9),*)*256l+data_array(26+(i*9),*))*0.025<br> + <br> + ENDFOR<br> + <br> + <br> + <br> + <br> + <br> + n=findgen(file_size)<br> + <br> + nstep=n<br> + <br> + n=n*2<br> + <br> + <br> + <br> + bx=fltarr(file_size*2l)<br> + <br> + by=bx<br> + <br> + bz=bx<br> + <br> + <br> + <br> + bx[n]=xvalue[0,nstep]<br> + <br> + bx[n+1]= xvalue[1,nstep]<br> + <br> + <br> + <br> + by[n]=yvalue[0,nstep]<br> + <br> + by[n+1]= yvalue[1,nstep]<br> + <br> + <br> + <br> + bz[n]=zvalue[0,nstep]<br> + <br> + bz[n+1]= zvalue[1,nstep]<br> + <br> + <br> + <br> + Dtime=dblarr(file_size*2l)<br> + <br> + Dtime[n]=timevalue[0,nstep]+ 0.25<br> + <br> + Dtime[n+1]= timevalue[0,nstep]+ 0.75<br> + <br> + <br> + <br> + ;Section for writing data<br> + <br> + lab = ''<br> + <br> + label=strmid(filename,0,2)<br> + <br> + labelx=strmid(filename,2,5)<br> + <br> + yrday=fix(labelx)<br> + <br> + MMDD, YRDAY, MON, DAY<br> + <br> + year=strmid(labelx,0,2)<br> + <br> + year1=fix(year)<br> + <br> + if year1 ge 92 then begin<br> + <br> + year=string('19',year)<br> + <br> + endif else begin<br> + <br> + year=string('20',year)<br> + <br> + endelse<br> + <br> + <br> + <br> + ;Create The 11 mandatory file header records<br> + <br> + <br> + <br> + line1=' Format | IAGA2000 |'<br> + <br> + <br> + <br> + if label eq 'NA' then begin<br> + <br> + line2=' Station | Nain, Canada |'<br> + <br> + line3=' IAGA Code | NAN |'<br> + <br> + line4=' Geodetic Latitude | 56.4 |'<br> + <br> + line5=' Geodetic Longitude | 298.3 |'<br> + <br> + line6=' Elevation | 7 |'<br> + <br> + endif<br> + <br> + <br> + <br> + if label eq 'CD' then begin<br> + <br> + line2=' Station | Cape Dorset, Canada |'<br> + <br> + line3=' IAGA Code | CDR |'<br> + <br> + line4=' Geodetic Latitude | 64.2 |'<br> + <br> + line5=' Geodetic Longitude | 283.4 |'<br> + <br> + line6=' Elevation | 50 |'<br> + <br> + endif<br> + <br> + <br> + <br> + line7=' Observed | XYZ |'<br> + <br> + line8=' Digital Sampling | 0.5 seconds |'<br> + <br> + line9=' Data Interval | 0.5 seconds |'<br> + <br> + line10=' Data type | Variation |'<br> + <br> + line11=' Variables | 9 |'<br> + <br> + line12=' # For more information visit http://space.augsburg.edu |'<br> + <br> + line13=' Year| MT| DY| HR| MN| SC| CDRX| CDRY| CDRZ|'<br> + <br> + length=size(bx,/n_elements)<br> + <br> + newarray = fltarr(4,length)<br> + <br> + stringarr = strarr(1,length)<br> + <br> + ;newarray[0,*]= ' '<br> + <br> + newarray[0,*]= Dtime<br> + <br> + newarray[1,*] = bx<br> + <br> + newarray[2,*] = by<br> + <br> + newarray[3,*] = bz<br> + <br> + <br> + <br> + for i=1l, length, 1 do begin<br> + <br> + totals = newarray[0,i-1]<br> + <br> + hour = fix(totals/3600)<br> + <br> + totals = totals - (hour*3600l)<br> + <br> + min = fix(totals/60)<br> + <br> + sec = fix(totals - (min*60))<br> + <br> + data = string(year, mon, day, hour, min, sec, newarray[1,i-1],newarray[2,i-1],newarray[3,i-1], $<br> + <br> + format='(" ", a4, "| ", i2, "| ", i2, "| ", i2, "| ", i2, "| ", i2, "|", f10.2, "|", f10.2, "|", f10.2, "|")')<br> + <br> + stringarr[0,i-1] = data<br> + <br> + endfor<br> + <br> + <br> + <br> + openw, 2,'/Volumes/physics_data/Ftp/MACCS_DATA/IAGA2000/'+label+'/'+year+'ir/'+label+labelx+'.dat',width=107<br> + <br> + printf,2,line1<br> + <br> + printf,2,line2<br> + <br> + printf,2,line3<br> + <br> + printf,2,line4<br> + <br> + printf,2,line5<br> + <br> + printf,2,line6<br> + <br> + printf,2,line7<br> + <br> + printf,2,line8<br> + <br> + printf,2,line9<br> + <br> + printf,2,line10<br> + <br> + printf,2,line11<br> + <br> + printf,2,line12<br> + <br> + printf,2,line13<br> + <br> + printf,2,stringarr<br> + <br> + ;printf,2,newarray,format='(f8.2,3f15.3)'<br> + <br> + close, 2<br> + <br> + <br> + <br> + print, 'program finished'<br> + <br> + END<br> + <br> + <br> + <br> + PRO MMDD,YRDAY,MONTH,MNTHDA,IYR<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + ; 11 NOV 85 S FAVIN<br> + <br> + <br> + <br> + ; GIVEN YRDAY LIKE 85199<br> + <br> + <br> + <br> + ; RETURNS WITH CHARACTER MONTH AND DAY NUMBER IN MONTH<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + LEAPYR = [0,0,31,60,91,121,152,182,213,244,274,305,335,366]<br> + <br> + <br> + <br> + NOLEAP = [0,0,31,59,90,120,151,181,212,243,273,304,334,365]<br> + <br> + <br> + <br> + CHARM = ['','1','2','3','4','5','6', $<br> + <br> + <br> + <br> + '7','8','9','10','11','12']<br> + <br> + <br> + <br> + MONTH = ''<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + IYEAR = FIX(YRDAY/1000)<br> + <br> + <br> + <br> + IDAY = FIX(YRDAY - IYEAR*1000)<br> + <br> + <br> + <br> + MON= FIX(IDAY/30+1)<br> + <br> + <br> + <br> + IF((IYEAR MOD 100) EQ 0) THEN GOTO, A366<br> + <br> + <br> + <br> + IF((IYEAR MOD 4) EQ 0) THEN GOTO, A366<br> + <br> + <br> + <br> + IF((IDAY-NOLEAP(MON)) LE 0) THEN MON = MON -1<br> + <br> + <br> + <br> + MNTHDA=IDAY-NOLEAP(MON)<br> + <br> + <br> + <br> + A365: MONTH = CHARM(MON)<br> + <br> + <br> + <br> + IYR=IYEAR<br> + <br> + <br> + <br> + RETURN<br> + <br> + <br> + <br> + A366: IF((IDAY-LEAPYR(MON)) LE 0) THEN MON = MON - 1<br> + <br> + <br> + <br> + MNTHDA=IDAY-LEAPYR(MON)<br> + <br> + <br> + <br> + GOTO, A365<br> + <br> + <br> + <br> + END<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + function xticks, axis, index, value<br> + <br> + <br> + <br> + on_error,1<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + if keyword_set(help) then begin<br> + <br> + <br> + <br> + helpdir = 'c:\rsi\idl40\help\user'<br> + <br> + <br> + <br> + helpfile = helpdir + '\xticks.txt'<br> + <br> + <br> + <br> + xdisplayfile, helpfile<br> + <br> + <br> + <br> + return, 0<br> + <br> + <br> + <br> + endif<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + ;hour = fix(value+.5)<br> + <br> + <br> + <br> + hour = fix(value)<br> + <br> + <br> + <br> + if hour gt 23 then hour = hour -24<br> + <br> + <br> + <br> + min = fix(value*60. mod 60.)<br> + <br> + <br> + <br> + sec = fix(value*3600. mod 60. + .5)<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + if sec eq 60 then begin<br> + <br> + <br> + <br> + sec = 0<br> + <br> + <br> + <br> + min = min + 1<br> + <br> + <br> + <br> + if min eq 60 then begin<br> + <br> + <br> + <br> + min = 0<br> + <br> + <br> + <br> + hour = hour+1<br> + <br> + <br> + <br> + endif<br> + <br> + <br> + <br> + endif<br> + <br> + <br> + <br> + if sec eq 0 then begin ;Seconds are not shown on time scale if they are zero.<br> + <br> + <br> + <br> + return, string(format = '(i2.2,":",i2.2)',hour,min)<br> + <br> + <br> + <br> + endif<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + ;min = fix(value*60. mod 60. + .5)<br> + <br> + <br> + <br> + ;if min eq 60 then begin<br> + <br> + <br> + <br> + ; min = 0<br> + <br> + <br> + <br> + ; hour = hour+1<br> + <br> + <br> + <br> + ;endif<br> + <br> + <br> + <br> + ;sec = fix(value*3600. mod 60. + .5)<br> + <br> + <br> + <br> + ;if sec eq 60 then sec = 0<br> + <br> + <br> + <br> + return, string(format = '(i2.2,":",i2.2,":",i2.2)', hour, min, sec)<br> + <br> + <br> + <br> + end</span> </td> </tr> </table> </div> IridiumMaccs2.prohttp://maccs.wikispot.org/IridiumMaccs2.pro2007-08-20 19:13:00maccs <div id="content" class="wikipage content"> Differences for IridiumMaccs2.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ PRO IridiumMACCS2,filename<br> + <br> + <br> + <br> + ;This program is run by ftpsri.sh at :00, :15, :30, and :45 past every hour of every day.<br> + <br> + ;It creates Augsburg format ASCII files from the raw MACCS Iridium data.<br> + <br> + ;The ASCII files it creates can be used to produce line plots (with linex7.pro) as well as spectrograms<br> + <br> + <br> + <br> + ;Overhaul Modifications by Michael Murphy Augsut 1, 2007 to begin working for 2 Maccs station<br> + <br> + ;Modifications by Erik Johnson August 15, 2007 to run on yspace from the maccsprocessing.sh shell script<br> + <br> + <br> + <br> + close, /all<br> + <br> + ;filename='/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/*.dat'<br> + <br> + ;filename=dialog_pickfile (path='C:\Documents and Settings\murphy\Research\Rawdata\*.dat')<br> + <br> + print, filename<br> + <br> + openr,unit,filename,error=err,/get_lun<br> + <br> + test_array = bytarr(11)<br> + <br> + readu,unit,test_array<br> + <br> + reclen=test_array(10)+9<br> + <br> + free_lun,unit<br> + <br> + <br> + <br> + openr,unit,filename,error=err,/get_lun<br> + <br> + file_info = fstat(unit)<br> + <br> + file_size = file_info.size/reclen<br> + <br> + data_array = bytarr(reclen,file_size)<br> + <br> + if (err eq 0) then begin<br> + <br> + print,'Now processing ',filename<br> + <br> + readu,unit,data_array<br> + <br> + free_lun,unit<br> + <br> + endif else begin<br> + <br> + print,'An error has occurred while trying to read ',filename<br> + <br> + stop<br> + <br> + endelse<br> + <br> + <br> + <br> + numsamples=(test_array(10)-9)/3/3<br> + <br> + <br> + <br> + xvalue=fltarr(numsamples,file_size)<br> + <br> + yvalue=fltarr(numsamples,file_size)<br> + <br> + zvalue=fltarr(numsamples,file_size)<br> + <br> + timevalue=data_array(4,*)*3600.0+data_array(5,*)*60.0+data_array(6,*)<br> + <br> + FOR i=0,numsamples-1 DO BEGIN<br> + <br> + xvalue(i,*)=(data_array(18+(i*9),*)*65536l+data_array(19+(i*9),*)*256l+data_array(20+(i*9),*))*0.025<br> + <br> + yvalue(i,*)=(data_array(21+(i*9),*)*65536l+data_array(22+(i*9),*)*256l+data_array(23+(i*9),*))*0.025<br> + <br> + zvalue(i,*)=(data_array(24+(i*9),*)*65536l+data_array(25+(i*9),*)*256l+data_array(26+(i*9),*))*0.025<br> + <br> + ENDFOR<br> + <br> + <br> + <br> + <br> + <br> + n=findgen(file_size)<br> + <br> + nstep=n<br> + <br> + n=n*2<br> + <br> + <br> + <br> + bx=fltarr(file_size*2l)<br> + <br> + by=bx<br> + <br> + bz=bx<br> + <br> + <br> + <br> + bx[n]=xvalue[0,nstep]<br> + <br> + bx[n+1]= xvalue[1,nstep]<br> + <br> + <br> + <br> + by[n]=yvalue[0,nstep]<br> + <br> + by[n+1]= yvalue[1,nstep]<br> + <br> + <br> + <br> + bz[n]=zvalue[0,nstep]<br> + <br> + bz[n+1]= zvalue[1,nstep]<br> + <br> + <br> + <br> + Dtime=dblarr(file_size*2l)<br> + <br> + Dtime[n]=timevalue[0,nstep]+ 0.25<br> + <br> + Dtime[n+1]= timevalue[0,nstep]+ 0.75<br> + <br> + <br> + <br> + ;Section for writing data<br> + <br> + lab = ''<br> + <br> + idoc = LONARR(24)<br> + <br> + label=strmid(filename,0,2)<br> + <br> + labelx=strmid(filename,2,5)<br> + <br> + year=strmid(labelx,0,2)<br> + <br> + ;label2=fix(strmid(filename,2,5))<br> + <br> + ;label3=strmid(filename,37,3)<br> + <br> + ;'C:\Documents and Settings\murphy\NA07159.dat'<br> + <br> + idoc(0)=1<br> + <br> + idoc(2)=n_elements(Dtime)<br> + <br> + <br> + <br> + print, label<br> + <br> + <br> + <br> + if label eq 'NA' then begin<br> + <br> + idoc(3)=122<br> + <br> + line3='Nain Iridium Data'<br> + <br> + endif<br> + <br> + <br> + <br> + if label eq 'CD' then begin<br> + <br> + idoc(3)=104<br> + <br> + line3='Cape Dorset Iridium Data'<br> + <br> + endif<br> + <br> + <br> + <br> + idoc(4)=labelx<br> + <br> + <br> + <br> + newarray = fltarr(4,size(bx,/n_elements))<br> + <br> + newarray[0,*]= Dtime<br> + <br> + newarray[1,*]= bx<br> + <br> + newarray[2,*]= by<br> + <br> + newarray[3,*]= bz<br> + <br> + <br> + <br> + <br> + <br> + ;yyddd<br> + <br> + ;print, label<br> + <br> + ;print, label2<br> + <br> + ;print, idoc<br> + <br> + ;print, bx<br> + <br> + ;print, dtime<br> + <br> + ;label3=string(label2)<br> + <br> + ;label3=strmid(label3,3,5)<br> + <br> + ;print, label2<br> + <br> + ;print, label3<br> + <br> + openw, 2,'/Volumes/physics_data/Ftp/MACCS_DATA/AugASCII/'+label+'/20'+year+'ir/'+label+labelx+'.dat',width=107<br> + <br> + printf,2,idoc, format = '(12(i8),/,12(i8))'<br> + <br> + printf,2,line3<br> + <br> + printf,2,newarray,format='(f8.2,3f15.3)'<br> + <br> + close, 2<br> + <br> + <br> + <br> + print, 'program finished'<br> + <br> + END</span> </td> </tr> </table> </div> Data Collectionhttp://maccs.wikispot.org/Data_Collection2007-08-20 19:09:24maccs <div id="content" class="wikipage content"> Differences for Data Collection<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at :00, :15, :30, :45 of every hour of every day when the maccs user crontab on the yspace server runs the script ["ftpsri.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory. You can view Augsburg's MACCS data from the ftp site ftp://space.augsburg.edu/MACCS_DATA/. </td> <td> <span>+</span> At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at :00, :15, :30, :45 of every hour of every day when the maccs user crontab on the yspace server runs the script ["ftpsri.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory. You can view Augsburg's MACCS data from the ftp site ftp://space.augsburg.edu/MACCS_DATA/.<span>&nbsp;After downloading the data, the ["ftpsri.sh"] script creates two formats of ASCII files with the ["IridiumMaccs2.pro"] and ["IridiumMaccs3.pro"] idl programs and it creates line plots of the data with the ["linex7.pro"] idl program.</span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-15 03:18:03PhilipNeustromexample of braces - you can put code in braces or upload the file 4 better look <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ {{{</span> </td> </tr> <tr> <td> Line 296: </td> <td> Line 297: </td> </tr> <tr> <td> </td> <td> <span>+ }}}</span> </td> </tr> </table> </div> strip.prohttp://maccs.wikispot.org/strip.pro2007-08-14 17:24:01ArlenAbrahamyou can put code in these nifty little braces, or you can upload the file <div id="content" class="wikipage content"> Differences for strip.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ {{{</span> </td> </tr> <tr> <td> Line 18: </td> <td> Line 19: </td> </tr> <tr> <td> </td> <td> <span>+ }}}</span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-13 21:28:35maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 2: </td> <td> Line 2: </td> </tr> <tr> <td> </td> <td> <span>+ # Last Modified 8/13/07</span> </td> </tr> </table> </div> ftpsri.shhttp://maccs.wikispot.org/ftpsri.sh2007-08-13 21:27:16maccs <div id="content" class="wikipage content"> Differences for ftpsri.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # Written by Erik Johnson July 2007<br> + # This program is run at :00, :15, :30, :45 of every hour of every day.<br> + # It downloads the latest MACCS raw data files from SRI's ftp site and files them into the MACCS_DATA/Raw/ folder.<br> + <br> + SOURCE='/Volumes/physics_data/Ftp/MACCS_DATA/Raw'<br> + YEAR=`date +%Y`<br> + YY=`date +%y`<br> + DAY=`date +%j`<br> + NDAY=`echo $DAY + 1 | bc`<br> + PDAY=`echo $DAY - 1 | bc`<br> + P2DAY=`echo $DAY - 2 | bc`<br> + P3DAY=`echo $DAY - 3 | bc`<br> + P4DAY=`echo $DAY - 4 | bc`<br> + P5DAY=`echo $DAY - 5 | bc`<br> + P6DAY=`echo $DAY - 6 | bc`<br> + <br> + #insert the necessary leading zeros for DAY<br> + #if [ $DAY -lt 10 ]; then<br> + # DAY=00$DAY<br> + #elif [ $DAY -lt 100 ]; then<br> + # DAY=0$DAY<br> + #fi<br> + <br> + if [ $NDAY -lt 10 ]; then<br> + NDAY=00$NDAY<br> + elif [ $NDAY -lt 100 ]; then<br> + NDAY=0$NDAY<br> + fi<br> + if [ $PDAY -lt 10 ]; then<br> + PDAY=00$PDAY<br> + elif [ $PDAY -lt 100 ]; then<br> + PDAY=0$PDAY<br> + fi<br> + if [ $P2DAY -lt 10 ]; then<br> + P2DAY=00$P2DAY<br> + elif [ $P2DAY -lt 100 ]; then<br> + P2DAY=0$P2DAY<br> + fi<br> + if [ $P3DAY -lt 10 ]; then<br> + P3DAY=00$P3DAY<br> + elif [ $P3DAY -lt 100 ]; then<br> + P3DAY=0$P3DAY<br> + fi<br> + if [ $P4DAY -lt 10 ]; then<br> + P4DAY=00$P4DAY<br> + elif [ $P4DAY -lt 100 ]; then<br> + P4DAY=0$P4DAY<br> + fi<br> + if [ $P5DAY -lt 10 ]; then<br> + P5DAY=00$P5DAY<br> + elif [ $P5DAY -lt 100 ]; then<br> + P5DAY=0$P5DAY<br> + fi<br> + if [ $P6DAY -lt 10 ]; then<br> + P6DAY=00$P6DAY<br> + elif [ $P6DAY -lt 100 ]; then<br> + P6DAY=0$P6DAY<br> + fi<br> + <br> + ##########################################################<br> + #get the files from SRI if they are different in file size from the ones we have<br> + <br> + cd $SOURCE/CD/${YEAR}ir/<br> + <br> + #Get the sizes of our files if they exits<br> + if [ -f "CD${YY}${P6DAY}.dat" ]; then<br> + P6DAYSIZE=`stat -f "%z" CD${YY}${P6DAY}.dat`<br> + else<br> + P6DAYSIZE=0<br> + fi<br> + if [ -f "CD${YY}${P5DAY}.dat" ]; then<br> + P5DAYSIZE=`stat -f "%z" CD${YY}${P5DAY}.dat`<br> + else<br> + P5DAYSIZE=0<br> + fi<br> + if [ -f "CD${YY}${P4DAY}.dat" ]; then<br> + P4DAYSIZE=`stat -f "%z" CD${YY}${P4DAY}.dat`<br> + else<br> + P4DAYSIZE=0<br> + fi<br> + if [ -f "CD${YY}${P3DAY}.dat" ]; then<br> + P3DAYSIZE=`stat -f "%z" CD${YY}${P3DAY}.dat`<br> + else<br> + P3DAYSIZE=0<br> + fi<br> + if [ -f "CD${YY}${P2DAY}.dat" ]; then<br> + P2DAYSIZE=`stat -f "%z" CD${YY}${P2DAY}.dat`<br> + else<br> + P2DAYSIZE=0<br> + fi<br> + if [ -f "CD${YY}${PDAY}.dat" ]; then<br> + PDAYSIZE=`stat -f "%z" CD${YY}${PDAY}.dat`<br> + else<br> + PDAYSIZE=0<br> + fi<br> + <br> + if [ "$P6DAYSIZE" != 3283200 ]; then<br> + echo CD P6DAY file is incomplete or missing, downloading P6DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${P6DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P5DAYSIZE" != 3283200 ]; then<br> + echo CD P5DAY file is incomplete or missing, downloading P5DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${P5DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P4DAYSIZE" != 3283200 ]; then<br> + echo CD P4DAY file is incomplete or missing, downloading P4DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${P4DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P3DAYSIZE" != 3283200 ]; then<br> + echo CD P3DAY file is incomplete or missing, downloading P3DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${P3DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P2DAYSIZE" != 3283200 ]; then<br> + echo CD P2DAY file is incomplete or missing, downloading P2DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${P2DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$PDAYSIZE" != 3283200 ]; then<br> + echo CD PDAY file is incomplete or missing, downloading PDAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${PDAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + echo Downloading data files from today<br> + <br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + <br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + <br> + get CD${YY}${DAY}.dat<br> + get CD${YY}${NDAY}.dat<br> + <br> + lcd $SOURCE/NA/${YEAR}ir/<br> + cd ../../NA/magnetometer/<br> + get NA${YY}${DAY}.dat<br> + get NA${YY}${NDAY}.dat<br> + <br> + bye<br> + END_SCRIPT<br> + <br> + cd $SOURCE/NA/${YEAR}ir/<br> + <br> + #Get the sizes of our NA files if they exits<br> + if [ -f "NA${YY}${P6DAY}.dat" ]; then<br> + P6DAYSIZE=`stat -f "%z" NA${YY}${P6DAY}.dat`<br> + else<br> + P6DAYSIZE=0<br> + fi<br> + if [ -f "NA${YY}${P5DAY}.dat" ]; then<br> + P5DAYSIZE=`stat -f "%z" NA${YY}${P5DAY}.dat`<br> + else<br> + P5DAYSIZE=0<br> + fi<br> + if [ -f "NA${YY}${P4DAY}.dat" ]; then<br> + P4DAYSIZE=`stat -f "%z" NA${YY}${P4DAY}.dat`<br> + else<br> + P4DAYSIZE=0<br> + fi<br> + if [ -f "NA${YY}${P3DAY}.dat" ]; then<br> + P3DAYSIZE=`stat -f "%z" NA${YY}${P3DAY}.dat`<br> + else<br> + P3DAYSIZE=0<br> + fi<br> + if [ -f "NA${YY}${P2DAY}.dat" ]; then<br> + P2DAYSIZE=`stat -f "%z" NA${YY}${P2DAY}.dat`<br> + else<br> + P2DAYSIZE=0<br> + fi<br> + if [ -f "NA${YY}${PDAY}.dat" ]; then<br> + PDAYSIZE=`stat -f "%z" NA${YY}${PDAY}.dat`<br> + else<br> + PDAYSIZE=0<br> + fi<br> + <br> + #Download data from each of the previous 6 days if our data for that day is incomplete or missing<br> + if [ "$P6DAYSIZE" != 3283200 ]; then<br> + echo NA P6DAY file is incomplete or missing, downloading P6DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${P6DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P5DAYSIZE" != 3283200 ]; then<br> + echo NA P5DAY file is incomplete or missing, downloading P5DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${P5DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P4DAYSIZE" != 3283200 ]; then<br> + echo NA P4DAY file is incomplete or missing, downloading P4DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${P4DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P3DAYSIZE" != 3283200 ]; then<br> + echo NA P3DAY file is incomplete or missing, downloading P3DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${P3DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$P2DAYSIZE" != 3283200 ]; then<br> + echo NA P2DAY file is incomplete or missing, downloading P2DAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${P2DAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi<br> + <br> + if [ "$PDAYSIZE" != 3283200 ]; then<br> + echo NA PDAY file is incomplete or missing, downloading PDAY file<br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + epsv4<br> + cd pub/maccs/NA/magnetometer/<br> + get NA${YY}${PDAY}.dat<br> + bye<br> + END_SCRIPT<br> + fi</span> </td> </tr> </table> </div> Data Collectionhttp://maccs.wikispot.org/Data_Collection2007-08-13 21:24:59maccs <div id="content" class="wikipage content"> Differences for Data Collection<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at 1<span>9</span>:35 <span>CDT</span> every day when the maccs user crontab on <span>yspace</span> runs the script ["<span>sridaily</span>.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory. You can view Augsburg's MACCS data from the ftp site ftp://space.augsburg.edu/MACCS_DATA/. </td> <td> <span>+</span> At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at <span>:00, :</span>1<span>5, </span>:3<span>0, :4</span>5 <span>of</span> every <span>hour of every </span>day when the maccs user crontab on <span>the yspace server</span> runs the script ["<span>ftpsri</span>.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory. You can view Augsburg's MACCS data from the ftp site ftp://space.augsburg.edu/MACCS_DATA/. </td> </tr> </table> </div> Data Collectionhttp://maccs.wikispot.org/Data_Collection2007-08-06 20:49:42maccs <div id="content" class="wikipage content"> Differences for Data Collection<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at 19:35 CDT every day when the maccs user crontab on yspace runs the script ["sridaily.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory. </td> <td> <span>+</span> At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at 19:35 CDT every day when the maccs user crontab on yspace runs the script ["sridaily.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory.<span>&nbsp;You can view Augsburg's MACCS data from the ftp site ftp://space.augsburg.edu/MACCS_DATA/.</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-08-06 20:40:44maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 7: </td> <td> Line 7: </td> </tr> <tr> <td> <span>-</span> ["igloolik_despike.pro<span>"</span>] </td> <td> <span>+</span> ["<span>igloolik despike.pro" </span>igloolik_despike.pro] </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-08-06 20:40:17maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 9: </td> <td> Line 9: </td> </tr> <tr> <td> <span>-</span> ["write_maccs.pro<span>"</span>] (called by igllolik_despike.pro) </td> <td> <span>+</span> ["write<span>&nbsp;maccs.pro" write</span>_maccs.pro] (called by igllolik_despike.pro) </td> </tr> <tr> <td> Line 11: </td> <td> Line 11: </td> </tr> <tr> <td> <span>-</span> ["step_view.pro<span>"</span>]<br> <span>-</span> ["step_wid.pro<span>"</span>] </td> <td> <span>+</span> ["step<span>&nbsp;view.pro" step</span>_view.pro]<br> <span>+</span> ["step<span>&nbsp;wid.pro" step</span>_wid.pro] </td> </tr> <tr> <td> Line 15: </td> <td> Line 15: </td> </tr> <tr> <td> <span>- ["five_sec_avg.pro"]<br> - ["five_sec_avg_fast_avg.pro"] (called by five_sec_avg.pro)<br> - ["read_maccs.pro"] (called by five_sec_avg.pro)<br> - ["write_maccs.pro"] (called by five_sec_avg.pro)</span> </td> <td> <span>+ ["five sec avg.pro" five_sec_avg.pro]<br> + ["five sec avg fast avg.pro" five_sec_avg_fast_avg.pro] (called by five_sec_avg.pro)<br> + ["read maccs.pro" read_maccs.pro] (called by five_sec_avg.pro)<br> + ["write maccs.pro" write_maccs.pro] (called by five_sec_avg.pro)</span> </td> </tr> <tr> <td> Line 20: </td> <td> Line 20: </td> </tr> <tr> <td> <span>-</span> ["sec_to_min.pro<span>"</span>]<br> <span>-</span> ["read_maccs.pro<span>"</span>] (called by sec_to_min.pro)<br> <span>-</span> ["write_maccs.pro<span>"</span>] (called by sec_to_min.pro) </td> <td> <span>+</span> ["<span>sec to min.pro" </span>sec_to_min.pro]<br> <span>+</span> ["read<span>&nbsp;maccs.pro" read</span>_maccs.pro] (called by sec_to_min.pro)<br> <span>+</span> ["write<span>&nbsp;maccs.pro" write</span>_maccs.pro] (called by sec_to_min.pro) </td> </tr> <tr> <td> Line 25: </td> <td> Line 25: </td> </tr> <tr> <td> <span>-</span> ["merge_files.pro<span>"</span>] </td> <td> <span>+</span> ["merge<span>&nbsp;files.pro" merge</span>_files.pro] </td> </tr> <tr> <td> Line 33: </td> <td> Line 33: </td> </tr> <tr> <td> <span>-</span> ["hour_read.pro<span>"</span>] </td> <td> <span>+</span> ["hour<span>&nbsp;read.pro" hour</span>_read.pro] </td> </tr> <tr> <td> Line 35: </td> <td> Line 35: </td> </tr> <tr> <td> <span>-</span> ["wid_draw.pro<span>"</span>] </td> <td> <span>+</span> ["wid<span>&nbsp;draw.pro" wid</span>_draw.pro] </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-08-06 20:37:13maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 8: </td> <td> Line 8: </td> </tr> <tr> <td> <span>-</span> ["read<span>_</span>maccs.pro" read<span>&nbsp;</span>maccs.pro] (called by igllolik_despike.pro) </td> <td> <span>+</span> ["read<span>&nbsp;</span>maccs.pro" read<span>_</span>maccs.pro] (called by igllolik_despike.pro) </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-08-06 20:36:50maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 8: </td> <td> Line 8: </td> </tr> <tr> <td> <span>-</span> ["read_maccs.pro"] (called by igllolik_despike.pro) </td> <td> <span>+</span> ["read_maccs.pro"<span>&nbsp;read maccs.pro</span>] (called by igllolik_despike.pro) </td> </tr> </table> </div> sridaily.shhttp://maccs.wikispot.org/sridaily.sh2007-08-06 20:33:34maccs <div id="content" class="wikipage content"> Differences for sridaily.sh<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ # Written by Erik Johnson July 2007<br> + # This program is run at 19:35 every day.<br> + # It downloads the latest MACCS raw data files from SRI's ftp site and files them into the MACCS_DATA/Raw/ folder.<br> + <br> + SOURCE='/Volumes/physics_data/Ftp/MACCS_DATA/Raw'<br> + YEAR=`date +%Y`<br> + YY=`date +%y`<br> + DAY=`date +%j`<br> + NDAY=`echo $DAY + 1 | bc`<br> + PDAY=`echo $DAY - 1 | bc`<br> + P2DAY=`echo $DAY - 2 | bc`<br> + <br> + #insert the necessary leading zeros for DAY<br> + #if [ $DAY -lt 10 ]; then<br> + # DAY=00$DAY<br> + #elif [ $DAY -lt 100 ]; then<br> + # DAY=0$DAY<br> + #fi<br> + <br> + if [ $NDAY -lt 10 ]; then<br> + NDAY=00$NDAY<br> + elif [ $NDAY -lt 100 ]; then<br> + NDAY=0$NDAY<br> + fi<br> + if [ $PDAY -lt 10 ]; then<br> + PDAY=00$PDAY<br> + elif [ $PDAY -lt 100 ]; then<br> + PDAY=0$PDAY<br> + fi<br> + if [ $P2DAY -lt 10 ]; then<br> + P2DAY=00$P2DAY<br> + elif [ $P2DAY -lt 100 ]; then<br> + P2DAY=0$P2DAY<br> + fi<br> + <br> + ##########################################################<br> + #get the files from SRI<br> + cd $SOURCE/CD/${YEAR}ir/<br> + <br> + ftp -n &lt;&lt; END_SCRIPT<br> + open 128.18.144.24<br> + user anonymous teakjohnson@embarqmail.com<br> + <br> + epsv4<br> + cd pub/maccs/CD/magnetometer/<br> + get CD${YY}${P2DAY}.dat<br> + get CD${YY}${PDAY}.dat<br> + get CD${YY}${DAY}.dat<br> + get CD${YY}${NDAY}.dat<br> + <br> + lcd $SOURCE/NA/${YEAR}ir/<br> + cd ../../NA/magnetometer<br> + get NA${YY}${P2DAY}.dat<br> + get NA${YY}${PDAY}.dat<br> + get NA${YY}${DAY}.dat<br> + get NA${YY}${NDAY}.dat<br> + <br> + bye<br> + END_SCRIPT</span> </td> </tr> </table> </div> Data Collectionhttp://maccs.wikispot.org/Data_Collection2007-08-06 20:29:56maccs <div id="content" class="wikipage content"> Differences for Data Collection<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ At Augsburg College the new MACCS iridium data is downloaded from SRI's ftp site at 19:35 CDT every day when the maccs user crontab on yspace runs the script ["sridaily.sh"] which is located in the /Volumes/physics_data/Code/MACCS_Code/ directory. The new data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/{site abbreviation}/{year}ir/ folders. For example, the 2007 Cape Dorest iridium data is saved in the /Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/ directory.</span> </td> </tr> </table> </div> Peoplehttp://maccs.wikispot.org/People2007-08-06 20:08:58maccs <div id="content" class="wikipage content"> Differences for People<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ Erik Johnson<br> + Student Employee at Augsburg College<br> + teakjohnson@embarqmail.com<br> + (763) 498-1880</span> </td> </tr> </table> </div> Realtime Plotshttp://maccs.wikispot.org/Realtime_Plots2007-07-26 20:55:30maccs <div id="content" class="wikipage content"> Differences for Realtime Plots<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>-</span> [http://<span>e</span>n<span>ginee</span>r<span>ing</span>.dartmouth.edu/~d<span>avid_</span>murr/m<span>i</span>c/<span>nain_current</span>.png] </td> <td> <span>+</span> [http://n<span>o</span>r<span>thstar-www</span>.dartmouth.edu/~dmurr/m<span>a</span>c<span>cs</span>/<span>NA</span>.png] </td> </tr> </table> </div> wid draw.prohttp://maccs.wikispot.org/wid_draw.pro2007-07-25 21:46:43maccs <div id="content" class="wikipage content"> Differences for wid draw.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ PRO wid_draw_event, ev<br> + <br> + WIDGET_CONTROL, ev.top, GET_UVALUE = ev_var<br> + <br> + WIDGET_CONTROL, ev.id, GET_UVALUE = uval<br> + <br> + CASE uval OF<br> + <br> + 'DRAW' : begin<br> + IF ((*ev_var).mouse((*ev_var).component) eq 0 AND ev.type eq 0) THEN BEGIN ;If draw lines is selected this loop begins<br> + n = (*ev_var).n + 1 ;which takes the coordinates of your mouse location and<br> + (*ev_var).n = n ;takes the coordinates of where you LAST clicked,<br> + (*ev_var).x(0) = 0 ;and draws a line connecting the two points<br> + location = convert_coord(ev.x, ev.y, /device, /to_data)<br> + (*ev_var).x(n) = location(0)<br> + (*ev_var).y(n) = location(1)<br> + IF ((*ev_var).x(n) gt 365) THEN BEGIN<br> + (*ev_var).x(n) = 365.<br> + (*ev_var).y(n) = (*ev_var).y(n-1)<br> + ENDIF<br> + PLOTS,[(*ev_var).x(n-1),(*ev_var).x(n)],[(*ev_var).y(n-1), (*ev_var).y(n)], COLOR = 25<br> + delx = (*ev_var).x(n) - (*ev_var).x(n-1) ;The slope and y-intercept of the drawn line is found and every day<br> + dely = (*ev_var).y(n) - (*ev_var).y(n-1) ;that is in between the endpoints of the line<br> + m = dely / delx ;is assigned the line's slope and y-intercept<br> + b = (*ev_var).y(n) - (m * (*ev_var).x(n))<br> + FOR i = FLOOR((*ev_var).x(n-1)) + 1, FLOOR((*ev_var).x(n)) DO BEGIN<br> + (*ev_var).slope[i] = m<br> + (*ev_var).yintercept[i] = b<br> + ENDFOR<br> + print, 'Size of '<br> + help, (*ev_var).y_val_all3<br> + FOR j = 1, 365 DO BEGIN ;From the slope and y-intercept of everyday<br> + (*ev_var).y_val_all3[j,(*ev_var).component] = j * (*ev_var).slope[j]$ ;a yvalue is found for that day and stored in<br> + + (*ev_var).yintercept[j] ;the state pointer array y_val_all3 (capable of storing<br> + ENDFOR<br> + PRINT, (*ev_var).y_val_all3[365,0]<br> + Print, (*ev_var).y_val_all3[365,1]<br> + Print, (*ev_var).y_val_all3[365,2] ;yvalues for every day for each component of a station)<br> + ENDIF<br> + <br> + IF ((*ev_var).mouse((*ev_var).component) eq 1) THEN BEGIN ;if fix lines is selected: when the mouse is<br> + ;DEPRESSED, a state pointer variable called 'motion'<br> + IF (ev.type eq 0) THEN BEGIN ;is set to 1, a counter state pointer variable, m, which counts<br> + (*ev_var).motion = 1 ;motion events is reset to zero, and two state pointer arrays which<br> + (*ev_var).m = 0 ;contain the x and y data coordinates of where the<br> + FOR i = 0, 99 DO BEGIN ;mouse is generating motion events, are reset to zero<br> + (*ev_var).x2(i) = 0<br> + (*ev_var).y2(i) = 0<br> + ENDFOR<br> + ENDIF<br> + <br> + IF (ev.type eq 1) THEN (*ev_var).motion = 0 ;when the mouse button is RELEASED, the state<br> + ;pointer variable 'motion' set back to zero<br> + IF ((*ev_var).motion eq 1 AND ev.type eq 2) THEN BEGIN ;this if-loop thus implies that<br> + m = (*ev_var).m + 1 ;if the mouse button is being<br> + (*ev_var).m = m ;held down and motion is occurring<br> + local = convert_coord(ev.x, ev.y, /device, /to_data) ;then with each different pixel<br> + (*ev_var).x2(m) = local(0) ;location the device coordinates<br> + (*ev_var).y2(m) = local(1) ;will be converted to data coordinates<br> + IF ((*ev_var).x2(m) lt 0 AND (*ev_var).x2(m) gt -.5) THEN BEGIN<br> + (*ev_var).y_val_all3[0,(*ev_var).component] = (*ev_var).y2(m)<br> + PLOT_IT, ev_var<br> + ENDIF ELSE BEGIN<br> + IF (ABS(((*ev_var).x2(m) MOD 1)-((*ev_var).x2(m-1) MOD 1)) ge .5) THEN BEGIN<br> + day = FLOOR((*ev_var).x2(m) + .5) ;this embedded if loop finds when an<br> + (*ev_var).y_val_all3[day,(*ev_var).component] = (*ev_var).y2(m) ;integer day is passed and changes the<br> + (*ev_var).y_val_all3[day,(*ev_var).component] = (*ev_var).y2(m) ;yvalue at that day to the converted<br> + PLOT_IT, ev_var ;device y-coordinate of where the motion<br> + ENDIF ;event occurred.<br> + ENDELSE<br> + ENDIF<br> + ENDIF ;The data and yvalues are then replotted<br> + end ;with this new yvalue using the procedure PLOT_IT<br> + ;so that AS the user creates motion events with the<br> + 'DONE' : WIDGET_CONTROL, ev.top, /DESTROY ;this button exits the program ;mouse button pressed, these new yvalues<br> + ;are constantly integrated into the graph that the<br> + 'FILE' : GET_THE_FILE, ev_var ;Calls procedure GET_THE_FILE which gets the file ;user is looking at<br> + <br> + 'REPLOT': begin<br> + ; basex = [ 9450, 6150, 0, 6900, 4240, 6050, 4220, 3870, 0, 2850, 0, 0 ] ;The REPLOT button finds the rotation angles necessary and fixes<br> + basex = [ 9450, 6150, 0, 6900, 4240, 7280, 4220, 3870, 0, 2850, 0, 0 ] ;The REPLOT button finds the rotation angles necessary and fixes<br> + <br> + index = where ((*ev_var).y_val_all3(*,*) eq 0) ;the baseline that the user drew which is represented by the yvalues<br> + PRINT, 'REPLOT ',index(0)<br> + help, index<br> + IF (index(0) eq -1) THEN BEGIN<br> + FOR j = 0, 365 DO BEGIN<br> + alpha = atan((*ev_var).y_val_all3[j,1],(*ev_var).y_val_all3[j,2]) ;these are the functions for finding<br> + zvalp = ((*ev_var).y_val_all3[j,1] * (sin(alpha)) + ((*ev_var).y_val_all3[j,2] * cos(alpha))) ;the rotation angles<br> + beta = FindBeta(zvalp, basex[(*ev_var).basex_index], (*ev_var).y_val_all3[j,0])<br> + s = MAX([0,j*24-11]) ;the MAX and MIN functions ensure that negative<br> + e = MIN([365*24,j*24+12]) ;subscripts and subscripts greater than 365 are not accessed<br> + FOR x = 0, 2 DO (*ev_var).yval_hours(x,s:e) = (*ev_var).y_val_all3[j,x]<br> + (*ev_var).lalpha(s:e) = LONG(alpha * 10000.0)<br> + (*ev_var).lbeta(s:e) = LONG(beta * 10000.0)<br> + (*ev_var).lx_yval(s:e) = LONG((*ev_var).y_val_all3(j,0) * 10000.0)<br> + (*ev_var).ly_yval(s:e) = LONG((*ev_var).y_val_all3(j,1) * 10000.0)<br> + (*ev_var).lz_yval(s:e) = LONG((*ev_var).y_val_all3(j,2) * 10000.0)<br> + index0 = where((*ev_var).data(0,s:e) eq 32767)<br> + index1 = where((*ev_var).data(1,s:e) eq 32767)<br> + index2 = where((*ev_var).data(2,s:e) eq 32767)<br> + pre_z = ((*ev_var).data(2,s:e) * cos(alpha)) + ((*ev_var).data(1,s:e) * sin(alpha)) ;these statements assign the corrected,<br> + (*ev_var).data(1,s:e) = ((*ev_var).data(1,s:e) * cos(alpha)) - ((*ev_var).data(2,s:e) * sin(alpha)) ;rotated yvalues to the data array,<br> + (*ev_var).data(0,s:e) = ((*ev_var).data(0,s:e) * cos(beta)) + (pre_z * sin(beta)) ;replacing the actual data<br> + (*ev_var).data(2,s:e) = (pre_z * cos(beta)) - ((*ev_var).data(0,s:e) * sin(beta))<br> + IF (index0(0) ne -1) THEN (*ev_var).data(0,index0+s) = 32767<br> + IF (index1(0) ne -1) THEN (*ev_var).data(1,index1+s) = 32767<br> + IF (index2(0) ne -1) THEN (*ev_var).data(2,index2+s) = 32767<br> + ENDFOR<br> + WIDGET_CONTROL, (*ev_var).mouse_select_ID, SENSITIVE = 0<br> + (*ev_var).mouse(*) = 2<br> + ENDIF ELSE BEGIN<br> + errmess = DIALOG_MESSAGE(['In order to proceed with rotation corrections, the x, y, AND z components must have baseline values.',$<br> + 'The year and station that you have selected do not have complete baselines for all three coordinates.'],$<br> + /ERROR, DIALOG_PARENT = draw) ;this error message box appears if the user tries to replot without<br> + (*ev_var).disp_err = errmess ;having created baselines for all three coordinate axis<br> + ENDELSE<br> + <br> + PLOT_IT, ev_var<br> + end<br> + <br> + 'PRINT': begin<br> + Months = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']<br> + Days_in_month = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]<br> + IF ((*ev_var).year MOD 4 eq 0) THEN Days_in_month(2) = 29<br> + basex = [ 9450, 6150, 0, 6900, 4240, 6050, 4220, 3870, 0, 2850, 0, 0 ]<br> + FOR month = 0, 11 DO BEGIN<br> + s = total(Days_in_month(0:month)) * 24<br> + e = total(Days_in_month(0:month+1)) * 24 - 1<br> + ;openw, x,"/magneto3/maccs/maccsidl/sarah13/" + $<br> + openw, x,"/raid/2004/rotated/cor/" + $<br> + STRUPCASE((*ev_var).station) + $<br> + strmid((*ev_var).year,2,2) + $<br> + Months(month) + '.cor', /get_lun<br> + FOR hour = s, e DO BEGIN<br> + writeu,x,long(basex[(*ev_var).basex_index]*10000.), $<br> + long((*ev_var).yval_hours(0,hour)*10000.), $<br> + long((*ev_var).yval_hours(1,hour)*10000.), $<br> + long((*ev_var).yval_hours(2,hour)*10000.), $<br> + long((*ev_var).lalpha(hour)), $<br> + long((*ev_var).lbeta(hour))<br> + <br> + ; print,hour,long(basex[(*ev_var).basex_index]*10000.), $<br> + ; long((*ev_var).yval_hours(0,hour)*10000.), $<br> + ; long((*ev_var).yval_hours(1,hour)*10000.), $<br> + ; long((*ev_var).yval_hours(2,hour)*10000.), $<br> + ; long((*ev_var).lalpha(hour)), $<br> + ; long((*ev_var).lbeta(hour))<br> + ENDFOR<br> + close, x<br> + free_lun, x<br> + ENDFOR<br> + <br> + PLOT_IT, ev_var<br> + end<br> + <br> + 'SLIDER1': begin<br> + (*ev_var).start_day = ev.value<br> + PLOT_IT, ev_var<br> + end<br> + <br> + 'SLIDER2': begin<br> + (*ev_var).stop_day = ev.value<br> + PLOT_IT, ev_var<br> + end<br> + <br> + 'MOUSE_SELECT': begin<br> + print, (*ev_var).mouse(*)<br> + (*ev_var).mouse((*ev_var).component) = ev.value<br> + print, (*ev_var).mouse(*)<br> + IF ((*ev_var).mouse((*ev_var).component) eq 1) THEN BEGIN<br> + errmessage = DIALOG_MESSAGE('You cannot draw'$<br> + +'anymore lines' $<br> + +'once you have started fixing them!'$<br> + +'Are you sure you are done drawing lines?', TITLE = 'CAUTION!',$<br> + DIALOG_PARENT = draw, /QUESTION)<br> + (*ev_var).disp_err = errmessage<br> + IF (errmessage eq 'No') THEN BEGIN<br> + (*ev_var).mouse((*ev_var).component) = 0<br> + WIDGET_CONTROL, (*ev_var).mouse_select_ID, SET_VALUE = 0<br> + ENDIF<br> + IF (errmessage eq 'Yes') THEN BEGIN<br> + (*ev_var).mouse((*ev_var).component) = 1<br> + PLOT_IT, ev_var<br> + ENDIF<br> + ENDIF<br> + end<br> + <br> + 'STATION': begin<br> + (*ev_var).basex_index = ev.index<br> + abbrev = ['pg','cy','iq','cd','ig','ch','rb','pb','bl','gh','cb','re']<br> + (*ev_var).station = abbrev(ev.index)<br> + end<br> + <br> + 'YEAR': begin<br> + years = ['1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004','2005','2006','2007']<br> + (*ev_var).year = years(ev.index)<br> + end<br> + <br> + 'COMPONENT': begin<br> + (*ev_var).component = ev.value<br> + IF ((*ev_var).y_val_all3(360,(*ev_var).component) ne 0) THEN BEGIN<br> + PLOT_IT, ev_var<br> + IF ((*ev_var).mouse((*ev_var).component) eq 0) THEN WIDGET_CONTROL, (*ev_var).mouse_select_ID, SENSITIVE = 13, SET_VALUE = 0<br> + IF ((*ev_var).mouse((*ev_var).component) eq 1 OR (*ev_var).component eq 2) THEN WIDGET_CONTROL, (*ev_var).mouse_select_ID, SENSITIVE = 0<br> + ENDIF ELSE BEGIN<br> + (*ev_var).n = 0<br> + FOR p = 0, 99 DO (*ev_var).x(p) = 0<br> + FOR m = 0, 99 DO (*ev_var).y(m) = 0<br> + FOR r = 0, 365 DO (*ev_var).slope(r) = 0<br> + FOR l = 0, 365 DO (*ev_var).yintercept(l) = 0<br> + PLOT_IT, ev_var<br> + index = where((*ev_var).data((*ev_var).component,*) ne 32767)<br> + (*ev_var).y(0) = (*ev_var).data((*ev_var).component,index(0))<br> + (*ev_var).y_val_all3(0,(*ev_var).component) = (*ev_var).data((*ev_var).component,index(0))<br> + WIDGET_CONTROL, (*ev_var).mouse_select_ID, SENSITIVE = 13, SET_VALUE = 0<br> + (*ev_var).mouse((*ev_var).component) = 0<br> + ENDELSE<br> + end<br> + <br> + 'RANGE': begin<br> + (*ev_var).range = ev.value<br> + t = findgen(8760)<br> + s = (*ev_var).start_day * 24<br> + e = (*ev_var).stop_day * 24 - 1<br> + index = where ((*ev_var).data((*ev_var).component,s:e) ne 32767)<br> + (*ev_var).ave_val = MEDIAN((*ev_var).data((*ev_var).component,index+s))<br> + PLOT, t(s:e)/24, FLAG((*ev_var).data((*ev_var).component,s:e)),$<br> + MAX_VAL = 100000, YSTYLE = 1,$<br> + YRANGE = [(*ev_var).ave_val-(*ev_var).range, (*ev_var).ave_val+(*ev_var).range],$<br> + XRANGE = [(*ev_var).start_day, (*ev_var).stop_day], XSTYLE = 1<br> + OPLOT, findgen(366), (*ev_var).y_val_all3(0:365,(*ev_var).component), PSYM = -5, COLOR = 25<br> + end<br> + <br> + ENDCASE<br> + <br> + END<br> + <br> + <br> + <br> + PRO wid_draw<br> + <br> + LOADCT, 12<br> + <br> + base = WIDGET_BASE(xoffset = 100)<br> + <br> + draw = WIDGET_DRAW(base, XOFFSET = 0, YOFFSET = 130, XSIZE = 800, YSIZE = 500,$<br> + UVALUE = 'DRAW', /BUTTON_EVENTS, /MOTION_EVENTS)<br> + <br> + button = WIDGET_BUTTON(base, value = 'Done', uvalue = 'DONE',$<br> + scr_xsize = 100, XOFFSET = 442, YOFFSET = 92)<br> + <br> + file_button = WIDGET_BUTTON(base, value = 'Get file', uvalue = 'FILE',$<br> + scr_xsize = 100, scr_ysize = 38, XOFFSET = 180, YOFFSET = 53)<br> + <br> + replot_button = WIDGET_BUTTON(base, value = 'Replot', uvalue = 'REPLOT',$<br> + scr_xsize = 100, XOFFSET = 442, YOFFSET = 15)<br> + <br> + print_button = WIDGET_BUTTON(base, value = 'Creat File', uvalue = 'PRINT',$<br> + scr_xsize = 100, XOFFSET = 442, YOFFSET = 53)<br> + <br> + slider1 = WIDGET_SLIDER(base, value = 0, title = 'Start day',$<br> + uvalue = 'SLIDER1', XOFFSET = 565, YOFFSET = 65, maximum = 365,$<br> + scr_xsize = 100)<br> + <br> + slider2 = WIDGET_SLIDER(base, value = 365, title = 'Stop day',$<br> + uvalue = 'SLIDER2', XOFFSET = 685, YOFFSET = 65, maximum = 365,$<br> + scr_xsize = 100)<br> + <br> + mouse_select_ID = CW_BGROUP(base, ['draw lines', 'fix lines'], SET_VALUE = 0,$<br> + XOFFSET = 45, YOFFSET = 93, UVALUE = 'MOUSE_SELECT', /ROW,$<br> + /EXCLUSIVE)<br> + <br> + station = WIDGET_DROPLIST(base, FRAME = 5, TITLE = 'MACCS Stations',$<br> + UVALUE = 'STATION', VALUE = ['Pangnirtung', 'Clyde River', 'Iqaluit',$<br> + 'Cape Dorset', 'Igloolik', 'Coral Harbour', 'Repulse Bay', 'Pelly Bay',$<br> + 'Baker Lake', 'Gjoa Haven', 'Cambridge Bay', 'Resolute Bay', 'Nain'],$<br> + scr_xsize = 100, XOFFSET = 15, YOFFSET = 10)<br> + <br> + year_select = WIDGET_DROPLIST(base, FRAME = 5, TITLE = 'Select Year',$<br> + UVALUE = 'YEAR', VALUE = ['1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004','2005','2006','2007'],$<br> + scr_xsize = 100, XOFFSET = 15, YOFFSET = 50)<br> + <br> + component_select = CW_BGROUP(base, ['x component', 'y component', 'z component'],$<br> + SET_VALUE = 0, UVALUE = 'COMPONENT', XOFFSET = 295, YOFFSET = 15,$<br> + /COLUMN, /EXCLUSIVE, /NO_RELEASE)<br> + <br> + y_range = WIDGET_SLIDER(base, value = 0, TITLE = 'y range(+/-)', UVALUE='RANGE',$<br> + maximum = 1000, XOFFSET = 625, YOFFSET = 10, scr_xsize = 100)<br> + <br> + <br> + <br> + ev_var = ptr_new({n:0,x:fltarr(100),y:fltarr(100),$<br> + slope: fltarr(366),$<br> + yintercept: fltarr(366),$<br> + start_day: 0.,$<br> + stop_day: 365.,$<br> + data: fltarr(3,24*366),$<br> + station: 'Pangnirtung',$<br> + basex_index: 0,$<br> + year: '2001',$<br> + component: 0.,$<br> + mouse_select_ID: mouse_select_ID,$<br> + mouse: intarr(3),$<br> + hour: 0.,$<br> + day: 0.,$<br> + range: 0.,$<br> + ave_val: 0.,$<br> + disp_err: " ",$<br> + motion: 0,$<br> + lx_yval: fltarr(24*366),$<br> + ly_yval: fltarr(24*366),$<br> + lz_yval: fltarr(24*366),$<br> + lalpha: fltarr(24*366),$<br> + lbeta: fltarr(24*366),$<br> + yval_hours: fltarr(3,24*366),$<br> + y_val_all3: fltarr(366,3),$<br> + m:0, x2:fltarr(1000), y2:fltarr(1000)})<br> + <br> + WIDGET_CONTROL, base, SET_UVALUE = ev_var<br> + <br> + WIDGET_CONTROL, /REALIZE, base<br> + <br> + WIDGET_CONTROL, draw, GET_VALUE = index<br> + <br> + WSET, index<br> + <br> + <br> + XMANAGER, 'Wid_draw', base<br> + <br> + ptr_free, ev_var<br> + <br> + END<br> + <br> + <br> + <br> + PRO PLOT_IT, ev_var<br> + t = findgen(8760)<br> + s = (*ev_var).start_day * 24<br> + e = (*ev_var).stop_day * 24 - 1<br> + IF (s GE e) THEN print, 'Invalid start and end day' ELSE BEGIN<br> + index = where ((*ev_var).data((*ev_var).component,s:e) ne 32767)<br> + IF (index(0) ne -1) THEN BEGIN<br> + IF ((*ev_var).range eq 0) THEN BEGIN<br> + PLOT, t(s:e)/24, FLAG((*ev_var).data((*ev_var).component,s:e)),$<br> + MAX_VAL = 100000, /YSTYLE,$<br> + XRANGE = [(*ev_var).start_day, (*ev_var).stop_day], XSTYLE = 1<br> + OPLOT, findgen(366), (*ev_var).y_val_all3(0:365,(*ev_var).component), PSYM = -5, COLOR = 25<br> + ENDIF ELSE BEGIN<br> + (*ev_var).ave_val = MEDIAN((*ev_var).data((*ev_var).component,index+s))<br> + PLOT, t(s:e)/24, FLAG((*ev_var).data((*ev_var).component, s:e)),$<br> + MAX_VAL = 100000, YSTYLE = 1,$<br> + XRANGE = [(*ev_var).start_day, (*ev_var).stop_day], XSTYLE = 1,$<br> + YRANGE = [(*ev_var).ave_val-(*ev_var).range, (*ev_var).ave_val+(*ev_var).range]<br> + OPLOT, findgen(366), (*ev_var).y_val_all3(0:365,(*ev_var).component), PSYM = -5, COLOR = 25<br> + ENDELSE<br> + ENDIF ELSE BEGIN<br> + print, 'No data in range: ', 'Day ', BYTE((*ev_var).start_day),$<br> + ' to Day ', BYTE((*ev_var).stop_day)<br> + ENDELSE<br> + ENDELSE<br> + IF ((*ev_var).mouse((*ev_var).component) eq 1) THEN WIDGET_CONTROL, (*ev_var).mouse_select_ID, SENSITIVE = 0<br> + END<br> + <br> + <br> + <br> + PRO GET_THE_FILE, ev_var<br> + (*ev_var).n = 0<br> + (*ev_var).x(*) = 0<br> + (*ev_var).y(*) = 0<br> + (*ev_var).slope(*) = 0<br> + (*ev_var).yintercept(*) = 0<br> + (*ev_var).y_val_all3(*,*) = 0<br> + (*ev_var).data(*,*) = 0<br> + (*ev_var).lx_yval(*) = 0<br> + (*ev_var).ly_yval(*) = 0<br> + (*ev_var).lz_yval(*) = 0<br> + (*ev_var).lalpha(*) = 0<br> + (*ev_var).lbeta(*) = 0<br> + IF ((*ev_var).station eq 'Pangnirtung') THEN (*ev_var).station = 'pg'<br> + hour_read, code = STRUPCASE((*ev_var).station), year = (*ev_var).year, temp_data<br> + (*ev_var).data=temp_data<br> + t = findgen(8760)<br> + s = (*ev_var).start_day * 24<br> + e = (*ev_var).stop_day * 24 - 1<br> + i = where ((*ev_var).data((*ev_var).component,s:e) ne 32767)<br> + IF (i(0) eq -1) THEN BEGIN<br> + errmessage = DIALOG_MESSAGE(['There is no data for this station in the year you selected.',$<br> + 'Please select a different file.'], DIALOG_PARENT = DRAW, /ERROR)<br> + (*ev_var).disp_err = errmessage<br> + ENDIF ELSE BEGIN<br> + (*ev_var).ave_val = MEDIAN((*ev_var).data((*ev_var).component,i+s))<br> + IF ((*ev_var).range eq 0) THEN BEGIN<br> + PLOT, t((*ev_var).start_day * 24:(*ev_var).stop_day * 24 - 1)/24,$<br> + FLAG((*ev_var).data((*ev_var).component,*)), MAX_VAL=100000, /YSTYLE,$<br> + XRANGE = [(*ev_var).start_day, (*ev_var).stop_day], XSTYLE = 1<br> + PLOTS, t(0)/365., FLAG((*ev_var).data((*ev_var).component,0))<br> + ENDIF ELSE BEGIN<br> + PLOT, t((*ev_var).start_day * 24:(*ev_var).stop_day * 24 - 1)/24,$<br> + FLAG((*ev_var).data((*ev_var).component,*)), MAX_VAL=100000, YSTYLE = 1,$<br> + XRANGE = [(*ev_var).start_day, (*ev_var).stop_day], XSTYLE = 1,$<br> + YRANGE = [(*ev_var).ave_val-(*ev_var).range, (*ev_var).ave_val+(*ev_var).range]<br> + PLOTS, t(0)/365., FLAG((*ev_var).data((*ev_var).component,0))<br> + ENDELSE<br> + ENDELSE<br> + index = where((*ev_var).data((*ev_var).component,*) ne 32767)<br> + (*ev_var).y(0) = (*ev_var).data((*ev_var).component,index(0))<br> + (*ev_var).y_val_all3(0,(*ev_var).component) = (*ev_var).data((*ev_var).component,index(0))<br> + WIDGET_CONTROL, (*ev_var).mouse_select_ID, SENSITIVE = 13, SET_VALUE = 0<br> + (*ev_var).mouse = 0<br> + <br> + END</span> </td> </tr> </table> </div> hour read.prohttp://maccs.wikispot.org/hour_read.pro2007-07-25 21:46:07maccs <div id="content" class="wikipage content"> Differences for hour read.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ Pro hour_read, code=code, year=year, month=month, length=length, data<br> + <br> + if not keyword_set(month) then month=1<br> + month = month - 1<br> + if not keyword_set(length) then length=12<br> + length = length - 1<br> + <br> + path='/magneto3/maccs/murr/hour/'<br> + path='/atmos5/2000/hour/'<br> + path='/raid/2004/unrotated/hour/'<br> + months = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']<br> + days = [31,28,31,30,31,30,31,31,30,31,30,31]<br> + if year mod 4 eq 0 then days(1)=days(1)+1<br> + hours = days*24.<br> + total_hours = total(hours(month:month+length))<br> + <br> + data = fltarr(3,total_hours)<br> + <br> + j=0<br> + for i = 0,length do begin<br> + filename = path+code+strmid(strip(year), 2,2)+months(i+month)+'.1h'<br> + openr,file,filename,/get_lun,error=err<br> + if err ne 0 then begin<br> + print,'Error in '+filename+' '+!err_string<br> + data(*,j:j+hours(i+month)-1)=32767<br> + j = j + hours(i+month)<br> + endif else begin<br> + print,'Processing '+filename<br> + temp_data = bytarr(12*hours(i+month))<br> + readu,file,temp_data<br> + for k = 0,hours(i+month)-1 do begin<br> + data(0,j) = (long(temp_data(12*k:12*k+11),0)) / 1000.<br> + data(1,j) = (long(temp_data(12*k:12*k+11),4)) / 1000.<br> + data(2,j) = (long(temp_data(12*k:12*k+11),8)) / 1000.<br> + j=j+1<br> + endfor<br> + close,file<br> + free_lun,file<br> + endelse<br> + endfor<br> + <br> + <br> + end</span> </td> </tr> </table> </div> findbeta.prohttp://maccs.wikispot.org/findbeta.pro2007-07-25 21:45:28maccs <div id="content" class="wikipage content"> Differences for findbeta.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ Function FindBeta, zprime, xnaught, xp<br> + <br> + ;This function uses 1-stage iteration to find the sensor rotation angle<br> + ;BETA, a rotation about the BH axis<br> + <br> + beta1=(xnaught-xp)/zprime<br> + beta=(xnaught-(xp*cos(beta1)))/zprime<br> + <br> + return,beta<br> + <br> + end</span> </td> </tr> </table> </div> houravrg.prohttp://maccs.wikispot.org/houravrg.pro2007-07-25 21:43:55maccs <div id="content" class="wikipage content"> Differences for houravrg.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ;Program to make 1-hour averaged files from 1-minute averaged monthly<br> + <br> + ;files and to plot them in 1 or 6 month format<br> + <br> + <br> + <br> + Pro houravrg, wdin=wdin, wdout=wdout, code=code, yr=yr<br> + <br> + <br> + <br> + <br> + <br> + ;cd,wdin<br> + <br> + <br> + <br> + ;print,'ls '+code+'*'+yr+'*.1m'<br> + <br> + ;spawn,'ls '+code+'*'+yr+'[a-z]*.1m*',fnames<br> + <br> + search = FILEPATH(code+'*'+yr+'*.1m*', ROOT_DIR = wdin)<br> + <br> + print, search<br> + <br> + fnames = findfile(search) ;,count=num_raw)<br> + <br> + fnames = file_basename(fnames)<br> + <br> + <br> + <br> + print,fnames<br> + <br> + numfiles=n_elements(fnames)<br> + <br> + code=strarr(numfiles)<br> + <br> + year=code<br> + <br> + month=code<br> + <br> + <br> + <br> + for i = 0L,numfiles-1 do begin<br> + <br> + code(i) = strmid(fnames(i),0,2)<br> + <br> + year(i) = strmid(fnames(i),2,2)<br> + <br> + month(i) = strmid(fnames(i),4,3)<br> + <br> + endfor<br> + <br> + <br> + <br> + hor = '.1h'<br> + <br> + <br> + <br> + for j = 0L,numfiles-1 do begin<br> + <br> + <br> + <br> + name = fnames(j)<br> + <br> + print,'Now processing file '+name+'....'<br> + <br> + <br> + <br> + if month(j) eq 'jan' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + if month(j) eq 'feb' then begin<br> + <br> + if (year(j) eq 92) or (year(j) eq 96) or (year(j) eq 00) then begin<br> + <br> + njours = 29.0<br> + <br> + endif else begin<br> + <br> + njours = 28.0<br> + <br> + endelse<br> + <br> + endif<br> + <br> + if month(j) eq 'mar' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + if month(j) eq 'apr' then begin<br> + <br> + njours = 30.0<br> + <br> + endif<br> + <br> + if month(j) eq 'may' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + if month(j) eq 'jun' then begin<br> + <br> + njours = 30.0<br> + <br> + endif<br> + <br> + if month(j) eq 'jul' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + if month(j) eq 'aug' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + if month(j) eq 'sep' then begin<br> + <br> + njours = 30.0<br> + <br> + endif<br> + <br> + if month(j) eq 'oct' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + if month(j) eq 'nov' then begin<br> + <br> + njours = 30.0<br> + <br> + endif<br> + <br> + if month(j) eq 'dec' then begin<br> + <br> + njours = 31.0<br> + <br> + endif<br> + <br> + name=FILEPATH(name, ROOT_DIR = wdin)<br> + <br> + openr,file,name,/get_lun<br> + <br> + <br> + <br> + scale = 1000.0<br> + <br> + print,'Reading all data into component arrays....'<br> + <br> + len = 20160.0 * njours<br> + <br> + data = bytarr(len)<br> + <br> + numrecords = 1440.0 * njours<br> + <br> + x = fltarr(numrecords)<br> + <br> + y = x<br> + <br> + z = x<br> + <br> + buf = bytarr(numrecords)<br> + <br> + <br> + <br> + readu,file,data<br> + <br> + <br> + <br> + for k = 0L,numrecords-1 do begin<br> + <br> + ind1 = 14 * k<br> + <br> + ind2 = ind1 + 13<br> + <br> + buf = data(ind1:ind2)<br> + <br> + x(k) = (long(buf,2)) / scale<br> + <br> + y(k) = (long(buf,6)) / scale<br> + <br> + z(k) = (long(buf,10)) / scale<br> + <br> + endfor<br> + <br> + <br> + <br> + close,file<br> + <br> + free_lun,file<br> + <br> + <br> + <br> + print,'Averaging data....'<br> + <br> + xhrav = fltarr(njours*24)<br> + <br> + yhrav = xhrav<br> + <br> + zhrav = xhrav<br> + <br> + hrnum = findgen((njours*24) + 1)<br> + <br> + newfile = wdout+code(j)+year(j)+month(j)+hor<br> + <br> + <br> + <br> + ; cd,wd<br> + <br> + <br> + <br> + openw,nfile,newfile,/get_lun<br> + <br> + <br> + <br> + for p = 0L,numrecords-1,60 do begin<br> + <br> + divisx = 0<br> + <br> + divisy = 0<br> + <br> + divisz = 0<br> + <br> + subx = 0<br> + <br> + suby = 0<br> + <br> + subz = 0<br> + <br> + for q = 0L,59 do begin<br> + <br> + if x(p+q) eq 32767.0 then begin<br> + <br> + divisx = divisx<br> + <br> + subx = subx<br> + <br> + endif else begin<br> + <br> + divisx = divisx + 1<br> + <br> + subx = subx + x(p+q)<br> + <br> + endelse<br> + <br> + if y(p+q) eq 32767.0 then begin<br> + <br> + divisy = divisy<br> + <br> + suby = suby<br> + <br> + endif else begin<br> + <br> + divisy = divisy + 1<br> + <br> + suby = suby + y(p+q)<br> + <br> + endelse<br> + <br> + if z(p+q) eq 32767.0 then begin<br> + <br> + divisz = divisz<br> + <br> + subz = subz<br> + <br> + endif else begin<br> + <br> + divisz = divisz + 1<br> + <br> + subz = subz + z(p+q)<br> + <br> + endelse<br> + <br> + endfor<br> + <br> + elem = (p + 1) / 60<br> + <br> + if divisx lt 45 then begin<br> + <br> + xhrav(elem) = 32767.0<br> + <br> + endif else begin<br> + <br> + xhrav(elem) = subx / divisx<br> + <br> + endelse<br> + <br> + if divisy lt 45 then begin<br> + <br> + yhrav(elem) = 32767.0<br> + <br> + endif else begin<br> + <br> + yhrav(elem) = suby / divisy<br> + <br> + endelse<br> + <br> + if divisz lt 45 then begin<br> + <br> + zhrav(elem) = 32767.0<br> + <br> + endif else begin<br> + <br> + zhrav(elem) = subz / divisz<br> + <br> + endelse<br> + <br> + xav = long(xhrav(elem) * 1000.0)<br> + <br> + yav = long(yhrav(elem) * 1000.0)<br> + <br> + zav = long(zhrav(elem) * 1000.0)<br> + <br> + writeu,nfile,xav,yav,zav<br> + <br> + endfor<br> + <br> + print,'1-hour file written.'<br> + <br> + close,nfile<br> + <br> + free_lun,nfile<br> + <br> + endfor<br> + <br> + <br> + <br> + print,'DONE!'<br> + <br> + <br> + <br> + end<br> + <br> + <br> + <br> + <br> + <br> + <br> + </span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:42:43maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 26: </td> <td> Line 26: </td> </tr> <tr> <td> <span>-</span> Nb. Requires an extra file "[<span>"</span>missing.1m<span>"</span>]", to substitute </td> <td> <span>+</span> Nb. Requires an extra file "[<span>[File(</span>missing.1m<span>)]</span>]", to substitute </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:42:21maccsUpload of file <a href="http://maccs.wikispot.org/Processing_Software?action=Files&do=view&target=missing.1m">missing.1m</a>.merge files.prohttp://maccs.wikispot.org/merge_files.pro2007-07-25 21:36:39maccs <div id="content" class="wikipage content"> Differences for merge files.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ pro merge_files,month=month,year=year,code=code,in_dir=in_dir,out_dir=out_dir,can=can,grn=grn,missing_min_path=missing_min_path<br> + <br> + ; This program merges daily 1 min. files into 1 big file<br> + <br> + mm=['JANUARY','FEBRUARY','MARCH','APRIL','MAY','JUNE',$<br> + 'JULY','AUGUST','SEPTEMBER','OCTOBER','NOVEMBER','DECEMBER']<br> + months=['jan','feb','mar','apr','may','jun',$<br> + 'jul','aug','sep','oct','nov','dec']<br> + set=strarr(31)<br> + missdays=intarr(31)<br> + yrstr=string(year,format='(i2.2)')<br> + if (year mod 4 eq 0) then begin<br> + day1=[1,32,61,92,122,153,183,214,245,275,306,336]<br> + day2=[31,60,91,121,152,182,213,244,274,305,335,366]<br> + endif else begin<br> + day1=[1,32,60,91,121,152,182,213,244,274,305,335]<br> + day2=[31,59,90,120,151,181,212,243,273,304,334,365]<br> + endelse<br> + <br> + ; Select stations<br> + <br> + can_stations=['mc','co','rl','sm','si','da','pi','is','gi','ba','cc','es','rn','ta']<br> + grn_stations=['am','sc','dn','dm','nr','na','fh','gb','sk','st','at','gd','um',$<br> + 'up','ku','sv','th','me','mw','mn','mg']<br> + mac_stations=['re','cy','ig','rb','pb','gh','cb','pg','iq','cd','ch','bl', 'na']<br> + stations = mac_stations<br> + if keyword_set(can) then stations = can_stations<br> + if keyword_set(grn) then stations = grn_stations<br> + if keyword_set(code) then stations = [code]<br> + <br> + ; Set up loop<br> + <br> + if keyword_set(month) then begin<br> + start_month = month<br> + end_month = month<br> + endif else begin<br> + start_month = 1<br> + end_month = 12<br> + endelse<br> + <br> + for month = start_month, end_month do begin<br> + for ii = 0, n_elements(stations)-1 do begin<br> + code=STRUPCASE(stations(ii))<br> + mo=month-1<br> + ndays=(day2(mo)-day1(mo))+1<br> + print,'Processing '+expandcode(code)+' '+mm(mo)+' '+yrstr<br> + searchstr=code+strtrim(string(year),2)+'*'+'.1m'<br> + print,in_dir+'\'+searchstr<br> + fn=findfile(in_dir+'/'+searchstr,count=nel)<br> + dot_pos = strpos(fn(0),'.')<br> + d=fix(strmid(fn,dot_pos-3,3)) ;form array of days<br> + if nel EQ 0 then begin<br> + print,'NO MATCH FOR GIVEN YEAR AND STATION CODE'<br> + goto, next_file<br> + endif<br> + <br> + ngood=0<br> + nbad=0<br> + s=0<br> + for k=day1(mo),day2(mo) do begin<br> + j=k-day1(mo)<br> + i=where((d EQ k),count)<br> + if count NE 0 then begin<br> + set(j)=fn(i) ;names of month files<br> + ngood=ngood+1<br> + endif else begin<br> + set(j)='missing.1m'<br> + nbad=nbad+1<br> + missdays(s)=k ;missing days<br> + s=s+1<br> + endelse<br> + endfor<br> + if ngood EQ 0 then begin<br> + print,'NO FILES FOR GIVEN MONTH HAVE BEEN FOUND'<br> + goto, next_file<br> + endif<br> + if nbad NE 0 then begin<br> + print,format='(I3," missing days have been found")',nbad<br> + print,'They are:'<br> + print,missdays(0:s-1)<br> + endif<br> + <br> + ; Open month file and write<br> + <br> + newfn=out_dir+code+yrstr+months(mo)+'.1mg'<br> + openw,newf,newfn,/get_lun<br> + for kk=0,ndays-1 do begin<br> + if set(kk) NE 'missing.1m' then openr,minf,set(kk),/get_lun $<br> + else openr,minf,missing_min_path,/get_lun<br> + rec=assoc(minf,bytarr(20160))<br> + buf=rec(0)<br> + writeu,newf,buf<br> + free_lun,minf<br> + endfor<br> + free_lun,newf<br> + <br> + next_file:<br> + <br> + print,'ALL DONE...'<br> + <br> + endfor ; station loop<br> + endfor ; month loop<br> + end</span> </td> </tr> </table> </div> expandcode.prohttp://maccs.wikispot.org/expandcode.pro2007-07-25 21:35:42maccs <div id="content" class="wikipage content"> Differences for expandcode.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ function expandcode,code<br> + ;expands string CODE<br> + <br> + case strupcase(code) of<br> + 'BU': a='BOSTON UNIVERSITY'<br> + 'PG': a='PANGNIRTUNG'<br> + 'CD': a='CAPE DORSET'<br> + 'CH': a='CORAL HARBOUR'<br> + 'RB': a='REPULSE BAY'<br> + 'CY': a='CLYDE RIVER'<br> + 'IG': a='IGLOOLIK'<br> + 'PB': a='PELLY BAY'<br> + 'GH': a='GJOA HAVEN'<br> + 'RE': a='RESOLUTE BAY'<br> + 'CB': a='CAMBRIDGE BAY'<br> + 'BL': a='BAKER LAKE'<br> + 'IQ': a='IQALUIT'<br> + 'BA': a='BACK'<br> + 'GI': a='GILLAM'<br> + 'CC': a='CHURCHILL'<br> + 'ES': a='ESKIMO POINT'<br> + 'RN': a='RANKIN INLET'<br> + 'IS': a='ISLAND LAKE'<br> + 'PI': a='PINAWA'<br> + 'SM': a='FORT SMITH'<br> + 'CO': a='CONTWOYTO LAKE'<br> + 'RL': a='RABBIT LAKE'<br> + 'DA': a='DAWSON CREEK'<br> + 'SI': a='FORT SIMPSON'<br> + 'MC': a='FORT MCMURRAY'<br> + 'TA': a='TALOYAK'<br> + 'AM': a='AMK'<br> + 'GW': a='GREAT WHALE RIVER'<br> + 'PD': a='GREAT WHALE RIVER'<br> + 'TH': a='THULE'<br> + 'GD': a='GODHAVEN'<br> + 'NA': a='NAIN'<br> + ; 'NA': a='NARSARSUAQ'<br> + 'MG': a='MAGIC GISP'<br> + 'MN': a='MAGIC NORTH'<br> + 'ME': a='MAGIC EAST'<br> + 'MW': a='MAGIC WEST'<br> + 'NE': a='NEWPORT'<br> + 'RP': a='RAPID CITY'<br> + 'CS': a='CAMP DOUGLAS'<br> + 'ML': a='MOUNT CLEMENS'<br> + 'SU': a='SUDBURY'<br> + 'LO': a='LOMPOC'<br> + 'TP': a='TAMPA'<br> + <br> + else: begin<br> + a='unknown '<br> + ; message, 'Unknown station code'+': '+code<br> + end<br> + <br> + endcase<br> + return,a<br> + end</span> </td> </tr> </table> </div> sec to min.prohttp://maccs.wikispot.org/sec_to_min.pro2007-07-25 21:34:51maccs <div id="content" class="wikipage content"> Differences for sec to min.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/17/07<br> + <br> + ; sec_to_min.pro, compiles and runs with idl<br> + <br> + ; it is used in the 5 second to 1 minute average step<br> + <br> + ; needs read_maccs.pro &amp; write_maccs.pro to run<br> + <br> + ; input must be 5 second average files (.5s files)<br> + <br> + ; output is 1 minute average files (.1m files)<br> + <br> + ; example file names: input: CD04024.5s output: CD04024.1m<br> + <br> + ; to compile: .compile sec_to_min<br> + ; to run: sec_to_min, files="/path_to_input_file(s)/name_of_input_file(s)", out_dir="/path_to_output_directory/" (you can use * and ?)<br> + <br> + ; Example: five_sec_avg, files="/Volumes/physics_data/Ftp/MACCS_DATA/Unrotated/5sec/CD/2005/*.5s", out_dir="/Volumes/physics_data/Ftp/MACCS_DATA/Unrotated/5sec/CD/2005/"<br> + <br> + pro sec_to_min, files=files, out_dir=out_dir<br> + <br> + <br> + if (not keyword_set(files)) and (not keyword_set(out_dir)) then begin<br> + print,'Enter files=search string and out_dir=output directory'<br> + print,'Also, you must complie first with .r sec_to_min'<br> + stop<br> + endif<br> + <br> + ; This program makes 1 min averages from 5 sec MACCS data 10/30/01<br> + <br> + print,'running sec_to_min ver 1.0'<br> + data_files = findfile(files,count=count)<br> + if count eq 0 then begin<br> + print,'No files found in '+in_dir+' with '+files<br> + stop<br> + endif<br> + for i = 0, count-1 do begin<br> + read_maccs,data_files(i),time,bx,by,bz,/nt<br> + bx_avg = fast_avg(bx)<br> + by_avg = fast_avg(by)<br> + bz_avg = fast_avg(bz)<br> + ; plot,bx_avg,max_val=30000,/ystyle<br> + dot_pos=strpos(data_files(i),'.')<br> + new_file = out_dir+$<br> + strmid(data_files(i),dot_pos-7,8)+'1m'<br> + write_maccs,new_file,[32767,bx_avg,32767],$<br> + [32767,by_avg,32767],$<br> + [32767,bz_avg,32767],type='1mg'<br> + endfor<br> + <br> + end<br> + <br> + function fast_avg,b<br> + b_tmp = reform(b(12:17267),12,1438)<br> + bad = b_tmp eq 32767<br> + badsums = float(total(bad,1))/12.<br> + bad = where(b_tmp eq 32767,count)<br> + if count ne 0 then b_tmp(bad)=!values.f_nan<br> + b_avg = total(b_tmp,1,/nan)/(12.-badsums*12.)<br> + bad = where(badsums ge 0.4,count)<br> + if count ne 0 then b_avg(bad) = 32767.<br> + return,b_avg<br> + end</span> </td> </tr> </table> </div> five sec avg fast avg.prohttp://maccs.wikispot.org/five_sec_avg_fast_avg.pro2007-07-25 21:33:25maccs <div id="content" class="wikipage content"> Differences for five sec avg fast avg.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/16/07<br> + <br> + ; five_sec_avg_fast_avg.pro, compiles and runs with idl<br> + <br> + ; called by five_sec_avg.pro which is used in the 1/2 sec to 5 sec avg step<br> + <br> + ; inputs b1 &amp; b2<br> + <br> + ; returns b_avg<br> + <br> + <br> + <br> + function five_sec_avg_fast_avg,b1,b2<br> + <br> + ; # of sec in a day is 864000<br> + <br> + b_tmp = fltarr(86400*2)<br> + <br> + t1 = lindgen(86400)*2<br> + <br> + t2 = lindgen(86400)*2+1<br> + <br> + b_tmp(t1) = b1<br> + <br> + b_tmp(t2) = b2<br> + <br> + ; now all b1 and b2 for the same day<br> + <br> + ; are adjacent in the b_tmp array<br> + <br> + <br> + <br> + ; Always skip the first five values in front<br> + <br> + ; and the fifteen values in the back<br> + <br> + ; (see in five_sec_avg.pro where the values<br> + <br> + ; are printed), so basically two 5 sec intervals<br> + <br> + ; are missing in the final result<br> + <br> + b_tmp2 = reform(b_tmp(6:172785),10,17278)<br> + <br> + ; now b_tmp2 includes 10x17278 array, i.e. all<br> + <br> + ; the values from the a 5 sec interval are<br> + <br> + ; grouped together<br> + <br> + ; Nb. Mean of each row is then the 5 sec avg<br> + <br> + <br> + <br> + ; Nb. The bad value is 32767000L in the raw data.<br> + <br> + ; As the derived data is scaled with 1/1000 that<br> + <br> + ; gives this derived bad value<br> + <br> + bad = b_tmp2 eq 32767<br> + <br> + <br> + <br> + badsums = float(total(bad,1))/10.<br> + <br> + <br> + <br> + bad = where(b_tmp2 eq 32767,count)<br> + <br> + <br> + <br> + if count ne 0 then b_tmp2(bad)=!values.f_nan<br> + <br> + ; Nb. Strictly speaking the next line is not valid<br> + <br> + ; as it is illdefined, when badsums = 10,<br> + <br> + ; i.e. all the data points in the interval bad.<br> + <br> + ; This is recovered from in the next to last step<br> + <br> + ; by setting the average of any interval with more<br> + <br> + ; than 4 bad points to '32767' the designated bad value.<br> + <br> + b_avg = total(b_tmp2,1,/nan)/(10.-badsums*10.)<br> + <br> + <br> + <br> + bad = where(badsums ge 0.4,count)<br> + <br> + if count ne 0 then b_avg(bad) = 32767.<br> + <br> + return,b_avg<br> + <br> + end</span> </td> </tr> </table> </div> five sec avg.prohttp://maccs.wikispot.org/five_sec_avg.pro2007-07-25 21:32:35maccs <div id="content" class="wikipage content"> Differences for five sec avg.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/16/07<br> + <br> + ; five_sec_avg.pro, compiles and runs with idl<br> + <br> + ; it is used in the 1/2 sec to 5 sec avg step<br> + <br> + ; needs five_sec_avg_fast_avg.pro, read_maccs.pro &amp; write_maccs.pro to run<br> + <br> + ; input must be clean maccs files (.s2 files)<br> + <br> + ; output is 5 second average files (.5s files)<br> + <br> + ; example file names: input: CD04024.s2 output: CD04024.5s<br> + <br> + ; to compile &amp; run: five_sec_avg, files="/path_to_input_file(s)/name_of_input_file(s)", out_dir="/path_to_output_directory/" (you can use * and ?)<br> + <br> + ; Example: five_sec_avg, files="/Volumes/physics_data/Ftp/MACCS_DATA/Clean/CD/2005/*.s2", out_dir="/Volumes/physics_data/Ftp/MACCS_DATA/Unrotated/5sec/CD/2005/"<br> + <br> + <br> + <br> + pro five_sec_avg, files=files, out_dir=out_dir<br> + <br> + <br> + <br> + <br> + <br> + if (not keyword_set(files)) and (not keyword_set(out_dir)) then begin<br> + <br> + print,'Enter files=search string and out_dir=output directory'<br> + <br> + print,'Also, you must compile first with .r five_sec_avg'<br> + <br> + stop<br> + <br> + endif<br> + <br> + <br> + <br> + ; This program makes 5 sec averages from 1/2 sec MACCS data 04/26/00<br> + <br> + <br> + <br> + print,'running five_sec_avg ver 1.0'<br> + <br> + data_files = findfile(files,count=count)<br> + <br> + if count eq 0 then begin<br> + <br> + print,'No files found in '+in_dir+' with '+files<br> + <br> + stop<br> + <br> + endif<br> + <br> + for i = 0, count-1 do begin<br> + <br> + read_maccs,data_files(i),time,bx1,by1,bz1,type,$<br> + <br> + bx2=bx2,by2=by2,bz2=bz2,/nt<br> + <br> + if type eq 2 then begin<br> + <br> + ; bad_bx1=where(bx1 eq 32767,count)<br> + <br> + ; bx2(bad_bx1) = 32767<br> + <br> + bx_avg = five_sec_avg_fast_avg(bx1,bx2)<br> + <br> + by_avg = five_sec_avg_fast_avg(by1,by2)<br> + <br> + bz_avg = five_sec_avg_fast_avg(bz1,bz2)<br> + <br> + ;PRINT, 'The min and max of bx are ', MIN(bx_avg), ' and ', MAX(bx_avg)<br> + <br> + ;PRINT, 'The min and max of by are ', MIN(by_avg), ' and ', MAX(by_avg)<br> + <br> + ;PRINT, 'The min and max of bz are ', MIN(bz_avg), ' and ', MAX(bz_avg)<br> + <br> + <br> + <br> + endif else begin<br> + <br> + print,'GSC file'<br> + <br> + bx2=bx1 &amp; by2=by1 &amp; bz2=bz1<br> + <br> + bx_avg = five_sec_avg_fast_avg(bx1,bx2)<br> + <br> + by_avg = five_sec_avg_fast_avg(by1,by2)<br> + <br> + bz_avg = five_sec_avg_fast_avg(bz1,bz2)<br> + <br> + endelse<br> + <br> + ; plot,bx_avg,max_val=30000,/ystyle<br> + <br> + new_file = out_dir+$<br> + <br> + strmid(data_files(i),strlen(data_files(i))-10,8)+'5s'<br> + <br> + write_maccs,new_file,[32767,bx_avg,32767],$<br> + <br> + [32767,by_avg,32767],$<br> + <br> + [32767,bz_avg,32767],type='5sg'<br> + <br> + endfor<br> + <br> + <br> + <br> + end</span> </td> </tr> </table> </div> flag.prohttp://maccs.wikispot.org/flag.pro2007-07-25 21:31:58maccs <div id="content" class="wikipage content"> Differences for flag.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/6/07<br> + <br> + ; flag.pro, compiles and runs with idl<br> + <br> + ; called by step_view.pro (which is used in the manual step of removing spikes)<br> + <br> + <br> + <br> + function Flag,inarr<br> + <br> + ;raise flag levels to fit into MAXLEVEL<br> + <br> + outarr=(inarr NE !BAD)*inarr+(inarr EQ !BAD)*1E23<br> + <br> + return,outarr<br> + <br> + end</span> </td> </tr> </table> </div> cleaner.prohttp://maccs.wikispot.org/cleaner.pro2007-07-25 21:29:06maccs <div id="content" class="wikipage content"> Differences for cleaner.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>- cleaner.pro, compiles and runs with idl<br> - <br> - needs strip.pro to run<br> - <br> - input must be raw MACCS data file(s)<br> - <br> - output is a cleaned binary version of the raw data with filetype .s2<br> - <br> - example: if input file is CD05.4, output file is CD05004.s2<br> - <br> - to compile &amp; run: cleaner, "path_and_name_of_raw_data_file(s)" (you can use * and ?)<br> - <br> - default output directory is e:\<br> - <br> - to set output directory: out_dir="output_directory"<br> - <br> - to display a window with a graph: view="view"<br> - <br> - to create summary text file(s) containg the command line output: summary="summary"<br> - <br> - to save the .s2 file(s) in a subdirectory folder (which must already exist): month_str="sub_dir_name"<br> - <br> - to move the raw file(s) after creating the clean file(s): move="path" (if you used the month_str parameter, the file(s) will be moved to the subdirectory within the folder you specified for the move directory) Ex: if parameters are month_str="Jan05/", move="/Volumes/MACCS_DATA/" then raw file(s) will be moved to /Volumes/MACCS_DATA/Jan05/<br> - <br> - the click parameter should not be used unless changes are made to the program<br> - <br> - Example: cleaner, "/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2005/CD05.4", out_dir="/Users/johnson8/maccs/", summary="summary", month_str="Jan05/", move="/Users/johnson8/Desktop/", view="view"</span> </td> <td> <span>+ ; Comments added by Erik Johnson 7/3/07<br> + ; cleaner.pro, compiles and runs with idl<br> + ; needs strip.pro to run<br> + ; input must be raw MACCS data file(s)<br> + ; output is a cleaned binary version of the raw data with filetype .s2<br> + ; example: if input file is CD05.4, output file is CD05004.s2<br> + ; to compile &amp; run: cleaner, "path_and_name_of_raw_data_file(s)" (you can use * and ?)<br> + ; default output directory is e:\<br> + ; to set output directory: out_dir="output_directory"<br> + ; to display a window with a graph: view="view"<br> + ; to create summary text file(s) containg the command line output: summary="summary"<br> + ; to save the .s2 file(s) in a subdirectory folder (which must already exist): month_str="sub_dir_name"<br> + ; to move the raw file(s) after creating the clean file(s): move="path" (if you used the month_str parameter, the file(s) will be moved to the subdirectory within the folder you specified for the move directory) Ex: if parameters are month_str="Jan05/", move="/Volumes/MACCS_DATA/" then raw file(s) will be moved to /Volumes/MACCS_DATA/Jan05/<br> + ; the click parameter should not be used unless changes are made to the program<br> + ; Example: cleaner, "/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2005/CD05.4", out_dir="/Users/johnson8/maccs/", summary="summary", month_str="Jan05/", move="/Users/johnson8/Desktop/", view="view"<br> + <br> + pro cleaner,search,view=view,summary=summary,month_str=month_str,$<br> + calc_mon=calc_mon,out_dir=out_dir,click=click,move=move<br> + <br> + <br> + !p.multi=[0,0,4]<br> + if not keyword_set(month_str) then month_str = ''<br> + flagged_record = byte([32767000L,32767000L,32767000L,32767000L,32767000L,32767000L],0,1,24)<br> + x = 35 ;bytes<br> + clean_data = bytarr(28,86400)<br> + raw_files = findfile(search,count=num_raw)<br> + <br> + <br> + for i = 0, n_elements(raw_files)-1 do begin ; Loop over number of files to be processed<br> + if keyword_set(view) then window,0,xsize=600,ysize=700<br> + for ii = 0L,86399L do clean_data(0,ii) = [0B,0B,0B,0B,reform(flagged_record)]<br> + print,'done'<br> + print,raw_files(i)<br> + dot_pos = strpos(raw_files(i),'.')<br> + date = string(fix(strmid(raw_files(i),dot_pos+1,3)),format='(i3.3)')<br> + if keyword_set(calc_mon) then date_var,yrday=fix(strmid(raw_files(i),dot_pos-2,2)+date),month_str=month_str<br> + if not keyword_set(out_dir) then out_dir = 'e:\'<br> + ; OLD clean_file = out_dir+month_str+'\'+strmid(raw_files(i),dot_pos-4,4)+date+'.s2'<br> + clean_file = FILEPATH(strmid(raw_files(i),dot_pos-4,4)+date+'.s2', ROOT_DIR = out_dir, SUBDIR = [month_str])<br> + ; OLD text_file = out_dir+month_str+'\'+strmid(raw_files(i),dot_pos-4,4)+date+'.txt'<br> + text_file = FILEPATH(strmid(raw_files(i),dot_pos-4,4)+date+'.txt', ROOT_DIR = out_dir, SUBDIR = [month_str])<br> + print,clean_file,text_file<br> + <br> + ; Open "summary" text file is summary keyword is selected<br> + <br> + if keyword_set(summary) then openw,summary_file,text_file,/get_lun<br> + <br> + ; Open and read raw data file<br> + <br> + openr, unit, raw_files(i), error=err, /get_lun<br> + if err eq 0 then begin<br> + file_info = fstat(unit)<br> + print,file_info.isatty<br> + y = file_info.size / x<br> + PRINT, 'Y ', y<br> + print,raw_files(i)+' has '+strip(y)+' records.'<br> + if keyword_set(summary) then printf,summary_file,raw_files(i)+' has '+strip(y)+' records.'<br> + temp = assoc(unit, bytarr(x, y), 0)<br> + raw_data = temp(0)<br> + close,unit<br> + free_lun, unit<br> + endif else begin<br> + print,'An error has occured reading '+raw_files(i)<br> + stop<br> + endelse<br> + <br> + good_time = where((raw_data(30,*) ne 0) and (raw_data(31,*) ne 1),n_good_time)<br> + no_time = where((raw_data(30,*) eq 0) and (raw_data(31,*) eq 1),n_no_time)<br> + print,n_no_time,' records without time.'<br> + if n_no_time gt 0 then begin<br> + raw_data = raw_data(*,good_time)<br> + y = n_good_time<br> + endif<br> + <br> + ; Read data into arrays<br> + <br> + header= raw_data( 0,*)<br> + dd = fix (raw_data( 1: 2,*),0,1,y)<br> + hh = raw_data( 3,*)<br> + mm = raw_data( 4,*)<br> + ss = raw_data( 5,*)<br> + bx1 = long(raw_data( 6: 9,*),0,1,y)/1000.<br> + by1 = long(raw_data(10:13,*),0,1,y)/1000.<br> + bz1 = long(raw_data(14:17,*),0,1,y)/1000.<br> + bx2 = long(raw_data(18:21,*),0,1,y)/1000.<br> + by2 = long(raw_data(22:25,*),0,1,y)/1000.<br> + bz2 = long(raw_data(26:29,*),0,1,y)/1000.<br> + tf1 = raw_data(30,*)<br> + tf2 = raw_data(31,*)<br> + block = raw_data(32,*)<br> + status= raw_data(33,*)<br> + house = raw_data(34,*)<br> + <br> + ; Plot if keyword "view" is selected<br> + <br> + if keyword_set(view) then begin<br> + ; window,1,xsize=600,ysize=600<br> + seconds = hh*3600L + mm*60L + ss<br> + diff = seconds(1:n_elements(seconds)-1) - seconds(0:n_elements(seconds)-2)<br> + backward = where(diff lt 0,count)<br> + plot,seconds,/ystyle,title=raw_files(i)<br> + plot,bx1,max_val=median(bx1)+500,min_val=median(bx1)-500,/ystyle<br> + plot,by1,max_val=median(by1)+500,min_val=median(by1)-500,/ystyle<br> + plot,bz1,max_val=median(bz1)+500,min_val=median(bz1)-500,/ystyle<br> + ; if (keyword_set(click) and count gt 0) then cursor,cx,cy,/wait,/up,/norm<br> + ; print,cx,cy<br> + ; if cy lt .5 then goto,skip<br> + ; print,'noskip',cy<br> + endif<br> + <br> + ; Check day<br> + <br> + same_day = where(((dd gt 0) and (dd le 366)) and (dd ne dd(0)) and (tf1 eq 49) and (tf2 eq 48),count)<br> + if count ne 0 then begin<br> + <br> + print,raw_files(i)+' has more than one day.'<br> + ; for jk=0,count-1 do begin<br> + ; print,same_day(jk)<br> + ; for kk = same_day(jk)-2, same_day(jk)+2 do $<br> + ; print,header(kk),dd(kk),hh(kk),mm(kk),ss(kk),tf1(kk),tf2(kk),block(kk)<br> + ; endfor<br> + stop<br> + endif<br> + <br> + ; Find Gaps<br> + <br> + ; flagged = where((tf1 ne 49) or (tf2 ne 57),n_flagged)<br> + ; good = where((tf1 eq 49) and (tf2 eq 57),n_good)<br> + flagged = where((tf1 ne 49) or (tf2 ne 48),n_flagged)<br> + good = where((tf1 eq 49) and (tf2 eq 48),n_good)<br> + ; if n_good eq 0 then begin<br> + ; print,'n_good',n_good<br> + ; goto,skip<br> + ; endif<br> + delta_good = good(1:n_good-1) - good(0:n_good-2)<br> + good_gaps = where(delta_good ne 1,n_good_gap)<br> + <br> + seconds = hh * 3600. + mm * 60. + ss<br> + seconds = reform(seconds)<br> + <br> + ; Find first good record<br> + <br> + print,'first good time at ',hh(good(0)),':',mm(good(0)),':',ss(good(0))<br> + if keyword_set(summary) then printf,summary_file,'first good time at ',hh(good(0)),':',mm(good(0)),':',ss(good(0))<br> + clean_data(0,0:seconds(good(0))) = 2b<br> + for ii = 0L,seconds(good(0)) do clean_data(04:27,ii) = flagged_record<br> + <br> + ; Write good data into clean_data<br> + <br> + clean_time = findgen(86400)<br> + clean_data(0,seconds(good)) = 0b<br> + clean_data(1,*) = byte(floor(clean_time/3600.))<br> + clean_data(2,*) = byte(floor((clean_time-clean_data(1,*)*3600.)/60.))<br> + clean_data(3,*) = byte(clean_time-clean_data(1,*)*3600.-clean_data(2,*)*60.)<br> + <br> + clean_data(04:27,seconds(good)) = raw_data(06:29,good)<br> + <br> + ; Fix Gaps<br> + <br> + for jj = 0L,n_good_gap-1 do begin<br> + <br> + gap_start = good(good_gaps(jj))<br> + gap_stop = good(good_gaps(jj)+1)<br> + gap_delta_t = seconds(gap_stop) - seconds(gap_start)<br> + gap_delta_b = block(gap_stop) - block(gap_start)<br> + gap_length = gap_stop-gap_start<br> + print,'gap ',strip(jj),' at ',hh(gap_start),':',mm(gap_start),':',ss(gap_start),$<br> + ' has ',strip(gap_delta_t),' seconds and ',strip(gap_length),' data points'<br> + if keyword_set(summary) then printf,summary_file,'gap ',strip(jj),' at ',hh(gap_start),$<br> + ':',mm(gap_start),':',ss(gap_start),' has ',strip(gap_delta_t),' seconds and ',strip(gap_length),' data points'<br> + <br> + ; for kk = gap_start, gap_stop do begin<br> + ; print,dd(kk),hh(kk),mm(kk),ss(kk),bz1(kk),block(kk),tf1(kk),tf2(kk)<br> + ; endfor<br> + <br> + if (gap_length eq gap_delta_t) and (gap_length eq gap_delta_b) then begin<br> + clean_data(0,seconds(gap_start):seconds(gap_stop)) = 1b<br> + clean_data(04:27,seconds(gap_start):seconds(gap_stop)) = raw_data(06:29,gap_start:gap_stop)<br> + if gap_delta_t gt 3600 then stop<br> + endif else begin<br> + if gap_delta_t gt 5 then begin<br> + clean_data(0,seconds(gap_start):seconds(gap_stop)) = 2b<br> + for ii = seconds(gap_start),seconds(gap_stop-1) do clean_data(04:27,ii) = flagged_record<br> + gap_flagged = where((flagged gt gap_start) and (flagged lt gap_stop), n_gap_flagged)<br> + print,'* ',strip(n_gap_flagged),' flagged values in gap.'<br> + if keyword_set(summary) then printf,summary_file,'* ',strip(n_gap_flagged),' flagged values in gap.'<br> + if n_gap_flagged/gap_length gt 0.5 then stop<br> + endif else begin<br> + ; clean_data(0,seconds(gap_start):seconds(gap_stop-1)) = 2b<br> + clean_data(0,seconds(gap_start):seconds(gap_stop)) = 2b<br> + for ii = seconds(gap_start),seconds(gap_stop-1) do clean_data(04:27,ii) = flagged_record<br> + endelse<br> + endelse<br> + <br> + endfor<br> + <br> + ; Switch from bx1,by1,bz1,bx2,by2,bz2 to bx1,bx2,by1,by2,bz1,bz2<br> + <br> + old_bytes = [04,05,06,07,16,17,18,19,08,09,10,11,20,21,22,23,12,13,14,15,24,25,26,27]<br> + clean_data(04:27,*) = clean_data(old_bytes,*)<br> + <br> + ; Write clean data to file<br> + <br> + openw,unit,clean_file,/get_lun<br> + writeu,unit,clean_data<br> + close,unit<br> + free_lun,unit<br> + <br> + if keyword_set(move) then begin<br> + print,'move '+raw_files(i)+' '+move+month_str+'\'+strmid(raw_files(i),dot_pos-4,8)<br> + spawn,'move '+raw_files(i)+' '+move+month_str+'\'+strmid(raw_files(i),dot_pos-4,8)<br> + ; wait,5<br> + endif<br> + <br> + ; Close "summary" text file<br> + <br> + ; skip:<br> + <br> + if keyword_set(summary) then close,summary_file<br> + if keyword_set(summary) then free_lun,summary_file<br> + <br> + endfor<br> + <br> + !p.multi=0<br> + end</span> </td> </tr> </table> </div> step wid.prohttp://maccs.wikispot.org/step_wid.pro2007-07-25 21:27:46maccs <div id="content" class="wikipage content"> Differences for step wid.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/6/07<br> + <br> + ; step_wid.pro, compiles and runs with idl<br> + <br> + ; used in the manual step of removing spikes<br> + <br> + <br> + <br> + ;<br> + <br> + ;-------------------------------------------------------------------------------<br> + <br> + ;<br> + <br> + ; Event Handler<br> + <br> + ;<br> + <br> + <br> + <br> + PRO step_wid_event, ev<br> + <br> + <br> + <br> + WIDGET_CONTROL, ev.top, GET_UVALUE=statePtr<br> + <br> + WIDGET_CONTROL, ev.id, GET_UVALUE=uval<br> + <br> + <br> + <br> + CASE uval OF<br> + <br> + 'marker_select':(*statePtr).current_marker = ev.value<br> + <br> + <br> + <br> + 'component_select':begin<br> + <br> + ss = (*statePtr).start_mark*3600<br> + <br> + ee = (*statePtr).stop_mark*3600<br> + <br> + (*statePtr).current_component = ev.value<br> + <br> + if ev.value eq 0 then fix_level=-1*(median((*statePtr).bx(ee-600:ee))$<br> + <br> + -median((*statePtr).bx(ee:ee+600)))<br> + <br> + <br> + <br> + if ev.value eq 1 then fix_level=-1*(median((*statePtr).by(ee-600:ee))$<br> + <br> + -median((*statePtr).by(ee:ee+600)))<br> + <br> + <br> + <br> + if ev.value eq 2 then fix_level=-1*(median((*statePtr).bz(ee-600:ee))$<br> + <br> + -median((*statePtr).bz(ee:ee+600)))<br> + <br> + <br> + <br> + WIDGET_CONTROL, (*statePtr).slider2_id, SET_VALUE=fix_level<br> + <br> + ; WIDGET_CONTROL, (*statePtr).slider2_id, SET_slider_max=fix_level + 1000.<br> + <br> + ; WIDGET_CONTROL, (*statePtr).slider2_id, SET_slider_min=fix_level - 1000.<br> + <br> + end<br> + <br> + <br> + <br> + 'plot_box': begin<br> + <br> + location = convert_coord(ev.x,ev.y,/device,/to_data)<br> + <br> + if ev.press eq 1 then begin<br> + <br> + (*statePtr).start_mark = location(0)<br> + <br> + new_slider_min = max([location(0)*3600 - 1000,0])<br> + <br> + new_slider_max = min([location(0)*3600 + 1000,86399])<br> + <br> + WIDGET_CONTROL, (*statePtr).slider4_id, SET_slider_max=new_slider_max<br> + <br> + WIDGET_CONTROL, (*statePtr).slider4_id, SET_slider_min=new_slider_min<br> + <br> + WIDGET_CONTROL, (*statePtr).slider4_id, SET_VALUE=location(0)*3600<br> + <br> + endif<br> + <br> + if ev.press eq 4 then begin<br> + <br> + (*statePtr).stop_mark = location(0)<br> + <br> + new_slider_min = max([location(0)*3600 - 1000,0])<br> + <br> + new_slider_max = min([location(0)*3600 + 1000,86399])<br> + <br> + WIDGET_CONTROL, (*statePtr).slider5_id, SET_slider_max=new_slider_max<br> + <br> + WIDGET_CONTROL, (*statePtr).slider5_id, SET_slider_min=new_slider_min<br> + <br> + WIDGET_CONTROL, (*statePtr).slider5_id, SET_VALUE=location(0)*3600<br> + <br> + endif<br> + <br> + if (ev.press eq 1 and ev.clicks eq 2) then begin<br> + <br> + (*statePtr).start_mark = location(0) - 20./3600.<br> + <br> + WIDGET_CONTROL,(*statePtr).slider4_id,SET_VALUE=(location(0)-20./3600.)*3600.<br> + <br> + (*statePtr).stop_mark = location(0) + 20./3600.<br> + <br> + WIDGET_CONTROL,(*statePtr).slider5_id,SET_VALUE=(location(0)+20./3600.)*3600.<br> + <br> + endif<br> + <br> + if (ev.press eq 1 or ev.press eq 4) then $<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + end<br> + <br> + <br> + <br> + 'file' :begin<br> + <br> + WIDGET_CONTROL, (*statePtr).file_box_id, get_VALUE=file<br> + <br> + WIDGET_CONTROL, (*statePtr).input_dir_box_id, get_VALUE=in<br> + <br> + WIDGET_CONTROL, (*statePtr).output_dir_box_id, get_VALUE=out<br> + <br> + (*statePtr).file = file &amp; (*statePtr).in_dir = in &amp; (*statePtr).out_dir = out<br> + <br> + (*statePtr).file = dialog_pickfile(path=(*statePtr).in_dir, get_path=new_path, filter='*.s2')<br> + <br> + (*statePtr).in_dir = new_path<br> + <br> + WIDGET_CONTROL, (*statePtr).file_box_id, SET_VALUE=(*statePtr).file<br> + <br> + IF(FILE_TEST((*statePtr).file, /READ)) THEN BEGIN<br> + <br> + WIDGET_CONTROL, (*statePtr).input_dir_box_id, SET_VALUE=(*statePtr).in_dir<br> + <br> + read_maccs,(*statePtr).file,t,x,y,z,/nt,bx2=bx2,by2=by2,bz2=bz2,tf1=tf1<br> + <br> + (*statePtr).bx(*)=x &amp; (*statePtr).by(*)=y &amp; (*statePtr).bz(*)=z<br> + <br> + (*statePtr).bx2(*)=bx2 &amp; (*statePtr).by2(*)=by2 &amp; (*statePtr).bz2(*)=bz2<br> + <br> + (*statePtr).tf1(*)=tf1<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + ENDIF<br> + <br> + end<br> + <br> + <br> + <br> + 'plot' :step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + <br> + <br> + 'fix' :step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,$<br> + <br> + (*statePtr).x_fix,(*statePtr).y_fix,(*statePtr).z_fix,/fixer<br> + <br> + <br> + <br> + 'do_it':begin<br> + <br> + widget_control, (*statePtr).file_box_id, get_VALUE=file<br> + <br> + widget_control, (*statePtr).output_dir_box_id, get_VALUE=out<br> + <br> + (*statePtr).file = file &amp; (*statePtr).out_dir = out<br> + <br> + <br> + <br> + ; OLD filename=(*statePtr).out_dir + $<br> + <br> + ; OLD strmid((*statePtr).file,strlen((*statePtr).file)-10,10)<br> + <br> + filename=FILEPATH(strmid((*statePtr).file,strlen((*statePtr).file)-10,10), $<br> + <br> + ROOT_DIR = (*statePtr).out_dir)<br> + <br> + <br> + <br> + openw,unit,strmid(filename,0,strlen(filename)-2)+'txt',/get_lun,/append<br> + <br> + ss = (*statePtr).start_mark*3600<br> + <br> + ee = (*statePtr).stop_mark*3600<br> + <br> + (*statePtr).tf1(ss:ee) = (*statePtr).tf1(ss:ee) + 2<br> + <br> + if !version.os eq 'Win32' then begin<br> + <br> + date_string=systime()<br> + <br> + endif else begin<br> + <br> + ; date=today()<br> + <br> + ; date_string = ' '+strip(fix(date.month))+'/'+$<br> + <br> + ; strip(fix(date.day))+'/'+strip(date.year)+' '+getenv('USER')<br> + <br> + date_string=systime()+' '+getenv('USER')<br> + <br> + endelse<br> + <br> + printf,unit,ss,ee,(*statePtr).x_fix,(*statePtr).y_fix,$<br> + <br> + (*statePtr).z_fix,date_string,' *fixed*'<br> + <br> + close,unit<br> + <br> + free_lun,unit<br> + <br> + <br> + <br> + bad = where((*statePtr).bx(*) eq 32767,count)<br> + <br> + (*statePtr).bx(ss:ee) = (*statePtr).bx(ss:ee) + (*statePtr).x_fix<br> + <br> + if count ne 0 then (*statePtr).bx(bad) = 32767<br> + <br> + bad = where((*statePtr).bx2(*) eq 32767,count)<br> + <br> + (*statePtr).bx2(ss:ee) = (*statePtr).bx2(ss:ee) + (*statePtr).x_fix<br> + <br> + if count ne 0 then (*statePtr).bx2(bad) = 32767<br> + <br> + bad = where((*statePtr).by(*) eq 32767,count)<br> + <br> + (*statePtr).by(ss:ee) = (*statePtr).by(ss:ee) + (*statePtr).y_fix<br> + <br> + if count ne 0 then (*statePtr).by(bad) = 32767<br> + <br> + bad = where((*statePtr).by2(*) eq 32767,count)<br> + <br> + (*statePtr).by2(ss:ee) = (*statePtr).by2(ss:ee) + (*statePtr).y_fix<br> + <br> + if count ne 0 then (*statePtr).by2(bad) = 32767<br> + <br> + bad = where((*statePtr).bz(*) eq 32767,count)<br> + <br> + (*statePtr).bz(ss:ee) = (*statePtr).bz(ss:ee) + (*statePtr).z_fix<br> + <br> + if count ne 0 then (*statePtr).bz(bad) = 32767<br> + <br> + bad = where((*statePtr).bz2(*) eq 32767,count)<br> + <br> + (*statePtr).bz2(ss:ee) = (*statePtr).bz2(ss:ee) + (*statePtr).z_fix<br> + <br> + if count ne 0 then (*statePtr).bz2(bad) = 32767<br> + <br> + fss1 = max([(*statePtr).start_mark*3600-30,0])<br> + <br> + fee1 = min([(*statePtr).start_mark*3600+30,86399])<br> + <br> + fss2 = max([(*statePtr).stop_mark*3600-30,0])<br> + <br> + fee2 = min([(*statePtr).stop_mark*3600+30,86399])<br> + <br> + (*statePtr).bx(fss1:fee1) = 32767<br> + <br> + (*statePtr).bx(fss2:fee2) = 32767<br> + <br> + (*statePtr).bx2(fss1:fee1) = 32767<br> + <br> + (*statePtr).bx2(fss2:fee2) = 32767<br> + <br> + (*statePtr).by(fss1:fee1) = 32767<br> + <br> + (*statePtr).by(fss2:fee2) = 32767<br> + <br> + (*statePtr).by2(fss1:fee1) = 32767<br> + <br> + (*statePtr).by2(fss2:fee2) = 32767<br> + <br> + (*statePtr).bz(fss1:fee1) = 32767<br> + <br> + (*statePtr).bz(fss2:fee2) = 32767<br> + <br> + (*statePtr).bz2(fss1:fee1) = 32767<br> + <br> + (*statePtr).bz2(fss2:fee2) = 32767<br> + <br> + (*statePtr).x_fix = 0<br> + <br> + (*statePtr).y_fix = 0<br> + <br> + (*statePtr).z_fix = 0<br> + <br> + end<br> + <br> + <br> + <br> + 'write':begin<br> + <br> + WIDGET_CONTROL, (*statePtr).file_box_id, get_VALUE=file<br> + <br> + WIDGET_CONTROL, (*statePtr).input_dir_box_id, get_VALUE=in<br> + <br> + WIDGET_CONTROL, (*statePtr).output_dir_box_id, get_VALUE=out<br> + <br> + (*statePtr).file = file &amp; (*statePtr).in_dir = in &amp; (*statePtr).out_dir = out<br> + <br> + ; OLD filename = (*statePtr).out_dir + strmid((*statePtr).file,strlen((*statePtr).file)-10,10)<br> + <br> + filename = FILEPATH(strmid((*statePtr).file,strlen((*statePtr).file)-10,10), ROOT_DIR = (*statePtr).out_dir)<br> + <br> + <br> + <br> + write_maccs,strcompress(filename,/remove_all),(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + bx2=(*statePtr).bx2,by2=(*statePtr).by2,bz2=(*statePtr).bz2,$<br> + <br> + tf1=(*statePtr).tf1,type='s2'<br> + <br> + end<br> + <br> + <br> + <br> + 'next' :begin<br> + <br> + (*statePtr).start_hour = 0<br> + <br> + (*statePtr).stop_hour = 24<br> + <br> + WIDGET_CONTROL, (*statePtr).slider6_id, SET_VALUE=(*statePtr).start_hour<br> + <br> + WIDGET_CONTROL, (*statePtr).slider7_id, SET_VALUE=(*statePtr).stop_hour<br> + <br> + next_day = string(fix(strmid((*statePtr).file,strlen((*statePtr).file)-6,3))+1,format='(i3.3)')<br> + <br> + next_file = (*statePtr).file<br> + <br> + strput,next_file,next_day,strlen(next_file)-6<br> + <br> + (*statePtr).file = next_file<br> + <br> + WIDGET_CONTROL, (*statePtr).file_box_id, SET_VALUE=(*statePtr).file<br> + <br> + PRINT, 'Checking the existance of ', next_file<br> + <br> + IF (FILE_TEST(next_file, /READ)) THEN BEGIN<br> + <br> + read_maccs,(*statePtr).file,t,x,y,z,/nt,bx2=bx2,by2=by2,bz2=bz2,tf1=tf1<br> + <br> + (*statePtr).bx(*)=x &amp; (*statePtr).by(*)=y &amp; (*statePtr).bz(*)=z<br> + <br> + (*statePtr).bx2(*)=bx2 &amp; (*statePtr).by2(*)=by2 &amp; (*statePtr).bz2(*)=bz2<br> + <br> + (*statePtr).tf1(*)=tf1<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + ENDIF ELSE BEGIN<br> + <br> + PRINT, 'Does not exist. Try again'<br> + <br> + <br> + <br> + <br> + <br> + ENDELSE<br> + <br> + end<br> + <br> + <br> + <br> + 'flag' :begin<br> + <br> + widget_control, (*statePtr).file_box_id, get_VALUE=file<br> + <br> + widget_control, (*statePtr).output_dir_box_id, get_VALUE=out<br> + <br> + (*statePtr).file = file &amp; (*statePtr).out_dir = out<br> + <br> + <br> + <br> + filename = (*statePtr).out_dir + strmid((*statePtr).file,strlen((*statePtr).file)-10,10)<br> + <br> + openw,unit,strmid(filename,0,strlen(filename)-2)+'txt',/get_lun,/append<br> + <br> + ss = (*statePtr).start_mark*3600<br> + <br> + ee = (*statePtr).stop_mark*3600<br> + <br> + if !version.os eq 'Win32' then begin<br> + <br> + date_string=systime()<br> + <br> + endif else begin<br> + <br> + ; date=today()<br> + <br> + ; date_string = ' '+strip(fix(date.month))+'/'+$<br> + <br> + ; strip(fix(date.day))+'/'+strip(date.year)+' '+getenv('USER')<br> + <br> + date_string=systime()+' '+getenv('USER')<br> + <br> + endelse<br> + <br> + printf,unit,ss,ee,(*statePtr).x_fix,(*statePtr).y_fix,(*statePtr).z_fix,date_string,' *flagged*'<br> + <br> + close,unit<br> + <br> + free_lun,unit<br> + <br> + <br> + <br> + (*statePtr).tf1(ss:ee) = (*statePtr).tf1(ss:ee) + 2<br> + <br> + (*statePtr).bx(ss:ee) = 32767<br> + <br> + (*statePtr).by(ss:ee) = 32767<br> + <br> + (*statePtr).bz(ss:ee) = 32767<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + end<br> + <br> + <br> + <br> + 'slider2' : begin<br> + <br> + if ((*statePtr).current_component eq 0) then (*statePtr).x_fix = ev.value<br> + <br> + if ((*statePtr).current_component eq 1) then (*statePtr).y_fix = ev.value<br> + <br> + if ((*statePtr).current_component eq 2) then (*statePtr).z_fix = ev.value<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,$<br> + <br> + (*statePtr).x_fix,(*statePtr).y_fix,(*statePtr).z_fix,/fixer<br> + <br> + end<br> + <br> + <br> + <br> + 'slider4' : (*statePtr).start_mark = ev.value/3600.<br> + <br> + <br> + <br> + 'slider5' : (*statePtr).stop_mark = ev.value/3600.<br> + <br> + <br> + <br> + 'slider6' : begin<br> + <br> + (*statePtr).start_hour = ev.value<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + end<br> + <br> + <br> + <br> + 'slider7' : begin<br> + <br> + (*statePtr).stop_hour = ev.value<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + end<br> + <br> + <br> + <br> + 'previous': begin<br> + <br> + (*statePtr).start_hour = (*statePtr).start_hour - 1<br> + <br> + (*statePtr).stop_hour = (*statePtr).stop_hour - 1<br> + <br> + if (*statePtr).start_hour lt 0 then (*statePtr).start_hour=0<br> + <br> + if (*statePtr).stop_hour lt 1 then (*statePtr).stop_hour=1<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + WIDGET_CONTROL, (*statePtr).slider6_id, SET_VALUE=(*statePtr).start_hour<br> + <br> + WIDGET_CONTROL, (*statePtr).slider7_id, SET_VALUE=(*statePtr).stop_hour<br> + <br> + end<br> + <br> + <br> + <br> + 'advance' : begin<br> + <br> + if ((*statePtr).start_hour eq 0 and (*statePtr).stop_hour eq 24) then begin<br> + <br> + (*statePtr).start_hour = -1<br> + <br> + (*statePtr).stop_hour = 0<br> + <br> + endif<br> + <br> + (*statePtr).start_hour = (*statePtr).start_hour + 1<br> + <br> + (*statePtr).stop_hour = (*statePtr).stop_hour + 1<br> + <br> + if (*statePtr).start_hour gt 23 then (*statePtr).start_hour=23<br> + <br> + if (*statePtr).stop_hour gt 24 then (*statePtr).stop_hour=24<br> + <br> + step_view,(*statePtr).bx,(*statePtr).by,(*statePtr).bz,$<br> + <br> + (*statePtr).start_mark,(*statePtr).stop_mark,0,0,0,$<br> + <br> + ss=(*statePtr).start_hour,ee=(*statePtr).stop_hour<br> + <br> + WIDGET_CONTROL, (*statePtr).slider6_id, SET_VALUE=(*statePtr).start_hour<br> + <br> + WIDGET_CONTROL, (*statePtr).slider7_id, SET_VALUE=(*statePtr).stop_hour<br> + <br> + end<br> + <br> + <br> + <br> + 'done': WIDGET_CONTROL, ev.top, /DESTROY<br> + <br> + <br> + <br> + ENDCASE<br> + <br> + <br> + <br> + END<br> + <br> + <br> + <br> + ;<br> + <br> + ;-----------------------------------------------------------------------------<br> + <br> + ;<br> + <br> + ; Widget Definitions<br> + <br> + ;<br> + <br> + <br> + <br> + PRO step_wid, InputDir = InputDir, OutputDir = OutputDir<br> + <br> + <br> + <br> + IF NOT KEYWORD_SET(InputDir) THEN BEGIN<br> + <br> + PRINT, 'Please provide initial input directory'<br> + <br> + STOP<br> + <br> + END<br> + <br> + <br> + <br> + IF NOT KEYWORD_SET(OutputDir) THEN BEGIN<br> + <br> + PRINT, 'Please provide initial input directory'<br> + <br> + STOP<br> + <br> + END<br> + <br> + <br> + <br> + loadct,12<br> + <br> + base = WIDGET_BASE(xoffset=100)<br> + <br> + <br> + <br> + file_box = widget_text(base, value='', uvalue='file_text',$<br> + <br> + xoffset=90, yoffset=0, xsize=30, /editable)<br> + <br> + <br> + <br> + file_box_label = widget_label(base, value='Current file: ',$<br> + <br> + xoffset=0, yoffset=0, xsize=100)<br> + <br> + <br> + <br> + input_dir_box = widget_text(base, value=InputDir, uvalue='in_dir_text',$<br> + <br> + xoffset=90, yoffset=30, xsize=30 ,/editable)<br> + <br> + <br> + <br> + input_dir_box_label = widget_label(base, value=' Input directory: ',$<br> + <br> + xoffset=0, yoffset=35, xsize=120)<br> + <br> + <br> + <br> + output_dir_box = widget_text(base, value=OutputDir,$<br> + <br> + uvalue='out_dir_text',xoffset=90, yoffset=55, xsize=30,$<br> + <br> + /editable)<br> + <br> + <br> + <br> + output_dir_box_label = widget_label(base, value=' Output directory: ',$<br> + <br> + xoffset=0, yoffset=60, xsize=120)<br> + <br> + <br> + <br> + file_button = WIDGET_BUTTON(base, VALUE='Select File', UVALUE='file',$<br> + <br> + xoffset=0, yoffset=90, scr_xsize=100)<br> + <br> + plot_button = WIDGET_BUTTON(base, VALUE='Plot', UVALUE='plot',$<br> + <br> + xoffset=110, yoffset=90, scr_xsize=100)<br> + <br> + do_it_button = WIDGET_BUTTON(base, VALUE='Do it', UVALUE='do_it',$<br> + <br> + xoffset=0, yoffset=120, scr_xsize=100)<br> + <br> + write_button = WIDGET_BUTTON(base, VALUE='Write!', UVALUE='write',$<br> + <br> + xoffset=110, yoffset=120, scr_xsize=100)<br> + <br> + next_button = WIDGET_BUTTON(base, VALUE='Next File', UVALUE='next',$<br> + <br> + xoffset=220, yoffset=120, scr_xsize=100)<br> + <br> + flag_button = WIDGET_BUTTON(base, VALUE='Flag Selection', UVALUE='flag',$<br> + <br> + xoffset=620, yoffset=140, scr_xsize=100)<br> + <br> + done_button = WIDGET_BUTTON(base, VALUE='Done', UVALUE='done',$<br> + <br> + xoffset=110, yoffset=145, scr_xsize=100)<br> + <br> + fix_button = WIDGET_BUTTON(base, VALUE='Fix', UVALUE='fix',$<br> + <br> + xoffset=220, yoffset=90, scr_xsize=100)<br> + <br> + slider2 = widget_slider(base, value=100, title='', uvalue='slider2',$;fix amount<br> + <br> + xoffset=680, yoffset=10, minimum=-10000, maximum=10000, scr_xsize=100, /vertical)<br> + <br> + slider4 = widget_slider(base, value=1, title='', uvalue='slider4',$<br> + <br> + xoffset=380, yoffset=130, minimum=0, maximum=86399, scr_xsize=100)<br> + <br> + slider5 = widget_slider(base, value=1, title='', uvalue='slider5',$<br> + <br> + xoffset=500, yoffset=130, minimum=0, maximum=86399, scr_xsize=100)<br> + <br> + slider6 = widget_slider(base, value=0, title='Start hour', uvalue='slider6',$<br> + <br> + xoffset=380, yoffset=5, maximum=24, scr_xsize=100)<br> + <br> + slider7 = widget_slider(base, value=24, title='Stop hour', uvalue='slider7',$<br> + <br> + xoffset=500, yoffset=5, maximum=24, scr_xsize=100)<br> + <br> + previous_button = WIDGET_BUTTON(base, VALUE='Previous', UVALUE='previous',$<br> + <br> + xoffset=380, yoffset=70, scr_xsize=100)<br> + <br> + advance_button = WIDGET_BUTTON(base, VALUE='Advance', UVALUE='advance',$<br> + <br> + xoffset=500, yoffset=70, scr_xsize=100)<br> + <br> + marker_select = CW_BGROUP(base, ['start marker','stop marker'], xoffset=400, yoffset=100,$<br> + <br> + UVALUE='marker_select', /row, /exclusive)<br> + <br> + component_select = CW_BGROUP(base, ['x','y','z'], xoffset=620, yoffset=10,$<br> + <br> + UVALUE='component_select', /column, /exclusive)<br> + <br> + plot_box = WIDGET_DRAW(base, xoffset = 0, yoffset = 170, XSIZE = 800, YSIZE = 500,$<br> + <br> + UVALUE='plot_box', /button_events)<br> + <br> + <br> + <br> + <br> + <br> + statePtr = ptr_new( { status: 0,$<br> + <br> + bx: fltarr(86400),$<br> + <br> + by: fltarr(86400),$<br> + <br> + bz: fltarr(86400),$<br> + <br> + bx2: fltarr(86400),$<br> + <br> + by2: fltarr(86400),$<br> + <br> + bz2: fltarr(86400),$<br> + <br> + tf1: fltarr(86400),$<br> + <br> + file: '',$<br> + <br> + in_dir: '/cdrom/',$<br> + <br> + out_dir: '/magneto1'+getenv('USER')+'/',$<br> + <br> + slider2_value: 100,$<br> + <br> + slider2_id: slider2,$<br> + <br> + slider4_id: slider4,$<br> + <br> + slider5_id: slider5,$<br> + <br> + slider6_id: slider6,$<br> + <br> + slider7_id: slider7,$<br> + <br> + current_marker: 0,$<br> + <br> + current_component: 0,$<br> + <br> + start_mark: 1.0,$<br> + <br> + stop_mark: 1.0,$<br> + <br> + start_hour: 0.,$<br> + <br> + stop_hour: 24.,$<br> + <br> + x_fix: 0,$<br> + <br> + y_fix: 0,$<br> + <br> + z_fix: 0,$<br> + <br> + file_box_id: file_box,$<br> + <br> + input_dir_box_id: input_dir_box,$<br> + <br> + output_dir_box_id: output_dir_box,$<br> + <br> + current_path: 'v:\murr'} )<br> + <br> + WIDGET_CONTROL, base, SET_UVALUE=statePtr<br> + <br> + WIDGET_CONTROL, base, /REALIZE<br> + <br> + WIDGET_CONTROL, plot_box, GET_VALUE = index<br> + <br> + WSET, index<br> + <br> + <br> + <br> + XMANAGER, 'step_wid', base<br> + <br> + <br> + <br> + file_value = (*statePtr).file<br> + <br> + ptr_free, statePtr<br> + <br> + print,'done'<br> + <br> + <br> + <br> + <br> + <br> + END</span> </td> </tr> </table> </div> step view.prohttp://maccs.wikispot.org/step_view.pro2007-07-25 21:26:54maccs <div id="content" class="wikipage content"> Differences for step view.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/6/07<br> + <br> + ; step_view.pro, compiles and runs with idl<br> + <br> + ; needs flag.pro to run<br> + <br> + ; used in the manual step of removing spikes<br> + <br> + ; input ?<br> + <br> + ; output: graphs?<br> + <br> + <br> + <br> + pro step_view,bx,by,bz,start_mark,stop_mark,x,y,z,ss=ss,ee=ee,fixer=fixer,$<br> + <br> + oplot_only=oplot_only<br> + <br> + !p.multi = [0,1,3,2]<br> + <br> + !p.background=255<br> + <br> + !p.color=0<br> + <br> + !p.charsize=1.5<br> + <br> + t = lindgen(86400)<br> + <br> + if keyword_set(fixer) then begin<br> + <br> + !p.multi = [0,2,3,0,1]<br> + <br> + ss = start_mark*3600.-600.<br> + <br> + ee = start_mark*3600.+600.<br> + <br> + if ss lt 0 then ss=0<br> + <br> + if ee gt 86399 then ee=86399<br> + <br> + bbx = bx &amp; bby = by &amp; bbz = bz<br> + <br> + bbx(start_mark*3600.:stop_mark*3600.) = bx(start_mark*3600.:stop_mark*3600.) + x<br> + <br> + bby(start_mark*3600.:stop_mark*3600.) = by(start_mark*3600.:stop_mark*3600.) + y<br> + <br> + bbz(start_mark*3600.:stop_mark*3600.) = bz(start_mark*3600.:stop_mark*3600.) + z<br> + <br> + bad = where(bx eq 32767,count)<br> + <br> + if count ne 0 then bbx(bad) = 32767<br> + <br> + bad = where(by eq 32767,count)<br> + <br> + if count ne 0 then bby(bad) = 32767<br> + <br> + bad = where(bz eq 32767,count)<br> + <br> + if count ne 0 then bbz(bad) = 32767<br> + <br> + fss = start_mark*3600.-10<br> + <br> + fee = start_mark*3600.+10<br> + <br> + if fss lt 0 then fss=0<br> + <br> + if fee gt 86399 then fee=86399<br> + <br> + bbx(fss:fee) = 32767<br> + <br> + bby(fss:fee) = 32767<br> + <br> + bbz(fss:fee) = 32767<br> + <br> + fss = stop_mark*3600.-10<br> + <br> + fee = stop_mark*3600.+10<br> + <br> + if fss lt 0 then fss=0<br> + <br> + if fee gt 86399 then fee=86399<br> + <br> + bbx(fss:fee) = 32767<br> + <br> + bby(fss:fee) = 32767<br> + <br> + bbz(fss:fee) = 32767<br> + <br> + plot,t(ss:ee)/3600.,flag(bbx(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2<br> + <br> + plot,t(ss:ee)/3600.,flag(bby(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2<br> + <br> + plot,t(ss:ee)/3600.,flag(bbz(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2<br> + <br> + ss = stop_mark*3600.-600.<br> + <br> + ee = stop_mark*3600.+600.<br> + <br> + if ss lt 0 then ss=0<br> + <br> + if ee gt 86399 then ee=86399<br> + <br> + plot,t(ss:ee)/3600.,flag(bbx(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2<br> + <br> + plot,t(ss:ee)/3600.,flag(bby(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2<br> + <br> + plot,t(ss:ee)/3600.,flag(bbz(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2<br> + <br> + endif else begin<br> + <br> + if keyword_set(oplot_only) then begin<br> + <br> + !p.multi=[3,1,3,2]<br> + <br> + ss = ss*3600L<br> + <br> + ee = ee*3600L-1<br> + <br> + plot,t(ss:ee)/3600.,flag(bx(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle,/nodata<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2,color=20<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2,color=140<br> + <br> + plot,t(ss:ee)/3600.,flag(by(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle,/nodata<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2,color=20<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2,color=140<br> + <br> + plot,t(ss:ee)/3600.,flag(bz(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle,/nodata<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2,color=20<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2,color=140<br> + <br> + endif else begin<br> + <br> + ss = ss*3600L<br> + <br> + ee = ee*3600L-1<br> + <br> + plot,t(ss:ee)/3600.,flag(bx(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2,color=20<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2,color=140<br> + <br> + plot,t(ss:ee)/3600.,flag(by(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2,color=20<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2,color=140<br> + <br> + plot,t(ss:ee)/3600.,flag(bz(ss:ee)),max_val=100000,$<br> + <br> + /xstyle,/ystyle<br> + <br> + oplot,[start_mark,start_mark],[-90000,90000],linestyle=2,color=20<br> + <br> + oplot,[stop_mark,stop_mark],[-90000,90000],linestyle=2,color=140<br> + <br> + endelse<br> + <br> + endelse<br> + <br> + !p.multi=0<br> + <br> + end</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:24:50maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 11: </td> <td> Line 11: </td> </tr> <tr> <td> <span>-</span> step_view.pro<br> <span>-</span> step_wid.pro<br> <span>-</span> flag.pro </td> <td> <span>+</span> <span>["</span>step_view.pro<span>"]</span><br> <span>+</span> <span>["</span>step_wid.pro<span>"]</span><br> <span>+</span> <span>["</span>flag.pro<span>"]</span> </td> </tr> <tr> <td> Line 15: </td> <td> Line 15: </td> </tr> <tr> <td> <span>-</span> five_sec_avg.pro<br> <span>-</span> five_sec_avg_fast_avg.pro (called by five_sec_avg.pro) </td> <td> <span>+</span> <span>["</span>five_sec_avg.pro<span>"]</span><br> <span>+</span> <span>["</span>five_sec_avg_fast_avg.pro<span>"]</span> (called by five_sec_avg.pro) </td> </tr> <tr> <td> Line 20: </td> <td> Line 20: </td> </tr> <tr> <td> <span>-</span> sec_to_min.pro </td> <td> <span>+</span> <span>["</span>sec_to_min.pro<span>"]</span> </td> </tr> <tr> <td> Line 24: </td> <td> Line 24: </td> </tr> <tr> <td> <span>-</span> expandcode.pro<br> <span>-</span> merge_files.pro<br> <span>-</span> Nb. Requires an extra file "missing.1m", to substitute </td> <td> <span>+</span> <span>["</span>expandcode.pro<span>"]</span><br> <span>+</span> <span>["</span>merge_files.pro<span>"]</span><br> <span>+</span> Nb. Requires an extra file "<span>["</span>missing.1m<span>"]</span>", to substitute </td> </tr> <tr> <td> Line 29: </td> <td> Line 29: </td> </tr> <tr> <td> <span>-</span> houravrg.pro </td> <td> <span>+</span> <span>["</span>houravrg.pro<span>"]</span> </td> </tr> <tr> <td> Line 31: </td> <td> Line 31: </td> </tr> <tr> <td> <span>-</span> findbeta.pro<br> <span>-</span> strip.pro<span>:</span><br> <span>-</span> hour_read.pro<br> <span>-</span> flag.pro<br> <span>-</span> wid_draw.pro </td> <td> <span>+</span> <span>["</span>findbeta.pro<span>"]</span><br> <span>+</span> <span>["</span>strip.pro<span>"]</span><br> <span>+</span> <span>["</span>hour_read.pro<span>"]</span><br> <span>+</span> <span>["</span>flag.pro<span>"]</span><br> <span>+</span> <span>["</span>wid_draw.pro<span>"]</span> </td> </tr> </table> </div> write maccs.prohttp://maccs.wikispot.org/write_maccs.pro2007-07-25 21:20:45maccs <div id="content" class="wikipage content"> Differences for write maccs.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/6/07<br> + <br> + ; write_maccs.pro, compiles and runs with idl<br> + <br> + ; called by igloolik_despike.pro (which creates despiked .s2 files)<br> + ; called by five_sec_avg.pro (which creates 5 second average .5s files)<br> + ; called by sec_to_min.pro (which creates 1 minute average .1m files)<br> + <br> + ; writes 5 different types of maccs data files: .1m (1 minute files), .1mg (1 month of 1 min files merged together in one file), .5sg (rotated 5 second files), .5s (5 second files), .s2 (cleaned files)<br> + ; uses the type parameter to specify what type of file to write, Ex: type="1m"<br> + ; all parameters are required<br> + <br> + <br> + <br> + <br> + <br> + pro write_maccs,filename,bx,by,bz,bx2=bx2,by2=by2,bz2=bz2,tf1=tf1,type=type<br> + <br> + <br> + <br> + case type of<br> + <br> + '1m':begin<br> + <br> + new_data=bytarr(14,1440)<br> + <br> + for j=0,1439 do begin<br> + <br> + hr=floor(j*60./3600.)<br> + <br> + mi=floor((j*60.-hr*3600.)/60.)<br> + <br> + ; writeu,unit2,byte(hr),byte(mi),long(bx(j)*1000),long(by(j)*1000),long(bz(j)*1000)<br> + <br> + new_data(*,j)=byte([byte(hr),byte(mi),$<br> + <br> + reform(byte(long(bx(j)*1000),0,1,4)),$<br> + <br> + reform(byte(long(by(j)*1000),0,1,4)),$<br> + <br> + reform(byte(long(bz(j)*1000),0,1,4))],0,1,14)<br> + <br> + endfor<br> + <br> + openw,unit2,filename,/get_lun<br> + <br> + writeu,unit2,new_data<br> + <br> + free_lun,unit2<br> + <br> + end<br> + <br> + '1mg':begin<br> + <br> + new_data=bytarr(14,1440)<br> + <br> + for j=0,1439 do begin<br> + <br> + hr=floor(j*60./3600.)<br> + <br> + mi=floor((j*60.-hr*3600.)/60.)<br> + <br> + ; writeu,unit2,byte(hr),byte(mi),long(bx(j)*1000),long(by(j)*1000),long(bz(j)*1000)<br> + <br> + new_data(*,j)=byte([byte(hr),byte(mi),$<br> + <br> + reform(byte(long(bx(j)*1000),0,1,4)),$<br> + <br> + reform(byte(long(by(j)*1000),0,1,4)),$<br> + <br> + reform(byte(long(bz(j)*1000),0,1,4))],0,1,14)<br> + <br> + endfor<br> + <br> + openw,unit2,filename,/get_lun<br> + <br> + writeu,unit2,new_data<br> + <br> + free_lun,unit2<br> + <br> + end<br> + <br> + '5sg':begin<br> + <br> + openw,unit2,filename,/get_lun<br> + <br> + for j=0,17279 do begin<br> + <br> + hr=floor(j*5./3600.)<br> + <br> + mi=floor((j*5.-hr*3600.)/60.)<br> + <br> + se=j*5.-(hr*3600.+mi*60.)<br> + <br> + writeu,unit2,byte(hr),byte(mi),byte(se),long(bx(j)*1000),long(by(j)*1000),long(bz(j)*1000)<br> + <br> + endfor<br> + <br> + free_lun,unit2<br> + <br> + end<br> + <br> + '5s':begin<br> + <br> + openw,unit2,filename,/get_lun<br> + <br> + for j=0,17279 do begin<br> + <br> + hr=floor(j*5./3600.)<br> + <br> + mi=floor((j*5.-hr*3600.)/60.)<br> + <br> + se=j*5-(hr*3600.+mi*60.)<br> + <br> + writeu,unit2,byte(hr),byte(mi),byte(se),long(bx(j)*1000),long(by(j)*1000),long(bz(j)*1000)<br> + <br> + endfor<br> + <br> + free_lun,unit2<br> + <br> + end<br> + <br> + 's2':begin<br> + <br> + openw,unit2,filename,/get_lun<br> + <br> + for j=0L,86399L do begin<br> + <br> + hr=floor(j/3600.)<br> + <br> + mi=floor((j-hr*3600.)/60.)<br> + <br> + se=j-(hr*3600.+mi*60.)<br> + <br> + writeu,unit2,byte(tf1(j)),byte(hr),byte(mi),byte(se),$<br> + <br> + long(bx(j)*1000),long(bx2(j)*1000),$<br> + <br> + long(by(j)*1000),long(by2(j)*1000),$<br> + <br> + long(bz(j)*1000),long(bz2(j)*1000)<br> + <br> + ;if j eq 86399L then begin<br> + <br> + ; print, bx(j),long(bx(j)),tf1(j),byte(tf1(j)),byte(hr),byte(mi),byte(se)<br> + <br> + ; help, bx, tf1, hr, mi, se<br> + <br> + ;endif<br> + <br> + endfor<br> + <br> + free_lun,unit2<br> + <br> + end<br> + <br> + endcase<br> + <br> + print,'done writing'<br> + <br> + end</span> </td> </tr> </table> </div> read maccs.prohttp://maccs.wikispot.org/read_maccs.pro2007-07-25 21:19:28maccs <div id="content" class="wikipage content"> Differences for read maccs.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/16/07<br> + <br> + ; read_maccs.pro, compiles and runs with idl<br> + <br> + ; called by igloolik_despike.pro (which creates despiked .s2 files)<br> + ; called by five_sec_avg.pro (which creates 5 second average .5s files)<br> + ; called by sec_to_min.pro (which creates 1 minute average .1m files)<br> + <br> + ; reads 5 different types of maccs data: raw maccs, cleaned maccs, raw gsc, cleaned gsc, 5 sec &amp; 1 min<br> + <br> + ; GSC = Geological Survey of Canada (The Geomagnetic Monitoring Service of the GSC operates a network of 13 Magnetic Observatories across Canada which includes all CANMOS magnetometers and the Alert magnetometer. It used to operate the Mould Bay magnetometer which is now closed.)<br> + ; calculates and returns time<br> + <br> + ; stores the data in variables and returns them<br> + ; the only required parameter is the filename unless it is a raw file (then raw must be set to 1 or 2)<br> + ; Ex: read_maccs, "CD04025.s2"<br> + ; if you set the diag parameter (diag="something") it outputs the following to the command line:<br> + ; *****************************************************************************<br> + ; if you are reading a raw file you must set the raw parameter to 1 for a maccs file or 2 for a gsc file.<br> + <br> + ; to prevent the program from printing the name of the file it is processing: quiet="something"<br> + ; If you set the nt parameter (ex: nt="nt") the field values will be divided by 1000 to get the values in nanoteslas.<br> + <br> + ; Ex: read_maccs, "/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2007ir/CD07193.dat", diag="bob", raw=1, nt="nanoT", quiet="please"<br> + <br> + <br> + pro read_maccs,filename,time,bx1,by1,bz1,type,raw=raw,nt=nt,$<br> + <br> + bx2=bx2,by2=by2,bz2=bz2,tf1=tf1,int=int,diag=diag,quiet=quiet,block=block<br> + <br> + <br> + <br> + ; set the keyword raw to 1 for raw maccs and to 2 for raw gsc<br> + <br> + <br> + <br> + ; x and y are the byte dimensions of the file. The order for the different file<br> + <br> + ; types is raw maccs, raw gsc, cleaned maccs, cleaned gsc, 5 sec, and 1 min<br> + <br> + ; (the raw files do not have fixed length)<br> + <br> + <br> + <br> + x = [35, 21, 28, 15, 15, 14]<br> + <br> + y = [00, 00, 86400L, 86400L, 17280L, 1440L]<br> + <br> + sizes = [00, 00, 2419200L, 1296000L, 259200L, 20160L]<br> + <br> + <br> + <br> + ; Open file and get file size<br> + <br> + <br> + <br> + if not keyword_set(quiet) then print,'Now processing ',filename<br> + <br> + openr,unit,filename,error=err,/get_lun<br> + <br> + if err ne 0 then print,'no file ',filename<br> + <br> + file_info = fstat(unit)<br> + <br> + file_size = file_info.size<br> + <br> + <br> + <br> + <br> + <br> + if keyword_set(raw) then begin<br> + <br> + type = raw - 1<br> + <br> + if raw eq 1 then y(0) = file_size / x(0)<br> + <br> + if raw eq 2 then y(1) = file_size / x(1)<br> + <br> + endif else begin<br> + <br> + type = where(file_size eq sizes, count)<br> + <br> + if count eq 0 then begin<br> + <br> + print,'Error in file size.'<br> + <br> + stop<br> + <br> + endif else type = type(0)<br> + <br> + endelse<br> + <br> + <br> + <br> + if (err eq 0) then begin<br> + <br> + m=x(type)<br> + <br> + n=y(type)<br> + <br> + data_array = bytarr(m,n)<br> + <br> + readu,unit,data_array<br> + <br> + free_lun,unit<br> + <br> + endif else begin<br> + <br> + print,'An error has occurred while trying to read.'<br> + <br> + stop<br> + <br> + endelse<br> + <br> + <br> + <br> + ; Extract the individual data arrays from the file byte array. Also, divide<br> + <br> + ; the field values by 1000. to get nanotesla.<br> + <br> + <br> + <br> + ; all files<br> + <br> + <br> + <br> + offset = [3, 2, 1, 0, 0, 0]<br> + <br> + <br> + <br> + hh = data_array(offset(type) + 0,*)<br> + <br> + mm = data_array(offset(type) + 1,*)<br> + <br> + offset(5) = -1<br> + <br> + bx1 = long(data_array(offset(type) + 3:offset(type) + 6,*),0,1,y(type))<br> + <br> + by1 = long(data_array(offset(type) + 7:offset(type) + 10,*),0,1,y(type))<br> + <br> + bz1 = long(data_array(offset(type) + 11:offset(type) + 14,*),0,1,y(type))<br> + <br> + <br> + <br> + case type of<br> + <br> + 5: ss = 0<br> + <br> + 4: ss = data_array(2,*) ; 5 sec<br> + <br> + 3: ss = data_array(2,*) ; gsc clean<br> + <br> + 2: begin ; maccs clean<br> + <br> + tf1 = data_array(0,*)<br> + <br> + ss = data_array(3,*)<br> + <br> + bx1 = long(data_array(04:07,*),0,1,y(type))<br> + <br> + bx2 = long(data_array(08:11,*),0,1,y(type))<br> + <br> + by1 = long(data_array(12:15,*),0,1,y(type))<br> + <br> + by2 = long(data_array(16:19,*),0,1,y(type))<br> + <br> + bz1 = long(data_array(20:23,*),0,1,y(type))<br> + <br> + bz2 = long(data_array(24:27,*),0,1,y(type))<br> + <br> + end<br> + <br> + 1: begin ; gsc raw<br> + <br> + dd = fix (data_array( 0: 1,*),0,1,y(type))<br> + <br> + ss = data_array(4,*)<br> + <br> + end<br> + <br> + 0: begin ; maccs raw<br> + <br> + header= data_array( 0,*)<br> + <br> + dd = fix (data_array( 1: 2,*),0,1,y(type))<br> + <br> + ss = data_array(5,*)<br> + <br> + bx2 = long(data_array(18:21,*),0,1,y(type))<br> + <br> + print, bx2(10)<br> + <br> + by2 = long(data_array(22:25,*),0,1,y(type))<br> + <br> + print, by2(10)<br> + <br> + bz2 = long(data_array(26:29,*),0,1,y(type))<br> + <br> + print, bz2(10)<br> + <br> + tf1 = data_array(30,*)<br> + <br> + tf2 = data_array(31,*)<br> + <br> + block = data_array(32,*)<br> + <br> + status= data_array(33,*)<br> + <br> + house = data_array(34,*)<br> + <br> + end<br> + <br> + endcase<br> + <br> + <br> + <br> + time = hh*3600. + mm*60. + ss<br> + <br> + if keyword_set(int) then begin<br> + <br> + good = where(bx1 ne 32767000,count)<br> + <br> + if count gt 0 then bx1=interpol(bx1(good),time(good),time)<br> + <br> + good = where(by1 ne 32767000,count)<br> + <br> + if count gt 0 then bx1=interpol(by1(good),time(good),time)<br> + <br> + good = where(bz1 ne 32767000,count)<br> + <br> + if count gt 0 then bx1=interpol(bz1(good),time(good),time)<br> + <br> + endif<br> + <br> + if keyword_set(nt) then begin<br> + <br> + bx1 = bx1/1000.<br> + <br> + by1 = by1/1000.<br> + <br> + bz1 = bz1/1000.<br> + <br> + if type eq 2 then begin<br> + <br> + bx2 = bx2/1000.<br> + <br> + by2 = by2/1000.<br> + <br> + bz2 = bz2/1000.<br> + <br> + endif<br> + <br> + endif<br> + <br> + if keyword_set(diag) then print,bx1(0:10),format='(11f7.1)'<br> + <br> + end<br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + <br> + </span> </td> </tr> </table> </div> igloolik despike.prohttp://maccs.wikispot.org/igloolik_despike.pro2007-07-25 21:17:52maccs <div id="content" class="wikipage content"> Differences for igloolik despike.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/5/07<br> + ; igloolik_despike.pro, compiles and runs with idl<br> + ; needs read_maccs.pro &amp; write_maccs.pro to run<br> + ; input must be cleaned MACCS binary .s2 data file(s) (it accepts original files &amp; despiked files)<br> + ; output is a despiked binary version of the cleaned data<br> + ; if the output directory is the same as the input directory the original cleaned file(s) is/are replaced by the despiked version(s)<br> + ; example file names: if input file is CD05004.s2, output file is CD05004.s2<br> + ; to compile &amp; run: igloolik_despike, "name_of_input_file(s)", "/path_to_input_file(s)/", "/path_to_output_directory/" (you can use * and ?)<br> + ; to display windows with graphs (after the first 2 graphs appear, close the windows (bottom graph first) to display the next graph): view="something" (WARNING: If the input file has not been despiked and the view parameter is set, it will display hundreds of graphs that you have to click through one at a time before it outputs a despiked file. Also, if you click through the graphs too quickly it will have a bus error and exit IDL.)<br> + ; the spikeview parameter is not used in the program<br> + ; Example: igloolik_despike, "CD05*.s2", "/Volumes/physics_data/Ftp/MACCS_DATA/Clean/CD/2005/", "/Volumes/physics_data/Ftp/MACCS_DATA/Despiked/CD/2005/", view="view"<br> + <br> + PRO igloolik_despike,File_Specification,in_dir,out_dir,view=view,spikeview=spikeview<br> + <br> + !p.multi=[0,0,3]<br> + <br> + window,0<br> + <br> + window,1<br> + <br> + ; OLD files=findfile(in_dir+file)<br> + <br> + files=FINDFILE(FILEPATH(File_Specification, ROOT_DIR = in_dir))<br> + <br> + FOR j = 0, n_elements(files)-1 DO BEGIN<br> + <br> + read_maccs,files(j),t,bx,by,bz,bx2=bx2,by2=by2,bz2=bz2,tf1=tf1,/nt<br> + <br> + <br> + <br> + x_diff = abs(bx(1:86399) - bx(0:86398))<br> + <br> + y_diff = abs(by(1:86399) - by(0:86398))<br> + <br> + z_diff = abs(bz(1:86399) - bz(0:86398))<br> + <br> + spikes = where((x_diff gt 10 and x_diff lt 10000) $<br> + <br> + or (y_diff gt 10 and y_diff lt 10000) $<br> + <br> + or (z_diff gt 10 and z_diff lt 10000))<br> + <br> + index=where(spikes gt 11 and spikes lt 86388,count)<br> + <br> + if count lt 2 then goto, next<br> + <br> + spikes=spikes(index)<br> + <br> + spike_diff = spikes(1:n_elements(spikes)-1) - spikes(0:n_elements(spikes)-2)<br> + <br> + repeats=where(spike_diff gt 2)<br> + <br> + spikes=spikes(repeats+1)<br> + <br> + <br> + <br> + <br> + <br> + if keyword_set(view) then begin<br> + <br> + wset,0<br> + <br> + plot,bx,max_val=30000,/ystyle<br> + <br> + for i = 0, n_elements(spikes)-1 do $<br> + <br> + oplot,[spikes(i),spikes(i)],[-20000,bx(spikes(i))-20],linestyle=2<br> + <br> + for i = 0, n_elements(spikes)-1 do $<br> + <br> + oplot,[spikes(i),spikes(i)],[bx(spikes(i))+20,20000],linestyle=2<br> + <br> + plot,by,max_val=30000,/ystyle<br> + <br> + for i = 0, n_elements(spikes)-1 do $<br> + <br> + oplot,[spikes(i),spikes(i)],[-20000,by(spikes(i))-20],linestyle=2<br> + <br> + for i = 0, n_elements(spikes)-1 do $<br> + <br> + oplot,[spikes(i),spikes(i)],[by(spikes(i))+20,20000],linestyle=2<br> + <br> + plot,bz,min_val=40000,/ystyle<br> + <br> + for i = 0, n_elements(spikes)-1 do $<br> + <br> + oplot,[spikes(i),spikes(i)],[-20000,bz(spikes(i))-20],linestyle=2<br> + <br> + for i = 0, n_elements(spikes)-1 do $<br> + <br> + oplot,[spikes(i),spikes(i)],[bz(spikes(i))+20,60000],linestyle=2<br> + <br> + <br> + <br> + wset,1<br> + <br> + for k = 0, n_elements(spikes)-1 do begin<br> + <br> + print,spikes(k)<br> + <br> + if (spikes(k) gt 101 and spikes(k) lt 86298) then begin<br> + <br> + plot,bx(spikes(k)-100:spikes(k)+100),max_val=30000,/ystyle<br> + <br> + oplot,[90,90],[-20000,20000],linestyle=2<br> + <br> + oplot,[110,110],[-20000,20000],linestyle=2<br> + <br> + plot,by(spikes(k)-100:spikes(k)+100),max_val=30000,/ystyle<br> + <br> + plot,bz(spikes(k)-100:spikes(k)+100),min_val=40000,/ystyle<br> + <br> + cursor,x,y,/up<br> + <br> + endif<br> + <br> + ; read,junk<br> + <br> + endfor<br> + <br> + endif<br> + <br> + ;plot,bx(spikes(25)-100:spikes(25)+100),max_val=30000,/ystyle<br> + <br> + ;oplot,[spikes(25),spikes(25)],[-20000,20000],linestyle=2<br> + <br> + ;read,junk<br> + <br> + <br> + <br> + for i = 0, n_elements(spikes)-1 do begin<br> + <br> + bx(spikes(i)-10:spikes(i)+10)=32767<br> + <br> + by(spikes(i)-10:spikes(i)+10)=32767<br> + <br> + bz(spikes(i)-10:spikes(i)+10)=32767<br> + <br> + bx2(spikes(i)-10:spikes(i)+10)=32767<br> + <br> + by2(spikes(i)-10:spikes(i)+10)=32767<br> + <br> + bz2(spikes(i)-10:spikes(i)+10)=32767<br> + <br> + endfor<br> + <br> + <br> + <br> + files(j)=strmid(files(j),strpos(files(j),'.')-7,10)<br> + <br> + ; OLD print,out_dir+files(j)<br> + <br> + ; OLD write_maccs,out_dir+files(j),bx,by,bz,bx2=bx2,by2=by2,bz2=bz2,tf1=tf1,type='s2'<br> + <br> + <br> + <br> + PRINT,FILEPATH(files(j), ROOT_DIR = out_dir)<br> + <br> + write_maccs,FILEPATH(files(j), ROOT_DIR = out_dir) ,bx,by,bz,bx2=bx2,by2=by2,bz2=bz2,tf1=tf1,type='s2'<br> + <br> + next:<br> + <br> + ENDFOR<br> + <br> + ;stop<br> + <br> + !p.multi=0<br> + <br> + END<br> + </span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:16:53maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 7: </td> <td> Line 7: </td> </tr> <tr> <td> <span>-</span> igloolik_despike.pro<br> <span>-</span> read_maccs.pro (called by igllolik_despike.pro)<br> <span>-</span> write_maccs.pro (called by igllolik_despike.pro) </td> <td> <span>+</span> <span>["</span>igloolik_despike.pro<span>"]</span><br> <span>+</span> <span>["</span>read_maccs.pro<span>"]</span> (called by igllolik_despike.pro)<br> <span>+</span> <span>["</span>write_maccs.pro<span>"]</span> (called by igllolik_despike.pro) </td> </tr> <tr> <td> Line 17: </td> <td> Line 17: </td> </tr> <tr> <td> <span>-</span> read_maccs.pro (called by five_sec_avg.pro)<br> <span>-</span> write_maccs.pro (called by five_sec_avg.pro) </td> <td> <span>+</span> <span>["</span>read_maccs.pro<span>"]</span> (called by five_sec_avg.pro)<br> <span>+</span> <span>["</span>write_maccs.pro<span>"]</span> (called by five_sec_avg.pro) </td> </tr> <tr> <td> Line 21: </td> <td> Line 21: </td> </tr> <tr> <td> <span>-</span> read_maccs.pro (called by sec_to_min.pro)<br> <span>-</span> write_maccs.pro (called by sec_to_min.pro) </td> <td> <span>+</span> <span>["</span>read_maccs.pro<span>"]</span> (called by sec_to_min.pro)<br> <span>+</span> <span>["</span>write_maccs.pro<span>"]</span> (called by sec_to_min.pro) </td> </tr> </table> </div> strip.prohttp://maccs.wikispot.org/strip.pro2007-07-25 21:14:16maccs <div id="content" class="wikipage content"> Differences for strip.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ ; Comments added by Erik Johnson 7/3/07<br> + ; strip.pro, compiles and runs with idl<br> + ; called by cleaner.pro (which creates clean .s2 files)<br> + <br> + function strip,str<br> + <br> + <br> + <br> + new_str = strcompress(string(str),/remove_all)<br> + <br> + <br> + <br> + return, new_str<br> + <br> + <br> + <br> + end</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:13:45maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 5: </td> <td> Line 5: </td> </tr> <tr> <td> <span>-</span> [<span>[File(</span>strip.pro<span>)]</span>] (called by cleaner.pro) </td> <td> <span>+</span> [<span>"</span>strip.pro<span>"</span>] (called by cleaner.pro) </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:11:37maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 5: </td> <td> Line 5: </td> </tr> <tr> <td> <span>-</span> strip.pro (called by cleaner.pro) </td> <td> <span>+</span> <span>[[File(</span>strip.pro<span>)]]</span> (called by cleaner.pro) </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:10:58maccsUpload of file <a href="http://maccs.wikispot.org/Processing_Software?action=Files&do=view&target=strip.pro">strip.pro</a>.Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:09:58maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 3: </td> <td> Line 3: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the clean step </td> <td> <span>+</span> *The IDL program<span>s</span> used in the clean step </td> </tr> <tr> <td> Line 6: </td> <td> Line 6: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the despike step </td> <td> <span>+</span> *The IDL program<span>s</span> used in the despike step </td> </tr> <tr> <td> Line 10: </td> <td> Line 10: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the manual step of removing spikes </td> <td> <span>+</span> *The IDL program<span>s</span> used in the manual step of removing spikes </td> </tr> <tr> <td> Line 14: </td> <td> Line 14: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the 1/2 sec to 5 sec avg step </td> <td> <span>+</span> *The IDL program<span>s</span> used in the 1/2 sec to 5 sec avg step </td> </tr> <tr> <td> Line 19: </td> <td> Line 19: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the 5sec to 1 min avg step </td> <td> <span>+</span> *The IDL program<span>s</span> used in the 5sec to 1 min avg step </td> </tr> <tr> <td> Line 23: </td> <td> Line 23: </td> </tr> <tr> <td> <span>-</span> *The IDL program used to merge all 1 min files in 1 big file </td> <td> <span>+</span> *The IDL program<span>s</span> used to merge all 1 min files in 1 big file </td> </tr> <tr> <td> Line 28: </td> <td> Line 28: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the 1 min merged files to 1 hour avg step </td> <td> <span>+</span> *The IDL program<span>s</span> used in the 1 min merged files to 1 hour avg step </td> </tr> <tr> <td> Line 30: </td> <td> Line 30: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in prepare the baselines for rotation </td> <td> <span>+</span> *The IDL program<span>s</span> used in prepare the baselines for rotation </td> </tr> <tr> <td> Line 36: </td> <td> Line 36: </td> </tr> <tr> <td> <span>-</span> *The IDL program used in the rotate step </td> <td> <span>+</span> *The IDL program<span>s</span> used in the rotate step </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-25 21:04:45maccsEdited By Erik Johnson 7/25/07 <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 5: </td> <td> Line 5: </td> </tr> <tr> <td> <span>-</span> strip.pro </td> <td> <span>+</span> strip.pro<span>&nbsp;(called by cleaner.pro)</span> </td> </tr> <tr> <td> Line 8: </td> <td> Line 8: </td> </tr> <tr> <td> <span>-</span> read_maccs.pro<br> <span>-</span> write_maccs.pro </td> <td> <span>+</span> read_maccs.pro<span>&nbsp;(called by igllolik_despike.pro)</span><br> <span>+</span> write_maccs.pro<span>&nbsp;(called by igllolik_despike.pro)</span> </td> </tr> <tr> <td> Line 15: </td> <td> Line 15: </td> </tr> <tr> <td> <span>- five_sec_avg_fast_avg.pro</span> </td> <td> </td> </tr> <tr> <td> Line 17: </td> <td> Line 16: </td> </tr> <tr> <td> </td> <td> <span>+ five_sec_avg_fast_avg.pro (called by five_sec_avg.pro)<br> + read_maccs.pro (called by five_sec_avg.pro)<br> + write_maccs.pro (called by five_sec_avg.pro)</span> </td> </tr> <tr> <td> Line 18: </td> <td> Line 20: </td> </tr> <tr> <td> <span>- sec_to_min_fast_avg.pro</span> </td> <td> </td> </tr> <tr> <td> Line 20: </td> <td> Line 21: </td> </tr> <tr> <td> </td> <td> <span>+ read_maccs.pro (called by sec_to_min.pro)<br> + write_maccs.pro (called by sec_to_min.pro)</span> </td> </tr> <tr> <td> Line 25: </td> <td> Line 28: </td> </tr> <tr> <td> <span>-</span> The IDL program used in the 1 min merged files to 1 hour avg step </td> <td> <span>+</span> <span>&nbsp;*</span>The IDL program used in the 1 min merged files to 1 hour avg step </td> </tr> <tr> <td> Line 34: </td> <td> Line 37: </td> </tr> <tr> <td> </td> <td> <span>+ ?</span> </td> </tr> </table> </div> Realtime Plotshttp://maccs.wikispot.org/Realtime_Plots2007-07-25 19:04:27maccs <div id="content" class="wikipage content"> Differences for Realtime Plots<p><strong></strong></p>No differences found!</div> Realtime Plotshttp://maccs.wikispot.org/Realtime_Plots2007-07-25 19:04:04maccs <div id="content" class="wikipage content"> Differences for Realtime Plots<p><strong></strong></p>No differences found!</div> Realtime Plotshttp://maccs.wikispot.org/Realtime_Plots2007-07-25 18:40:34maccs <div id="content" class="wikipage content"> Differences for Realtime Plots<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> <span>- <br> - [[Image(nain_current.jpg)]]</span> </td> <td> <span>+ [http://engineering.dartmouth.edu/~david_murr/mic/nain_current.png]</span> </td> </tr> </table> </div> Realtime Plotshttp://maccs.wikispot.org/Realtime_Plots2007-07-25 18:39:21maccs <div id="content" class="wikipage content"> Differences for Realtime Plots<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + [[Image(nain_current.jpg)]]</span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-07-24 21:16:10maccsUpload of image <a href="http://maccs.wikispot.org/Front_Page?action=Files&do=view&target=pang1.jpg">pang1.jpg</a>.Front Pagehttp://maccs.wikispot.org/Front_Page2007-07-24 21:15:43maccs <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 2: </td> <td> Line 2: </td> </tr> <tr> <td> </td> <td> <span>+ <br> + [[Image(pang1.jpg)]]</span> </td> </tr> </table> </div> cleaner.prohttp://maccs.wikispot.org/cleaner.pro2007-07-24 21:09:50maccs <div id="content" class="wikipage content"> Differences for cleaner.pro<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ cleaner.pro, compiles and runs with idl<br> + <br> + needs strip.pro to run<br> + <br> + input must be raw MACCS data file(s)<br> + <br> + output is a cleaned binary version of the raw data with filetype .s2<br> + <br> + example: if input file is CD05.4, output file is CD05004.s2<br> + <br> + to compile &amp; run: cleaner, "path_and_name_of_raw_data_file(s)" (you can use * and ?)<br> + <br> + default output directory is e:\<br> + <br> + to set output directory: out_dir="output_directory"<br> + <br> + to display a window with a graph: view="view"<br> + <br> + to create summary text file(s) containg the command line output: summary="summary"<br> + <br> + to save the .s2 file(s) in a subdirectory folder (which must already exist): month_str="sub_dir_name"<br> + <br> + to move the raw file(s) after creating the clean file(s): move="path" (if you used the month_str parameter, the file(s) will be moved to the subdirectory within the folder you specified for the move directory) Ex: if parameters are month_str="Jan05/", move="/Volumes/MACCS_DATA/" then raw file(s) will be moved to /Volumes/MACCS_DATA/Jan05/<br> + <br> + the click parameter should not be used unless changes are made to the program<br> + <br> + Example: cleaner, "/Volumes/physics_data/Ftp/MACCS_DATA/Raw/CD/2005/CD05.4", out_dir="/Users/johnson8/maccs/", summary="summary", month_str="Jan05/", move="/Users/johnson8/Desktop/", view="view"</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-24 21:09:40maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 4: </td> <td> Line 4: </td> </tr> <tr> <td> <span>-</span> [cleaner.pro] </td> <td> <span>+</span> [<span>"</span>cleaner.pro<span>"</span>] </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-24 21:09:26maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 4: </td> <td> Line 4: </td> </tr> <tr> <td> <span>-</span> cleaner.pro </td> <td> <span>+</span> <span>[</span>cleaner.pro<span>]</span> </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-24 21:08:00maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 7: </td> <td> Line 7: </td> </tr> <tr> <td> <span>-</span> igloolik_despike.pro<br> <span>- read_maccs.pro<br> -</span> write_maccs.pro<br> <span>- </span>The IDL program used in the manual step of removing spikes<br> <span>-</span> step_view.pro<br> <span>-</span> step_wid.pro<br> <span>- flag.pro<br> - </span>The IDL program used in the 1/2 sec to 5 sec avg step<br> <span>- five_sec_avg_fast_avg.pro<br> - five_sec_avg.pro<br> - </span>The IDL program used in the 5sec to 1 min avg step<br> <span>- sec_to_min_fast_avg.pro<br> - sec_to_min.pro<br> - </span>The IDL program used to merge all 1 min files in 1 big file<br> <span>-</span> expandcode.pro<br> <span>- merge_files.pro<br> -</span> Nb. Requires an extra file "missing.1m", to substitute<br> <span>-</span> missing days </td> <td> <span>+ </span> igloolik_despike.pro<br> <span>+ read_maccs.pro<br> + </span> write_maccs.pro<br> <span>+ *</span>The IDL program used in the manual step of removing spikes<br> <span>+ </span> step_view.pro<br> <span>+ </span> step_wid.pro<br> <span>+ flag.pro<br> + *</span>The IDL program used in the 1/2 sec to 5 sec avg step<br> <span>+ five_sec_avg_fast_avg.pro<br> + five_sec_avg.pro<br> + *</span>The IDL program used in the 5sec to 1 min avg step<br> <span>+ sec_to_min_fast_avg.pro<br> + sec_to_min.pro<br> + *</span>The IDL program used to merge all 1 min files in 1 big file<br> <span>+ </span> expandcode.pro<br> <span>+ merge_files.pro<br> + </span> Nb. Requires an extra file "missing.1m", to substitute<br> <span>+ </span> missing days </td> </tr> <tr> <td> Line 26: </td> <td> Line 26: </td> </tr> <tr> <td> <span>-</span> houravrg.pro<br> <span>- </span>The IDL program used in prepare the baselines for rotation<br> <span>-</span> findbeta.pro<br> <span>-</span> strip.pro:<br> <span>-</span> hour_read.pro<br> <span>-</span> flag.pro<br> <span>-</span> wid_draw.pro<br> <span>- </span>The IDL program used in the rotate step </td> <td> <span>+ </span> houravrg.pro<br> <span>+ *</span>The IDL program used in prepare the baselines for rotation<br> <span>+ </span> findbeta.pro<br> <span>+ </span> strip.pro:<br> <span>+ </span> hour_read.pro<br> <span>+ </span> flag.pro<br> <span>+ </span> wid_draw.pro<br> <span>+ *</span>The IDL program used in the rotate step </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-24 21:06:46maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 4: </td> <td> Line 4: </td> </tr> <tr> <td> <span>-</span> cleaner.pro<br> <span>-</span> strip.pro </td> <td> <span>+ </span> cleaner.pro<br> <span>+ </span> strip.pro </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-24 21:06:14maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 3: </td> <td> Line 3: </td> </tr> <tr> <td> <span>-</span> <span>1. </span>The IDL program used in the clean step </td> <td> <span>+</span> <span>*</span>The IDL program used in the clean step </td> </tr> <tr> <td> Line 6: </td> <td> Line 6: </td> </tr> <tr> <td> <span>-</span> <span>2. </span>The IDL program used in the despike step </td> <td> <span>+</span> <span>*</span>The IDL program used in the despike step </td> </tr> </table> </div> Processing Softwarehttp://maccs.wikispot.org/Processing_Software2007-07-24 21:05:31maccs <div id="content" class="wikipage content"> Differences for Processing Software<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ Describe Processing Software here.<br> + <br> + 1. The IDL program used in the clean step<br> + cleaner.pro<br> + strip.pro<br> + 2. The IDL program used in the despike step<br> + igloolik_despike.pro<br> + read_maccs.pro<br> + write_maccs.pro<br> + The IDL program used in the manual step of removing spikes<br> + step_view.pro<br> + step_wid.pro<br> + flag.pro<br> + The IDL program used in the 1/2 sec to 5 sec avg step<br> + five_sec_avg_fast_avg.pro<br> + five_sec_avg.pro<br> + The IDL program used in the 5sec to 1 min avg step<br> + sec_to_min_fast_avg.pro<br> + sec_to_min.pro<br> + The IDL program used to merge all 1 min files in 1 big file<br> + expandcode.pro<br> + merge_files.pro<br> + Nb. Requires an extra file "missing.1m", to substitute<br> + missing days<br> + The IDL program used in the 1 min merged files to 1 hour avg step<br> + houravrg.pro<br> + The IDL program used in prepare the baselines for rotation<br> + findbeta.pro<br> + strip.pro:<br> + hour_read.pro<br> + flag.pro<br> + wid_draw.pro<br> + The IDL program used in the rotate step</span> </td> </tr> </table> </div> Front Pagehttp://maccs.wikispot.org/Front_Page2007-07-24 20:58:27 <div id="content" class="wikipage content"> Differences for Front Page<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 4: </td> <td> Line 4: </td> </tr> <tr> <td> <span>-</span> 1. First read the rest of this page! </td> <td> <span>+</span> 1. First read the rest of this page!<span>!</span> </td> </tr> </table> </div>