comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: hor2eq mystery - disagreeing output from same input?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: hor2eq mystery - disagreeing output from same input? [message #66924] Wed, 17 June 2009 12:15
MichaelT is currently offline  MichaelT
Messages: 52
Registered: May 2006
Member
Thanks for the very quick fix, Wayne! I just downloaded and tested it
with the expected result.

> It assumed that the Julian date would be
> supplied as a vector with a separate date for each position.    (So it
> would loop over the number of Julian dates.)      But you are giving a
> scalar Julian date with vector positions, so all positions except the
> first are not being precessed.    I have now updated hor2eq.pro to
> recognize your case (http://idlastro.gsfc.nasa.gov/ftp/pro/astro/hor2eq.pro)

OK, I indeed overlooked to provide the julian date as a vector as
well.
I had already noticed that the alt/az grid that I had generated was
somehow shifted with respect of the single values that I found were
correct. So the missing precession nicely explains this observation.

Thanks again!
Re: hor2eq mystery - disagreeing output from same input? [message #66932 is a reply to message #66924] Wed, 17 June 2009 08:17 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Jun 17, 9:45 am, MichaelT <michael.theus...@googlemail.com> wrote:
> I have run into a problem using the hor2eq. It output different
> results when using single values from an array as input (correct
> output) compared to using the same array as a whole (wrong output).

First, for non-astronomers, hor2eq.pro is a program in the IDL
astronomy library (http://idlastro.gsfc.nasa.gov). The
vectorization was done incorrectly (not by me), or at least it didn't
anticipate all usages. It assumed that the Julian date would be
supplied as a vector with a separate date for each position. (So it
would loop over the number of Julian dates.) But you are giving a
scalar Julian date with vector positions, so all positions except the
first are not being precessed. I have now updated hor2eq.pro to
recognize your case (
http://idlastro.gsfc.nasa.gov/ftp/pro/astro/hor2eq.pro )

--Wayne
Re: hor2eq mystery - disagreeing output from same input? [message #66934 is a reply to message #66932] Wed, 17 June 2009 07:10 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
Hi,

just a though...

what do you get if you declare a0 and d0 as double before calling
hor2eq? ... in he first case, you are using a float, while in the second
one, you are using a double (a and d)

Jean

MichaelT wrote:
> I have run into a problem using the hor2eq. It output different
> results when using single values from an array as input (correct
> output) compared to using the same array as a whole (wrong output).
> The example below shows what I mean:
>
> alt = [0, 5, 10, 15]
> az = Replicate(295, 4)
> a = DblArr(4)
> d = DblArr(4)
>
> lat = 52.5
> lon = 10.0
>
> jd = 2454999.38928241d
>
> Print, alt, az
>
> For i = 0, N_Elements(alt) - 1 Do Begin
> hor2eq, alt[i], az[i], jd, a0, d0, LAT= lat, LON=lon
> a[i] = a0
> d[i] = d0
> EndFor
> Print, a, d
>
> hor2eq, alt, az, jd, a, d, LAT= lat, LON=lon
> Print, a, d
> end
>
> OutPut:
>
> 124.64645 127.89450 131.10259 134.47664
> 14.470190 18.890924 22.987733 26.978259
>
> 124.64645 128.02987 131.24057 134.61690
> 14.470190 18.858534 22.953070 26.941322
>
> Clearly, the ra and dec values are *not* the same, except for the
> first value. The loop result is listed first and is correct. The other
> is not.
>
> The same applies to using eq2hor.
>
> FYI: And I have just downloaded the current versions of both programs.
>
> How can this be? Anybody run into this problem before? Am I doing
> something wrong?
>
> Michael
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Trial version of Slither, the IDL to Python bridge, available
Next Topic: Problems with tying ROI's to image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:42:54 PDT 2025

Total time taken to generate the page: 0.00400 seconds