Strangely high sst values
Posted: Wed Dec 07, 2022 2:02 pm America/New_York
Hi all, I am just learning how to process satellite images, particularly, learning how to convert L2 images to raster (tif). For this, I am developing a mixed, very basic, R/bash routine (if anyone is interested, you can visit my github: https://github.com/oscarIM/imgsatEasy), that for some reason that I still don't understand or see, I get abnormally high values for sst for a given area.
The only thing the routine does (after downloading the daily l2 files manually) is to go from individual L2 files to individual L3 mapped files, which I then transform to raster, group and calculate according to what I need.
Here is a processing scheme (since the original one is an R loop invoking the binaries of seadas for each file) for a given file:
####L2bin####
infile = 20221201T185501.L2.SST.NRT.x.nc
ofile = 20221201T185501.L2.SST.NRT_1km_L3b_tmp.nc
prodtype="day"
l3bprod ="sst"
resolve =1
verbose="off",
flaguse ="LAND,HISOLZEN",
qual_max=0,
latnorth=-35,
latsouth=-40,
loneast =-75,
lonwest = -70,
area_weighting=0
l2bin infile=${infile} ofile=${ofile} prodtype=${prodtype} l3bprod=${l3bprod} resolve=${resolve} verbose=${verbose} flaguse=${flaguse} qual_max=${qual_max} latnorth=${latnorth} latsouth=${latsouth} loneast=${loneast} lonwest=${lonwest} area_weighting=${area_weighting} > ${infile}"_l2binlog.txt"
####L3bin####
infile = 20221201T185501.L2.SST.NRT_1km_L3b_tmp.nc
ofile = 20221201T185501.L2.L2.SST.NRT_1km_L3m_tmp.nc
prod="sst"
oformat ="netCDF4"
verbose = "off"
l3bin infile=${infile} ofile=${ofile} prod=${prod} oformat=${oformat} verbose=${verbose} > ${infile}"_l3binlog.txt"
####L3mapgen####
ifile=20221201T185501.L2.L2.SST.NRT_1km_L3m_tmp.nc
ofile=20221201T185501.L2_sst_1km_L3mapped.nc
product="sst"
oformat="netcdf4"
resolution="1km"
projection="platecarree"
interp="area"
north=-35
south=-40
west=-75
east=-70
quiet="true"
mask_land="no"
fudge=2
l3mapgen ifile=${ifile} ofile=${ofile} product=${product} oformat=${oformat} resolution=${resolution} projection=${projection} interp=${7} north=${north} south=${south} west=${west} east=${east} quiet=${quiet} mask_land=${mask_land} fudge=${fudge}> ${ifile}"_l3mapgenlog.txt"
Then, in R (in another routine), I group the L3 mapped files according to the temporality I need, convert them to raster, stacked them and calculate some measure (mean, median, etc.). The result of all this, is that some pixels are generated with very high sst values (they are high compared to 4km L3 images downloaded from https://oceancolor.gsfc.nasa.gov/l3/order/ for the same geographic extent and time) or compared to the “expected” for this latitudes
If anyone finds any errors in the L2 to L3 process, I would be very grateful if you could let me know.
Regards
The only thing the routine does (after downloading the daily l2 files manually) is to go from individual L2 files to individual L3 mapped files, which I then transform to raster, group and calculate according to what I need.
Here is a processing scheme (since the original one is an R loop invoking the binaries of seadas for each file) for a given file:
####L2bin####
infile = 20221201T185501.L2.SST.NRT.x.nc
ofile = 20221201T185501.L2.SST.NRT_1km_L3b_tmp.nc
prodtype="day"
l3bprod ="sst"
resolve =1
verbose="off",
flaguse ="LAND,HISOLZEN",
qual_max=0,
latnorth=-35,
latsouth=-40,
loneast =-75,
lonwest = -70,
area_weighting=0
l2bin infile=${infile} ofile=${ofile} prodtype=${prodtype} l3bprod=${l3bprod} resolve=${resolve} verbose=${verbose} flaguse=${flaguse} qual_max=${qual_max} latnorth=${latnorth} latsouth=${latsouth} loneast=${loneast} lonwest=${lonwest} area_weighting=${area_weighting} > ${infile}"_l2binlog.txt"
####L3bin####
infile = 20221201T185501.L2.SST.NRT_1km_L3b_tmp.nc
ofile = 20221201T185501.L2.L2.SST.NRT_1km_L3m_tmp.nc
prod="sst"
oformat ="netCDF4"
verbose = "off"
l3bin infile=${infile} ofile=${ofile} prod=${prod} oformat=${oformat} verbose=${verbose} > ${infile}"_l3binlog.txt"
####L3mapgen####
ifile=20221201T185501.L2.L2.SST.NRT_1km_L3m_tmp.nc
ofile=20221201T185501.L2_sst_1km_L3mapped.nc
product="sst"
oformat="netcdf4"
resolution="1km"
projection="platecarree"
interp="area"
north=-35
south=-40
west=-75
east=-70
quiet="true"
mask_land="no"
fudge=2
l3mapgen ifile=${ifile} ofile=${ofile} product=${product} oformat=${oformat} resolution=${resolution} projection=${projection} interp=${7} north=${north} south=${south} west=${west} east=${east} quiet=${quiet} mask_land=${mask_land} fudge=${fudge}> ${ifile}"_l3mapgenlog.txt"
Then, in R (in another routine), I group the L3 mapped files according to the temporality I need, convert them to raster, stacked them and calculate some measure (mean, median, etc.). The result of all this, is that some pixels are generated with very high sst values (they are high compared to 4km L3 images downloaded from https://oceancolor.gsfc.nasa.gov/l3/order/ for the same geographic extent and time) or compared to the “expected” for this latitudes
If anyone finds any errors in the L2 to L3 process, I would be very grateful if you could let me know.
Regards