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.
Hi Kwan, re: > I have been trying to import some surface data into an MD file using > TXT2MD. But I ran into a strange behavior from TXT2MD. The first few lines > of the input data file are as follows. > > TYPE MOD IDA DAY HMS LAT LON T TD PSL > DIR SPD SPMX STI WXP > 0 0 28401 2013312 12:00:00 32.23 -144.54 -9999.00 -9999.00 -9999.0 -9999 > -9999.0 -9999.0 -9999.0 > 0 0 52073 2013313 00:00:00 4.93 -137.30 302.15 -9999.00 1007.9 40 > 8.2 -9999.0 302.4 > 0 0 52077 2013313 00:00:00 2.08 -146.97 -9999.00 -9999.00 -9999.0 -9999 > -9999.0 -9999.0 302.4 > 0 0 52080 2013313 00:00:00 2.04 -138.17 -9999.00 -9999.00 -9999.0 -9999 > -9999.0 -9999.0 302.6 > 0 0 52079 2013313 00:00:00 0.06 -147.01 300.45 -9999.00 1008.4 -9999 > -9999.0 -9999.0 302.4 > > Note that the date in the first line is 2013312 whereas the rest has > 2013313. > > Now, I ran the TXT2MD command like so: > txt2md.k buoy.txt 1003 ISHP MISS=-9999 > > I got a new MDXX1003. > > But when I listed the data in MDXX1003, they all have the date 2013312 > assigned, which are of course incorrect. > > ptlist.k MYDATA/PTSRCS.1003 PAR=IDA DAY HMS lat lon T[C] TD[C] SPMX[KT] > STI[C] FORM=DATA NUM=ALL > > IDA DAY[CYD] HMS[HMS] LAT[DEG] LON[DEG] T[C] TD[C] SPMX[KT] > STI[C] > ---- --------- --------- --------- --------- --------- --------- --------- > --------- > 2840 2013312 120000 32.2300 -144.5400 > 5207 2013312 0 4.9300 -137.3000 28.99 > 29.24 > 5207 2013312 0 2.0800 -146.9700 > 29.24 > 5208 2013312 0 2.0400 -138.1700 > 29.44 > 5207 2013312 0 0.0600 -147.0100 27.29 > 29.24 > 5208 2013312 0 7.6400 -136.7000 > 29.04 > > This incorrect date assignment is the reason that I have been bewildered > for a long time as to why they could not be plotted with the correct date > and time specified. > > I am attaching the data file for you to examine. After years of merging UPC additions/modifications into TXT2MD, I finally gave up when there was a major update to the SSEC version. Evidently, the SSEC version of TXT2MD has at least one bug in it as you have found. Instead of trying to debug the SSEC routine, I suggest that you use the Unidata version instead, UPCTXT2MD. You would run this in exactly the same way as you did for the SSEC version: upctxt2md.k buoy.txt 1003 ISHP MISS=-9999 I just did this with your buoy.txt file, and here is the PTLIST listing for the first 15 records: PTLIST MYDATA/PTSRCS.1003 PAR=IDA DAY HMS lat lon T[C] TD[C] SPMX[KT] STI[C] FORM=DATA NUM=15 IDA DAY[CYD] HMS[HMS] LAT[DEG] LON[DEG] T[C] TD[C] SPMX[KT] STI[C] ---- --------- --------- --------- --------- --------- --------- --------- --------- 2840 2013312 120000 32.2300 -144.5400 5207 2013313 0 4.9300 -137.3000 28.99 29.24 5207 2013313 0 2.0800 -146.9700 29.24 5208 2013313 0 2.0400 -138.1700 29.44 5207 2013313 0 0.0600 -147.0100 27.29 29.24 5208 2013313 0 7.6400 -136.7000 29.04 5208 2013313 0 2.0400 -138.1700 29.44 5208 2013313 0 2.0300 -156.0200 27.19 29.84 5208 2013313 0 0.0100 -156.0400 27.69 30.04 5207 2013313 0 4.9300 -137.3000 28.99 29.24 5208 2013313 0 5.0200 -155.9700 28.89 29.84 5207 2013313 0 2.0800 -146.9700 29.24 5208 2013313 0 2.0300 -156.0200 27.19 29.84 5207 2013313 0 0.0600 -147.0100 27.29 29.24 5208 2013313 0 7.6400 -136.7000 29.04 Number of matches found = 15 PTLIST: Done So, give UPCTXT2MD a try and let me know how it goes for you. Cheers, Tom -- **************************************************************************** Unidata User Support UCAR Unidata Program (303) 497-8642 P.O. Box 3000 address@hidden Boulder, CO 80307 ---------------------------------------------------------------------------- Unidata HomePage http://www.unidata.ucar.edu **************************************************************************** Ticket Details =================== Ticket ID: QLY-545896 Department: Support McIDAS Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.