190 likes | 281 Views
EARTH SCIENCE MARKUP LANGUAGE Tutorial on how to write an ESML Description File (for ESML Schema v3.0). “Define Once Use Anywhere” INFORMATION TECHNOLOGY AND SYSTEMS CENTER UNIVERSITY OF ALABAMA IN HUNTSVILLE. ESML Schema.
E N D
EARTH SCIENCE MARKUP LANGUAGETutorial on how to write an ESML Description File (for ESML Schema v3.0) “Define Once Use Anywhere” INFORMATION TECHNOLOGY AND SYSTEMS CENTER UNIVERSITY OF ALABAMA IN HUNTSVILLE
ESML Schema • ESML schema defines Syntactic metadata that describe the structure of the file in machine-readable and -interpretable terms • Divide data formats into free form (ASCII, Binary) and structured (HDF-EOS, netCDF, etc)
Two Sections • Part I • Writing ESML Description for free form formats in ASCII, Binary • Examples • Part II • Writing ESML Description Files for structured formats • HDF-EOS • netCDF
Part I • Goal: • To write an ESML Description File for a simple ASCII data file • Show similar example for Binary data file • Show other capabilities
Writing an ESML File (1) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> ESML MARKUP FOR THE DATA FILE The next slides will set describe how to write an ESML file for a simple ASCII file described below 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (2) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> DESCRIBING ONLY THE STRUCTURE 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (3) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> DESCRIBE THE FORMAT 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (4) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> ENTIRE FILE CONTENTS INTO 1 LOGICAL STRUCTURE 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (5) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> DEFINE THE FIRST FIELD IN THE FILE: HEADER INFORMATION 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (6) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> DEFINE THE SECOND FIELD IN THE FILE: HEADER INFORMATION 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (7) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> DEFINE THE DATA FIELD IN THE FILE: PROVIDE SIZE AND FORMAT INFORMATION 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
Writing an ESML File (8) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d"/> <Header name="SizeY" format="%d"/> <Array occurs=“4"> <Array occurs=“5"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> CLOSE ALL THE TAGS: ESML FILE IS READY 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 REMEMBER TO VALIDATE YOUR FILE AGAINST THE SCHEMA! SIMPLE ASCII DATA FILE
Another Possible ESML Description (9) <a:ESML> <SyntacticMetaData> <Ascii> <Structure instances="1"> <Header name="SizeX" format="%d" symbol=“true"/> <Header name="SizeY" format="%d“ symbol=“true"/> <Array occurs=“$SizeX"> <Array occurs=“$SizeY"> <Field name="BrightnessTemp" format="%d"/> </Array> </Array> </Structure> </Ascii> </SyntacticMetaData> </a:ESML> USE HEADER INFORMATION 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 SIMPLE ASCII DATA FILE
ESML Description for a similar file in Binary format <a:ESML xsi:schemaLocation="ESML ../../Schema/ESML.xsd"> <SyntacticMetaData> <Binary> <Structure name="Bin" instances="1"> <Header type="Int32" name="sizeX"/> <Header type="Int32" name="sizeY"/> <Array occurs="5"> <Array occurs="5"> <Field name="BrightnessTemp" type="Int32" order="LittleEndian"/> </Array> </Array> </Structure> </Binary> </SyntacticMetaData> </a:ESML>
ESML Description File using wild card ‘*’ to read till the end of file <a:ESML xsi:schemaLocation="ESML ../../Schema/ESML.xsd"> <SyntacticMetaData> <Binary> <Structure name="Bin" instances="1"> <Header type="Int32" name="sizeX"/> <Header type="Int32" name="sizeY"/> <Array occurs=“*"> <Array occurs="5"> <Field name="BrightnessTemp" type="Int32" order="LittleEndian"/> </Array> </Array> </Structure> </Binary> </SyntacticMetaData> </a:ESML>
Part II • Goal: • Show some example ESML Description Files for structured data formats supported by the ESML Schema • HDF-EOS • netCDF • HDF5 • Grib • WSR88DLII
ESML Descriptions for a Structured Format (HDF-EOS) <a:ESML> <SyntacticMetaData> </HdfEos> </SyntacticMetaData> </a:ESML> <a:ESML > <SyntacticMetaData> <HdfEos> <Structure name="CERES_ES8_12891" instances="1"> <Field name="Colatitude of CERES FOV at TOA“/> <Field name="Longitude of CERES FOV at TOA“/> <Field name="Time of observation“/> </Structure> </HdfEos> </SyntacticMetaData> </a:ESML> Both ESML Descriptions are correct and valid
ESML Descriptions for a Structured Format (netCDF) <a:ESML> <SyntacticMetaData> </netCDF> </SyntacticMetaData> </a:ESML> <a:ESML > <SyntacticMetaData> <netCDF> <netCDFField name="U"> </netCDFField> </netCDF> </SyntacticMetaData> </a:ESML> Both ESML Descriptions are correct and valid
REMEMBER TO CHECK THE ESML REGISTRY FOR ALREADY EXISTING ESML DESCRIPTION FILE!!