I converted a dataset into csv file and added one more column to the said csv file manually. now when I tried importing it back to snap i get the following
Error : No appropriate reader found.
Is there a way to import it a CSV file back to SNap after doing manipulations on it ?
I can neither open the original, nor the modified CSV in SNAP.
Maybe for my understanding:
How did you create the original one? Is it based on raster values from pins? And what do you want to do with the new column in SNAP?
I had Sentinel 2 datasets, I did NDVI calculation on those and exported the direct values using FILE ā> EXPORT ā> CSV.
Then I marked some pixels of interest and concatenated the column to the original file.
The original CSV file can be open in SNAP but after any manipulation SNAP is not reading it back.
For the files I added before.
The CSV files were large(28000 rows) and I only kept the first 10 lines of each.
Could it be possible that manually modifying a CSV file tampers with itās ability to open in SNAP?
I send you a csv that can be read, as example. I do not know exactly what is the matter, I think it has something to do with the tabulation, but I was not able to solve it. Maybe using this csv as template could work. new_test_snap.csv (11.8 KB)
I have also coded a Python script to add the necessary lines to the csv to be read by SNAP. I hope it helps too. write_comments_csv_snap.py (532 Bytes)
@abruescas Oh thank you so muchā¦this can be helpful .
I tried the new_test_snap file u gave it opened at first.
Then I modified the file (deleted one row) to see if it still works and while saving it got this error.
So I decided to use the python code.
I have a query though. Please excuse me for being novice.
in the python script based on my limited understamding we have to manually enter the values as
SNAP will always read a two-dimensional matrix, for instance my data has 14 values per band. If I assigned (as I did) #sceneRasterWidth=2, only two columns will be written and the rest of the values will be distributed along those two columns. When there are not more values to assign, SNAP will write NaN to complete the matrix. If you know the dimensions of your file, you can change the #sceneRasterWidth=# at your convenience. You dataset has 118 columns, but the important number would be the width to build the two-dimensional square (I guess the 181 width that you obtained when you exported the csv first). I think the problem in your case was the tabulation, maybe @marpet or somebody else have something to say.
You are more likely to get help if you create a new thread with a title that will allow others who have worked with similar data recognize your issue and tell us how they solved it.
SNAP can import many kinds of CSV data: cruise tracks, images, etc. If you search for āimport csvā in SNAPās Help window the first 4 topics listed are for different kinds of data. There should be many other pages that refer back to one of the first 4 topics.
Please tell us the kind of data you wish to import, show us the first few lines of your .csv file, and tell us what isnāt working. Do you get some error? Does the import run but produces unexpected values?
Check you file against the Help page called āCSV File Conventionsā. You need to use the prescribed names and assign a geometry to āzā. Quoting the āConventionsā page:
If the CSV data set does not provide valid geoinformation as described above, the data set will be rejected as invalid.
Can you provide me with an example of how that would look because i have honestly tired reading through that manual but it doesnt make sense to me. Maybe because i am new to SNAP. I am used to qucikly uploading csv files into softwares without any issues.
I donāt need the first column i need the lat long and z values. but am not sure how to go about assigning a geometry to āzā as you said above. none of the examples given in that manual show a āzā attribute .