Welcome to the BEAM Forum!

We encourage you to sign in our forum and participate in the BEAM community. The forum is maintained by the BEAM project team who will most likely answer your questions within 24 hours (except during common holidays) - if not done by other community members. Collaborate, share your knowledge and learn from other users!

If you don't find what you are looking for, please also consider the following external forums:

Combination View Flat View Tree View
Threads [ Previous | Next ]
RE: cloud masking of modis images
toggle
cloud masking of modis images
band math
4/8/14 5:17 PM
Hi Beam forum,

I'm processing 200 modis images and I'm trying to mask out the cloud sst. Although standard l2 flags are inappropriate to sst data I'm using the l2_flags.CLICE flag as a basis for a cloud mask preventing very low sst values appearing in the images.

I can create a cloud mask band using the bandmaths operator in the gpt tool and simple band multiplication (cloudMask * sst) gives me the desired result.

My question is; is it possible to create a band (cloudMask) and preform band maths using this newly created band in the same xml/gpt operation?

The alternative is to run the data through gpt to create the cloud mask and then again with the cloudMask present as a band in the output data files to do the band maths on sst in a second run through the gpt tool. Unfortunately if I output as .dim format from the first run through gpt I cannot pass it to the gpt tool again (no product reader found). If I output as h5 from the first run through the gpt it cannot read in the h5/nc formats. I manually changed the file extension to .hdf from h5 of a test file and the gpt tool will read in the data but now the cloudMask band had 1's and 0's rather than 1's and NANs contaminating the results. I seem to have found myself in a loop...Maybe this approach is too convoluted and I would appreciate and suggestions ideas from the forum on how best to batch process and cloud mask modis sst images.

Thanks in advance

Kieran
Flag Flag
RE: cloud masking of modis images
4/13/14 1:25 PM as a reply to Kieran Harper.
Hi Kieran,

some advice from my site.
You cannot use the result of a Band Maths operation in itself. But you can have a second node using also Band Maths and the output of the first node. This way you can use the result of one expression in an other within a single xml graph file.

If a *.dim file can not be read, "no product reader found" as you say, it indicates that either the product is corrupt (can you open it in VISAT?) or the BEAM installation is corrupt. However, it as BEAM-DIMAP is the default format of BEAM it should be readable.

Regarding your actual problem, masking the sst I can not help.

best wishes
Marco
Flag Flag
RE: cloud masking of modis images
4/29/14 12:57 PM as a reply to Marco Peters.
Apologies Marco for late reply.

I managed to create a daytime cloud mask for sst with

!l2_flags.CLDICE ? SST : NAN

It seems to be what's required.

thanks for your answers they will be useful for other work I'm doing.

Regards

Kieran
Flag Flag