Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csv2table doesn’t handle repeated fields correctly #3676

Closed
rbeyer opened this issue Feb 10, 2020 · 3 comments
Closed

csv2table doesn’t handle repeated fields correctly #3676

rbeyer opened this issue Feb 10, 2020 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request Missions Issues which are a priority for missions

Comments

@rbeyer
Copy link
Contributor

rbeyer commented Feb 10, 2020

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

wget https://hirise-pds.lpl.arizona.edu/PDS/EDR/PSP/ORB_010500_010599/PSP_010502_2090/PSP_010502_2090_RED5_0.IMG
hi2isis fr= PSP_010502_2090_RED5_0.IMG to= EDR.cub
tabledump fr= EDR.cub to=cal.csv name='HiRISE Calibration Image'
vi cal.csv (change first value in first line to a zero, or change nothing at all)
cp EDR.cub EDR_edit.cub
csv2table csv=cal.csv to=EDR_edit.cub tablename='HiRISE Calibration Image'

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

@jessemapel jessemapel added the bug Something isn't working label Feb 10, 2020
@ascbot
Copy link
Contributor

ascbot commented Sep 1, 2020

I am a bot that cleans up old issues that do not have activity.

This issue has not received feedback in the last six months. I am going to add the inactive label to
this issue. If this is still a pertinent issue, please add a comment or add an emoji to an existing comment.

I will post again in five months with another reminder and will close this issue on it's birthday unless it has
some activity.

@ascbot ascbot added the inactive Issue that has been inactive for at least 6 months label Sep 1, 2020
@rbeyer
Copy link
Contributor Author

rbeyer commented Oct 14, 2020

This remains a problem in ISIS 4.2.0

@rbeyer rbeyer removed the inactive Issue that has been inactive for at least 6 months label Oct 15, 2020
@jessemapel jessemapel added this to the 4.3.1 milestone Dec 4, 2020
@jessemapel jessemapel added the Missions Issues which are a priority for missions label Dec 15, 2020
@jessemapel jessemapel removed this from the 4.3.1 milestone Dec 15, 2020
@scsides scsides self-assigned this Mar 16, 2021
@scsides scsides added the enhancement New feature or request label Mar 22, 2021
@acpaquette
Copy link
Collaborator

@scsides Can this be closed?

@scsides scsides closed this as completed Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Missions Issues which are a priority for missions
Projects
None yet
Development

No branches or pull requests

5 participants