<<jleGroup`
Unprotect[ContextToFileName];
ContextToFileName[context_?specialCharacterStringQ] := Module[
	{string1, string2},
	
	string1 = StringReplace[context,
		{"-"->"DASH", "."->"DOT", "_"->"UNDERSCORE"}];
	string2 = ContextToFileName[string1];
	StringReplace[string2,
		{"DASH"->"-", "DOT"->".", "UNDERSCORE"->"_"}]
  ]
(* SET UP CONTEXTS WITH CURRENT VERSION NUMBERS OF THE FILES *)

Print["Context                           File Name","\n",
"-----------------------------------------------------------","\n",
"asbGroup`stripPipeline`          ",
	ContextToFileName["asbGroup`stripPipeline`"] =
	ContextToFileName["asbGroup`stripPipeline_2.4.1`"], "\n",

"asbGroup`ringKinematics`         ",
	ContextToFileName["asbGroup`ringKinematics`"] =
	ContextToFileName["asbGroup`ringKinematics_15.1`"], "\n",
	
"asbGroup`occultationAnalysis`    ",
	ContextToFileName["asbGroup`occultationAnalysis`"] =
	ContextToFileName["asbGroup`occultationAnalysis_0.5.3`"], "\n",
	
"asbGroup`occultationGeometry`    ",
	ContextToFileName["asbGroup`occultationGeometry`"] =
	ContextToFileName["asbGroup`occultationGeometry_15.1.1`"], "\n",
	
"asbGroup`proposalTools`         *",
	ContextToFileName["asbGroup`proposalTools`"] =
	ContextToFileName["asbGroup`proposalTools_2.0`"], "\n",
	
"asbGroup`ringConstants`          ",
	ContextToFileName["asbGroup`ringConstants`"] =
	ContextToFileName["asbGroup`ringConstants_5.0.2`"], "\n",
	
"asbGroup`occultationSetup`       ",
	ContextToFileName["asbGroup`occultationSetup`"] =
	ContextToFileName["asbGroup`occultationSetup_4.0.2`"], "\n",
	
"asbGroup`fosCalib`              *",
	ContextToFileName["asbGroup`fosCalib`"] =
	ContextToFileName["asbGroup`fosCalib_1.1`"], "\n",
	
"Packages marked with a * are not yet fully 3.0/4.0 compliant due to long
disuse prior to the conversion.  Significant work would be needed on
these packages before they could be used."];
	
Protect[ ContextToFileName ];

(* GET FULL PATH NAMES TO CURRENT VERSIONS OF MATHLINK FILES *)
(* Procedure now "hard wired" for astron and hubble *)

If[$MachineType === "DEC",

prefix = Select[$Path, StringMatchQ[#,
 "*ExtraPackages"]&][[1]]<>$PathnameSeparator<>
  "jleGroup"<>$PathnameSeparator<>"LINK"<>$PathnameSeparator;

Print[""];
Print["Prefix for MathLink files is:","\n",prefix];

Print["jleGroupFitsManagerMathLINK file is ",
  file = "fitsManagerMathLINK3.0"];
	jleGroupFitsManagerMathLINK = prefix<>file;
 
Print["jleGroupImageModelsLINK1 file is ",
  file = "cubicInterpolationLINK1.3"];
	jleGroupImageModelsLINK1 = prefix<>file;

Remove[prefix, file];
] (* end of the If statement *)


If[$MachineType === "Macintosh",
prefix = $MachineName<>":Remote Files:From yoda.lowell.edu:pscf:asb-grp:software:lib:math4_packages:LINK:";

Print["Prefix for MathLink files is:","\n",prefix];
(*Print["jleGroupFitsManagerMathLINK file is ",
	file = "fitsmanagerMathLINK4.0"];
jleGroupFitsManagerMathLINK = prefix<>file;
Print["WARNING: Mathlink NOT loaded."];*)
(*Leave that there until fmm is working again.*)

(*Print["jleGroupFastBinaryFilesLINK file is ",
    file="binary1.0.2"];
jleGroupFastBinaryFilesLINK = prefix<>file;*)

(*The following is for Mike's fmm testing.*)
If[$machineName === "aquarius.mit.edu",
	prefix = "AQUARIUS:Testing:";
	Print["AQUARIUS OVERRIDE: jleGroupFitsManagerMathLINK file is ",
	file = "fitsmanagerMathLINK4.0test"];
	jleGroupFitsManagerMathLINK = prefix<>file;
	];
Remove[prefix, file];
] (* end of the If statement *)


(* DECLARE THE FUNCTIONS IN THE PACKAGES *)

DeclarePackage[ "asbGroup`stripPipeline`",
{"spMakeMeanRow", "spExtractStar", "spCentroid", "spFlatten",
"spAnalyzeStrip"}
];

DeclarePackage[ "asbGroup`occultationGeometry`",
{"ogEarthPositions", "ogObserverPositions", "ogOccultationGeometry13", "return",
 "ogPlanetPositions", "ogSatellitePositions", "ogLoadData", "ogCrossEntry",
 "ogColumnPosition", "ogGetList","ogSemimajorAxisLookup", "ogFreeRegressionRate1", "ogROGRbending", "ogCreateSymbols", "ogRemoveZeroWeightData", "ogMappingFunction", "ogSelectCoordinatesAndData","ogEventsAndStationsFromCoordinates","ogFeaturesFromCoordinates","ogSortNumericalStrings","ogRemoveSurroundingSpaces","ogAdditionalKeylinesParameter","ogDataInformation","ogParameterInformation","ogAdditionalKeylinesData","ogCorrelationMatrixInformation"}
 ];

DeclarePackage[ "asbGroup`occultationAnalysis`",
{"oaStarPathPlot", "oaStarPathList", "oaPredictPlot"}
 ];

DeclarePackage[ "asbGroup`ringKinematics`",
{"rkRingOrbit14", "rkFreePrecessionRate", "rkFreeRegressionRate",
 "rkMeanMotion"}
 ];

DeclarePackage[ "asbGroup`ringConstants`",
{"gravitationalConstant", "speedOfLight", "astronomicalUnit",
 "j2", "j4", "j6", "rEq", "mass", "massFactor",
 "jupiterPoleJ2000", "jupiterPoleB1950",
 "saturnPoleJ2000", "saturnPoleB1950", "poleReferenceEpoch",
 "uranusPoleJ2000", "uranusPoleB1950",
 "neptunePoleJ2000", "neptunePoleB1950"}
 ];

DeclarePackage[ "asbGroup`occultationSetup`",
{"osOccultationSetup", "osGeometricPlanetPositions", 
 "osAstrometricPlanetPositions", "osObserverPositions",
 "osEarthPositions", "osPlanetBarycenterOffset",
 "osPlanetPositionsAtPlanetPlane", "osGeometricStarPositions",
 "osStarPositions", "osBackdate"}
 ];

DeclarePackage[ "asbGroup`fosCalib`",
{"fcCalibration","fcPixelWavelength", "fcWavelengthParameters",
 "fcGetHeaderInfo"}];


(*Still to do:  Put ro on ringOrbit functions.  Upgrade ringConstants 
package. Fix options in occultationGeometry.  Fix pixel function in
fosCalib.*)

Protect[ContextToFileName];
