Nikon DSLR Plugin

Main forum about Astroart
Post Reply
Forum_2015
Posts: 358
Joined: 07 Dec 2018, 15:04

Nikon DSLR Plugin

Post by Forum_2015 »

Hi All,

Just by way of introduction I'm a complete newbie I have just started with astrophotography (2 months) and purchased AA a week ago. I'm having a great time learning the ropes!

I have an old Nikon DSLR camera lying around that I wanted to use and noticed on the forum that there is no nikon plugin for AA. So, as I'm not new to programming, I've written a simple nikon plugin for my old D90 based on the demo CCD_Driver.

It is all working nicely, AA connects to the camera. Exposure times are set using the AA ccd control panel, and exposures are triggering as normal from the start button. Raw NEF images are downloaded in memory and loaded directly into AA as 16bit colour (3 channel) images. Sequences and subframes are all working as expected.

So far so good

Now I have two questions.

Firstly, it was not clear to me how to "cancel" an AA image acquisition in the event of some failure. Let's say for example that AA is calling d_ReadImage for the second time (i.e. green channel) and for some reason something goes wrong on my side - is there a way to cancel the image acquisition at that point? i.e. how do I stop AA from continuing to try to finishing reading the image?

The reason I bring this up is that currently if I run a script to capture multiple images and don't add an additional pause after the Camera.wait, AA starts asking for additional d_ReadImages (i.e. more than 3 colour channels with no d_StartExposure calls in between). This only occurs when scripting. And only if I do NOT include an additional pause(3) after my Camera.Wait.

As mentioned it works fine with the additional pause but I'm just wondering what I might be doing wrong to need the additional pause?

Second question relates to the possibility of adding a general purpose SetParam/GetParam pair for the purposes of custom camera scripting - I'm thinking in particular of ISO, but it would be great for many other things also.

I'm thinking of something like:

int d_GetParam(int param_id)
void d_SetParam(int param_id, int param_val)

which would have scriptable corollaries something like:

ISOID = 1
isoval = Camera.GetParam(ISOID)
Camera.SetParam(ISOID,400)
newisoval = Camera.GetParam(ISOID)

Is there anyway for me to do this currently?

Cheers,
Andrew.

Forum_2015
Posts: 358
Joined: 07 Dec 2018, 15:04

Re: Nikon DSLR Plugin

Post by Forum_2015 »

Hi,
1) on color downloads, the functions d_StartDownload and d_ReadImage called on the two extra channels should not control anything in the camera: the driver should simply return the data which was acquired yet with the first channel. So there is no reason to interrupt, the data is available yet.
2) It could be added easily to the next CCD Interface 5.43, please write me by email to receive it.
Thanks,
Fabio.

Forum_2015
Posts: 358
Joined: 07 Dec 2018, 15:04

Re: Nikon DSLR Plugin

Post by Forum_2015 »

1) Yes, this is what I'm currently doing, downloading/parsing/extracting nef only on chan 1, then just reading extracted data on chan 2 and 3. I guess my green example was not the best - let's change green to red . What if I have a fail loading up the image on the first channel - what behaviour does AA expect to see - the spec says that startdownload and readimage always return true. At the moment in the case of failure with nef extraction on channel 1 I just return true immediately, and also return true immediately for subsequent channels, and AA renders a "blank" image?

2) Excellent that would be wonderful.

Any idea about why I might need the additional Pause() (in addition to CameraWait) in my script? I imagine it's something that I'm doing wrong in my plugin but not sure what?

Cheers,
Andrew

Forum_2015
Posts: 358
Joined: 07 Dec 2018, 15:04

Re: Nikon DSLR Plugin

Post by Forum_2015 »

1) A CCD camera may fail to start an exposure, but a failure during download is extremely rare. However this is not true for DSLR, for example if the user set the camera to download images on the SD card only. In this case the Astroart Canon plugin downloads a blank image with a big X in the middle.

2) Maybe your driver uses some Windows messaging / queueing? Do you get the problem also with true RAW download (grayscale with bayer pattern)?

Forum_2015
Posts: 358
Joined: 07 Dec 2018, 15:04

Re: Nikon DSLR Plugin

Post by Forum_2015 »

Thanks Fabio, the plugin is now working nicely, with scriptable ISO changes

I've moved all of my logic "up", so now I make sure that I have an image downloaded and parsed before I return from d_StartExposure. This seems to fix all of my problems (more than 3 colour requests from AA - and additional pause time in scripts). I lose the nice exposure progress graphic but I gain error reporting and stability so I'll stick with this approach.

Cheers,
Andrew.

Post Reply