C+ C NAME: C iHOSInfo C PURPOSE: C Get info about content of Helios file C CATEGORY: C I/O C CALLING SEQUENCE: function iHOSInfo(iOpen,cFile,iRecl,iSc,iYr,TMin,TMax,iD,Lst) C INPUTS: C iOpen integer passed to bOpenFile C cFile character*(*) file name C OUTPUTS: C iHOSInfo C integer # records; if iR=0 there was an open error or the file was empty C iRecl integer record length (4-byte longwords) C iSc integer spacecraft ID (1=Helios A, 2=Helios B) C iYr integer year C TMin real start time (Doy) C TMax real end time (Doy) C iD integer describes the file content by setting/clearing bits C according to the definitions in include file hos_e9.h C Bits set/cleared are: C HOS__P_*: set if photometer present C HOS__C_*: set if color present C HOS__F_*: set if filter present C HOS__AA or HOS__BB: identified spacecraft (based on 1st record) C HOS__NONORM: set if file unnormalized (based on 1st record) C HOS__OS_*: identifies architecture where file was written C Lst(3,11) file contents; C integer 3 = 1+1+1 = colors U,B,V C 11 = 5+5+1 = (5 filters for phot 1) + C (5 filters for phot 2) + C (photometer 3) C INCLUDE: include 'filparts.h' include 'openfile.h' include 'hos_e9.h' include 'dirspec.h' C CALLS: C bOpenFile, iHOSRead, HOSOrbID, Say, ArrI4Zero, iArrI4Total, iFreeLun, itrim, cInt2Str C RESTRICTIONS: C > iSc,iYr,Lst(1,12) are based on the first record of the file C MODIFICATION HISTORY: C JUN-1993, Paul Hick (UCSD) C- parameter (nP= 3) parameter (nF=11) integer iOpen character cFile*(*) integer iRecl integer iSc integer iYr real TMin real TMax integer iD integer Lst(nP,nF) real L real Z(32) integer P integer C integer F character cStr*24 character cUBV(3) /'U','B','V'/ character cInt2Str*14 character cSay*8 /'iHOSInfo'/ logical bOpenFile kCn(I) = Lst(I,1)+Lst(I,2)+Lst(I,3)+Lst(I,4)+Lst(I,5)+Lst(I,6)+Lst(I,7)+Lst(I,8)+Lst(I,9)+Lst(I,10)+Lst(I,11) iHOSInfo = 0 iD = HOS__NULL ! Read 1st record, try to determine architecture !------- ! The iHOSRead call sets architecture, spacecraft and no-normalization bits in iD if (bOpenFile(ior(OPN__HOS+OPN__READONLY,iOpen),iU,cFile,iRecl) .and. & iHOSRead(iD,iU,iRecl,1,T,P,C,F,R,L,32,Z) .eq. 0) then L = mod(L+180.,360.) call HOSOrbID(T,R,L,iSc,iYr,dRMin) if ( (iSc .eq. 1 .and. iand(iD,HOS__AA) .eq. 0) .and. & (iSc .eq. 2 .and. iand(iD,HOS__BB) .eq. 0) ) call Say(cSay,'E','S/C','problem identifying spacecraft') call ArrI4Zero(nP*nF,Lst) TMin = T TMax = T iDD = iD+HOS__PCF_ALL ! Select all data do while (iHOSRead(iDD,iU,iRecl,iHOSInfo,T,P,C,F,R,L,32,Z) .eq. 0) if (P .eq. 3) F = 1 F = 5*(P-1)+F if (1 .le. F .and. F .le. 11 .and. 1 .le. C .and. C .le. 3) then Lst(C,F) = Lst(C,F)+1 else call Say(cSay,'W','Bad','record ignored: '//cInt2Str(iHOSInfo)) end if TMin = min(TMin,T) TMax = max(TMax,T) end do cStr = ' NORMALIZED' if (iand(iD,HOS__NONORM ) .ne. 0) cStr = ' UNNORMALIZED' if (iand(iD,HOS__OS_VMS ) .ne. 0) cStr(itrim(cStr)+1:) = ' OS: '//OS__VMS if (iand(iD,HOS__OS_DOS ) .ne. 0) cStr(itrim(cStr)+1:) = ' OS: '//OS__DOS if (iand(iD,HOS__OS_UNIX) .ne. 0) cStr(itrim(cStr)+1:) = ' OS: '//OS__UNIX write (*,'(/,A,I2,A,I4,A,F7.3,A,F8.3,A,I2,A,I5,A,//,12X,8X,A,15X,A,9X,A,/,1X,2A)') & ' Helios',iSc,' (',iYr,' ',TMin,'-',TMax,') recl=',iRecl,' #recs=',iHOSInfo,cStr, & 'PHOTOMETER 1','PHOTOMETER 2','PHOTOMETER 3', & ' FILTERS -->',' 1 2 3 4 5 1 2 3 4 5' write (*,'(7X,A,4X,5I5,2X,5I5,5X,I5)') (cUBV(J),(Lst(J,I),I=1,nF),J=1,nP) !------- ! Add data information to Lst(1,12) reflecting the content of the file iD = iD + & min(1,iArrI4Total(15,Lst(1, 1),i))*HOS__P_1 + ! Phot. 1 (all colors and filters) & min(1,iArrI4Total(15,Lst(1, 6),i))*HOS__P_2 + ! Phot. 2 (all colors and filters) & min(1,iArrI4Total( 3,Lst(1,11),i))*HOS__P_3 + ! Phot. 3 (all colors) & min(1,kCn(1))*HOS__C_1 + ! Color 1 (all photom and filters) & min(1,kCn(2))*HOS__C_2 + ! Color 2 (all photom and filters) & min(1,kCn(3))*HOS__C_3 + ! Color 3 (all photom and filters) & min(1,iArrI4Total(3,Lst(1,1),i)+iArrI4Total(3,Lst(1, 6),i))*HOS__F_1 + ! Filter 1 (photom 1 and 2, all colors) & min(1,iArrI4Total(3,Lst(1,2),i)+iArrI4Total(3,Lst(1, 7),i))*HOS__F_2 + ! Filter 2 (photom 1 and 2, all colors) & min(1,iArrI4Total(3,Lst(1,3),i)+iArrI4Total(3,Lst(1, 8),i))*HOS__F_3 + ! Filter 3 (photom 1 and 2, all colors) & min(1,iArrI4Total(3,Lst(1,4),i)+iArrI4Total(3,Lst(1, 9),i)+iArrI4Total(3,Lst(1,11),i))*HOS__F_4 + ! Filter 4 (all photom and colors) & min(1,iArrI4Total(3,Lst(1,5),i)+iArrI4Total(3,Lst(1,10),i)+iArrI4Total(3,Lst(1,11),i))*HOS__F_5 ! Filter 5 (all photom and colors) end if if (iU .ne. FIL__NOUNIT) iU = iFreeLun(iU) return end