Joachim replied to the topic 'FITS Keywords' in the forum. 4 years ago

Hi.

I was wondering about the focus position in the header as well. The modifications n the indiccd source files listed below (output from diff) appear to make it work for the CCD simulator. To my understanding this should be propagated to any CCD driver. I haven't done any further testing though, so I cannot tell whether this true and whether the mod could mess up other things.... but it at least suggests to me that it should be possible quite easily?

Cheers,

Joachim



indiccd.h:

505a506
> long FocusPos;
545c546
< IText ActiveDeviceT[4] {};
---
> IText ActiveDeviceT[5] {};
549a551
> SNOOP_FOCUSER,



indiccd.cpp:

118a119
> FocusPos = std::numeric_limits<long>::quiet_NaN();
411,414c412,416
< IUFillText(&ActiveDeviceT[1], "ACTIVE_FOCUSER", "Focuser", "Focuser Simulator");
< IUFillText(&ActiveDeviceT[2], "ACTIVE_FILTER", "Filter", "CCD Simulator");
< IUFillText(&ActiveDeviceT[3], "ACTIVE_SKYQUALITY", "Sky Quality", "SQM");
< IUFillTextVector(&ActiveDeviceTP, ActiveDeviceT, 4, getDeviceName(), "ACTIVE_DEVICES", "Snoop devices", OPTIONS_TAB,
---
> IUFillText(&ActiveDeviceT[1], "ACTIVE_ROTATOR", "Rotator", "Rotator Simulator");
> IUFillText(&ActiveDeviceT[2], "ACTIVE_FOCUSER", "Focuser", "Focuser Simulator");
> IUFillText(&ActiveDeviceT[3], "ACTIVE_FILTER", "Filter", "CCD Simulator");
> IUFillText(&ActiveDeviceT[4], "ACTIVE_SKYQUALITY", "Sky Quality", "SQM");
> IUFillTextVector(&ActiveDeviceTP, ActiveDeviceT, 5, getDeviceName(), "ACTIVE_DEVICES", "Snoop devices", OPTIONS_TAB,
431a434
> IDSnoopDevice(ActiveDeviceT[SNOOP_FOCUSER].text, "ABS_FOCUS_POSITION");
727a731,743
> else if (!strcmp(propName, "ABS_FOCUS_POSITION"))
> {
> for (ep = nextXMLEle(root, 1); ep != nullptr; ep = nextXMLEle(root, 0))
> {
> const char * name = findXMLAttValu(ep, "name");
>
> if (!strcmp(name, "FOCUS_ABSOLUTE_POSITION"))
> {
> FocusPos = atol(pcdataXMLEle(ep));
> break;
> }
> }
> }
786a803,807
> if (strlen(ActiveDeviceT[SNOOP_FOCUSER].text) > 0)
> IDSnoopDevice(ActiveDeviceT[SNOOP_FOCUSER].text, "FOCUS_ABSOLUTE_POSITION");
> else
> MPSAS = std::numeric_limits<double>::quiet_NaN();
>
---
> fits_update_key_dbl(fptr, "FOCUSPOS", FocusPos, 3, "Focus Position in steps", &status);
1722c1732,1734
<
---

Read More...