|
POST
|
It's just a value used to make sure the output integers are in the appropriate range. For example, NDVI (a vegetation index) ranges from -1.0 to 1.0. If I wanted to store it as an integer between 0 and 1000 I could use a scale factor of 500 and an offset of 500. e.g. -1 * 500 + 500 = 0 and 1 * 500 + 500 = 1000. As your offset is 0, to convert your values to float just use value * scale factor. As an aside, the ATBD notes that: It is probably confusing to most users that the HDF convention calls the offset �??add_offset�?� even though it�??s subtracted from the stored integer when unpacking the da- ta. It seems likely that this terminology originated from the programmer�??s, and not the end user�??s, perspective, since to pack the data the offset is added.
... View more
02-13-2012
08:32 AM
|
0
|
0
|
1274
|
|
POST
|
I'm not familiar with the MODIS atmosphere products, but a quick scan of the Algorithm Theoretical Basis Document shows that you need to apply a scale factor and offset to convert the values to floating point. 5.1. Descaling the SDS data The local attributes �??scale_factor�?� and �??add_offset,�?� attached to each and every SDS, are used for the conversion of stored (packed) SDS integer data to geophysical floating point numbers. The formula to descale the data follows conventional HDF usage (see HDF User�??s Guide): Geophysical Float Value = scale_factor * (Stored Integer - add_offset). The units of the unpacked geophysical floating point value are indicated by the �??units�?� local attribute that is also provided with each SDS. The �??valid_range�?� local attribute applies to the packed data (before de-scaling). The two valid range values given are the expected low and high values of valid (non-fill) packed data.
... View more
02-12-2012
10:37 AM
|
0
|
0
|
1274
|
|
POST
|
IDL doesn't use ENVI georeferencing. The map info is lost from the time you export the data to IDL arrays. Just right click on the layer in the available bands window after you import the deglinted array back into ENVI, edit the header and import the header from the original glint affected image.
... View more
01-27-2012
12:42 AM
|
0
|
0
|
1998
|
|
POST
|
What version of ENVI do you have? You could also try (after opening the image in ENVI, selecting the ROI, exporting variables etc...) in the IDL Workbench, create a new file, paste my code in, save it and then click compile then click run.
... View more
01-18-2012
08:57 PM
|
0
|
0
|
1998
|
|
POST
|
That piece of code ran fine for me when when I changed the file paths to actual rasters. Make sure your paths don't have any spaces in them.
... View more
01-18-2012
02:36 PM
|
0
|
0
|
1290
|
|
POST
|
That's a different error to your previous post. Are you typing it in or copying it? There should be a space between "do" and "begin".
... View more
01-18-2012
12:51 PM
|
0
|
0
|
3389
|
|
POST
|
In ArcToolbox, right click on the Spatial Autocorrelation Moran�??s I tool and select "Batch..."
... View more
01-17-2012
07:02 PM
|
0
|
0
|
449
|
|
POST
|
What three methods? I only recall two. Both the "cookbook" method and my IDL code implement the algorithm detailed in the paper by Hedley et al. (2005) that I linked to. I have not used the "cookbook" method. But it should give the same results, it's doing the same thing. By the way... if you have any land in your image, this method will make it look terrible. As is noted in the paper: the algorithm is valid only for submerged pixels .
... View more
01-17-2012
06:57 PM
|
0
|
0
|
3389
|
|
POST
|
Works for me. I just realised I left in some code I shouldn't have. Try the below (also attached):. nirs=samples[*,*,7]
nird=data[*,*,7]
d=size(nirs,/dim)
i=where(nirs gt 0)
o=where(nird eq 0)
m=min(nirs)
out=0
help, m
foreach b, bindgen(6) do begin
band=samples[*,*,b]
r=linfit(nirs,band)
band=data[*,*,b]
deglint=long(band - r[1] * (nird - m)+0.5)
deglint =0
if size(out, /n_dimensions) eq 0 then $ ;Image stack doesn't exist yet
out=temporary(deglint) $
else $ ;Concatenate image to stack
out=[[[temporary(out)]],[[temporary(deglint)]]]
endforeach
out=[[[temporary(out)]],[[data[*,*,6]]]]
out=[[[temporary(out)]],[[data[*,*,7]]]]
end
An example using the above code: Before [ATTACH=CONFIG]11237[/ATTACH] After [ATTACH=CONFIG]11238[/ATTACH]
... View more
01-17-2012
01:02 PM
|
0
|
0
|
3389
|
|
POST
|
Perhaps try the eval function (I haven't tested this): expression = '(Raster(inRaster1) < var1[0]) & (Raster(inRaster2) > var1[1]) & (Raster(inRaster3) <> var1[2]) & (Raster(inRaster4) == var1[3])'
NewRaster=eval(expression)
... View more
01-16-2012
03:02 PM
|
0
|
0
|
863
|
|
POST
|
Search and ye shall find 😉 http://forums.arcgis.com/threads/14660-Export-raster-statistics?p=74505
... View more
01-16-2012
02:40 PM
|
0
|
0
|
455
|
|
POST
|
It requires a full ENVI+IDL install, not just the ENVI runtime. It also requires you have enough memory to load the entire image into RAM as I didn't bother writing any sort of tiling code, it was just a very rough hack that I whipped up to meet an immediate need. To use my code: Save the code to a file with a ".pro" extension Start "ENVI + IDL" (not ENVI) Load your WV2 image into ENVI. In the main ENVI toolbar click File-> Export to IDL variable and export the WV2 as variable called "data" Create an ROI of a variety of deep ocean areas In the ROI tool dialog, select File->Subset data via ROIs In the main ENVI toolbar click File-> Export to IDL variable and export the subset as variable called "samples" At the ENVI> command prompt in the IDL workbench, type .r <path to>\<script>.pro i.e .r C:\Temp\deglint.pro After the script completes you can get the image back into ENVI using File-> Import from IDL variable (select the "out" variable)
... View more
01-15-2012
03:35 PM
|
0
|
0
|
3389
|
|
POST
|
Have a read of this paper: Hedley et al. (2005) Simple and robust removal of sun glint for mapping shallow-water benthos. International Journal of Remote Sensing Vol. 26, No. 10, 2107�??2112. Step by step instructions to implement this method are available for ENVI (not ArcGIS sorry). I use some IDL code from ENVI to do this instead of the above manual method, though I do generate the samples with the ROI tool by hand):
nirs=samples[*,*,7]
nird=data[*,*,7]
d=size(nirs,/dim)
i=where(nirs gt 0)
o=where(nird eq 0)
m=min(nirs)
m=nirs
m = m[(sort(m))[5 * N_ELEMENTS(m) / 100] ]
out=0
help, m
foreach b, bindgen(6) do begin
band=samples[*,*,b]
r=linfit(nirs,band)
band=data[*,*,b]
deglint=long(band - r[1] * (nird - m)+0.5)
deglint =0
if size(out, /n_dimensions) eq 0 then $ ;Image stack doesn't exist yet
out=temporary(deglint) $
else $ ;Concatenate image to stack
out=[[[temporary(out)]],[[temporary(deglint)]]]
endforeach
out=[[[temporary(out)]],[[data[*,*,6]]]]
out=[[[temporary(out)]],[[data[*,*,7]]]]
end
Again note that these methods are for ENVI, not ArcGIS. You could probably reimplement the code in numpy though.
... View more
01-12-2012
01:16 PM
|
0
|
0
|
3389
|
|
POST
|
For "general slope and aspect" I'd generate an elevation trend surface from your DEM (masked to your polygon): Clip and mask your DEM to the polygon then convert the masked DEM to points, or... Create Random Points constrained by your landslide polygon which you can use to sample the elevation values. Then Generate the elevation trend surface from those points and then calculate slope and aspect from that. Repeat 300 times (batch or script)
... View more
01-12-2012
12:21 PM
|
0
|
0
|
921
|
|
POST
|
Replace python.exe with pythonw.exe in your subprocess call. Pythonw is a non-console version of the python executable.
... View more
12-28-2011
11:17 AM
|
0
|
0
|
677
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-30-2025 03:00 PM | |
| 1 | 06-10-2025 08:06 PM | |
| 5 | 05-20-2025 07:56 PM | |
| 1 | 05-04-2025 10:34 PM | |
| 5 | 04-22-2025 09:04 PM |