Skip to content

Commit

Permalink
ECSE-1412 replacing single letter variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
eereiter committed Oct 19, 2023
1 parent 7b11f32 commit 854611e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,18 @@
"Returns UMM-C spatial map from DIF 10 XML document."
[doc]
(let [[spatial] (select doc "/DIF/Spatial_Coverage")
[o] (select spatial "Orbit_Parameters")]
[orbit-parameters] (select spatial "Orbit_Parameters")]
{:SpatialCoverageType (dif10-spatial-type->umm-spatial-type (value-of spatial "Spatial_Coverage_Type"))
:GranuleSpatialRepresentation (value-of spatial "Granule_Spatial_Representation")
:HorizontalSpatialDomain (parse-horizontal-spatial-domains doc)
:VerticalSpatialDomains (spatial-conversion/convert-vertical-spatial-domains-from-xml
(select spatial "Vertical_Spatial_Info"))
:OrbitParameters (when o
(as->{:SwathWidth (util/safe-read-string (value-of o "Swath_Width"))
:OrbitPeriod (util/safe-read-string (value-of o "Period"))
:InclinationAngle (util/safe-read-string (value-of o "Inclination_Angle"))
:NumberOfOrbits (util/safe-read-string (value-of o "Number_Of_Orbits"))
:StartCircularLatitude (util/safe-read-string (value-of o "Start_Circular_Latitude"))} op
:OrbitParameters (when orbit-parameters
(as->{:SwathWidth (util/safe-read-string (value-of orbit-parameters "Swath_Width"))
:OrbitPeriod (util/safe-read-string (value-of orbit-parameters "Period"))
:InclinationAngle (util/safe-read-string (value-of orbit-parameters "Inclination_Angle"))
:NumberOfOrbits (util/safe-read-string (value-of orbit-parameters "Number_Of_Orbits"))
:StartCircularLatitude (util/safe-read-string (value-of orbit-parameters "Start_Circular_Latitude"))} op
;; Add assumed units for the corresponding fields.
(if (:SwathWidth op)
(assoc op :SwathWidthUnit "Kilometer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@
:HorizontalSpatialDomain (parse-horizontal-spatial-domain doc)
:VerticalSpatialDomains (spatial-conversion/convert-vertical-spatial-domains-from-xml
(select spatial "VerticalSpatialDomain"))
:OrbitParameters (when-let [[o] (select spatial "OrbitParameters")]
(as-> {:SwathWidth (util/safe-read-string (value-of o "SwathWidth"))
:OrbitPeriod (util/safe-read-string (value-of o "Period"))
:InclinationAngle (util/safe-read-string (value-of o "InclinationAngle"))
:NumberOfOrbits (util/safe-read-string (value-of o "NumberOfOrbits"))
:StartCircularLatitude (util/safe-read-string (value-of o "StartCircularLatitude"))} op
:OrbitParameters (when-let [[orbit-parameters] (select spatial "OrbitParameters")]
(as-> {:SwathWidth (util/safe-read-string (value-of orbit-parameters "SwathWidth"))
:OrbitPeriod (util/safe-read-string (value-of orbit-parameters "Period"))
:InclinationAngle (util/safe-read-string (value-of orbit-parameters "InclinationAngle"))
:NumberOfOrbits (util/safe-read-string (value-of orbit-parameters "NumberOfOrbits"))
:StartCircularLatitude (util/safe-read-string (value-of orbit-parameters "StartCircularLatitude"))} op
;; Add assumed units for the corresponding fields.
;; Replace :Period with :OrbitPeriod.
(if (:SwathWidth op)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@
resolution (when (or description geodetic-model local-coord-sys hor-res)
{:ResolutionAndCoordinateSystem (umm-c/map->ResolutionAndCoordinateSystemType
(merge {} description geodetic-model local-coord-sys hor-res))})
geometry (when-let [g (parse-geometry doc extent-info sanitize?)]
{:Geometry g})
zone (when-let [z (value-of doc zone-identifier-xpath)]
{:ZoneIdentifier z})]
geometry (when-let [geom (parse-geometry doc extent-info sanitize?)]
{:Geometry geom})
zone (when-let [zne (value-of doc zone-identifier-xpath)]
{:ZoneIdentifier zne})]
(when (or geometry zone resolution)
(merge {} geometry zone resolution))))

Expand Down

0 comments on commit 854611e

Please sign in to comment.