Changeset 3653
- Timestamp:
- Apr 4, 2005, 1:19:51 PM (21 years ago)
- Location:
- trunk/doc/pslib
- Files:
-
- 2 edited
-
ChangeLogSDRS.tex (modified) (2 diffs)
-
psLibSDRS.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/ChangeLogSDRS.tex
r3621 r3653 1 %%% $Id: ChangeLogSDRS.tex,v 1.8 0 2005-04-01 04:20:31 jhoblitt Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.81 2005-04-04 23:19:51 jhoblitt Exp $ 2 2 3 3 \subsection{Changes from version 00 to version 01} … … 521 521 \end{itemize} 522 522 523 \item Restrictions on the use of \code{malloc}, \code{calloc}, \code{realloc}, and \code{free} should not be unintentional imposed on 3rd party code. 524 \item Added database support for ``auto-incrementing'' 525 \end{itemize} 523 \item Restrictions on the use of \code{malloc}, \code{calloc}, \code{realloc}, and \code{free} should not be unintentionaly imposed on 3rd party code. 524 \item Add database support for ``auto-incrementing'' 525 \item Changes to Configuration Files: 526 \begin{itemize} 527 \item Add \code{UTC,UT1,TAI,TT} types 528 \item Change ``multiple symbol'' declaration format to \code{[keyword] MULTI} 529 \item Add Scoping Rules 530 \end{itemize} 531 \item Add \code{PS_META_TIME} to \code{psMetadataType} 532 \end{itemize} -
trunk/doc/pslib/psLibSDRS.tex
r3621 r3653 1 %%% $Id: psLibSDRS.tex,v 1.19 4 2005-04-01 04:20:31 jhoblitt Exp $1 %%% $Id: psLibSDRS.tex,v 1.195 2005-04-04 23:19:51 jhoblitt Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 3690 3690 PS_META_PNG, ///< PNG (item.data) 3691 3691 PS_META_ASTROM, ///< astrometric coefficients (item.data) 3692 PS_META_TIME, ///< psTime (item.data.V) 3692 3693 PS_META_UNKNOWN, ///< other (item.data) 3693 3694 PS_META_NTYPE ///< Number of types; must be last … … 3937 3938 On error, the function shall return \code{NULL}. 3938 3939 3940 \subsubsection{Comments} 3941 3939 3942 The configuration file shall consist of plain text with 3940 3943 key/type/value/comment quads on separate lines. Blank lines, … … 3948 3951 which should not form part of the key. 3949 3952 3950 Next, to assist the casting of the value, shall be a string 3951 identifying the type of the value, which shall correspond to one of 3952 the simple types supported in \code{psMetadata}: 3953 \code{STRING,BOOL,S32,F32,F64}; \code{STR} may be used to abbreviate 3954 \code{STRING}. 3953 \subsubsection{Types} 3954 \paragraph{Scalar \& Vector} 3955 3956 Next, to assist the casting of the value, shall be a string identifying the 3957 type of the value, which shall correspond to one of the simple types supported 3958 in \code{psMetadata}: \code{STRING,BOOL,S32,F32,F64}; \code{STR} may be used to 3959 abbreviate \code{STRING}; valid time type are \code{UTC,UT1,TAI,TT}. 3955 3960 3956 3961 \tbd{May, in the future, require more types, including U8,S16,C64, 3957 3962 which will also necessitate updating the definition of psMetadata.} 3958 3963 3959 The value shall follow the type: strings may consist of multiple 3960 words, and shall have all leading and trailing whitespace removed; 3961 booleans shall simply be either \code{T} or \code{F}. 3964 The value shall follow the type: strings may consist of multiple words, and 3965 shall have all leading and trailing whitespace removed; booleans shall simply 3966 be either \code{T} or \code{F}. Time type values will be in the ISO8601 3967 compatible format of "YYYY-MM-DDTHH:MM:SS,sZ". When parsed, time types shall 3968 be represented as a \code{psTime} object. 3962 3969 3963 3970 Following the value may be an optional comment, preceded by a comment … … 3984 3991 1.23+4.56i in the future.} 3985 3992 3986 An additional hurdle is the specification of keys that may be 3987 non-unique (such as the \code{COMMENT} keyword in a FITS header). 3988 These keys shall be specified in the configuration file as non-unique 3989 by specifying the key at the start of the line (possibly preceded by 3990 whitespace) and specifying the type as a ``multiple symbol'', which we 3991 choose to be an asterisk, \code{*}. No other data may be provided on 3992 this line, though a comment, preceeded by the comment marker, is 3993 valid. A warning shall be produced when a key which has not been 3994 specified to be non-unique is repeated; in this case, the former value 3995 shall be overwritten if \code{overwrite} is \code{true}, otherwise the 3996 line shall be ignored and counted as one that could not be parsed. 3993 \tbd{May add null, Not-a-Number (NaN), denormalized, underflow, overflow, 3994 and/or +/-infinity values for selected types.} 3995 3996 \paragraph{MULTI} 3997 3998 An additional hurdle is the specification of keys that may be non-unique (such 3999 as the \code{COMMENT} keyword in a FITS header). These keys shall be specified 4000 in the configuration file as non-unique with a \code{MULTI} declaration. In 4001 the form \code{[keyword] MULTI}. No other data may be provided on this line, 4002 though a comment, preceeded by the comment marker, is valid. A warning shall 4003 be produced when a key which has not been specified to be non-unique is 4004 repeated; in this case, the former value shall be overwritten if 4005 \code{overwrite} is \code{true}, otherwise the line shall be ignored and 4006 counted as one that could not be parsed. It should be noted that non-unique 4007 keys may be of mixed type (even the \code{TYPE} and \code{METADATA} complex 4008 types). For example: 4009 \begin{verbatim} 4010 comment MULTI # a comment 4011 comment STR some string 4012 comment F32 1.23456 4013 comment BOOL T 4014 \end{verbatim} 3997 4015 3998 4016 If a line does not conform to the rules laid out here, a warning shall … … 4029 4047 files. 4030 4048 4031 We extend \code{psMetadataParseConfig} to allow a modest tree 4032 structure by defining a reserved keyword \code{TYPE}. Any line in the 4033 config file which starts with the word \code{TYPE} shall be 4034 interpretted as defining a new valid type. The defined type name 4035 follows the word \code{TYPE}, and is in turn followed by an arbitrary 4036 number of words. These words are to be interpreted as the names of an 4037 embedded \code{psMetadata} entry, where the values are given on any 4038 line which (following the \code{TYPE} definition) employs the new type 4039 name. For example, a new type may be defined as: 4049 \subsubsection{Complex Types} 4050 \paragraph{TYPE} 4051 4052 We support a modest tree structure by defining a reserved keyword \code{TYPE}. 4053 Any line in the config file which starts with the word \code{TYPE} shall be 4054 interpretted as defining a new valid type. The defined type name follows the 4055 word \code{TYPE}, and is in turn followed by an arbitrary number of words. 4056 These words are to be interpreted as the names of an embedded \code{psMetadata} 4057 entry, where the values are given on any line which (following the \code{TYPE} 4058 definition) employs the new type name. For example, a new type may be defined 4059 as: 4040 4060 \begin{verbatim} 4041 4061 TYPE CELL EXTNAME BIASSEC CHIP … … 4055 4075 Figure~\ref{fig:metadata}. 4056 4076 4057 We further extend \code{psMetadataParseConfig} to allow the definition 4058 of a \code{psMetadata} entry using a sequence of successive lines to 4059 define the values of the \code{psMetadataItem} entries. The initial 4060 line defines the new \code{psMetadata} entry and its name. The 4061 following lines have the same format as the other metadata config file 4062 entries. The sequence is terminated with a line with a single word 4063 \code{END}. For example, a metadata entry may be defined as: 4077 \paragraph{METADATA} 4078 4079 Another way to form a tree-like structure is to directly define a 4080 \code{psMetadata} entry using a sequence of successive lines to define the 4081 values of the \code{psMetadataItem} entries. The initial line defines the new 4082 \code{psMetadata} entry and its name. The following lines have the same format 4083 as the other metadata config file entries. The sequence is terminated with a 4084 line with a single word \code{END}. For example, a metadata entry may be 4085 defined as: 4064 4086 \begin{verbatim} 4065 4087 CELL METADATA … … 4070 4092 END 4071 4093 \end{verbatim} 4094 4095 \subsubsection{Scoping Rules} 4096 4097 A simple set of ``Scoping Rules'' are required to properly parse a 4098 configuration file. ``Scope'' refers to the current ``level'' of 4099 \code{METADATA} that a statement appears in. Statements that are not contained 4100 in a nested \code{METADATA} are said to be in the ``Top level scope''. Each 4101 level of nested \code{METADATA} statements create a new ``lower level scope''. 4102 4103 \begin{itemize} 4104 \item 4105 Variable names are unique only to the current level of scope. 4106 4107 \item 4108 non-unique keywords (\code{MULTI}) apply only to the current scope. i.e. They 4109 are invalid in ``higher'' or ``lower'' level scopes. 4110 4111 \item 4112 \code{TYPE} declarations apply only to the current scope. 4113 4114 \item 4115 \code{METADATA} declarations must begin and end in the same scope. i.e. They 4116 may not be declared and end in two different nested METADATA and the same 4117 depth. 4118 \end{itemize} 4072 4119 4073 4120 A series of test inputs is contained in
Note:
See TracChangeset
for help on using the changeset viewer.
