@observerly/astrometry
Version:
observerly's lightweight, zero-dependency, type safe astrometry library written in Typescript for calculating the position of celestial objects in the sky.
3 lines (2 loc) • 685 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=(e,d)=>{const t=e.match(`^${d}_(\\d+)_(\\d+)$`);return t?[Number.parseInt(t[1],10),Number.parseInt(t[2],10)]:null},s=(e,d)=>{let t=d.x-e.crpix.x,o=d.y-e.crpix.y,m=0,S=0;if(e.SIP){for(const n in e.SIP.APower){const l=e.SIP.APower[n],i=f(n,"A");if(i){const[P,a]=i;m+=l*t**P*o**a}}for(const n in e.SIP.BPower){const l=e.SIP.BPower[n],i=f(n,"B");if(i){const[P,a]=i;S+=l*t**P*o**a}}}t+=m,o+=S;let r=e.cd11*t+e.cd12*o+e.E;r=r%360,r<0&&(r+=360);let c=e.cd21*t+e.cd22*o+e.F;return c=c%90,{ra:r,dec:c}};exports.convertPixelToWorldCoordinateSystem=s;exports.parseSIPTerm=f;
//# sourceMappingURL=wcs.cjs.map