[APBeta] Global observations script
Christopher Todd
christopher.todd at gmail.com
Wed Mar 25 20:48:34 PDT 2009
Jeff,
I discovered that my primary problem was that I must have screwed something
up when I ran the V1 to V2 converter, because my telescope resources did not
match up correctly to what was in the Observations database (I think I
manually re-created my telescope, Site, and eyepiece resources in V2). So
when your script started querying for the properties of the scope and ep
objects in GetMagnification, it choked.
The other thing I discovered is that for binocular observations (at least in
*my* observations database, YMMV), the ep field is not "None", but rather
it's empty/Nil, so when you query for the EyepieceResource.Get(epName), it
throws an Exception. So I moved the lines
ep = EyepieceResource.Get(epName)
aid = VisualAidResource.Get(aidName)
Inside of the else block, like so:
if scope.IsBinocular then
mag = scope.Magnification
else
ep = EyepieceResource.Get(epName)
aid = VisualAidResource.Get(aidName)
mag = APResource.Magnification(scope, ep, aid)
end if
Then it worked just fine. Cool script! Thanks for writing it.
Chris
On 3/25/09 6:47 AM, "Jeff Young" <jey at adobe.com> wrote:
> Chris --
>
> I did find one bug in the script -- if you have any observations with no
> telescope listed (for instance, a naked-eye observation of a comet), then it
> will throw an exception.
>
> The offending lines are in GetMagnification() where it checks
> scope.IsBinocular and scope.IsTelescope without first checking if scope <>
> nil.
>
> But I've also attached a new copy of the script which fixes the bug, and
> implements some more sophisticated page-breaking rules:
> * it attempts to place user images on the same page with their observations
> * it includes "continued" headers when breaks occur within the observations
> for a single target
> * it removes the RA/Dec coordinates from moving targets (such as planets
> and comets)
>
> Cheers,
> -- Jeff.
More information about the APBeta
mailing list