I am using ArcGIS 10 and want to calculate the Latitude and longitude values of each pixel of Landsat image so that I could get radiance values. I will appreciate if someone can help me for the algorithm for raster calculator, if possible.
Do you need so much precision ? taking the coordinates (using getrasterproperties) of the nadir pixel will lead to less than 1 degree of error. This is far less than topographic or atmospheric effects.
Otherwise André's suggestion is a good one, but I would rather convert to points instead of polygons in order to take less disk space. An alternative method would be to interpolate between the extent coordinates (using linear trend, for instance).
Maybe a bit bulky, but I would convert the raster to points directly (should be quicker than polygons) and add the xy coordinates of the points (data management toolbox).
I am not really sure what are you going to do but why don't you save the raster into XYZ ASCII? You will definitely get the last long and the reflectance values.
Finally I am able to get the job done! I tried couple of ways to achieve the X and Y coordinates for each pixel of the image.
First I followed the steps suggested by you and Steve on LInkedin and it did finally worked. Initially I tried for Band B6II and B1 but somehow it did not work and I got error message. Then I tried for band 3 and it did work. It is simple and easy but takes long time for a large image. The details are:
Conversion tools > From Raster to Point
Data Management tools > Features > add XY coordinates
Open DBF in excel to access the values
Later I tried to develop a polygon layer but in a different way. it may help others working on similar activity. I used the Fishnet tool as follows:
Data Management Tool > Feature Class > Create Fishnet tool
Set the output feature class > set the Template Extent to Same as layer < select the Image
Enter the desired point spacing in Cell Size Width and Cell Size Height (as I am using Landsat data so I used 30X30 as per the pixel size)
If using set a cell size, enter 0 for both the number of rows and columns (these will be determined automatically)
Ensure Create Label Points (optional) is checked and set the Geometry Type (optional) to Polygon. Click OK to generate the lattice point labels and polygons.
Open the table of the Point layer and add two columns for X and Y and calculate the X and Y coordinates. When I overlaid the polygon layer on the image, it very well fits to the pixel boarders.
It will again take a long time to process, especially for a large size image but you can get both Polygon and centroid point layers simultaneously.
Thanks once again for all of you to get me started.
I know you have said that you want the Radiance value of each pixel, but what are you going to be using that data for that you need to have the XY coordinates in this format.
Forgive me for asking, but it seems like a cumbersome and exhausting exercise, so I assume you have some cunning master plan in mind for this data?
Shshshshshsh...........it is a secret....do not tell anybody...just kidding :)
You are right that it is a cumbersome job but I need the radiance of each pixel to calculate the sin and cosin of the radiance for each pixel which then will be used to calculate the solar incidence angle of each pixel. This is a one minor component of computations for energy balance equation. Finally I am targeting to calculate the ET surface.
I tried to use raster calculator but could not figure out how to do it. . Actually the image has DN values and the table has histogram values. If you have any idea or know the algorithm for this, I will appreciate your help.
Thanks Gabor for this idea but what I am looking for is a map of Y values that I can use for calculating sin and cosin for each pixel...........so far not much success. I tried to join table of polygon and point layers and then converting polygon layer to raster layer. I can get the XY values in raster but when I tried to extract Y value from raster using raster calculator, it does not recognize the Y column of raster layer.
In ArcGIS raster calculator, use the expression "(((("MaxGain - MinGain)/255) * "Image") + (MinGain)) to convert to Radiance (these values are in your Metadata, but I assume you have them to do the calculations anyway?
Then use the "Sin" and "Cos"tools in the spatial analyst toolbox to calculate the Sin and Cosine of the radiance image.
I've never tried to calculate the solar incidence angle though... (but don't tell anyone that there is something I don't know!)