Georectify airborne image data [message #92492] |
Wed, 30 December 2015 06:17  |
sawahrman
Messages: 2 Registered: December 2015
|
Junior Member |
|
|
Hello,
I've written some code for georectifying airborne image data, but I'm stuck at one particular point. I'm reading in a GPS file and keep getting this error: READ_CSV: OPENR: Null filename not allowed - see code below.
gps_csv_path = FILE_SEARCH(strjoin([HSI_parent_dir,'*GPS.csv']))
all_POS_csv_files = FILE_SEARCH(strjoin([HSI_VNIR_data_dir,'*POS.csv']))
; check to see if the output directories we want exist, if they don't, then create them
if (FILE_TEST(IGMGLT_dir) ne 1) then FILE_MKDIR, IGMGLT_dir
if (FILE_TEST(georect_dir) ne 1) then FILE_MKDIR, georect_dir
;read in the elevation data
elevation_geotiff = read_tiff(elevation_file,geotiff=elevation_tags)
;read in all the gps data and put it in a useable form
gps_data = read_csv(gps_csv_path, HEADER=gpsHeader, N_TABLE_HEADER=1, TABLE_HEADER=gpsTableHeader)
los_az_el = losAzElFromLosLatLon(gps_data)
gps_data.field04 = los_az_el[*,0]
gps_data.field03 = los_az_el[*,1]
Does anything stand out to anyone out there? I appreciate the help.
|
|
|
Re: Georectify airborne image data [message #92493 is a reply to message #92492] |
Wed, 30 December 2015 07:42  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Wednesday, December 30, 2015 at 2:17:28 PM UTC, Spencer Wahrman wrote:
> Hello,
>
> I've written some code for georectifying airborne image data, but I'm stuck at one particular point. I'm reading in a GPS file and keep getting this error: READ_CSV: OPENR: Null filename not allowed - see code below.
>
> gps_csv_path = FILE_SEARCH(strjoin([HSI_parent_dir,'*GPS.csv']))
> all_POS_csv_files = FILE_SEARCH(strjoin([HSI_VNIR_data_dir,'*POS.csv']))
>
> ; check to see if the output directories we want exist, if they don't, then create them
> if (FILE_TEST(IGMGLT_dir) ne 1) then FILE_MKDIR, IGMGLT_dir
> if (FILE_TEST(georect_dir) ne 1) then FILE_MKDIR, georect_dir
>
> ;read in the elevation data
> elevation_geotiff = read_tiff(elevation_file,geotiff=elevation_tags)
>
> ;read in all the gps data and put it in a useable form
> gps_data = read_csv(gps_csv_path, HEADER=gpsHeader, N_TABLE_HEADER=1, TABLE_HEADER=gpsTableHeader)
> los_az_el = losAzElFromLosLatLon(gps_data)
> gps_data.field04 = los_az_el[*,0]
> gps_data.field03 = los_az_el[*,1]
>
> Does anything stand out to anyone out there? I appreciate the help.
Hi,
this error happens when the filename variable (in your case "gps_csv_path") is an empty string. If you inser the command:
help, gps_csv_path
IDL will write:
<Expression> STRING = ''
If then you try to use this variable to read in a csv file, it will through the error you mentioned.
How to solve it?
Check this line
gps_csv_path = FILE_SEARCH(strjoin([HSI_parent_dir,'*GPS.csv']))
How about using this:
gps_csv_path = FILE_SEARCH(HSI_parent_dir,'*GPS.csv')
Any better? If not, check the content of HSI_parent_dir and make sure it really points to a directory containing files ending with GPS.csv.
Cheers,
Helder
|
|
|