Reprojection s3 slstr issue

Hello there!
I need some advice!
I have to reproject source data with gpt / python ,but always got same isse “cannot construct databuffer”

I can reproject with desktop app snap though… Raster->Reprojection.

code:
import snappy
import sys
from snappy import ProductIO

ReprojectOp = snappy.jpy.get_type(‘org.esa.snap.core.gpf.common.reproject.ReprojectionOp’)

in_file = snappy.File(‘C:\Sentinel3a\RGB\S3A_SL_1_RBT____20161209T231902_20161209T232202_20161210T123755_0179_012_030_1979_SVL_O_NR_002.SEN3\xfdumanifest.xml’)
out_file = ‘C:\Sentinel3a\RGB\reproj.dim’

reader500 = snappy.ProductIO.getProductReader(‘Sen3_SLSTRL1B_500m’)

product500 = reader500.readProductNodes(in_file, None)
width = int(product500.getSceneRasterWidth())
print width
print product500.getName()
print product500.getProductReader().getReaderPlugIn()

op = ReprojectOp()
op.setSourceProduct(product500)
op.setParameter(‘crs’,‘EPSG:21781’)
op.setParameter(‘resampling’,‘Nearest’)

sub_product = op.getTargetProduct()

ProductIO.writeProduct(sub_product, out_file, “BEAM-DIMAP”)

Thanks

Hi,

simple things first. You can simplify the reading of the product.

reader500 =  snappy.ProductIO.readProduct(in_file, 'Sen3_SLSTRL1B_500m')

I think this will work.
Regarding the memory issue. You can configure how much memory can be used. Please see this post:

still same issue. It also happens when I launce graph with “reproject”
is there any way to reproject not all data from source but few (for example only S1-S3_radiance) ?

You can use the Subset operator. You can use it before or after the Reproject operator.
As a general note, it is better to use GPF.createOperator('Reproject', ...) to invoke the operators.
See the example in this thread:

How is your system equipped with memory? I really wonder why you still get this error after editing the memory setting. To which value you have you set it?

Hey there!
I have 16gb mem. I also wonder why this script fails. Desktop Snap raster -> reprojection works perfectly. Desktop snap graph builder doesn’t work (same error)

I edited files there:
c:\Users\username.snap\snap-python\snappy\
both file jpyconfig.py :

jvm_maxmem = ‘6G’

and snappy.ini
#…
java_max_mem: 6G
#…

regards

P.S. I’ll try to use reproj for few bands. Hope this’ll work.

Have you been lucky?
Maybe you try to execute your processing chain directly from the command line without Python.
You can create the graph with the graph Builder and store it as file.
Then you can execute it with gpt.
You can change memory settings for gpt in the gpt.vmoptions file. You’ll find several posts about it.
Additionally you can set the -c option. This allows to set a bigger cache size.
Call gpt -h for some more help.

Hey there!
Pretty hard API. Still trying to understand how to reproject only 2 bands from source product sen3. I have to spend more time for it than i thought.
gpt reproj.xml failed with same error. I’ll try to add more mem for gpt.

I’ll reply what i’ll get .
Thanks for you work!
Regards!

Hello !
Well I set maximum memory in gpt.vmoptions file to 6G and It’s finally works!

Still no clear understanding of how to work with sen3 data.
At least I can reproject some source data at scripts with gpt
Thanks very much for your help!
Regards