I am trying to speed up my Sentinel 2 processing. My graph is below. This graph works and is fast but it produces sections of NaNs (0s) running vertically along on the east and west sides of the outputted TSM tif (see image below). I believe it’s from subsetting using a polygon before resampling using ‘bilinear’ method. I have explored several 'solutions’ that aren’t appropriate:
- using ‘nearest neighbor’ resampling method (although I am aware this does ‘solve’ the problem, it isn’t a good method for the purpose of the study).
- changing the order in which I subset and resample - my current method is the quickest.
- Expanding the region to provide a ‘buffer’ and then cropping out the NaN sections - i need to be able to select a region right against the edge of the tile so expanding the buffer does not help.
Are there any other suggestions for maintaining my fast processing speed but that removes these NaN sections?
<graph id="graph">
<version>1.0</version>
<node id="Read">
<operator>Read</operator>
<sources/>
<parameters>
<file>${sourceProduct}</file>
</parameters>
</node>
<node id="SubsetArea">
<operator>Subset</operator>
<sources>
<sourceProduct refid="Read"/>
</sources>
<parameters>
<geoRegion>POLYGON ((141.4 -12.39, 141.4 -13.21, 142.05 -13.21, 142.05 -12.39, 141.4 -12.39))</geoRegion>
<copyMetadata>true</copyMetadata>
</parameters>
</node>
<node id="Resample">
<operator>Resample</operator>
<sources>
<sourceProduct refid="SubsetArea"/>
</sources>
<parameters>
<referenceBand>B2</referenceBand>
<upsampling>Bilinear</upsampling>
<downsampling>Mean</downsampling>
</parameters>
</node>
<node id="c2rcc">
<operator>c2rcc.msi</operator>
<sources>
<sourceProduct refid="Resample"/>
</sources>
<parameters>
<salinity>35.0</salinity>
<temperature>25.0</temperature>
</parameters>
</node>
<node id="TSMonly">
<operator>BandMaths</operator>
<sources>
<sourceProducts>c2rcc</sourceProducts>
</sources>
<parameters>
<targetBands>
<targetBand>
<name>tsm_conc</name>
<type>float32</type>
<expression>conc_tsm</expression>
</targetBand>
</targetBands>
</parameters>
</node>
</graph>
