X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Jun 2009 06:53 PM by  anon
ENVI batch mode problem
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
01 Jun 2009 06:53 PM
      Hi all, Because the large amount of image data, I have to use the batch model of ENVI. My aim is to registrate the images in the batch model. Coordinate info of each image is in the .pts file using the same file name as the images. The projection is set up using the parameters, and the image dat files contain only the grey values. The IDL programme can be compiled successfully, so does the Running Process, but the out file titled with "test" contains nothing. The batch.txt file shows as following: ENVI Error [Thu May 14 09:04:10 2009] envi_register_doit: An error has occurred during processing Error: "Array dimensions must be greater than 0." The result may be invalid. The IDL code is below, and the version of IDL is 6.4.1: forward_function envi_translate_projection_units, $   envi_proj_create pro example_envi_register_doit   ;   ; First restore all the base save files.   ;   envi, /restore_base_save_files   ;   ; Initialize ENVI and send all errors   ; and warnings to the file batch.txt   ;   envi_batch_init, log_file='batch.txt'   ;   ; Open the input file   ;   envi_open_file, ‘image.dat', r_fid=fid   if (fid eq -1) then begin     envi_batch_exit     return   endif   ;   ; Set the DIMS and POS to keywords   ; to processes all spatial and all   ; spectral data. Output the result   ; to disk.   ;   envi_file_query, fid, ns=ns, nl=nl, nb=nb   dims = [-1, 0, ns-1, 0, nl-1]   pos  = lindgen(nb)   out_name = 'test'   ;   ; Setup the points file with the map   ; coordinates for know pixel locations and   ; create projection for the map coordinates.   ; Set the output pixel size to 30 meters.   ;   openr,lun,’image.pts',/get_lun pts=DblArr(4,nl*2) readf,lun,pts free_lun,lun   ;   ; Create the projection of the map coordinates   ; ; Define the PARAMS values ; Params =[1737400.0, 1737400.0, -90.000000, 0.000000, 0.0, 0.0] ; ; Define the Datum and projection name datum = 'Moon' name = 'Moon South Polar Stereographic' ; ; Create the projection ; units = envi_translate_projection_units('Meters') proj = envi_proj_create(type=31, $   name=name, datum=datum, params=params) pixel_size = [120., 120.]     ;   ; Perform the image-to-map registration.   envi_doit, 'envi_register_doit', $     w_fid=fid, w_pos=pos, w_dims=dims, $     method=6, out_name=out_name, $     pts=pts, pixel_size=pixel_size, $     proj=proj, r_fid=r_fid   ;   ; Exit ENVI   ;   envi_batch_exit end regards,

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    03 Jun 2009 11:57 AM
    Have you tried setting up this same projection in the Custom map projections using the ENVI tools?  Can you project your image in ENVI (not batch) using the same points and custom projection?  If so, then it may be an issue with your code but I cannot see anything wrong with it.  If not, it leads me to believe the problem may be in the registration points or projection parameters themselves.  The array dimensions error is often a problem with the output image size that is estimated from the projection or the pixel size used in the projection.  You may be able to see what is going wrong if you try this first using the registration tools within ENVI.

    Deleted User



    New Member


    Posts:
    New Member


    --
    04 Jun 2009 02:44 AM
    Dear Mminari, Thank you for you reply! I have defined a projectiong in ENVI, and succeed in processing the same image with the same projection. The reason why I tried to use the batch mode is due to the huge amount of images. I have changed the pts array into coordingates using the formulary: X=R*cos( lat )*cos( lon); Y=R*cos( lat )*sin( lon)(R=1737400m) Then it is ok. However, the errors of the image is unacceptable, and there is about 2 degrees different between the one generated by ENVI Registration Tools(no batch) and the one by batch mode. On the other hand, when I change the parameters of the projection in order to project other images into Moon Mercator Projection, the result is curious, it seems to do it as the Moon Polar Stereographic Projection as I have metioned above. Of course, the results are wrong! regards!

    Deleted User



    New Member


    Posts:
    New Member


    --
    11 Jul 2009 10:47 PM
    no one knows?
    You are not authorized to post a reply.