############################################################################### # This isisminer CONFIG file computes stereo pairs for all MDIS images. # The complete set of MESSENGER MDIS image data is contained in two # separate databases. This set of Strategies reads from two different # databases created from footprintinit/caminfo data and determines the stereo # compliments for every image in the defined Region. Region definitions # should be used to restrict the range of images using database # CenterLatitude/CenterLongitude and the corners of the Region definition in # the GLOBALS file parameter. # # @author 2015-06-05 Kris Becker # ############################################################################### Object = IsisMiner # This config is designed to work with overlap files generated using the # GisOverlap strategy that creates a file of all overlapping images. This # will compute stereo sets from that list. NOTE: Wipes the incoming Resource # list so should use a Sidebar strategy with a SavePoint. Name = MdisGlobalStereo RequiredParameters = ( "Region", "OutputDir" ) Object = ResourceManager Name = ClearResources Type = ResourceManager Description = "Clear the complete list of Resources since we are reading in a completely new set of Resources" Operations = "ResetDiscard, ToggleDiscard, DeleteDiscard" EndObject Object = Strategy # Read image overlap CSV file intp empty Resource list for stereo processing Name = ReadImageOverlaps Type = CsvReader Description = "Read regional overlap image set" CsvFile = "%1/Overlaps/%2/%3_overlaps.csv" CsvFileArgs = ( "OutputDir", "Region", "SourceProductId" ) #Ignore the first several lines including the header. HasHeader = True Identity = "%1" IdentityArgs = "SourceProductId" # Can specify a GIS keyword that will be converted on input GisGeometryRef = GisFootprint GisType = WKB RemoveGisKeywordAfterImport = True EndObject Object = Strategy # Find the source image Name = FindImageMatches Type = IsNumeric Description = "Identify all valid images" Keyword = OverlapRatioSource EndObject Object = Strategy Name = FindSourceImage Type = ResourceManager Description = "Choose all resources to determine stereo" Operations = ToggleDiscard EndObject Object = Strategy # Determine stereo pairs of each selected image in the region Name = RegionStereoPairs Type = StereoPair Description = "Find all stereo pairs in specfied region" #ShowProgress = True #Debug = true PixelPrecisionMatch = 0.2 Asset = StereoPairs OverlapMerge = "Intersection" GisMethod = Direct ` # Now specify how the stereo quality is determined. Based upon # ImageStrength and StereoStrength, the maximum (best) rank is 8.0. Equation = "ImageStrengthRank * 1.0 + StereoStrengthRank * 1.0" Result = StereoPairRank # First level contraints/strenghts. Best strength (ImageStrengthRank) is # 3.0. (We won't restrict resolution at this point on individual images.) # Relaxed the incidence angles to get high/low indicence angls at the poles # (KJB 2015-06-07) Group = ImageStrength # Use these parameters for data between 65N and 65S Incidence = ( 30.0, 70.0, 50.0 ) # Use these values for polar regions above 65N/S center latitude # Incidence = ( 10.0, 79.0, 50.0 ) Emission = ( 0.0, 55.0, 15.0 ) Phase = ( 5.0, 120.0, 30.0 ) # Resolution = ( 25.0, 5000.0, 200.0 ) EndGroup # Second level constraints/strengths. Best strength (StereoStrengthRank) # is 5.0. Group = StereoStrength ResolutionRatio = ( 1.0, 2.5, 1.0 ) ParallaxHeightRatio = ( 0.1, 1.0, 0.4 ) ShadowTipDistance = ( 0.0, 2.58, 0.0 ) OverlapRatio = ( 0.05, 1.0, 0.5 ) StereoAngle = ( 10.0, 65.0, 25.0 ) EndGroup # This shows the keyword mappings to values required for stereo # matching and constraint values. Values on left side of keyword is # the actual keyword used. Values on the right are the actual keywords # whose values are substituted and used instead. Group = KeywordMap Resolution = PixelResolution Emission = EmissionAngle Incidence = IncidenceAngle Phase = PhaseAngle # These values are computed because OverlapMerge = "Intersection". This # provides the centroid lat/lon of the common area of image overlap which # is more accurate than the image center lat/lon values used by default. CenterLongitude = GisOverlapCentroidX CenterLatitude = GisOverlapCentroidY EndGroup # Select candidates from input list. Matches over itself. This one set # is used for all images that satisfy the regional limits. It can be # dangerous to try to limit the candidates, however, using all images will # make it slower since there are likely many more images to search # through. Object = CandidateMiner Object = Strategy Name = PairCandidates Type = ResourceManager Description = "Choose all resources to determine stereo" Operations = ResetDiscard EndObject EndObject EndObject # Write the stereo pairs to a CSV file. The files will be put in a directory # of the form "OutputDir/Region/SourceProductId_stereopairs.csv" where # OutputDir is provided in the program PARAMETERS as the full base path to # the directory to write the files, and Region comes from the contents of # the GLOBALS file. # # This shows the use of the AssetSidebar strategy. Note the "Asset" keyword # is the same as the one specifed in StereoPair strategy above. All the # Strategy Objects listed in the IsisMiner object (a whole other CONFIG file), # will execute on any Resource that contains at least one stereo image pair. # # There is an Asset called StereoPairs, also a list of Resources, that just # happens to work perfectly for all the following Strategies. Remember # all Resource keywords containing the Asset are available in the global # parameter list and can be referenced as any keyword. # # These stratagies sort the stereo pairs by StereoStrengthRank and write to a # CSV file. Object = Strategy Name = WriteStereoFiles Type = AssetSidebar Description = "Process all stereo pair assets" Asset = StereoPairs # This is a whole new set of processing strategies on the Resource Assets. # In this case, all Resources that contain a stereo pair asset in named # StereoPairs, created in StereoPairs. Object = IsisMiner Object = Strategy # Sort the StereoPairs by rank Name = SortStereoPairs Type = NumericalSort Description = "Sort stereo pairs by StereoPairRank" SortKey = StereoPairRank Order = Descending EndObject Object = Strategy # Ensure the output directory exists for the CSV files Name = MakeOutputDirectory Type = RunCommand Description = "Ensure output directory exists" CommandArgs = ( "OutputDir", "Region" ) Group = PreCommands Mkdir = "mkdir -p %1/Stereo/%2" EndGroup EndObject Object = Strategy # Write result of StereoPair strategy for each Resource that has a # StereoPairs asset. Name = WritePairs Type = CsvWriter Description = "Write individual files with stereo pair data" SkipEmptyLists = True CsvFile = "%1/Stereo/%2/%3_stereopairs.csv" CsvFileArgs = ( "OutputDir", "Region", "Identity" ) Keywords = ("SourceProductIdA", "SourceProductIdB", "Region", "StereoPairRank", "ImageStrengthRank", "StereoStrengthRank", "ParallaxHeightRatio", "ShadowTipDistance", "ResolutionRatio", "DeltaSolarAzimuth", "DeltaSpacecraftAzimuth", "VerticalPrecision", "StereoAngle", "ImageStrengthRankA", "ImageStrengthRankB", "NumberA", "NumberB","ObservationTypeA", "ObservationTypeB", "IncidenceRankA", "IncidenceRankB", "EmissionRankA", "EmissionRankB", "PhaseRankA", "PhaseRankB", "OverlapRatioA", "OverlapRatioB", "YearDoyA", "YearDoyB", "CenterLongitudeA", "CenterLatitudeA", "CenterLongitudeB", "CenterLatitudeB", "CenterRadiusA", "CenterRadiusB", "SlantDistanceA", "SlantDistanceB", "SubSpacecraftLongitudeA", "SubSpacecraftLatitudeA", "TargetCenterDistanceA", "SubSpacecraftLongitudeB", "SubSpacecraftLatitudeB", "TargetCenterDistanceB", "GisOverlapCentroidX", "GisOverlapCentroidY", "PixelResolutionA", "PixelResolutionB", "EmissionAngleA", "EmissionAngleB", "IncidenceAngleA", "IncidenceAngleB", "PhaseAngleA", "PhaseAngleB", "FocalPlaneTemperatureA", "FocalPlaneTemperatureB", "TempDependentFocalLengthA", "TempDependentFocalLengthB", "GisFootprint") GisGeometryKey = GisFootprint GisType = WKB EndObject EndObject EndObject EndObject End