How to store and display new redbook graphics: 1. The following files control the storage and display of redbook graphics: a. $FXA_DATA/nationalData/redbookDataKeys.txt b. $FXA_DATA/nationalData/redbookDepictKeys.txt c. $FXA_DATA/nationalData/redbookProductButtons.txt d. $FXA_DATA/nationalData/redbookSurfaceMenus.txt e. $FXA_DATA/nationalData/redbookUpperAirMenus.txt f. $FXA_HOME/data/localization/scripts/makeDataSups.csh g. $FXA_HOME/bin/fxa-data.purge An explanation of each file follows. NOTE: All references to directories are for the operational environment. If under the development environment then /nationalData is located under .../src/localization as is /scripts, and fxa-data.purge is found in .../src/dataIngest. 2. redbookDataKeys.txt Usage: storage and display Format: 1|2|3|4|5|6|7|8|9|10|11 1 - data key identifying the graphic This is an unique value ranging from 5000 to 5999. 2 - name of geographic information file This file contains information about the projection, e.g., polar stereographic, and the area that the data covers. This field is populated only when the projection of the graphic is not polar stereographic. This file is created during localization by makeDataSups.csh (see below). 3 - not used 4 - forecast time of the graphic in days if negative, in seconds if >240, otherwise in hours. This value is displayed in the title of the product when it is displayed. It is used to compute the end time of the product which is also displayed in the title. 5 - not used 6 - not used 7 - frequency, offset in seconds These values are used to adjust the receipt time that is used in the input file name into a valid time used in the output file name. TTAAiiCCCC.YEARMODY_HRMNSC.MSC ---> TTAAiiCCCC.YEARMODY_HRMN If this field contains no values then the time (HRMN) will default to 0000 or 1200, e.g., if the hour time of the input file timestamp is < 12 then HRMN = 0000, otherwise, it is 1200. If only the frequency value is set then the time is pushed back to the nearest hour that is a multiple of the frequency value, e.g., if the hour time of the input file timestamp is 14 and the frequency value is 6 hours then HRMN = 1200. If the offset field is set to a value then it is added to the truncated hour value, e.g., if frequency = 3600 and offset = 2100, then the frequency value truncates the timestamp back to the top of the hour and then the offset is added to push the time forward to 35 minutes past the hour. Another example, if frequency = 86400 and offset = 43200 then HRMN = 1200. 8 - output directory path This is the path under $FXA_DATA where the graphic is stored. The directory tree under /data/fxa/redbook is rich enough to accommodate most new products. If a new directory is needed, it can be created by running the -dirs target of localization on ds1. 9 - file name prefix The format of the output file name is TTAAiiCCCC.YEARMODY_HRMN. TTAAiiCCCC. (period included) is the file name prefix. 10 - not used 11 - description of the graphic The first six characters of this field must contain the unique WMO ID, TTAAii. This value is used by the RedbookStorage process to create a dictionary object of these WMO IDs and the data key assigned to it. (If the WMO ID is not unique, then the dictionary class will replace the data key value with the data key value of the latest WMO ID found in redbookDataKeys.txt.) 3. redbookDepictKeys.txt Usage: display Format: 1|2|3|4|5|6|7|8|9|10|11 1 - depict key This is an unique value ranging from 5000 to 5999. 2 - depictable type, 33 for redbook graphics 3 - data keys of the data that are displayed in this depictable 4 - not used 5 - 0 denotes use the default map for the scale 6 - 1 denotes graphic image 7 - long name used to label the depictable 8 - short name used in history list 9 - 1 depictable depth for graphic 10 - 0 denotes data display depictable, i.e., not a map 11 - 1 denotes plan view depictable 4. redbookProductButtons.txt Usage: display Format: 1|2|3|4|5 1 - product button associated with a menu item 2 - sequence of depict keys, one for each scale 3 - button label 4 - not used 5 - 0 which indicates show an inventory time For a detailed description of product buttons, refer to /data/fxa/nationalData/productButtonInfo.txt. 5. redbookSurfaceMenus.txt Usage: display Format: Refer to description found in /data/fxa/nationalData/dataMenus.txt 6. redbookUpperAirMenus.txt Usage: display Format: Refer to description found in /data/fxa/nationalData/dataMenus.txt 7. makeDataSups.csh 8. fxa-data.purge 9. Relationship between redbook graphics files: redbookSurfaceMenus.txt redbookUpperAirMenus.txt | | ---------------------------------- | menu item --> product button | 1 --> 1 redbookProductButtons.txt | product button --> depict key | 1 --> 1 redbookDepictKeys.txt | depict key --> data key | 1 --> 1 | 1 --> many redbookDataKeys.txt -------------------------------------------------------------------------------- How redbook graphics works: 1. The WMO ID for a redbook graphic has the following format: PTAAii P = pictorial information in binary T = data type designator (e.g., W = wind) A = geographical area designator (e.g., E = 0-90W tropical belt) A = reference time designator (e.g., G = 36 hour forecast) ii = level designator (e.g., 88 = ground/water properties for earth's surface) Note: These definitions are found in WMO Manual 386, Table A. 2. When a redbook graphic is received over the SBN it is stored (/comms/storeProduct.C) in a timestamped file in the appropriate directory by the acqserver process. The acqserver uses $FXA_HOME/data/acq_patterns.txt to find where to store the raw data. The redbook graphics are stored in $FXA_DATA/redbook/Raw. The raw data is stored in a file whose name is composed of the WMO ID and a timestamp (current time). The format of the file name is TTAAiiCCCC.YEARMODY_HRMNSC.MSC, e.g., PWEG88KNHC.20000208_081417.596. The day and hour in the time stamp is replaced with the day and hour extracted from the raw data (DYHRMN following the WMO ID in the beginning of the data). 3. The RedbookStorage process then renames (dmGetRedbookKey in /dataMgmt/dmDataAccessFns.C) the file and stores it in the appropriate output directory. The redbookDataKeys.txt file contains information that specifies how the output file name is derived and where to store the output file. a. The output file is stored in the output directory specified in column 8 of redbookDataKeys.txt. This output directory is located under $FXA_DATA. b. The format of the output file name is TTAAiiCCCC.YEARMODY_HRMN. Column 9 of redbookDataKeys.txt contains TTAAiiCCCC. (period included). YEARMODY_HRMN is derived from the timestamp of the input file name and column 7 of redbookDataKeys.txt. c. Whenever redbookDataKeys.txt is modified, the RedbookStorage process must be stopped and restarted in order for the modifications to take effect. The RedbookStorage process is stopped by issuing an UNIX command to kill the RedbookStorage process. The process is then automatically restarted by the DataController (TextCont2). The RedbookStorage process is run on as1. 4. In order to display the new products to the user, D-2D must be restarted on the workstation after the following files are modified: a. If the new product is to be displayed from a new menu item then one of two files needs to be modified: (1) redbookUpperAirMenus.txt (2) redbookSurfaceMenus.txt b. The new product button assigned to the new menu item will have to be defined in redbookProductButtons.txt. c. This new product button will have to correspond to a new depict key in redbookDepictKeys.txt. In general the product button and the depict key have the same value. d. If the product is to be displayed from an existing menu item then only redbookDepictKeys.txt needs to be modified. The data key of the new product is added to the data key field (column 3) of the depict key that corresponds to the product button of the menu item. e. Two fields in redbookDataKeys.txt are applicable to the display of the graphic. (1) Column 2 contains the name of a file that describes the projection and area that the data covers. This field needs to be populated whenever the projection of the data is not polar stereographic. This file is created during localization (dataSups task) in makeDataSups.csh (which calls maksuparg to create this file), therefore, if a new projection is used by the graphic, then localization must be run for the dataSups task only. (2) Column 4 contains the forecast time of the graphic in days if negative, in seconds if >240, otherwise in hours. This value is displayed in the title of the product when it is displayed. It is used to compute the the end time of the product which is also displayed in the title. 5. The script fxa-data.purge needs to be updated to keep only x number of the latest products in the output directory. The number of products to keep is determined as follows: a. To determine how many files to save for forecast data: 2 cycles of data + the number of updates per cycle. b. To determine how many files to save for analysis data: 24 hours of data, including all cycles within the 24-hour period. 6. Cannot bundle products under the same product button unless its forecast times are different or the reference times are different. 7. Any change to the config files, e.g., redbookProductButtons.txt, requires a restart of D2D. 8. Any change to the data keys, redbookDataKeys.txt, requires a restart of the RedbookStorage process on as1.