Page 1 of 1

Exporting Pixel Info

Posted: Tue Sep 22, 2020 8:42 pm America/New_York
by kmckee
Hello,It has been a while since I last posted on the Ocean Color Forum. I hope that everyone is doing well. A colleague and I were revisiting a file that she prepared some time ago on a much older version of SeaDAS. It was a simple matrix, with columns for Latitude, Longitude, Mapped_kd490, pixel, and Line. I'm including a small snippet below:Latitude  Longitude  Mapped_kd490  pixel  Line14.98  -62.98  999.9  1  114.98  -62.94  999.9  2  114.98  -62.9  999.9  3  114.98  -62.86  999.9  4  114.98  -62.82  999.9  5  114.98  -62.78  999.9  6  114.98  -62.74  0.063  7  114.98  -62.7  0.063  8  114.98  -62.66  999.9  9  114.98  -62.62  999.9  10  114.98  -62.58  999.9  11  114.98  -62.54  999.9  12  114.98  -62.5  999.9  13  114.98  -62.46  999.9  14  114.98  -62.42  999.9  15  114.98  -62.38  999.9  16  114.98  -62.34  999.9  17  114.98  -62.3  999.9  18  114.98  -62.26  999.9  19  114.98  -62.22  999.9  20  114.98  -62.18  999.9  21  114.98  -62.14  999.9  22  114.98  -62.1  999.9  23  114.98  -62.06  999.9  24  1I currently use SeaDAS 7.5.3 in Windows 10. I am familiar with extracting data along a ship track, but is there any way to generate such a file for the entire image, pixel by pixel as above? Any help would be very much appreciated. Thank you.Cheers,Kali

Exporting Pixel Info

Posted: Wed Sep 23, 2020 8:16 am America/New_York
by OB.DAAC - SeanBailey
Kali,
Welcome back :grin:

SeaDAS 7 does offer a similar ASCII output.   There is an option to export the data as a CSV file (although the C in this case isn't comma, it's character and that character is a tab...)
You can access this feature from the main menu: "File->Export->CSV"

Regards,
Sean

Exporting Pixel Info

Posted: Wed Sep 23, 2020 8:17 am America/New_York
by gnwiii
From the web version of SeaDAS Help/File I/O & Sessions/Export Tools/Raster Data/CSV: Export CSV.

Since you appear to be using mapped data, it is worth mentioning that there are many 3rd party tools to create CSV files for mapped data formats.   In the past, I have used the R stats package to export image data to CSV files.   CSV export is a common capability in GIS software.   For command-line processing, GDAL's gdal_translate can be used to write CVS files.

Exporting Pixel Info

Posted: Mon Sep 28, 2020 11:17 am America/New_York
by kmckee
Thank you both for getting back to me. I tried the Export CSV Product feature in SeaDAS itself, but the file did not include latitude and longitude values. I also did not see the Tie-Point Grid Subset tab under the Specify Product Subset dialog. This is probably just something silly on my part, but please advise when you have a chance. Thank you.

Cheers,
Kali

Exporting Pixel Info

Posted: Mon Sep 28, 2020 12:59 pm America/New_York
by gnwiii
If the "much older" version of SeaDAS was a version prior to version 7 then it was based on IDL, a full-featured image processing language and used non-standard file formats.   SeaDAS 7 lacks some features available in older versions, but uses widely supported file formats that can be used with 3rd party GIS tools such as QGIS or ArcGIS.

The tie-point grid tab may only be present for files that contain scanline data, e.g., unmapped.  

If your file is a format supported by GDAL you can try using gdal_translate with the "XYZ" output format to get an ASCII file with latitude, longitude, and data values.

Exporting Pixel Info

Posted: Wed Sep 30, 2020 8:40 am America/New_York
by OB.DAAC - SeanBailey
Ah, if you are using the SMI files, they don't have the lat/lon values as full arrays, so the csv export won't write them out.  But it can be done with a little trickery...  I had a vague feeling this issue came up before...it has, and seems I answered this very question a few years ago :grin:

https://oceancolor.gsfc.nasa.gov/forum/oceancolor/topic_show.pl?pid=24149#pid24149

Hope this helps,
Sean