Linux .dbf table output inconcistent with like-for-like Windows output
Posted: February 9th, 2017, 5:55 am
Hi All,
I've recently run HYSPLIT for Linux using pretty much the same .tcl script that I used for model runs on Windows but I'm having an issue with the shapefiles outputs. These couldn't be loaded into ArcGIS (following ftp transfer to Windows) because there are some problems with field types, and on closer inspection I have found an issue with the output .dbf tables that accompany the shapefiles. As you can see from the .dbf file info below (viewed in linux using python's dbfview package), where the "Trajnum" field should be populated with a 4-digit integer (1000, 1001, ..) I have 6-character data like 1000 02, 1001 02, 1001 03 which I presume is registered as a string field, hence the field type error when trying to open in ArcGIS. I also have an additional field "1000 201" which clearly just shouldn't be there.
I'm at a loose end as to why the outputs from the same tcl commands would produce a different output in linux vs. windows, however, I'm pretty sure that the problem must be occurring in the following code sequence (NB appears in a look, hence all the $):
In particular I think the options that I've used for txt2dbf "-C7 -C9 -C5 -C9 -d, -d, -d," are likely to be the problem.. but I'm unsure about what options to use or how to figure this out. Does anyone know what each option in that list means? Or could anyone point me towards a good resource?
Any pointers very much appreciated.
Matt
I've recently run HYSPLIT for Linux using pretty much the same .tcl script that I used for model runs on Windows but I'm having an issue with the shapefiles outputs. These couldn't be loaded into ArcGIS (following ftp transfer to Windows) because there are some problems with field types, and on closer inspection I have found an issue with the output .dbf tables that accompany the shapefiles. As you can see from the .dbf file info below (viewed in linux using python's dbfview package), where the "Trajnum" field should be populated with a 4-digit integer (1000, 1001, ..) I have 6-character data like 1000 02, 1001 02, 1001 03 which I presume is registered as a string field, hence the field type error when trying to open in ArcGIS. I also have an additional field "1000 201" which clearly just shouldn't be there.
Code: Select all
Trajnum : 1001 2
Yyyymmdd : 0111231 2
Time : 300
Level : 0.
1000 201:
Trajnum : 1002 2
Yyyymmdd : 0111231 2
Time : 200
Level : 0.
1000 201:
Code: Select all
exec $exeDir/trajplot -i$EPcodex$YY$MM$DD -a1 -l1 -o$EPcodex$YY$MM$DD
exec $exeDir/ascii2shp -i p$EPcodex$YY$MM$DD points <GIS_traj_ps_01.txt
exec $exeDir/txt2dbf -C7 -C9 -C5 -C9 -d, -d, -d, GIS_traj_ps_01.att p$EPcodex$YY$MM$DD.dbf
Any pointers very much appreciated.
Matt