csv2table doesn’t handle repeated fields correctly #3676
Labels
bug
Something isn't working
enhancement
New feature or request
Missions
Issues which are a priority for missions
ISIS version(s) affected: most (tested with 3.9, but widely applicable)
Description
The
csv2table
program does not seem to be able to create a table in an ISIS cube file that has a field with lengths longer than 1.How to reproduce
The original EDR.cub’s label looks like:
Object = Table
Name = "HiRISE Calibration Image"
StartByte = 4169452
Bytes = 126976
Records = 62
ByteOrder = Lsb
Group = Field
Name = Calibration
Type = Integer
Size = 512
End_Group
End_Object
But the new EDR_edit.cub’s label looks like:
Object = Table
Name = "HiRISE Calibration Image"
StartByte = 4802073
Bytes = 253952
Records = 62
ByteOrder = Lsb
Group = Field
Name = "Calibration(0)"
Type = Double
Size = 1
End_Group
Group = Field
Name = "Calibration(1)"
Type = Double
Size = 1
End_Group
Group = Field
Name = "Calibration(2)"
Type = Double
Size = 1
End_Group
Group = Field
Name = "Calibration(3)"
Type = Double
Size = 1
End_Group
....
The problem here is that tabledump takes a single table and dumps it to CSV, but csv2table apparently takes every field found in the CSV file and creates a ‘table’ in the cubefile. So the single table (with 62 ‘rows’ and 512 ‘columns’) in the original cube, creates a CSV file with 63 lines (first one being ‘header’ values) and 512 comma-separated values. csv2table takes that CSV file and appears to create 512 tables in the cube file with 62 ‘rows’ and a single ‘column’.
Possible Solution
Not sure on details, but this should be 'symmetric' with
tabledump.
I first thought that this was just me not understanding how the software works, so additional documentation, or a worked example would be useful.Additional context
AstroDiscuss topic
The text was updated successfully, but these errors were encountered: