X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07 May 2015 06:19 AM by  anon
Problems with saving files
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
07 May 2015 06:19 AM
    Hi! I am new in IDL. I have several hypercubes with 12-16 bands. I just want to take first band from the first hypercube and save it in one folder, then the first band from the next hypercube in the same folder. The process continue until the last band from the last hypercube... I write a script from one band, but it didn't work because '' Execution halted at : ENVI'' - error.. pro IDL_startup compile_opt IDL2 input_path = 'D:\Rares\k12' envi_open_data_file, '23_04_2015_09h43m04_K0012_B1_B12_geom_resampled', r_fid = fid1 envi_file_query, fid1, ns=ns, nl=nl dims = [-1, 0, ns-1022, 0, nl-1024] fid = [fid1] pos=[0] CD, 'D:\Bands\Band_1' envi_doit, 'cf_doit', fid=fid, pos=pos, dims=dims, $ out_name = "Bandm1", r_fid = r_fid end If someone can help i will be greatfull!!

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    07 May 2015 12:42 PM
    If you are running your code in IDL-only, you will need to restore the ENVI base save files and initialize batch mode. For example: PRO TEST COMPILE_OPT IDL2 ENVI, /RESTORE_BASE_SAVE_FILES ENVI_BATCH_INIT, LOG_FILE=’batch.log’ ; Batch processing goes here ENVI_BATCH_EXIT END If you do have the above statements in your code, could you post the full error message you receive running your code?

    Deleted User



    New Member


    Posts:
    New Member


    --
    08 May 2015 07:20 AM
    Thank you for your help! The program opens ENVI and save an empty file, so I've changed the script from 'open_data_file' with 'envi_select' and the program stop working after the changes.. Here is the error! Syntax error LINE 8, Execution halted at : $ MAINS$ envi_select [,/band_only][,dims=(-1, 0, 1022, 0, 1024)][,fid=1][,file_type=envi_file_type('ENVI Standard')][,pos=0][,/roi][,title='23_04_2015_09h43m04_K0012_B1_B12_geom_resampled'] I can't open the fisrt band which i want to save.. Here is the script i've wrote again: pro IDl_startup compile_opt IDL2 ENVI, /restore_base_save_files envi_batch_init, log_file='batch.log' input_path = 'D:\Rares\k12' envi_file_query, fid, file_type=file_type envi_select [,/band_only][,dims=(-1, 0, 1022, 0, 1024)][,fid=1][,file_type=envi_file_type('ENVI Standard')][,pos=0][,/roi][,title='23_04_2015_09h43m04_K0012_B1_B12_geom_resampled'] Cd, 'D:\Bands\Band_1' envi_doit, 'cf_doit', fid=did, pos=pos, dims=dims, $ out_name = "Bandm13", r_fid = r_fid envi_batch_exit end I'm waiting for your answer, thanks again!

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    08 May 2015 08:06 AM
    Rares, A syntax error means that the command you are trying to tell IDL to do is incorrect. There is something that is not quite correct about the 8th line in your code, which turns out to be the ENVI_SELECT procedure. It looks like it is how you included all of the square brackets "[ ]" in your code. For the examples in the documentation, these are used to differentiate between inputs and are not actually used when you call the procedure. I would recommend looking at the documentation regarding the syntax for this procedure and, specifically, the example code that is included near the bottom of the page.That should give you an idea of what you need to fix Here is the link: http://www.exelisvis.com/docs/ENVI_SELECT.html
    You are not authorized to post a reply.