Silvie Cafarella New Member
Posts:4  
12 Dec 2019 01:02 PM |
|
I have three ASCII arrays: 1) pixel values, 2) upper left corner longitude 3) upper left corner latitude. All 1350 x 1350, reading left-to-right, top-to-bottom, with a 4.5km pixel size. I tried using "Georeference from IGM", however, I have received a number errors, often "Attempt to subscript dxs with is out of range", If I do get an output, it is very strange, 77 X 2330. This is a gdal line with projection information: gdal_translate –a_srs “+datum=wgs84 +proj=stere +lat_0=70.000000 +lon_0=-45.000000” –a_ullr -3400000.000000 3404049.804688 3404049.804688 -3400000.000000 –of Gtiff
|
|
|
|
MariM Veteran Member
Posts:2396  
12 Dec 2019 02:13 PM |
|
To be clear: - you imported 3 arrays from ascii files and created a raster for each that is 1350X.1350, The result is three separate rasters of the same dimensions: one for pixel values, one for latitude and one for longitude? With this data, you should be able to use Georeference from IGM which expects latitude and longitude bands to match the same pixels of band that contains the data. However, - You mention only 'upper left corner longitude/latitude'. Does this mean you only have one coordinate, and not a grid (or raster) of latitude values and another of longitude values? If this is the case, then you can use that one coordinate and go to View Metadata->Edit Metadata and in the Edit ENVI Header dialog, select to add a new attribute of 'spatial reference'. Add in your projection and tie point (upper left corner coordinate). From this information, ENVI will calculate all other pixel locations on the fly. Note that adding spatial reference in this way assumes the image has already been georeferenced. It is only a rough estimate, or completely wrong, if the data has not been georeferenced. For example, it may not be oriented north up and be rotated in another direction.
|
|
|
|
Silvie Cafarella New Member
Posts:4  
12 Dec 2019 02:18 PM |
|
Sorry - I have three rasters. I was referring to the coordinates in the ASCII files being from the upper left corner of each pixel rather than extracted from the center of pixel. My raster image has not been georeferenced before.
|
|
|
|
MariM Veteran Member
Posts:2396  
12 Dec 2019 02:28 PM |
|
How are you setting up the parameters in the Georeference from IGM dialog? Are you selecting a true linear projection for output (not geographic) and a linear pixel size? What is the first error message you encounter? Also, if you display your lat/lon bands and bring up the cursor location tool, do the values look appropriate for your image?
|
|
|
|
Silvie Cafarella New Member
Posts:4  
12 Dec 2019 02:40 PM |
|
Yes. When I display all three rasters together, the input data looks appropriate for my image. I am choosing a Polar Stereographic Projection with a WGS_83 datum. I am unsure of the appropriate pixel size. ENVI autofills the value at 0.154531, is this in degrees? The pixels should be 4500m. I am currenty not getting any errors, but an output of 77 X 2330. It is a long strip with 4 archs, with values of 0.0 and -33.00 (my nodata value) creating the arch.
|
|
|
|
Silvie Cafarella New Member
Posts:4  
12 Dec 2019 02:44 PM |
|
If I set my pixel size to 4500 (m). I receive the error "envi_build_glt_doit: An error has coccured during processing, Error:"Attempt to subscript DXS with < INT ( 1)> is out of range." The result may be invalid.
|
|
|
|
MariM Veteran Member
Posts:2396  
13 Dec 2019 08:36 AM |
|
What if you use a different projection such as LCC? My guess is that the lat/lon images are not providing a good pixel size estimate and yes, it looks like it could be in degrees.
|
|
|
|