Resolved Planewave Autofocus Script stops Autosave sequence after successful focusing

Discussion in 'Scripting and Programming' started by Chris_HD, May 1, 2019.

  1. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi MaximDL team,

    I have started to use a script for the first time. I‘m not experienced with scripting at all, even I have some programming knowledge which is many years old.
    I‘m using the Planewave Autofocus script that is provided with the latest PWI 3.40 software.
    In MaximDL‘s Autosave dialog I have setup an L R G B Ha as usual. In every slot I added the pw_autofocus.js script. In the PWI software I set the timer to 1 hour.
    Everything works fine, after every image the script starts and checks if the timer has run through and thereafter the next image is taken. After 1 hour Autofocus starts and works fine. The PWI log file reports success. During Autofocus the camera control dialog shows „waiting“. When the Autofocus sequence has finished the camera control dialog shows something like „slewing“ for a very short moment - sorry that my observation is not optimal I‘m not 100% sure about this. I assume this comes from the dithering via mount I have setup in the autosave dialog.
    Then the autosave sequence stops. The start button in the camera control dialog becomes active and the stop button is grayed out.
    Some more info: in the autosave dialog I have a 1 second wait at the first and after all following images.
    I don‘t group the individual slots, I run repeatedly a R G B L Ha loop.

    What makes the autosave sequence stop? The PWI log looks ok, autosave did not fail.
    Is my setup wrong?
    Any ideas?

    Best regards
    Christof
     
  2. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    Hi Christof,

    Please review this explanation from another thread. You may be experiencing a similar issue. I do not know how pw_autofocus.js works, so the details may be slightly different even if the end result is the same.

    - Owen -
     
  3. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi Owen,

    thank you for your reply.
    I knew about the thread you mentioned however my autosave sequence returns “success“ in the output of the script as well as in the log file. The autosave sequence however stops every time. Would any log file, settings files or the script be of help for you to look into this?

    I contacted Planewave via their forum in parallel waiting for their reply at this moment.

    Best regards
    Christof
     
  4. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    Returning "success" is an example of what I meant by the details being slightly different. Does your script monitor the "AutofocusStatus" property? To look into further it I'd need everything you mentioned, though I'm not sure when I'd be able to get to it.

    The crux of the matter is that the original implementation of AutoSave never took inline scripting into account, at least for anything reflexive that calls back into MaxIm DL. I'm pretty sure it was intended for simpler things like renaming and moving files around; naturally our users quickly realized that they wanted autofocus to happen. I don't blame you for trying, but doing anything at all complicated in an AutoSave script is a poor fit for the architecture we have now.

    That's not to say there is no simple fix in this case, but I do want to temper your expectations.

    - Owen -
     
  5. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi Owen,

    here comes the script a PWI Log file and a MaximDL Log file.
    Any help would be appreciated. At my location I need to refocus during a typical full night automated imaging session.
    So far I was not able to get this running.

    Thanks & Best regards
    Christof
     

    Attached Files:

  6. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    Hi Christof,

    I'll need your Documents\MaxIm DL 6\Settings, too.

    Thanks.

    - Owen -
     
  7. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    I see the following in some of the Planewave documentation:

    3.3.0 Beta 1
    - Added a "Scheduler" option to the Focus tab, which can be used in conjunction
    with the script found under Documents\PlaneWave Instruments\PWI3\Scripts\pw_autofocus.js
    to schedule AutoFocus runs from other programs. For example, this script can be called after
    every image in Maxim DL's "Autosave" sequence mode. Periodic focus runs will be scheduled
    according to the settings in the Scheduler window.​

    I couldn't find any more info about a "Scheduler" option. You might want to contact them for help. It's possible that there's a specific startup routine you must follow, or a particular configuration you need in order for this to work. (Is there a Config file you can send me?) The PlaneWave.PWI3 object is a black box to me, yet it's the thing that's talking back to MaxIm DL. There might be an undesired shutdown occurring when it goes out of scope. I'm happy to work directly with them if we need to do something extra to make this work.

    If you haven't already done so, please right-click in View | Log Window and select "Log Debug Messages". Sometimes there will be additional clues explaining undesired behaviour. The only suggestion I can give without digging further is that you make sure you start MaxIm DL and connect to the camera and observatory hardware manually before launching an AutoSave containing this script.

    - Owen -
     
  8. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi Owen,

    thanks for the quick reply.
    I‘m away from my PC at the moment so I can’t provide you with more log or config files at the moment but here is some info:

    I always connect the scope, camera and focuser manually at the beginning of an imaging session in MaximDL. I never let any external software startup MaximDL.

    In fact I tried using the scheduler. I tried a test setup with a 60s image acquisition in a singe autosave slot with a few seconds delay between each image. In the PWI software I set the scheduler to 60s so that after every image of the autosave sequence a autofocus run started. This test setup worked well every time I stared it but after the focus run which obviously worked - the focus position was determined and set correct which I can see from images taken afterwards - the autosave sequence stopped every time.

    I will try to log more info for you and send it as soon as I have it.
    I will also contact the Planewave team again, they haben‘t replied yet. Thanks for your offer to work with them.

    Thank you very much
    Best regards
    Christof
     
  9. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    After your description my guess (still just a guess--need to set up tests to be sure) is that it's not PlaneWave's fault in any way, rather, our autofocus routine issues a global sort of "End" command when it's done, that that command leaks into the AutoSave machinery instead of stopping at the lower level camera control. I wasn't able to find where that happens on quick inspection, but the other thread I linked you to does exactly that on error.

    That said, it wouldn't hurt to mention it to the folks at PlaneWave, because if they wrote release notes about it perhaps they had it working at some point.

    - Owen -
     
  10. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi Owen,

    I'm finally back with access to my PC. You asked for the Documents\MaxIm DL 6\Settings Files.
    You need all the files and sub-folders in this directory or only some specific files?
    There are about 11 MB in this folder.

    Best
    Christof
     
  11. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    Hi Christof,

    I don't need all of the log files, just the recent ones containing the sessions that failed, but other than that I need everything. Just make a zip of the entire thing. It should compress very well.

    - Owen -
     
  12. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi Owen,

    I compressed the settings folder. Please find the zip file attached.

    Thanks & Best regards
    Christof
     

    Attached Files:

  13. Owen Lawrence

    Owen Lawrence Retired Staff

    Joined:
    Oct 1, 2014
    Messages:
    1,397
    Thanks. It's the MaxIm DL manual that's making it so big.

    - Owen -
     
  14. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,248
    We already have a copy. :)
     
  15. Chris_HD

    Chris_HD Cyanogen Customer

    Joined:
    Mar 19, 2017
    Messages:
    17
    Hi Owen & Doug,

    Kevin from Planewave fixed the issue in the newest 3.4.3 release of their software. Just to let you know, now autofocus with the Planewave script works perfect.

    Best
    Christof
     

Share This Page