Skip to content

Commit

Permalink
[api]: Fix Astap plate solver error
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagohm committed Feb 1, 2024
1 parent fad12d9 commit c22fb35
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c22fb35

Please sign in to comment.