idw2at |
Table of contents
ProcedureIDW2AT ( Get file architecture and type from ID word ) SUBROUTINE IDW2AT ( IDWORD, ARCH, TYPE ) AbstractExtract the architecture and type of a SPICE binary kernel file from a file ID word. Required_ReadingNone. KeywordsKERNEL UTILITY DeclarationsIMPLICIT NONE CHARACTER*(*) IDWORD CHARACTER*(*) ARCH CHARACTER*(*) TYPE Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- IDWORD I The IDWORD to be examined. ARCH O The file architecture DAS or DAF. TYPE O The type of the file. Detailed_InputIDWORD is the ID word from a SPICE binary kernel file or a text version of a binary kernel file whose architecture and type are to be extracted. Detailed_OutputARCH is the file architecture used to store the data in a SPICE binary kernel file. If the architecture cannot be extracted or is not recognized the value '?' is returned. The possible architectures are: ASC -- An ASCII text file. DAF -- A DAF based file. DAS -- A DAS based file. KPL -- Kernel Pool File (i.e., a text kernel) TXT -- An ASCII text file. TE1 -- Text E-Kernel type 1. TYPE is the type of the SPICE file. If the type can not be extracted or if it is blank, the value '?' is returned. The type can only be extracted by this routine if the ID word follows the convention <architecture>/<type> where <architecture> is one of the file architectures specified above, and <type> = 'xxxx' where 'xxxx' represents a four character mnemonic or code for the file type. This subroutine does not do any checking of the file types. If a valid architecture is found and the type is non-blank, that is what will be returned. It is up to a higher level authority to determine whether a type is valid. ParametersNone. Exceptions1) If the variable ID word is blank, both the architecture and type will be unknown, specified by '?'. FilesNone. ParticularsThis subroutine is a support utility routine that attempts to extract the architecture and type of a file from its ID word. It may not be possible to determine the type of the file from the ID word alone. Older files which contain the ID words 'NAIF/NIP', or 'NAIF/DAF' do not have sufficient information in the ID word to determine the type of the file. A type for the ID word 'NAIF/DAS' is always 'PRE ', since files with this ID word were pre-release DAS files. A file architecture can always be extracted from a valid SPICE ID word. This subroutine and the subroutine GETFAT (get file architecture and type) are intimately related. Whenever one of them is modified the other should be checked to see if the modifications affect it. Whenever a new architecture is added, both of the subroutines are affected. ExamplesSuppose you wish to write a single routine for converting files between text and binary formats. You can use this routine to determine the architecture and type of the file and then pass the file to the appropriate low level file conversion routine to handle the actual conversion. CALL IDW2AT ( IDWORD, ARCH, TYPE ) IF ( ARCH .EQ. 'DAF' ) THEN convert a DAF file ELSE IF ( ARCH .EQ. 'DAS' ) THEN convert a DAS file ELSE WRITE(*,*) 'File architecture not supported.' END IF RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) K.R. Gehringer (JPL) VersionSPICELIB Version 2.1.0, 20-AUG-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 2.0.0, 26-OCT-1995 (KRG) Changed the Version line from "Beta" to "SPICELIB" for the current revisions. The subroutine was already in SPICELIB, but the Version line said "Beta." Added several new architectures: KPL -- Kernel Pool File (i.e., a text kernel) TXT -- An ASCII text file. ASC -- An ASCII text file. TE1 -- Text E-Kernel type 1. Changed the response foe the ID word 'NAIF/DAS' to be consistent with GETFAT. It now sets the architecture to 'DAS' and the type to 'PRE', for pre-release version. SPICELIB Version 1.0.0, 30-SEP-1993 (KRG) |
Fri Dec 31 18:36:26 2021