TWB RSS Data File Manipulator
Dave Typinski, AJ4CO Observatory
February, 2015

Continuum Plotter - Makes a continuum plot from a CSV file saved from RSS when viewing a TWB SPS file

filebase="R:\\Observation Records\\AJ4CO_TWB\\1312\\131223\\";

infilename="131223092019-362 to 567.csv";

interptablename="R:\\Observation Records\\Spectro Step Cals\\20131220 TWB\\Spectro Step Cal Analysis - TWB 20131220 - Interpolation Table.csv";

outname=filebase<>StringDrop[infilename,-4]<>".png";



infile=Import[filebase<>infilename];
sweeps=Dimensions[infile][[1]]-1
channels=Dimensions[infile][[2]]-2

flo=Round[infile[[1,3]]/10^6]
fhi=Round[infile[[1,channels+2]]/10^6]

continuum= Table[0,{i,1,channels}];
continuumkK= Table[0,{i,1,channels}];

kKtable=Import[interptablename];
kKinterp=Interpolation[kKtable,InterpolationOrder->3];


Do[
{
continuum[[i]]=N[Mean[infile[[2;;sweeps+1,i+2 ]]]];
continuumkK[[i]]=kKinterp[continuum[[i]]];
},
{i,1,channels}
];

Min[continuum]

(*
AppendTo[$Path,filebase];
Get["CustomTicks`"];
*)


charttitle=Column[{" ",Style["Time-Averaged Continuum Plot",Bold,FontSize->20,FontFamily->Verdana],
Style["TWB Data Chunk "<>infilename,Bold,FontSize->16,FontFamily->Verdana]
},Center
];

xlabel=Column[{
Style["Frequency (MHz)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];

ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Antenna Temperature (kK)",FontSize->16,FontFamily->Verdana]
},Center];

pv=ListPlot[continuumkK,
DataRange->{flo,fhi},
PlotRange->{-20,80},
PlotRangePadding->{0.02,3.5},
InterpolationOrder->3,
ColorFunction->RGBColor[0,0,1,1],
Joined->True,
Filling->Axis,
FillingStyle->Automatic,
GridLines->Automatic,

(*
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
*)
Frame->True,
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
]

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

kKtable
Max[infile[[2;;sweeps+1,3;;channels+2]]]

infilename

StringDrop[infilename,-4]

Julian Date Functions - Convert to and from JD

(* Julian Date Conversion from USNO at http://aa.usno.navy.mil/faq/docs/JD_Formula.php *)
JD[y_,m_,d_,h_,n_]:=
PaddedForm[367.*y-IntegerPart[(7*(y+IntegerPart[(m+9)/12]))/4]+IntegerPart[(275*m)/9]+d+1721013.5+h/24+n/1440,{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)];

y=2015;
m=1;
d=30;
h=7;
n=44;

JD[y,m,d,h,n]

UFRO Jupiter Watch List Maker - Convert 1D array into a 2D array suitable for sending to JPL to get Io-CML ephemerides

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

SetDirectory[filebase];
infiles=FileNames["*"<>".dat"];
filecount=infiles//Length;
Print["Found ",ToString[filecount]," files to process in ",filebase];

OutFileName=filebase<>"Processed Watch Times.csv";
OutFile=Table[0,{i,1,10000},{j,1,8}];
Durations=Table[0,{i,1,10000}];

(* Julian Date Conversion from USNO at http://aa.usno.navy.mil/faq/docs/JD_Formula.php *)
JD[y_,m_,d_,h_,n_]:=367.*y-IntegerPart[(7*(y+IntegerPart[(m+9)/12]))/4]+IntegerPart[(275*m)/9]+d+1721013.5+h/24+n/1440;

wc=0;

Do[
{

InFile=Import[filebase<>infiles[[q]]];

NumRecs=Dimensions[InFile][[1]];

k=1;

While[k<NumRecs-6,
{
wc++;
datfilename=InFile[[k+1,1]];
month=Floor[InFile[[k+2,1]]/10000];
day=Floor[(InFile[[k+2,1]]-month*10000)/100];
year=InFile[[k+2,1]]-month*10000-day*100;
If[year<50, year=year+2000,year=year+1900];
antenna=InFile[[k+3,1]];
hourwatchstart=Floor[InFile[[k+4,1]]/100];
minutewatchstart=InFile[[k+4,1]]-hourwatchstart*100;
hourwatchend=Floor[InFile[[k+5,1]]/100];
minutewatchend=InFile[[k+5,1]]-hourwatchend*100;
If[hourwatchend<hourwatchstart,nextday=1,nextday=0];

OutFile[[wc,1]]=datfilename;
OutFile[[wc,2]]=year;
OutFile[[wc,3]]=month;
OutFile[[wc,4]]=day;
OutFile[[wc,5]]=ToString[PaddedForm[InFile[[k+4,1]],3,NumberPadding->"0"]];
OutFile[[wc,6]]=ToString[PaddedForm[JD[year,month,day,hourwatchstart,minutewatchstart],{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)]];
OutFile[[wc,7]]=ToString[PaddedForm[InFile[[k+5,1]],3,NumberPadding->"0"]];
OutFile[[wc,8]]=ToString[PaddedForm[JD[year,month,day,hourwatchend,minutewatchend]+nextday,{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)]];

Durations[[wc]]=JD[year,month,day,hourwatchend,minutewatchend]+nextday-JD[year,month,day,hourwatchstart,minutewatchstart];

n=6;
While[(InFile[[k+n,1]]!="$")&&(k+n<NumRecs),n++];
k=k+n;
}
];

}
,{q,1,filecount}
];


OutFileTrimmed=SortBy[OutFile[[1;;wc]],#[[6]]&];
Print["Processed ",filecount," files containing ",wc," Jupiter watches."]
Export[OutFileName,OutFileTrimmed]

DurationsTrimmed=Durations[[1;;wc]];
ListPlot[DurationsTrimmed,PlotRange->All]

Watch List TLIST Maker - Makes a TLIST file suitable for pasting into an email for sending to JPL

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Watch Times.csv";

InFile=Import[filebase<>infilename];
OutFileName=filebase<>"Processed Watch TLIST.tsv";

SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[y,{16,9},ExponentFunction->(If[-10<#<10,Null,#]&)]

NumRecs=Dimensions[InFile][[1]]

OutFile=Table[{0,0},{i,1,NumRecs}];

Do[
{
OutFile[[i,1]]=InFile[[i,6]];
OutFile[[i,2]]=InFile[[i,8]];
},
{i,1,NumRecs}
]

OutFile=numFormat[OutFile];

Do[
{
OutFile[[i,1]]="'"<>OutFile[[i,1]]<>"'";
OutFile[[i,2]]="'"<>OutFile[[i,2]]<>"'";
}
,{i,1,NumRecs}
];

Export[OutFileName,OutFile]

JPL 2-Line to 1-Line Converter - Jupiter & Io Ephemerides - Converts Watch Time Ephemerides from JPL from 2-line format to 1-line format

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="UFRO 18T Watches 1995-2007 J JPL.csv";

InFile=Import[filebase<>infilename];
OutFileName=filebase<>"UFRO 18T Watches 1995-2007 J JPL 1-Line.csv";

SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[y,{16,9},ExponentFunction->(If[-10<#<10,Null,#]&)]

NumRecs=Dimensions[InFile][[1]]

OutFile=Table[0,{i,1,NumRecs/2},{j,1,31}];

k=1;

Do[
{
OutFile[[k,1;;15]]=InFile[[i,1;;15]];
OutFile[[k,17;;31]]=InFile[[i+1,1;;15]];
k++;
},
{i,1,NumRecs,2}
]

OutFile[[All,2]]=numFormat[OutFile[[All,2]]];
OutFile[[All,18]]=numFormat[OutFile[[All,18]]];

Export[OutFileName,OutFile]

JPL 2-Line to 1-Line Converter - D_e Ephemerides - Converts Watch Time Ephemerides from JPL from 2-line format to 1-line format

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="UFRO 18T Watches 1995-2007 D JPL.csv";

InFile=Import[filebase<>infilename];
OutFileName=filebase<>"UFRO 18T Watches 1995-2007 D JPL 1-Line.csv";

SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[y,{16,9},ExponentFunction->(If[-10<#<10,Null,#]&)]

NumRecs=Dimensions[InFile][[1]]

OutFile=Table[0,{i,1,NumRecs/2},{j,1,13}];

k=1;

Do[
{
OutFile[[k,1;;6]]=InFile[[i,1;;6]];
OutFile[[k,8;;13]]=InFile[[i+1,1;;6]];
k++;
},
{i,1,NumRecs,2}
]

OutFile[[All,2]]=numFormat[OutFile[[All,2]]];
OutFile[[All,9]]=numFormat[OutFile[[All,9]]];

Export[OutFileName,OutFile]

UFRO Jupiter Storm List Maker - Convert 1D array into a 2D array suitable for sending to JPL to get Io-CML ephemerides

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

SetDirectory[filebase];
infiles=FileNames["*"<>".dat"];
filecount=infiles//Length;
Print["Found ",ToString[filecount]," files to process in ",filebase];

OutFileName=filebase<>"Processed Storm Times.csv";
OutFile=Table[0,{i,1,10000},{j,1,14}];
Durations=Table[0,{i,1,10000}];

(* Julian Date Conversion from USNO at http://aa.usno.navy.mil/faq/docs/JD_Formula.php *)
JD[y_,m_,d_,h_,n_]:=367.*y-IntegerPart[(7*(y+IntegerPart[(m+9)/12]))/4]+IntegerPart[(275*m)/9]+d+1721013.5+h/24+n/1440;

sc=0;

Do[
{

InFile=Import[filebase<>infiles[[q]]];

NumRecs=Dimensions[InFile][[1]];

k=1;

While[k<NumRecs-6,
{

datfilename=InFile[[k+1,1]];
month=Floor[InFile[[k+2,1]]/10000];
day=Floor[(InFile[[k+2,1]]-month*10000)/100];
year=InFile[[k+2,1]]-month*10000-day*100;
If[year<50, year=year+2000,year=year+1900];
antenna=InFile[[k+3,1]];
hourwatchstart=Floor[InFile[[k+4,1]]/100];
minutewatchstart=InFile[[k+4,1]]-hourwatchstart*100;
hourwatchend=Floor[InFile[[k+5,1]]/100];
minutewatchend=InFile[[k+5,1]]-hourwatchend*100;
If[hourwatchend<hourwatchstart,nextdaywatch=1,nextdaywatch=0];
numstorms=InFile[[k+6,1]];

If[ numstorms>0,
{

Do[
{
sc++;
hourstormstart=Floor[InFile[[k+6+(r-1)*2+1,1]]/100];
minutestormstart=InFile[[k+6+(r-1)*2+1,1]]-hourstormstart*100;
hourstormend=Floor[InFile[[k+6+(r-1)*2+2,1]]/100];
minutestormend=InFile[[k+6+(r-1)*2+2,1]]-hourstormend*100;
If[hourstormend<hourstormstart,nextdaystorm=1,nextdaystorm=0];
OutFile[[sc,1]]=datfilename;
OutFile[[sc,2]]=year;
OutFile[[sc,3]]=month;
OutFile[[sc,4]]=day;
OutFile[[sc,5]]=ToString[PaddedForm[InFile[[k+4,1]],3,NumberPadding->"0"]];
OutFile[[sc,6]]=ToString[PaddedForm[JD[year,month,day,hourwatchstart,minutewatchstart],{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)]];
OutFile[[sc,7]]=ToString[PaddedForm[InFile[[k+5,1]],3,NumberPadding->"0"]];
OutFile[[sc,8]]=ToString[PaddedForm[JD[year,month,day,hourwatchend,minutewatchend]+nextdaywatch,{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)]];
OutFile[[sc,9]]=numstorms;
OutFile[[sc,10]]=r;
OutFile[[sc,11]]=ToString[PaddedForm[InFile[[k+6+(r-1)*2+1,1]],3,NumberPadding->"0"]];
OutFile[[sc,12]]=ToString[PaddedForm[JD[year,month,day,hourstormstart,minutestormstart],{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)]];
OutFile[[sc,13]]=ToString[PaddedForm[InFile[[k+6+(r-1)*2+2,1]],3,NumberPadding->"0"]];
OutFile[[sc,14]]=ToString[PaddedForm[JD[year,month,day,hourstormend,minutestormend]+nextdaystorm,{16,9},NumberPadding->{"","0"},ExponentFunction->(Null&)]];
Durations[[sc]]=JD[year,month,day,hourstormend,minutestormend]+nextdaystorm-JD[year,month,day,hourstormstart,minutestormstart];
}
,{r,1,numstorms}
];

}
];

n=6;
While[(InFile[[k+n,1]]!="$")&&(k+n<NumRecs),n++];
k=k+n;
}
];

}
,{q,1,filecount}
];


OutFileTrimmed=SortBy[OutFile[[1;;sc]],{#[[6]]&,#[[10]]&}];
Print["Processed ",filecount," files containing ",sc," Jupiter storms."]
Export[OutFileName,OutFileTrimmed]

DurationsTrimmed=Durations[[1;;wc]];
ListPlot[DurationsTrimmed,PlotRange->All]

Storm List TLIST Maker - Makes a TLIST file suitable for pasting into an email for sending to JPL

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Storm Times.csv";

InFile=Import[filebase<>infilename];
OutFileName=filebase<>"Processed Storm TLIST.tsv";

SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[y,{16,9},ExponentFunction->(If[-10<#<10,Null,#]&)]

NumRecs=Dimensions[InFile][[1]]

OutFile=Table[{0,0},{i,1,NumRecs}];

Do[
{
OutFile[[i,1]]=InFile[[i,12]];
OutFile[[i,2]]=InFile[[i,14]];
},
{i,1,NumRecs}
]

OutFile=numFormat[OutFile];

Do[
{
OutFile[[i,1]]="'"<>OutFile[[i,1]]<>"'";
OutFile[[i,2]]="'"<>OutFile[[i,2]]<>"'";
}
,{i,1,NumRecs}
];

Export[OutFileName,OutFile]

CML-Io File Maker - Jupiter Watches - Makes a file of UTC, JD, CML & Io from a set of JPL 1-line ephemeris CSV files

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilenameJ="UFRO 18T Watches 1995-2007 J JPL 1-Line.csv";
infilenameI="UFRO 18T Watches 1995-2007 I JPL 1-Line.csv";
infilenameD="UFRO 18T Watches 1995-2007 D JPL 1-Line.csv";

OutFileName=filebase<>"Processed Watch CML-Io-De.csv";

IoOrb=420800; (* Io's average orbit radius in km *)
AU=149598000; (* 1 AU in km *)


SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[y,{16,9},ExponentFunction->(If[-10<#<10,Null,#]&)]

InFileJ=Import[filebase<>infilenameJ];
InFileI=Import[filebase<>infilenameI];
InFileD=Import[filebase<>infilenameD];


NumRecs=Dimensions[InFileJ][[1]]

OutFile=Table[0,{i,1,NumRecs},{j,1,9}];

Do[
{
OutFile[[i,1]]=InFileJ[[i,1]]; (* start time UTC *)
OutFile[[i,2]]=InFileJ[[i,2]]; (* start time JD *)

OutFile[[i,3]]=InFileJ[[i,9]]; (* start CML-III *)

(* Io phase SGC = Io CML+(Io orbit angular semidiameter)*sin(Io CML) *)
(* Io orbit angular semidiameter=arctan(SDavg/(AU2km*D)) *)
(* = 'Io JPL'!I916+(ATAN(420800/(149598000*'Jupiter JPL'!K916)*180/PI()))*SIN('Io JPL'!I916*PI()/180) *)
OutFile[[i,4]]=InFileI[[i,9]]+(ArcTan[AU*InFileJ[[i,11]],IoOrb]*180/Pi)*Sin[InFileI[[i,9]]*Pi/180]; (* Start Io phase *)

OutFile[[i,5]]=InFileD[[i,6]]; (* Start D-sub-e *)

OutFile[[i,6]]=InFileJ[[i,17]]; (* end time UTC *)
OutFile[[i,7]]=InFileJ[[i,18]]; (* end time JD *)

OutFile[[i,8]]=InFileJ[[i,25]]; (* end CML-III *)
OutFile[[i,9]]=InFileI[[i,25]]+(ArcTan[AU*InFileJ[[i,27]],IoOrb]*180/Pi)*Sin[InFileI[[i,25]]*Pi/180]; (* end Io phase *)

},
{i,1,NumRecs}
]

OutFile[[All,2]]=numFormat[OutFile[[All,2]]];
OutFile[[All,7]]=numFormat[OutFile[[All,7]]];

Export[OutFileName,OutFile]

Watch Tracks Plotter - Makes a CML-Io plot of all Jupter storm tracks listed in one CSV file

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Watch CML-Io-De.csv";

backimagefile="Io-CML_Phase_Plane_BW_-0deg.jpg";

outname="Processed Wacth CML-Io Phase Plane Tracks.png";

SetDirectory[filebase];
InFile=Import[infilename];
NumRecs=Dimensions[InFile][[1]]

Tracks=Table[{{0,0},{0,0}},{i,1,NumRecs}];

np=0;

Do[
{
cs=InFile[[i,3]];
is=InFile[[i,4]];
ce=InFile[[i,8]];
ie=InFile[[i,9]];

If[ce>cs&&ie>is,
{
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=ce;
Tracks[[i,2,2]]=ie;
}
];

If[ce<cs&&ie>is,
{
ce=ce+360;
m=(ie-is)/(ce-cs);
inew=is+m*(360-cs);
ce=ce-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=360;
Tracks[[i,2,2]]=inew;
Tracks=Append[Tracks,{{0,inew},{ce,ie}}];
}
];

If[ce>cs&&ie<is,
{
ie=ie+360;
m=(ie-is)/(ce-cs);
cnew=cs+(360-is)/m;
ie=ie-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=cnew;
Tracks[[i,2,2]]=360;
Tracks=Append[Tracks,{{cnew,0},{ce,ie}}];
}
];

If[ce<cs&&ie<is,
{
np++;
}
];

},
{i,1,NumRecs}
];

Print[np," tracks not plotted."]

AppendTo[$Path,filebase];
Get["CustomTicks`"];

BkgrdImg=Import[filebase<>backimagefile];
tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style["Storm Tracks",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007",Bold,FontSize->16,FontFamily->Verdana]
},Center
];
charttitle=tname;
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListLinePlot[Tracks,
PlotRange->{{0.,360.},{0.,360.}},
PlotRangePadding->5,
ColorFunction->Function[{x,y,z},RGBColor[0,0,1,1]],
AspectRatio->1,
Prolog->{Texture[BkgrdImg],Polygon[{Scaled[{0,0}],Scaled[{1,0}],Scaled[{1,1}],Scaled[{0,1}]},VertexTextureCoordinates->{{0,0},{1,0},{1,1},{0,1}}]},
Frame->True,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
]

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

Watch Tracks Plotter with 45deg Offset - Makes a CML-Io plot of all Jupter storm tracks listed in one CSV file

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Watch CML-Io-De.csv";

backimagefile="Io-CML_Phase_Plane_BW_-45deg.jpg";

outname="Processed Watch CML-Io Phase Plane Tracks 45.png";

SetDirectory[filebase];
InFile=Import[infilename];
NumRecs=Dimensions[InFile][[1]]

Tracks=Table[{{0,0},{0,0}},{i,1,NumRecs}];

np=0;

Do[
{
cs=Mod[InFile[[i,3]]-45,360];
is=InFile[[i,4]];
ce=Mod[InFile[[i,8]]-45,360];
ie=InFile[[i,9]];

If[ce>cs&&ie>is,
{
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=ce;
Tracks[[i,2,2]]=ie;
}
];

If[ce<cs&&ie>is,
{
ce=ce+360;
m=(ie-is)/(ce-cs);
inew=is+m*(360-cs);
ce=ce-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=360;
Tracks[[i,2,2]]=inew;
Tracks=Append[Tracks,{{0,inew},{ce,ie}}];
}
];

If[ce>cs&&ie<is,
{
ie=ie+360;
m=(ie-is)/(ce-cs);
cnew=cs+(360-is)/m;
ie=ie-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=cnew;
Tracks[[i,2,2]]=360;
Tracks=Append[Tracks,{{cnew,0},{ce,ie}}];
}
];

If[ce<cs&&ie<is,
{
np++;
}
];

},
{i,1,NumRecs}
];

Print[np," tracks not plotted."]

AppendTo[$Path,filebase];
Get["CustomTicks`"];

BkgrdImg=Import[filebase<>backimagefile];
tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style["Storm Tracks",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007",Bold,FontSize->16,FontFamily->Verdana]
},Center
];
charttitle=tname;
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListLinePlot[Tracks,
PlotRange->{{0.,360.},{0.,360.}},
PlotRangePadding->5,
ColorFunction->Function[{x,y,z},RGBColor[0,0,1,1]],
AspectRatio->1,
Prolog->{Texture[BkgrdImg],Polygon[{Scaled[{0,0}],Scaled[{1,0}],Scaled[{1,1}],Scaled[{0,1}]},VertexTextureCoordinates->{{0,0},{1,0},{1,1},{0,1}}]},
Frame->True,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
]

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

Mod[-15,360]

CML-Io File Maker - Jupiter Storms - Makes a file of UTC, JD, CML & Io from a set of JPL 1-line ephemeris CSV files

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilenameJ="UFRO 18T Storms 1995-2007 J JPL 1-Line.csv";
infilenameI="UFRO 18T Storms 1995-2007 I JPL 1-Line.csv";
infilenameD="UFRO 18T Storms 1995-2007 D JPL 1-Line.csv";

OutFileName=filebase<>"Processed Storm CML-Io-De.csv";

IoOrb=420800; (* Io's average orbit radius in km *)
AU=149598000; (* 1 AU in km *)


SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[y,{16,9},ExponentFunction->(If[-10<#<10,Null,#]&)]

InFileJ=Import[filebase<>infilenameJ];
InFileI=Import[filebase<>infilenameI];
InFileD=Import[filebase<>infilenameD];


NumRecs=Dimensions[InFileJ][[1]]

OutFile=Table[0,{i,1,NumRecs},{j,1,9}];

Do[
{
OutFile[[i,1]]=InFileJ[[i,1]]; (* start time UTC *)
OutFile[[i,2]]=InFileJ[[i,2]]; (* start time JD *)

OutFile[[i,3]]=InFileJ[[i,9]]; (* start CML-III *)

(* Io phase SGC = Io CML+(Io orbit angular semidiameter)*sin(Io CML) *)
(* Io orbit angular semidiameter=arctan(SDavg/(AU2km*D)) *)
(* = 'Io JPL'!I916+(ATAN(420800/(149598000*'Jupiter JPL'!K916)*180/PI()))*SIN('Io JPL'!I916*PI()/180) *)
OutFile[[i,4]]=InFileI[[i,9]]+(ArcTan[AU*InFileJ[[i,11]],IoOrb]*180/Pi)*Sin[InFileI[[i,9]]*Pi/180]; (* Start Io phase *)

OutFile[[i,5]]=InFileD[[i,6]]; (* Start D-sub-e *)

OutFile[[i,6]]=InFileJ[[i,17]]; (* end time UTC *)
OutFile[[i,7]]=InFileJ[[i,18]]; (* end time JD *)

OutFile[[i,8]]=InFileJ[[i,25]]; (* end CML-III *)
OutFile[[i,9]]=InFileI[[i,25]]+(ArcTan[AU*InFileJ[[i,27]],IoOrb]*180/Pi)*Sin[InFileI[[i,25]]*Pi/180]; (* end Io phase *)

},
{i,1,NumRecs}
]

OutFile[[All,2]]=numFormat[OutFile[[All,2]]];
OutFile[[All,7]]=numFormat[OutFile[[All,7]]];

Export[OutFileName,OutFile]

Storm Tracks Plotter - Makes a CML-Io plot of all Jupter storm tracks listed in one CSV file

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Storm CML-Io-De.csv";

backimagefile="Io-CML_Phase_Plane_BW_-0deg.jpg";

outname="Processed Storm CML-Io Phase Plane Tracks.png";

SetDirectory[filebase];
InFile=Import[infilename];
NumRecs=Dimensions[InFile][[1]];

Tracks=Table[{{0,0},{0,0}},{i,1,NumRecs}];

Do[
{
cs=InFile[[i,3]];
is=InFile[[i,4]];
ce=InFile[[i,8]];
ie=InFile[[i,9]];

If[ce>cs&&ie>is,
{
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=ce;
Tracks[[i,2,2]]=ie;
}
];

If[ce<cs&&ie>is,
{
ce=ce+360;
m=(ie-is)/(ce-cs);
inew=is+m*(360-cs);
ce=ce-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=360;
Tracks[[i,2,2]]=inew;
Tracks=Append[Tracks,{{0,inew},{ce,ie}}];
}
];

If[ce>cs&&ie<is,
{
ie=ie+360;
m=(ie-is)/(ce-cs);
cnew=cs+(360-is)/m;
ie=ie-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=cnew;
Tracks[[i,2,2]]=360;
Tracks=Append[Tracks,{{cnew,0},{ce,ie}}];
}
];

If[ce<cs&&ie<is,
{
ce=ce+360;
ie=ie+360;
m=(ie-is)/(ce-cs);
ce=ce-360;
ie=ie-360;
If[is<0.23378*cs+275.8392,
{
inew=is+m*(360-cs);
cnew=0+(360-inew)/m;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=360;
Tracks[[i,2,2]]=inew;
Tracks=Append[Tracks,{{0,inew},{cnew,360}}];
Tracks=Append[Tracks,{{cnew,0},{ce,ie}}];
},
{
cnew=cs+(360-is)/m;
inew=0+m*(360-cnew);
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=cnew;
Tracks[[i,2,2]]=360;
Tracks=Append[Tracks,{{cnew,0},{360,inew}}];
Tracks=Append[Tracks,{{0,inew},{ce,ie}}];
}
];
}
];

},
{i,1,NumRecs}
];


AppendTo[$Path,filebase];
Get["CustomTicks`"];

BkgrdImg=Import[filebase<>backimagefile];
tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style[ToString[NumRecs]<>" Storm Tracks",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007",Bold,FontSize->16,FontFamily->Verdana]
},Center
];
charttitle=tname;
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListLinePlot[Tracks,
PlotRange->{{0.,360.},{0.,360.}},
PlotRangePadding->5,
ColorFunction->Function[{x,y,z},RGBColor[0,0,1,1]],
AspectRatio->1,
Prolog->{Texture[BkgrdImg],Polygon[{Scaled[{0,0}],Scaled[{1,0}],Scaled[{1,1}],Scaled[{0,1}]},VertexTextureCoordinates->{{0,0},{1,0},{1,1},{0,1}}]},
Frame->True,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
]

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

Storm Tracks Plotter with 45deg Offset - Makes a CML-Io plot of all Jupter storm tracks listed in one CSV file

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Storm CML-Io-De.csv";

backimagefile="Io-CML_Phase_Plane_BW_-45deg.jpg";

outname="Processed Storm CML-Io Phase Plane Tracks 45.png";

SetDirectory[filebase];
InFile=Import[infilename];
NumRecs=Dimensions[InFile][[1]];

Tracks=Table[{{0,0},{0,0}},{i,1,NumRecs}];

Do[
{
cs=Mod[InFile[[i,3]]-45,360];
is=InFile[[i,4]];
ce=Mod[InFile[[i,8]]-45,360];
ie=InFile[[i,9]];

If[ce>cs&&ie>is,
{
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=ce;
Tracks[[i,2,2]]=ie;
}
];

If[ce<cs&&ie>is,
{
ce=ce+360;
m=(ie-is)/(ce-cs);
inew=is+m*(360-cs);
ce=ce-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=360;
Tracks[[i,2,2]]=inew;
Tracks=Append[Tracks,{{0,inew},{ce,ie}}];
}
];

If[ce>cs&&ie<is,
{
ie=ie+360;
m=(ie-is)/(ce-cs);
cnew=cs+(360-is)/m;
ie=ie-360;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=cnew;
Tracks[[i,2,2]]=360;
Tracks=Append[Tracks,{{cnew,0},{ce,ie}}];
}
];

If[ce<cs&&ie<is,
{
ce=ce+360;
ie=ie+360;
m=(ie-is)/(ce-cs);
ce=ce-360;
ie=ie-360;
If[is<0.23378*cs+275.8392,
{
inew=is+m*(360-cs);
cnew=0+(360-inew)/m;
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=360;
Tracks[[i,2,2]]=inew;
Tracks=Append[Tracks,{{0,inew},{cnew,360}}];
Tracks=Append[Tracks,{{cnew,0},{ce,ie}}];
},
{
cnew=cs+(360-is)/m;
inew=0+m*(360-cnew);
Tracks[[i,1,1]]=cs;
Tracks[[i,1,2]]=is;
Tracks[[i,2,1]]=cnew;
Tracks[[i,2,2]]=360;
Tracks=Append[Tracks,{{cnew,0},{360,inew}}];
Tracks=Append[Tracks,{{0,inew},{ce,ie}}];
}
];
}
];

},
{i,1,NumRecs}
];


AppendTo[$Path,filebase];
Get["CustomTicks`"];

BkgrdImg=Import[filebase<>backimagefile];
tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style[ToString[NumRecs]<>" Storm Tracks",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007",Bold,FontSize->16,FontFamily->Verdana]
},Center
];
charttitle=tname;
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListLinePlot[Tracks,
PlotRange->{{0.,360.},{0.,360.}},
PlotRangePadding->5,
ColorFunction->Function[{x,y,z},RGBColor[0,0,1,1]],
PlotStyle->Thin,
AspectRatio->1,
Prolog->{Texture[BkgrdImg],Polygon[{Scaled[{0,0}],Scaled[{1,0}],Scaled[{1,1}],Scaled[{0,1}]},VertexTextureCoordinates->{{0,0},{1,0},{1,1},{0,1}}]},
Frame->True,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{{{0.," 45",{0.01,0},{}},{5.,"",{0.005,0},{}},{10.,"",{0.005,0},{}},{15.," 60",{0.01,0},{}},{20.,"",{0.005,0},{}},{25.,"",{0.005,0},{}},{30.,"",{0.005,0},{}},{35.,"",{0.005,0},{}},{40.,"",{0.005,0},{}},{45.," 90",{0.01,0},{}},{50.,"",{0.005,0},{}},{55.,"",{0.005,0},{}},{60.,"",{0.005,0},{}},{65.,"",{0.005,0},{}},{70.,"",{0.005,0},{}},{75.,"120",{0.01,0},{}},{80.,"",{0.005,0},{}},{85.,"",{0.005,0},{}},{90.,"",{0.005,0},{}},{95.,"",{0.005,0},{}},{100.,"",{0.005,0},{}},{105.,"150",{0.01,0},{}},{110.,"",{0.005,0},{}},{115.,"",{0.005,0},{}},{120.,"",{0.005,0},{}},{125.,"",{0.005,0},{}},{130.,"",{0.005,0},{}},{135.,"180",{0.01,0},{}},{140.,"",{0.005,0},{}},{145.,"",{0.005,0},{}},{150.,"",{0.005,0},{}},{155.,"",{0.005,0},{}},{160.,"",{0.005,0},{}},{165.,"210",{0.01,0},{}},{170.,"",{0.005,0},{}},{175.,"",{0.005,0},{}},{180.,"",{0.005,0},{}},{185.,"",{0.005,0},{}},{190.,"",{0.005,0},{}},{195.,"240",{0.01,0},{}},{200.,"",{0.005,0},{}},{205.,"",{0.005,0},{}},{210.,"",{0.005,0},{}},{215.,"",{0.005,0},{}},{220.,"",{0.005,0},{}},{225.,"270",{0.01,0},{}},{230.,"",{0.005,0},{}},{235.,"",{0.005,0},{}},{240.,"",{0.005,0},{}},{245.,"",{0.005,0},{}},{250.,"",{0.005,0},{}},{255.,"300",{0.01,0},{}},{260.,"",{0.005,0},{}},{265.,"",{0.005,0},{}},{270.,"",{0.005,0},{}},{275.,"",{0.005,0},{}},{280.,"",{0.005,0},{}},{285.,"330",{0.01,0},{}},{290.,"",{0.005,0},{}},{295.,"",{0.005,0},{}},{300.,"",{0.005,0},{}},{305.,"",{0.005,0},{}},{310.,"",{0.005,0},{}},{315.,"  0",{0.01,0},{}},{320.,"",{0.005,0},{}},{325.,"",{0.005,0},{}},{330.,"",{0.005,0},{}},{335.,"",{0.005,0},{}},{340.,"",{0.005,0},{}},{345.," 30",{0.01,0},{}},{350.,"",{0.005,0},{}},{355.,"",{0.005,0},{}},{360.," 45",{0.01,0},{}}},
{{0.,"",{0.01,0},{}},{5.,"",{0.005,0},{}},{10.,"",{0.005,0},{}},{15.,"",{0.01,0},{}},{20.,"",{0.005,0},{}},{25.,"",{0.005,0},{}},{30.,"",{0.005,0},{}},{35.,"",{0.005,0},{}},{40.,"",{0.005,0},{}},{45.,"",{0.01,0},{}},{50.,"",{0.005,0},{}},{55.,"",{0.005,0},{}},{60.,"",{0.005,0},{}},{65.,"",{0.005,0},{}},{70.,"",{0.005,0},{}},{75.,"",{0.01,0},{}},{80.,"",{0.005,0},{}},{85.,"",{0.005,0},{}},{90.,"",{0.005,0},{}},{95.,"",{0.005,0},{}},{100.,"",{0.005,0},{}},{105.,"",{0.01,0},{}},{110.,"",{0.005,0},{}},{115.,"",{0.005,0},{}},{120.,"",{0.005,0},{}},{125.,"",{0.005,0},{}},{130.,"",{0.005,0},{}},{135.,"",{0.01,0},{}},{140.,"",{0.005,0},{}},{145.,"",{0.005,0},{}},{150.,"",{0.005,0},{}},{155.,"",{0.005,0},{}},{160.,"",{0.005,0},{}},{165.,"",{0.01,0},{}},{170.,"",{0.005,0},{}},{175.,"",{0.005,0},{}},{180.,"",{0.005,0},{}},{185.,"",{0.005,0},{}},{190.,"",{0.005,0},{}},{195.,"",{0.01,0},{}},{200.,"",{0.005,0},{}},{205.,"",{0.005,0},{}},{210.,"",{0.005,0},{}},{215.,"",{0.005,0},{}},{220.,"",{0.005,0},{}},{225.,"",{0.01,0},{}},{230.,"",{0.005,0},{}},{235.,"",{0.005,0},{}},{240.,"",{0.005,0},{}},{245.,"",{0.005,0},{}},{250.,"",{0.005,0},{}},{255.,"",{0.01,0},{}},{260.,"",{0.005,0},{}},{265.,"",{0.005,0},{}},{270.,"",{0.005,0},{}},{275.,"",{0.005,0},{}},{280.,"",{0.005,0},{}},{285.,"",{0.01,0},{}},{290.,"",{0.005,0},{}},{295.,"",{0.005,0},{}},{300.,"",{0.005,0},{}},{305.,"",{0.005,0},{}},{310.,"",{0.005,0},{}},{315.,"",{0.01,0},{}},{320.,"",{0.005,0},{}},{325.,"",{0.005,0},{}},{330.,"",{0.005,0},{}},{335.,"",{0.005,0},{}},{340.,"",{0.005,0},{}},{345.,"",{0.01,0},{}},{350.,"",{0.005,0},{}},{355.,"",{0.005,0},{}},{360.,"",{0.01,0},{}}}}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
]

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

Watch Matrix Maker - Makes a CML-Io matrix of all Jupter watch times listed in one CSV file

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Watch CML-Io-De.csv";

OutFileName=filebase<>"Processed Watch CML-Io Phase Plane Matrix.csv";

(* Phase plane bin width in degrees *)
(* MOUST divide into 360 evenly *)
binwidth = 1; 
bins=IntegerPart[2*360/binwidth];
binh=IntegerPart[360/binwidth];

samesideofline[x1_,y1_,x2_,y2_,ax_,ay_,bx_,by_]:=
((x1-x2)*(ay-y2)-(y1-y2)*(ax-x2))*((x1-x2)*(by-y2)-(y1-y2)*(bx-x2))≥0;

lineintersect[ax1_,ay1_,ax2_,ay2_,bx1_,by1_,bx2_,by2_]:=!samesideofline[ax1,ay1,ax2,ay2,bx1,by1,bx2,by2]&&!samesideofline[bx1,by1,bx2,by2,ax1,ay1,ax2,ay2];

InFile=Import[filebase<>infilename];
NumRecs=Dimensions[InFile][[1]]

OutFile=Table[0,{i,1,bins},{j,1,bins}];

Do[
{
CMLS=InFile[[i,3]];
IoS=InFile[[i,4]];

CMLE=InFile[[i,8]];
IoE=InFile[[i,9]];

If[CMLE<CMLS, CMLE=CMLE+360];
If[IoE<IoS, IoE=IoE+360];

Do[
{
Do[
{
If[lineintersect[CMLS,IoS,CMLE,IoE,(c-1)*binwidth,(p-1)*binwidth,c*binwidth,(p-1)*binwidth]||
lineintersect[CMLS,IoS,CMLE,IoE,c*binwidth,(p-1)*binwidth,c*binwidth,p*binwidth]||
lineintersect[CMLS,IoS,CMLE,IoE,c*binwidth,p*binwidth,(c-1)*binwidth,p*binwidth]||
lineintersect[CMLS,IoS,CMLE,IoE,(c-1)*binwidth,p*binwidth,(c-1)*binwidth,(p-1)*binwidth],
OutFile[[c,p]]++
];
},
{c,IntegerPart[CMLS/binwidth],IntegerPart[CMLE/binwidth]+1}
];
},
{p,IntegerPart[IoS/binwidth],IntegerPart[IoE/binwidth]+1}
];
If[Mod[i,10]==0,Print[i]];
},
{i,1,NumRecs}
];



OutFileCollapsed=OutFile[[1;;binh,1;;binh]]+OutFile[[binh+1;;bins,1;;binh]]+OutFile[[1;;binh,binh+1;;bins]]+OutFile[[binh+1;;bins,binh+1;;bins]];

Export[OutFileName,OutFileCollapsed]

Storm Matrix Maker - Makes a CML-Io matrix of all Jupter storm times listed in one CSV file

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Storm CML-Io-De.csv";

OutFileName=filebase<>"Processed Storm CML-Io Phase Plane Matrix.csv";

(* Phase plane bin width in degrees *)
(* MOUST divide into 360 evenly *)
binwidth = 1.0;
bins=IntegerPart[2*360/binwidth];
binh=IntegerPart[360/binwidth];

samesideofline[x1_,y1_,x2_,y2_,ax_,ay_,bx_,by_]:=
((x1-x2)*(ay-y2)-(y1-y2)*(ax-x2))*((x1-x2)*(by-y2)-(y1-y2)*(bx-x2))≥0;

lineintersect[ax1_,ay1_,ax2_,ay2_,bx1_,by1_,bx2_,by2_]:=!samesideofline[ax1,ay1,ax2,ay2,bx1,by1,bx2,by2]&&!samesideofline[bx1,by1,bx2,by2,ax1,ay1,ax2,ay2];

InFile=Import[filebase<>infilename];
NumRecs=Dimensions[InFile][[1]]

OutFile=Table[0,{i,1,bins},{j,1,bins}];

Do[
{
CMLS=InFile[[i,3]];
IoS=InFile[[i,4]];

CMLE=InFile[[i,8]];
IoE=InFile[[i,9]];

If[CMLE<CMLS, CMLE=CMLE+360];
If[IoE<IoS, IoE=IoE+360];

Do[
{
Do[
{
If[lineintersect[CMLS,IoS,CMLE,IoE,(c-1)*binwidth,(p-1)*binwidth,c*binwidth,(p-1)*binwidth]||
lineintersect[CMLS,IoS,CMLE,IoE,c*binwidth,(p-1)*binwidth,c*binwidth,p*binwidth]||
lineintersect[CMLS,IoS,CMLE,IoE,c*binwidth,p*binwidth,(c-1)*binwidth,p*binwidth]||
lineintersect[CMLS,IoS,CMLE,IoE,(c-1)*binwidth,p*binwidth,(c-1)*binwidth,(p-1)*binwidth],
OutFile[[c,p]]++
];
},
{c,IntegerPart[CMLS/binwidth],IntegerPart[CMLE/binwidth]+1}
];
},
{p,IntegerPart[IoS/binwidth],IntegerPart[IoE/binwidth]+1}
];
If[Mod[i,10]==0,Print[i]];
},
{i,1,NumRecs}
];



OutFileCollapsed=OutFile[[1;;binh,1;;binh]]+OutFile[[binh+1;;bins,1;;binh]]+OutFile[[1;;binh,binh+1;;bins]]+OutFile[[binh+1;;bins,binh+1;;bins]];

Export[OutFileName,OutFileCollapsed]

Occurrence Probability Matrix Maker - Makes a CML-Io matrix of Jovian DAM Occurrence Probabilities

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilenameS="Processed Storm CML-Io Phase Plane Matrix.csv";
infilenameW="Processed Watch CML-Io Phase Plane Matrix.csv";

OutFileName=filebase<>"Occurrence Probability CML-Io Phase Plane Matrix.csv";

SetAttributes[numFormat,Listable];
numFormat[y_]:=ToString@NumberForm[N[y],{5,4},ExponentFunction->(If[-10<#<10,Null,#]&)]

InFileS=Import[filebase<>infilenameS];
InFileW=Import[filebase<>infilenameW];
bins=Dimensions[InFileS][[1]]
binwidth = IntegerPart[360/bins]

OutFile=Table[0,{i,1,bins},{j,1,bins}];

Do[
{
Do[
{
If[InFileW[[c,p]]==0,OutFile[[c,p]]=0,OutFile[[c,p]]=InFileS[[c,p]]/InFileW[[c,p]]];
},
{c,1,bins}
];
},
{p,1,bins}
];

OutFile=numFormat[OutFile];

Export[OutFileName,OutFile]

CML-Io Phase Plane Plotter - Watch Tracks ONLY - Makes CML-Io phase plane plots of Jupiter watch tracks

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Watch CML-Io Phase Plane Matrix.csv";


infile=Import[filebase<>infilename];
bins=Dimensions[infile][[1]]
binwidth = IntegerPart[360/bins]

outname=filebase<>"Phase Plane 2D WATCHES ONLY "<>ToString[binwidth]<>"deg Bins - UFRO 18T 1995-2007.png";
outname3d=filebase<>"Phase Plane 3D WATCHES ONLY "<>ToString[binwidth]<>"deg Bins - UFRO 18T 1995-2007.png";

tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style["Watches Only",Bold,FontSize->20,FontFamily->Verdana],,
Style["UFRO 18T 1995-2007, "<>ToString[binwidth]<>"° Bins, WATCHES ONLY",Bold,FontSize->16,FontFamily->Verdana]
},Center
];

infile=Transpose[infile];

(*
Do[
infile[[i]]=RotateLeft[infile[[i]],0],
{i,1,bins}
];
*)

(*1 dB scale w/ heavy lines every 3 dB*)
contourcount=15;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*10^-(contourcount/10-i/10)
}
,{i,contourcount,1,-1}];
(*
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin}
};
*)
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin}
};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red,Magenta},#]&);
(* for B&W plots, use: *)
(* White,White,White,White,White,White,White *)
(*tname=Style["Io-CML Phase Plane, 1 dB Probability Colors & 3 dB Probability Contours",Bold,FontSize->14,FontFamily->Helvetica];*)


(*
(* Linear scale *)
contourcount=400;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*i/contourcount
}
,{i,contourcount,1,-1}];
cstyle={{Opacity[0.0],Thin}};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red},#]&);
tname=Style["Io-CML Phase Plane, "<>ToString[contourcount]<>" Linearly Spaced Contours",Bold,FontSize->14,FontFamily->Helvetica];
outname="F:\\Io-CML plot\\Io-CML_Phase_Plane_"<>ToString[contourcount]<>"_Linearly_Spaced_Contours.png"
*)

AppendTo[$Path,filebase];
Get["CustomTicks`"];

charttitle=tname;
(*charttitle=Column[{
Style[" ",Plain,FontSize->12,FontFamily->Verdana],
tname,
Style["using data from",Plain,FontSize->12,FontFamily->Verdana],
Style[filepath,Plain,FontSize->12,FontFamily->Verdana],
Style[" ",Plain,FontSize->8,FontFamily->Verdana]
},Center];*)
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListContourPlot[infile,
(*Method->"RungeKutta",*)
DataRange->{{0.,360.},{0.,360.}},
PlotRange->All,
PlotRangePadding->5,
Contours->contours,
ContourStyle->cstyle,
InterpolationOrder->1,
ColorFunction->contourcf,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
];

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

p3v=ListPlot3D[infile,
PlotRange->All,
InterpolationOrder->1
];
p3p=Rasterize[p3v,ImageSize->900,ImageResolution->300];
Export[outname3d,p3p]

CML-Io Phase Plane Plotter - Storm Tracks ONLY - Makes CML-Io phase plane plots of Jupiter storm tracks

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Processed Storm CML-Io Phase Plane Matrix.csv";


infile=Import[filebase<>infilename];
bins=Dimensions[infile][[1]]
binwidth = IntegerPart[360/bins]

outname=filebase<>"Phase Plane 2D STORMS ONLY "<>ToString[binwidth]<>"deg Bins - UFRO 18T 1995-2007.png";
outname3d=filebase<>"Phase Plane 3D STORMS ONLY "<>ToString[binwidth]<>"deg Bins - UFRO 18T 1995-2007.png";

tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style["Storms Only",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007, "<>ToString[binwidth]<>"° Bins",Bold,FontSize->16,FontFamily->Verdana]
},Center
];

infile=Transpose[infile];

(*
Do[
infile[[i]]=RotateLeft[infile[[i]],0],
{i,1,bins}
];
*)

(*1 dB scale w/ heavy lines every 3 dB*)
contourcount=15;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*10^-(contourcount/10-i/10)
}
,{i,contourcount,1,-1}];
(*
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin}
};
*)
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin}
};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red,Magenta},#]&);
(* for B&W plots, use: *)
(* White,White,White,White,White,White,White *)
(*tname=Style["Io-CML Phase Plane, 1 dB Probability Colors & 3 dB Probability Contours",Bold,FontSize->14,FontFamily->Helvetica];*)


(*
(* Linear scale *)
contourcount=400;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*i/contourcount
}
,{i,contourcount,1,-1}];
cstyle={{Opacity[0.0],Thin}};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red},#]&);
tname=Style["Io-CML Phase Plane, "<>ToString[contourcount]<>" Linearly Spaced Contours",Bold,FontSize->14,FontFamily->Helvetica];
outname="F:\\Io-CML plot\\Io-CML_Phase_Plane_"<>ToString[contourcount]<>"_Linearly_Spaced_Contours.png"
*)

AppendTo[$Path,filebase];
Get["CustomTicks`"];

charttitle=tname;
(*charttitle=Column[{
Style[" ",Plain,FontSize->12,FontFamily->Verdana],
tname,
Style["using data from",Plain,FontSize->12,FontFamily->Verdana],
Style[filepath,Plain,FontSize->12,FontFamily->Verdana],
Style[" ",Plain,FontSize->8,FontFamily->Verdana]
},Center];*)
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListContourPlot[infile,
(*Method->"RungeKutta",*)
DataRange->{{0.,360.},{0.,360.}},
PlotRange->All,
PlotRangePadding->5,
Contours->contours,
ContourStyle->cstyle,
InterpolationOrder->1,
ColorFunction->contourcf,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
];

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

p3v=ListPlot3D[infile,
PlotRange->All,
InterpolationOrder->1
];
p3p=Rasterize[p3v,ImageSize->900,ImageResolution->300];
Export[outname3d,p3p]

CML-Io Phase Plane Plotter - Occurrence Probabilities - Makes CML-Io phase plane plots of Jovian DAM Occurrence Probabilities

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Occurrence Probability CML-Io Phase Plane Matrix.csv";


infile=Import[filebase<>infilename];
bins=Dimensions[infile][[1]]
binwidth = IntegerPart[360/bins]

outname=filebase<>"Phase Plane 2D Occurrence Probabilities "<>ToString[binwidth]<>"deg Bins - UFRO 18T 1995-2007.png";
outname3d=filebase<>"Phase Plane 3D Occurrence Probabilities "<>ToString[binwidth]<>"deg Bins - UFRO 18T 1995-2007.png";

tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style["Occurrence Probabilities",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007, "<>ToString[binwidth]<>"° Bins",Bold,FontSize->16,FontFamily->Verdana]
},Center
];

infile=Transpose[infile];

(*
Do[
infile[[i]]=RotateLeft[infile[[i]],0],
{i,1,bins}
];
*)

(*1 dB scale w/ heavy lines every 3 dB*)
contourcount=15;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*10^-(contourcount/10-i/10)
}
,{i,contourcount,1,-1}];
(*
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin}
};
*)
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin}
};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red,Magenta},#]&);
(* for B&W plots, use: *)
(* White,White,White,White,White,White,White *)
(*tname=Style["Io-CML Phase Plane, 1 dB Probability Colors & 3 dB Probability Contours",Bold,FontSize->14,FontFamily->Helvetica];*)


(*
(* Linear scale *)
contourcount=400;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*i/contourcount
}
,{i,contourcount,1,-1}];
cstyle={{Opacity[0.0],Thin}};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red},#]&);
tname=Style["Io-CML Phase Plane, "<>ToString[contourcount]<>" Linearly Spaced Contours",Bold,FontSize->14,FontFamily->Helvetica];
outname="F:\\Io-CML plot\\Io-CML_Phase_Plane_"<>ToString[contourcount]<>"_Linearly_Spaced_Contours.png"
*)

AppendTo[$Path,filebase];
Get["CustomTicks`"];

charttitle=tname;
(*charttitle=Column[{
Style[" ",Plain,FontSize->12,FontFamily->Verdana],
tname,
Style["using data from",Plain,FontSize->12,FontFamily->Verdana],
Style[filepath,Plain,FontSize->12,FontFamily->Verdana],
Style[" ",Plain,FontSize->8,FontFamily->Verdana]
},Center];*)
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListContourPlot[infile,
(*Method->"RungeKutta",*)
DataRange->{{0.,360.},{0.,360.}},
PlotRange->All,
PlotRangePadding->5,
Contours->contours,
ContourStyle->cstyle,
InterpolationOrder->3,
ColorFunction->contourcf,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
];

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

p3v=ListPlot3D[infile,
PlotRange->All,
InterpolationOrder->1
];
p3p=Rasterize[p3v,ImageSize->900,ImageResolution->300];
Export[outname3d,p3p]

CML-Io Phase Plane Plotter - Occurrence Probabilities - 45 deg offset - Makes CML-Io phase plane plots of Jovian DAM Occurrence Probabilities

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="Occurrence Probability CML-Io Phase Plane Matrix.csv";


infile=Import[filebase<>infilename];
bins=Dimensions[infile][[1]]
binwidth = IntegerPart[360/bins]

outname=filebase<>"Phase Plane 2D Occurrence Probabilities "<>ToString[binwidth]<>" deg Bins 45 deg offset - UFRO 18T 1995-2007.png";
outname3d=filebase<>"Phase Plane 3D Occurrence Probabilities "<>ToString[binwidth]<>" deg Bins 45 deg offset - UFRO 18T 1995-2007.png";

tname=Column[{Style["CML-Io Phase Plane",Bold,FontSize->20,FontFamily->Verdana],Style["Occurrence Probabilities",Bold,FontSize->20,FontFamily->Verdana],
Style["UFRO 18T 1995-2007, "<>ToString[binwidth]<>"° Bins",Bold,FontSize->16,FontFamily->Verdana]
},Center
];

infile=RotateLeft[infile,IntegerPart[45/binwidth]];
infile=Transpose[infile];

(*
Do[
infile[[i]]=RotateLeft[infile[[i]],0],
{i,1,bins}
];
*)

(*1 dB scale w/ heavy lines every 3 dB*)
contourcount=15;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*10^-(contourcount/10-i/10)
}
,{i,contourcount,1,-1}];
(*
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{Opacity[1.0],Thin}
};
*)
cstyle={
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[0.8],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin},
{Opacity[0.3],Thin},{Opacity[0.3],Thin},{White,Opacity[1],Thin}
};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red,Magenta},#]&);
(* for B&W plots, use: *)
(* White,White,White,White,White,White,White *)
(*tname=Style["Io-CML Phase Plane, 1 dB Probability Colors & 3 dB Probability Contours",Bold,FontSize->14,FontFamily->Helvetica];*)


(*
(* Linear scale *)
contourcount=400;
contourmax=Max[infile]
contourmin=Min[infile]
contours=Table[0,{i,1,contourcount}];
Do[{
contours[[i]]=contourmax*i/contourcount
}
,{i,contourcount,1,-1}];
cstyle={{Opacity[0.0],Thin}};
contourcf=(Blend[{Black,Blue,Green,Yellow, Orange,Red},#]&);
tname=Style["Io-CML Phase Plane, "<>ToString[contourcount]<>" Linearly Spaced Contours",Bold,FontSize->14,FontFamily->Helvetica];
outname="F:\\Io-CML plot\\Io-CML_Phase_Plane_"<>ToString[contourcount]<>"_Linearly_Spaced_Contours.png"
*)

AppendTo[$Path,filebase];
Get["CustomTicks`"];

charttitle=tname;
(*charttitle=Column[{
Style[" ",Plain,FontSize->12,FontFamily->Verdana],
tname,
Style["using data from",Plain,FontSize->12,FontFamily->Verdana],
Style[filepath,Plain,FontSize->12,FontFamily->Verdana],
Style[" ",Plain,FontSize->8,FontFamily->Verdana]
},Center];*)
xlabel=Column[{
Style["CML-III(2010) (degrees)",FontSize->16,FontFamily->Verdana],
Style[" ",FontSize->8,FontFamily->Verdana]
},Center];
ylabel=Column[{
Style[" ",FontSize->8,FontFamily->Verdana],
Style["Io Phase (degrees)",FontSize->16,FontFamily->Verdana]
},Center];
pv=ListContourPlot[infile,
(*Method->"RungeKutta",*)
DataRange->{{0.,360.},{0.,360.}},
PlotRange->All,
PlotRangePadding->5,
Contours->contours,
ContourStyle->cstyle,
InterpolationOrder->3,
ColorFunction->contourcf,
FrameTicks->{{LinTicks[0,360,30,6],
LinTicks[0,360,30,6,ShowTickLabels->False]},
{{{0.," 45",{0.01,0},{}},{5.,"",{0.005,0},{}},{10.,"",{0.005,0},{}},{15.," 60",{0.01,0},{}},{20.,"",{0.005,0},{}},{25.,"",{0.005,0},{}},{30.,"",{0.005,0},{}},{35.,"",{0.005,0},{}},{40.,"",{0.005,0},{}},{45.," 90",{0.01,0},{}},{50.,"",{0.005,0},{}},{55.,"",{0.005,0},{}},{60.,"",{0.005,0},{}},{65.,"",{0.005,0},{}},{70.,"",{0.005,0},{}},{75.,"120",{0.01,0},{}},{80.,"",{0.005,0},{}},{85.,"",{0.005,0},{}},{90.,"",{0.005,0},{}},{95.,"",{0.005,0},{}},{100.,"",{0.005,0},{}},{105.,"150",{0.01,0},{}},{110.,"",{0.005,0},{}},{115.,"",{0.005,0},{}},{120.,"",{0.005,0},{}},{125.,"",{0.005,0},{}},{130.,"",{0.005,0},{}},{135.,"180",{0.01,0},{}},{140.,"",{0.005,0},{}},{145.,"",{0.005,0},{}},{150.,"",{0.005,0},{}},{155.,"",{0.005,0},{}},{160.,"",{0.005,0},{}},{165.,"210",{0.01,0},{}},{170.,"",{0.005,0},{}},{175.,"",{0.005,0},{}},{180.,"",{0.005,0},{}},{185.,"",{0.005,0},{}},{190.,"",{0.005,0},{}},{195.,"240",{0.01,0},{}},{200.,"",{0.005,0},{}},{205.,"",{0.005,0},{}},{210.,"",{0.005,0},{}},{215.,"",{0.005,0},{}},{220.,"",{0.005,0},{}},{225.,"270",{0.01,0},{}},{230.,"",{0.005,0},{}},{235.,"",{0.005,0},{}},{240.,"",{0.005,0},{}},{245.,"",{0.005,0},{}},{250.,"",{0.005,0},{}},{255.,"300",{0.01,0},{}},{260.,"",{0.005,0},{}},{265.,"",{0.005,0},{}},{270.,"",{0.005,0},{}},{275.,"",{0.005,0},{}},{280.,"",{0.005,0},{}},{285.,"330",{0.01,0},{}},{290.,"",{0.005,0},{}},{295.,"",{0.005,0},{}},{300.,"",{0.005,0},{}},{305.,"",{0.005,0},{}},{310.,"",{0.005,0},{}},{315.,"  0",{0.01,0},{}},{320.,"",{0.005,0},{}},{325.,"",{0.005,0},{}},{330.,"",{0.005,0},{}},{335.,"",{0.005,0},{}},{340.,"",{0.005,0},{}},{345.," 30",{0.01,0},{}},{350.,"",{0.005,0},{}},{355.,"",{0.005,0},{}},{360.," 45",{0.01,0},{}}},
{{0.,"",{0.01,0},{}},{5.,"",{0.005,0},{}},{10.,"",{0.005,0},{}},{15.,"",{0.01,0},{}},{20.,"",{0.005,0},{}},{25.,"",{0.005,0},{}},{30.,"",{0.005,0},{}},{35.,"",{0.005,0},{}},{40.,"",{0.005,0},{}},{45.,"",{0.01,0},{}},{50.,"",{0.005,0},{}},{55.,"",{0.005,0},{}},{60.,"",{0.005,0},{}},{65.,"",{0.005,0},{}},{70.,"",{0.005,0},{}},{75.,"",{0.01,0},{}},{80.,"",{0.005,0},{}},{85.,"",{0.005,0},{}},{90.,"",{0.005,0},{}},{95.,"",{0.005,0},{}},{100.,"",{0.005,0},{}},{105.,"",{0.01,0},{}},{110.,"",{0.005,0},{}},{115.,"",{0.005,0},{}},{120.,"",{0.005,0},{}},{125.,"",{0.005,0},{}},{130.,"",{0.005,0},{}},{135.,"",{0.01,0},{}},{140.,"",{0.005,0},{}},{145.,"",{0.005,0},{}},{150.,"",{0.005,0},{}},{155.,"",{0.005,0},{}},{160.,"",{0.005,0},{}},{165.,"",{0.01,0},{}},{170.,"",{0.005,0},{}},{175.,"",{0.005,0},{}},{180.,"",{0.005,0},{}},{185.,"",{0.005,0},{}},{190.,"",{0.005,0},{}},{195.,"",{0.01,0},{}},{200.,"",{0.005,0},{}},{205.,"",{0.005,0},{}},{210.,"",{0.005,0},{}},{215.,"",{0.005,0},{}},{220.,"",{0.005,0},{}},{225.,"",{0.01,0},{}},{230.,"",{0.005,0},{}},{235.,"",{0.005,0},{}},{240.,"",{0.005,0},{}},{245.,"",{0.005,0},{}},{250.,"",{0.005,0},{}},{255.,"",{0.01,0},{}},{260.,"",{0.005,0},{}},{265.,"",{0.005,0},{}},{270.,"",{0.005,0},{}},{275.,"",{0.005,0},{}},{280.,"",{0.005,0},{}},{285.,"",{0.01,0},{}},{290.,"",{0.005,0},{}},{295.,"",{0.005,0},{}},{300.,"",{0.005,0},{}},{305.,"",{0.005,0},{}},{310.,"",{0.005,0},{}},{315.,"",{0.01,0},{}},{320.,"",{0.005,0},{}},{325.,"",{0.005,0},{}},{330.,"",{0.005,0},{}},{335.,"",{0.005,0},{}},{340.,"",{0.005,0},{}},{345.,"",{0.01,0},{}},{350.,"",{0.005,0},{}},{355.,"",{0.005,0},{}},{360.,"",{0.01,0},{}}}}},
FrameLabel->{xlabel,ylabel,charttitle,""},
FrameStyle->{{Directive[Black,Bold,FontFamily->Verdana,16],Directive[Black,Thin]},{Directive[Black,Bold,Thin,FontFamily->Verdana,16],Directive[Black,Thin]}}
];

pp=Rasterize[pv,ImageSize->900,ImageResolution->300];
Export[outname,pp]

p3v=ListPlot3D[infile,
PlotRange->All,
InterpolationOrder->1
];
p3p=Rasterize[p3v,ImageSize->900,ImageResolution->300];
Export[outname3d,p3p]

JPL 2-Line to 1-Line Converter ALTERNATE - Converts Ephemerides from JPL from 2-line format to 1-line format

filebase="N:\\Documents\\0 RA\\Jupiter Emission Log\\UFRO Data\\";

infilename="test.txt";

InFile=ReadList[filebase<>infilename,String,RecordSeparators->{"\n"}];

InFile

Dimensions[InFile]

InFile[[1]]

a=InFile[[1]]<>","<>InFile[[2]]

Export[filebase<>"testout.csv",a,"Text"]