PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 29 Oct 2020 12:13 PM by  Mari Minari
reading and processing multiple bands into one big file
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

David Hein-Griggs



New Member


Posts:
New Member


--
24 Oct 2020 06:30 PM
    Hello,
    I am helping a PhD student automate processing of hundreds of huge satellite imagery files.
    These imagery files have been split into individuals files per band in the process of correcting metadata in a previous step.
    These band files all have the same names -- only the directory names are different based on the name of the source satellite imagery file.

    29/09/2020 00:31 644 alpha.bin.hdr
    29/09/2020 01:24 419,576,868 alpha.bin.img
    [snip]
    29/09/2020 00:31 657 yamaguchi4_y4o_vol.bin.hdr
    29/09/2020 01:25 419,576,868 yamaguchi4_y4o_vol.bin.img

    There are 66 *.img files and 66 corresponding *.hdr files.

    I need to read all these files into IDL then output into one single huge file (with 66 bands).
    In ENVI when I do this with Basic Tools --> Layer Stacking the output file loses the band names (it gives Band 1 - Band 66).
    I can correct this by Edit Band Names Values --> import ASCII (where I have a text file with the correct band names in order).
    I would like to avoid having to do this (i.e. the output file does not use Band 1 - Band 66 but uses alpha.bin.img - yamaguchi4_y4o_vol.bin.img as the band names -- basically the band name is taken from the input *img layer name).

    The big output file needs to be aggregated (nearest neighbour) to 0.000913 degrees in WGS84 (the source data is WGS84 0.000058 degrees) in the step to write it out.

    From there I need to select ROIs in the big processed file and output values to CSV files, but I am more confident in getting this step done.

    Can anyone help?

    I have a good grasp of directory navigation in IDL, looping and IDL regular expressions. It is only the read multiple bands--> stack them -->output with correct band names and at the correct resolution steps I am not sure about.

    Many thanks in advance,
    David












    Mari Minari



    Veteran Member


    Posts:2320
    Veteran Member


    --
    29 Oct 2020 12:13 PM
    I still think the most efficient way to do this is to use Layer Stacking or in the API: https://www.l3harrisgeospatial.com/docs/envibuildlayerstacktask.html
    I found that it did pass on the band names but not wavelengths so you would then need to use ENVIRasterMetadata::AddItem: https://www.l3harrisgeospatial.com/docs/ENVIRasterMetaData__AddItem.html
    You are not authorized to post a reply.