Skip to content

Commit

Permalink
feat: add parseSIPTerm utility in wcs module in @observerly/astrometry
Browse files Browse the repository at this point in the history
feat: add parseSIPTerm utility in wcs module in @observerly/astrometry
  • Loading branch information
michealroberts committed Nov 12, 2024
1 parent 10c91f1 commit d505cee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/wcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@ export type SIP2DParameters = {
BPower: { [key: string]: number }
}

/*****************************************************************************************************************/

// Helper function to parse SIP terms like "A_0_1" and extract i, j values
const parseSIPTerm = (term: string, prefix: 'A' | 'B'): [number, number] | null => {

Check failure on line 27 in src/wcs.ts

View workflow job for this annotation

GitHub Actions / publish (ubuntu-latest, 18)

'parseSIPTerm' is declared but its value is never read.

Check failure on line 27 in src/wcs.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 18)

'parseSIPTerm' is declared but its value is never read.

Check failure on line 27 in src/wcs.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 20)

'parseSIPTerm' is declared but its value is never read.
const match = term.match(new RegExp(`^${prefix}_(\\d+)_(\\d+)$`))
return match ? [Number.parseInt(match[1], 10), Number.parseInt(match[2], 10)] : null
}


/*****************************************************************************************************************/

0 comments on commit d505cee

Please sign in to comment.