Batch processing in Seadas
Batch processing in Seadas
I am trying to crop with lat and long values and reproject multiple chlorophyl L2 files. I used my algorithm to process MODIS L1 to cholophyll L2 using Matlab. I am getting error croping and reprojecting in Matlab. I think using seadas is a better option to do that. any help is appreciated.
Filters:
-
- Subject Matter Expert
- Posts: 711
- Joined: Tue Feb 09, 2021 5:42 pm America/New_York
- Been thanked: 9 times
Re: Batch processing in Seadas
Here is the help page for reprojection -- https://seadas.gsfc.nasa.gov/help-8.3.0/desktop/Reprojection.html
Here is the Reprojection cookbook -- https://seadas.gsfc.nasa.gov/help-8.3.0/GptCookbook/gptCookbookReproject.html
Here is the Reprojection cookbook -- https://seadas.gsfc.nasa.gov/help-8.3.0/GptCookbook/gptCookbookReproject.html
Re: Batch processing in Seadas
Yes. Thank you for your response.
This method is allowing me to reproject single file. Is there any other way I can reproject multiple files?
This method is allowing me to reproject single file. Is there any other way I can reproject multiple files?
-
- Subject Matter Expert
- Posts: 306
- Joined: Mon Apr 07, 2008 4:40 pm America/New_York
- Been thanked: 3 times
Re: Batch processing in Seadas
You can use l2bin followed by l3mapgen:
1. Use l2bin to combine multiple level-2 files into a single binned file.
2. Then use l3mapgen to create a mapped file.
3. Then if l3mapgen doesn't have the projection you want then you can use the Reproject Tool on the output file of l3mapgen.
Another way would be to use l2bin followed l3mapgen for each level-2 file, which would create multiple mapped files (one for each level-2 file). Then use the Mosaic tool to combine all the mapped files into a single file.
A third way (but perhaps less advisable) is to use the Mosaic Tool directly on all the level-2 files to generate a single file. This will usually work, but the Mosaic Tool isn't optimized to directly handle a lot of level-2 files and things could break with a lot of files.
1. Use l2bin to combine multiple level-2 files into a single binned file.
2. Then use l3mapgen to create a mapped file.
3. Then if l3mapgen doesn't have the projection you want then you can use the Reproject Tool on the output file of l3mapgen.
Another way would be to use l2bin followed l3mapgen for each level-2 file, which would create multiple mapped files (one for each level-2 file). Then use the Mosaic tool to combine all the mapped files into a single file.
A third way (but perhaps less advisable) is to use the Mosaic Tool directly on all the level-2 files to generate a single file. This will usually work, but the Mosaic Tool isn't optimized to directly handle a lot of level-2 files and things could break with a lot of files.
-
- Subject Matter Expert
- Posts: 306
- Joined: Mon Apr 07, 2008 4:40 pm America/New_York
- Been thanked: 3 times
Re: Batch processing in Seadas
... actually a fourth way would be to use the Reproject Tool on each level-2 file. Then use Mosaic Tool to combine all the reprojected files.
-
- Posts: 1519
- Joined: Wed Sep 18, 2019 6:15 pm America/New_York
- Been thanked: 9 times
Re: Batch processing in Seadas
Just a comment on l3mapgen - while it has a set of default projections it supports, it also accepts user defined projections...if it's available in Proj, it's (very likely) available in l3mapgen
Regards,
Sean
Regards,
Sean
Re: Batch processing in Seadas
Hi Knowles,
Thanks for the response. Tried doing the first method but again l2bin takes single L2 file. So I tried using file list (l32003.txt) as this one in the ifile
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030523T194500.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030530T195000.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030601T194000.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030608T194500.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030609T185000.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030617T194000.L2._Rrs_chl.nc
but that disabling the ofile. I have attached the screenshot with this comment. If there is any solution such as this one viewtopic.php?t=4378 that would be easier.
Other methods is same as manual reprojections of files and I have 100s of images.
Thanks for the response. Tried doing the first method but again l2bin takes single L2 file. So I tried using file list (l32003.txt) as this one in the ifile
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030523T194500.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030530T195000.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030601T194000.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030608T194500.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030609T185000.L2._Rrs_chl.nc
/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030617T194000.L2._Rrs_chl.nc
but that disabling the ofile. I have attached the screenshot with this comment. If there is any solution such as this one viewtopic.php?t=4378 that would be easier.
Other methods is same as manual reprojections of files and I have 100s of images.
- Attachments
-
- Screenshot 2023-08-25 at 1.22.29 PM.png (128.81 KiB) Not viewed yet
-
- Subject Matter Expert
- Posts: 711
- Joined: Tue Feb 09, 2021 5:42 pm America/New_York
- Been thanked: 9 times
Re: Batch processing in Seadas
l2bin should take a list of L2 files as ifile. If your L2 files do not have SeaDAS L2 format, l2bin might have trouble to come up with an ofile name. Can you do
SeaDAS has another tool mapgen that also takes a list of files as ifile, bins them together and creates a mapped file -- https://seadas.gsfc.nasa.gov/help-8.3.0/processors/ProcessMapgen.html
If mapgen also disables the ofile textfield, you can try this on the command line (command line help is at the bottom of the help page)
Code: Select all
obpg_file_type /Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.20030523T194500.L2._Rrs_chl.nc
If mapgen also disables the ofile textfield, you can try this on the command line (command line help is at the bottom of the help page)
Code: Select all
mapgen -i /Users/gulfcarbon/Desktop/Chlorophyll_MODIS/l2files.txt -o /Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.2003052320030617.L3m.nc --product chlor_a --oformat netcdf4
Re: Batch processing in Seadas
I have the L2 root file
(base) Euricos-iMac:~ gulfcarbon$ /Users/gulfcarbon/ocssw/bin/obpg_file_type /Users/gulfcarbon/AQUA_MODIS.20030103T192000.L2.OC_BFW.nc
AQUA_MODIS.20030103T192000.L2.OC_BFW.nc: MODIS Aqua: Level 2.
Chl.nc file came unknown: unknown
It is better to work with the root file rather than changing the metadata of processed chlorophyll file. If I like to georeference list of files L2 files, how to write the .par file?
Like I can start as this in the par file
[main]
ifile=/Users/gulfcarbon/Downloads/MODIS_L1A/ifile_text/reproject.txt
odir=/Volumes/IomegaHDD/Reproject
what to add as other other command such as resolution, Datum etc.?
for reference I have this WKT while I am using the Reprojection feature in Seadas GUI
GEOGCS["WGS84(DD)",
DATUM["WGS84",
SPHEROID["WGS84", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH],
AUTHORITY["EPSG","4326"]
(base) Euricos-iMac:~ gulfcarbon$ /Users/gulfcarbon/ocssw/bin/obpg_file_type /Users/gulfcarbon/AQUA_MODIS.20030103T192000.L2.OC_BFW.nc
AQUA_MODIS.20030103T192000.L2.OC_BFW.nc: MODIS Aqua: Level 2.
Chl.nc file came unknown: unknown
It is better to work with the root file rather than changing the metadata of processed chlorophyll file. If I like to georeference list of files L2 files, how to write the .par file?
Like I can start as this in the par file
[main]
ifile=/Users/gulfcarbon/Downloads/MODIS_L1A/ifile_text/reproject.txt
odir=/Volumes/IomegaHDD/Reproject
what to add as other other command such as resolution, Datum etc.?
for reference I have this WKT while I am using the Reprojection feature in Seadas GUI
GEOGCS["WGS84(DD)",
DATUM["WGS84",
SPHEROID["WGS84", 6378137.0, 298.257223563]],
PRIMEM["Greenwich", 0.0],
UNIT["degree", 0.017453292519943295],
AXIS["Geodetic longitude", EAST],
AXIS["Geodetic latitude", NORTH],
AUTHORITY["EPSG","4326"]
-
- Subject Matter Expert
- Posts: 711
- Joined: Tue Feb 09, 2021 5:42 pm America/New_York
- Been thanked: 9 times
Re: Batch processing in Seadas
Here is the command line help of mapgen -- https://seadas.gsfc.nasa.gov/help-8.3.0/processors/ProcessMapgen.html#cl
You can add --resolution --projection as the argument.
You can also do
The example content of mapgen-par12345.par can be
ifile=/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/l2files.txt
ofile=/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.2003052320030617.L3m.nc
product=chlor_a
projection=lambert
oformat=netcdf4
You can add --resolution --projection as the argument.
Code: Select all
mapgen -i /Users/gulfcarbon/Desktop/Chlorophyll_MODIS/l2files.txt -o /Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.2003052320030617.L3m.nc --product chlor_a --oformat netcdf4
Code: Select all
mapgen -p mapgen-par12345.par
ifile=/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/l2files.txt
ofile=/Users/gulfcarbon/Desktop/Chlorophyll_MODIS/AQUA_MODIS.2003052320030617.L3m.nc
product=chlor_a
projection=lambert
oformat=netcdf4