This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Charley, Your PARM line in your ascii file (and your SFPRMF input list) does not need STID. Your sfedit is looking for 4 parameters, and having to extend into the next line to find it. Steve Chiswell Unidata User Support On Tue, 2004-05-04 at 15:18, Charley Knoderer wrote: > I have been trying to import air quality data into a surface gempak > file using the following script: > > #!/bin/csh > # > #Get air quality data from ftp and creates airq gem file > # > mkdir /tmp/airq > cd /tmp/airq > # > #lftp -u shcoperator,Navi7r webserver3.sonomatech.com << _FTP_EOF_ > #cd /outgoing/forecasts > #get PMFN.dat > #_FTP_EOF_ > # > # Temporary copy of AirQ.dat to test file format. > cp /home/gempak/Charley/AirQ.dat /tmp/airq/AirQ.dat > # > # > #Define Date > set YY=`date -u +%y` > set MM=`date -u +%m` > set DD=`date -u +%d` > set DATE=$YY$MM$DD > #set GEMFILE=/home/gempak/metdat/gempak/airq/${DATE}_pmfn.gem > set GEMFILE=/home/gempak/metdat/gempak/airq/${DATE}_airq.gem > #set TMPGEMFILE=${DATE}_pmfn.gem > set TMPGEMFILE=${DATE}_airq.gem > # > sfcfil << SFCFIL_EOF > > SFOUTF = $TMPGEMFILE > SFPRMF = PMFN;PM10;OZON;STID > STNFIL = /home/gempak/nawips5.6j/gempak/tables/stns/airqstations.tbl > SHIPFL = NO > TIMSTN = 24/800 > r > > exit > > SFCFIL_EOF > gpend > sfedit << SFEDIT_EOF > > #SFEFIL = /tmp/airq/PMFN.dat > SFEFIL = /tmp/airq/AirQ.dat > SFFILE = $TMPGEMFILE > r > > exit > > SFEDIT_EOF > gpend > mv ${TMPGEMFILE} ${GEMFILE} > #rm /tmp/airq/* > mv /tmp/airq/* /home/gempak/Charley/ > rmdir /tmp/airq > > > > The data file looks like this: > > PARM = PMFN;PM10;OZON;STID > > STID DATTIM PMFN PM10 OZON > A0000981 040504/0000 131 159 134 > A0000981 040504/0100 115 19 85 > A0000981 040504/0200 179 88 148 > A0000981 040504/0300 62 192 66 > A0000981 040504/0400 77 2 65 > A0000981 040504/0500 6 58 185 > A0000981 040504/0600 53 31 176 > A0000981 040504/0700 0 60 134 > A0000981 040504/0800 135 195 138 > A0000981 040504/0900 142 53 126 > A0000981 040504/1000 37 166 163 > A0000981 040504/1100 173 156 9 > A0000981 040504/1200 128 140 99 > A0000981 040504/1300 74 167 125 > A0000981 040504/1400 111 168 166 > A0000981 040504/1500 22 45 49 > A0000981 040504/1600 170 111 139 > A0000981 040504/1700 21 17 15 > A0000981 040504/1800 143 103 154 > A0000981 040504/1900 68 14 47 > A0000981 040504/2000 37 114 12 > A0000985 040504/0000 191 6 57 > A0000985 040504/0100 161 144 122 > A0000985 040504/0200 164 70 99 > A0000985 040504/0300 187 110 13 > A0000985 040504/0400 64 152 59 > A0000985 040504/0500 19 187 39 > A0000985 040504/0600 163 110 90 > A0000985 040504/0700 15 100 52 > A0000985 040504/0800 138 1 149 > A0000985 040504/0900 1 149 42 > A0000985 040504/1000 40 116 105 > A0000985 040504/1100 127 49 109 > A0000985 040504/1200 67 96 3 > A0000985 040504/1300 106 197 81 > A0000985 040504/1400 155 84 44 > A0000985 040504/1500 199 52 115 > A0000985 040504/1600 44 174 106 > A0000985 040504/1700 180 192 48 > A0000985 040504/1800 197 118 153 > A0000985 040504/1900 122 34 21 > A0000995 040504/0000 66 168 71 > A0000995 040504/0100 8 101 24 > A0000995 040504/0200 123 187 53 > A0000995 040504/0300 2 183 185 > A0000995 040504/0400 33 51 78 > A0000995 040504/0500 87 190 194 > A0000995 040504/0600 42 73 148 > A0000995 040504/0700 4 64 4 > A0000995 040504/0800 175 90 193 > A0000995 040504/0900 189 45 68 > A0000995 040504/1000 58 11 111 > A0000995 040504/1100 124 134 35 > A0000995 040504/1200 11 133 196 > A0000995 040504/1300 178 140 38 > A0000995 040504/1400 158 198 145 > A0000995 040504/1500 146 73 91 > A0000995 040504/1600 53 117 3 > A0000995 040504/1700 143 97 26 > A0000995 040504/1800 186 96 10 > A0000995 040504/1900 36 47 115 > A0000995 040504/2000 95 131 146 > A0000999 040504/0000 107 21 12 > A0000999 040504/0100 126 55 74 > A0000999 040504/0200 195 56 163 > A0000999 040504/0300 58 55 109 > A0000999 040504/0400 145 133 129 > A0000999 040504/0500 61 68 118 > A0000999 040504/0600 82 60 26 > A0000999 040504/0700 6 197 79 > A0000999 040504/0800 2 149 121 > A0000999 040504/0900 163 97 119 > A0000999 040504/1000 52 178 137 > A0000999 040504/1100 143 117 193 > A0000999 040504/1200 62 129 0 > A0000999 040504/1300 133 70 132 > A0000999 040504/1400 46 93 127 > A0000999 040504/1500 166 81 17 > A0000999 040504/1600 76 136 7 > A0000999 040504/1700 193 103 86 > A0000999 040504/1800 17 33 194 > A0000999 040504/1900 174 150 102 > A0000999 040504/2000 172 160 220 > > The problem I am having is that the surface gem file being created > does not contain all of the data. It seems to be skipping every other > hour. For example, two stations will have all data for the 1400 hour > and then the other two stations will have data for 1500 hours, then it > switches back the two stations that had data at 1400 hours for the > 1600 hour? Any ideas as to why this is happening? > > -Charley > > Charley Knoderer > Meteorologist 1 > Sonoma Technology, Inc. > 1360 Redwood Way, Suite C > Petaluma, CA 94954 > (707) 665-9900 > FAX: (707) 665-9800 > www.sonomatech.com >