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

Coding of floating values in MIDAS BDF files in VAX/VMS and AXP/VMS



Hello. 

One user of MIDAS at our institution has the following problems.
Many years ago (1992), she saved tenths of MIDAS BDF image files using
BACKUP from a VAX/VMS machine. 
  Now she needs to reuse these images and she downloaded them from tape,
but on an AXP/VMS machine (the VAX/VMS  machine is no longer available
so we cannot write them to FITS files on VAX).

  So when she tries to access her BDF files from within MIDAS (96NOV on
AXP/VMS), for example with command READ/DESC, she gets the following
error message :

Warning: data is VAX Float instead of Gfloat...
frame: WD_MRK691_1_202  (data = R4)
NAXIS:                    1
NPIX:                   571
START:               0.26897961173593E+32
STEP:                 2048.0000000000
IDENT:           WD_MRK691_1_202
CUNIT:           none given
LHCUTS:            -7.046526       162.8535      -7.046526     162.8535

so the values in START and STEP are totally meaningless.

  Some people explained me that this could be due to the difference of
formats of floating values between VAX machines and other architectures
; I fould also a note about that in the MIDAS documentation 
(http://www.eso.org/projects/esomidas/doc/user/98NOV/vola/node209.html).

  But there are two strange points :
1) the data of the image are also real numbers and they are not affected
(when one assigns likely values to descriptors START and STEP, the
correct spectrum is displayed), and so look the LHCUTS ;

2) the message is "VAX Float instead of Gfloat" ;  now, I have looked
inside the MIDAS code where such messages are issued and in routine
MID_ACCFRM in MIDFCT.C, one can see that this message is normally
displayed for single precision floating numbers (R*4) whereas there is a
dedicated mesage for double precision floating numbers (R*8). Now, the
START and STEP descriptors are double precision numbers, not single.

I have tried to build a program inside MIDAS which reads the image and
writes it back again to disk after a correction applied to the START and
STEP values using a routine converting VAX float to IEEE float found on
the INFO-VAX Discussion List (<INFO-VAX@LISTSERV.UGA.EDU>), but that did
not give back likely values (known from log book in this case, but these
are not known for all the BDF images).

 I have also tried to find the binary values of the descriptor directly
from a dump of the BDF file but did not manage to get anything out of
it.
 I have seen in the MIDAS code, that the values of the double precision
descriptors are read and written using a heap of routines which
transform the value of the numbers. 

  So my questions are : 
- does there exist a program somewhere which can convert a BDF image
file from VAX format to AXP (IEEE) format ?
- how are the values of the START and STEP descriptors written into BDF
files ?
- which are the low-level routines which allow to read and write these
values to and from the BDF file ? (This would allow to apply the
conversion routine above to the binary value read) 

Thanks in advance for any help. Best regards,
                            Bernard Debray
                            Observatoire de Besancon
                            debray@obs-besancon.fr