[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Author Index][Subject Index]

Re: RA--TAN --> pixel number?



Hello,

Try the attached midas .prg file.

Regards,
Otmar Stahl



---------------------------------Cut
here------------------------------------

!       world2pixel             Thomas Szeifert         1998-12-05
!
!       patch problems with world coordinates in spectroscopic mode
!       if the frame is in world coordinates we set the START and STEP
!       values to 1.,1.
!       for frames with pixel coordinates we set REFPIX(1) to 1033
!       or 1020 in full frame read out and window read out mode
respectively


DEFI/PARA P1 ? ? "frame specification"


DEFI/LOCA I/I/1/1 0
DEFI/LOCA inframe/c/1/40 " " ALL
DEFINE/LOCAL IN_A/C/1/19 " " all

DEFINE/LOCAL CATAL/I/1/1 0

CREA/ICAT middummc.cat {P1}

CAT_LOOP:
STORE/FRAME inframe middummc.cat 1 END

  IF "{{inframe},CUNIT(17:18)}" .EQ. "RA" THEN
    IF {{inframe},NPIX(1)} .EQ. 2048 THEN

      WRITE/DESC {inframe} START/D/1/2 14.,1.
      WRITE/DESC {inframe} STEP/D/1/2 1.,1.

      WRITE/DESC {inframe} CUNIT/C/1/48 " " ALL

    ELSE IF {{inframe},NPIX(1)} .EQ. 2080 THEN

      WRITE/DESC {inframe} START/D/1/2 1.,1.
      WRITE/DESC {inframe} STEP/D/1/2 1.,1.

      WRITE/DESC {inframe} CUNIT/C/1/48 " " ALL

    ELSE

        WRITE/OUT "ERROR: world2pixel doesn't like world coordinates in
window read out mode"
        WRITE/OUT "       quick look for frame {P1} is not supprted"

        RETURN

    ENDIF
  ELSE
    IF {{inframe},NPIX(1)} .EQ. 2048 THEN
      {inframe},REFPIX(1) = 1033
    ELSE
      {inframe},REFPIX(1) = 1033
    ENDIF
  ENDIF


GOTO CAT_LOOP
END: