4
$\begingroup$

http://exoplanets.eu/ displays R.A. on screen in hh:mm:ss format but when you export the table, it gives the R.A. as a decimal. Likewise for Declination.

How can I turn for example 24.35417 (WASP-18) into 01:37:25.0 ? And likewise for Declination -45.67778 to -45:40:40? I'm looking for a method, not a website that will do it for me.

Either a way to convert between formats or how do I export in non-decimal format?

Thanks

$\endgroup$
1

1 Answer 1

4
$\begingroup$

DecRA is the decimal right ascension RAh, RAm, RAs are the hms form


$${\rm DecRA} = {\rm RAh}\times 15.0 + {\rm RAm}/4.0 + {\rm RAs}/240.0$$

$$ {\rm RAh} = {\rm INT}({\rm DecRA}/15.0) $$

$${\rm RAm} = {\rm INT}(({\rm DecRA}-{\rm RAh}\times 15.0)\times 4.0)$$

$${\rm RAs} = ({\rm DecRA}-{\rm Rah}\times 15.0 - {\rm RAm}/4.0)\times 240.0$$

where INT is the operation that truncates to an integer


e.g. DecRA=24.35417

$${\rm RAh} = {\rm INT}(24.35417/15.0) = 1$$

$${\rm RAm} = {\rm INT}((24.35417 - 1\times 15.0)\times 4.0) = 37$$

$${\rm RAs} = (24.35417-1\times 15.0 - 37/4.0)\times 240.0 = 25.00$$

DecDE is the decimal declination

DEd, DEm, DEs are the dms form

posneg is -1.0 for a position below the celestial equator (negative declination) and +1.0 for above the equator


$${\rm DecDE} = {\rm DEd} + {\rm posneg}\times {\rm DEm}/60.0 + {\rm posneg}\times {\rm DEs}/3600.0$$

$${\rm DEd} = {\rm INT}({\rm DecDE})$$

$${\rm DEm} = {\rm INT}(({\rm DecDE} - {\rm DEd})\times 60.0\times {\rm posneg})$$

$${\rm DEs} = ({\rm DecDE} - {\rm DEd} - {\rm posneg}\times {\rm DEm}/60.0)\times 3600.0\times {\rm posneg}$$


e.g. DecDE = -45.67778 posneg=-1.0

$${\rm DEd} = {\rm INT}(-45.67778) = -45$$

$${\rm DEm} = {\rm INT}((-45.67778 - (-45))\times 60.0\times (-1.0)) = 40$$

$${\rm DEs} = (-45.67778 - (-45) - (-1.0)\times 40/60.0)\times 3600\times (-1.0) = 40.0$$

$\endgroup$
5
  • 1
    $\begingroup$ Just to clarify does PosNeg relate to the Observer, so as we're in the UK, that'll be 1.0 and if in Australia, -1? or does PosNeg mean if the Dec is a positive number then 1.0 otherwise -1? $\endgroup$ Jan 13, 2018 at 19:00
  • 1
    $\begingroup$ @MiscellaneousUser It applies to the source position. $\endgroup$
    – ProfRob
    Jan 14, 2018 at 0:51
  • $\begingroup$ if your dec degrees are never negative try : (DEd + DEm/60.0 + DEs/3600.0)*posneg $\endgroup$
    – tomc
    Aug 7, 2021 at 22:41
  • $\begingroup$ In the line DEm, should DEd be the absolute of DEd ? Therefore the formula would be DEm = INT((-45.67778-(-1.0)*abs(DEd)x60x(-1)? I can't see how you get x 40 otherwise. $\endgroup$ Feb 21, 2022 at 20:09
  • $\begingroup$ @MiscellaneousUser I think I've got it. A spurious posneg. $\endgroup$
    – ProfRob
    Feb 21, 2022 at 20:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .