diff --git a/nebulosa-astap/src/main/kotlin/nebulosa/astap/plate/solving/AstapPlateSolver.kt b/nebulosa-astap/src/main/kotlin/nebulosa/astap/plate/solving/AstapPlateSolver.kt index ff2218a9f..ccf844f73 100644 --- a/nebulosa-astap/src/main/kotlin/nebulosa/astap/plate/solving/AstapPlateSolver.kt +++ b/nebulosa-astap/src/main/kotlin/nebulosa/astap/plate/solving/AstapPlateSolver.kt @@ -1,6 +1,7 @@ package nebulosa.astap.plate.solving import nebulosa.common.process.ProcessExecutor +import nebulosa.fits.Header import nebulosa.fits.NOAOExt import nebulosa.fits.Standard import nebulosa.imaging.Image @@ -87,22 +88,23 @@ class AstapPlateSolver(path: Path) : PlateSolver { val width = cdelt1 * dimensions[0].trim().toDouble() val height = cdelt2 * dimensions[1].trim().toDouble() - val solution = PlateSolution(true, crota2.deg, cdelt2.deg, crval1.deg, crval2.deg, width.deg, height.deg) - - solution.add(Standard.CTYPE1, ctype1) - solution.add(Standard.CTYPE2, ctype2) - solution.add(Standard.CRPIX1, crpix1) - solution.add(Standard.CRPIX2, crpix2) - solution.add(Standard.CRVAL1, crval1) - solution.add(Standard.CRVAL2, crval2) - solution.add(Standard.CDELT1, cdelt1) - solution.add(Standard.CDELT2, cdelt2) - solution.add(Standard.CROTA1, crota1) - solution.add(Standard.CROTA2, crota2) - solution.add(NOAOExt.CD1_1, cd11) - solution.add(NOAOExt.CD1_2, cd12) - solution.add(NOAOExt.CD2_1, cd21) - solution.add(NOAOExt.CD2_2, cd22) + val header = Header() + header.add(Standard.CTYPE1, ctype1) + header.add(Standard.CTYPE2, ctype2) + header.add(Standard.CRPIX1, crpix1) + header.add(Standard.CRPIX2, crpix2) + header.add(Standard.CRVAL1, crval1) + header.add(Standard.CRVAL2, crval2) + header.add(Standard.CDELT1, cdelt1) + header.add(Standard.CDELT2, cdelt2) + header.add(Standard.CROTA1, crota1) + header.add(Standard.CROTA2, crota2) + header.add(NOAOExt.CD1_1, cd11) + header.add(NOAOExt.CD1_2, cd12) + header.add(NOAOExt.CD2_1, cd21) + header.add(NOAOExt.CD2_2, cd22) + + val solution = PlateSolution(true, crota2.deg, cdelt2.deg, crval1.deg, crval2.deg, width.deg, height.deg, header = header) LOG.info("astap solved. calibration={}", solution)