I was able to convert an L1A file (A2018175065500.L1A_LAC to be precise) to L1B using the getanc.py, modis_GEO.py and modis_L1B.py scripts.
The results seem to be in HDF. Is there some option I can use to get netCDF L1B output instead?
Also three output files are created - ...L1B_HKM, ...L1B_LAC and ...L1B_QKM. What are the differences between them?
The MODIS L1B code outputs HDF as that is what it outputs - no, there is no option to have it output netCDF...although you *can* run the resulting L1B HDF file through l1bgen_generic and generate a generic L1B file in netCDF format if you desire....but it's not necessary if you're going to use l2gen to process for atmospheric correction.
The three files are because there are three resolutions 1km, 500m and 250m - not all bands are at all resolutions, e.g. only 645 and 859 are at 250m.
I'm getting an error when trying to use l1bgen_generic:
>l1bgen_generic ifile=A2018175065500.L1B_LAC ofile=A2018175065500.L1B_LAC.nc
Input file A2018175065500.L1B_LAC is MODIS Aqua Level-1B HDF-EOS product.
-W- /home/seadas/ocssw/src/l2gen/l1_hmodis_hdf.c:399: Cannot open file:
Error reading ; please specify a valid geolocation file.
There is a A2018175065500.GEO in the same directory as A2018175065500.L1B_LAC. Is there a command line parameter I'm missing?
This is no longer an L1B question but since I already have this thread going I'll ask it anyway...
I want to select Rrs_645, Rrs_859, Rrs_1240 an l2_flags as my custom L2 products. I see the l2prod flag in the l2gen command line help but don't know what to set it to in order to get those. Can you please give me a pointer? Thank you.
- Subject Matter Expert
- Posts: 224
- Joined: Mon Apr 07, 2008 4:40 pm America/New_York
Here's a sample l2gen command:
l2gen ifile=A2018175065500.L1B_LAC geofile=A2018175065500.GEO ofile=A2018175065500.L2_LAC_RRS l2prod="Rrs_645,Rrs_859,Rrs_1240" resolution=500
The product "l2_flags" will automatically get created so you don't need to specify that.
Note the native instrument resolution: 645 and 859 are 250m; 1240 is 500m. Running l2gen at 500 resolution will preserve 1240 and downsample 645 and 859. Likewise, running l2gen at 250 resolution will upsample (interpolate) 1240 and preserve 645 and 859. No specification for resolution will downsample everything to 1km resolution (default).