Rayleight corr. only Band C01 Goes 16

39 views
Skip to first unread message

Roman SvK

unread,
Jan 15, 2023, 10:42:18 AM1/15/23
to pytroll
Hi All,
Could you me help,
I need short code for rayleight correction only  band C01 from Goes 16
I want comparission band C01 before and after correction
Thanks

Adam Dybbroe

unread,
Jan 16, 2023, 3:08:07 AM1/16/23
to pyt...@googlegroups.com, adam.d...@smhi.se

Roman,

I understood from previous correspondence you were able to derive the reflectance corrections with Pyspectral like demonstrated here:

https://pyspectral.readthedocs.io/en/latest/rayleigh_correction.html

And then these should be subtracted from the observed reflectances.

The "short code" you are asking for is that Python code using Satpy? I am asking because you said you were not programming in Python but using c#.

Cheers

Adam

--
You received this message because you are subscribed to the Google Groups "pytroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/7790b752-a584-4d70-897c-50109d72d2e1n%40googlegroups.com.
-- 
Adam Dybbroe,
Satellite Remote Sensing Scientist
Research lead - Nowcasting and Remote Sensing
Meteorological Research unit, Research and Development
Swedish Meteorological and Hydrological Institute (SMHI)
www.pytroll.org
nwcsaf.smhi.se
www.smhi.se

Roman SvK

unread,
Jan 16, 2023, 11:29:40 AM1/16/23
to pytroll
Adam,
Yes I have rayleight value , I want check my procedure with pytroll ,
I send my output images before and after rayleight correcton I apply cira_stretch formula on image and I make subtracted

cira stretch formula:
log_root = np.log10(0.0223)
denom = (1.0 - log_root) * 0.75
band_data *= 0.01
band_data = np.log10(band_data)
band_data -= log_root
band_data /= denom

I can't get colors like from pytroll ,I don't know what I am doing wrong.

Cheers
Roman



Dátum: pondelok 16. januára 2023, čas: 9:08:07 UTC+1, odosielateľ: Adam
true_color.jpg
goes16_geo_col.jpg

Raspaud Martin

unread,
Jan 18, 2023, 4:21:19 AM1/18/23
to pyt...@googlegroups.com
Hi Roman,

The rayleigh correction should be subtracted before the cira stretch is
applied.

Could you give us a link to the image you get, maybe that can help us
help you better?

Best regards,
Martin

Roman SvK

unread,
Jan 18, 2023, 11:17:16 AM1/18/23
to pytroll
Hi Martin,
I am sending images , It's Band C01 original image, after correction without cira stretch and correction + cira stretch Red band is applied,
It 's quite dark
Best regards, Roman
image original.jpggoes16_cref.jpggoes16_cref_cira.jpg

Dátum: streda 18. januára 2023, čas: 10:21:19 UTC+1, odosielateľ: Raspaud Martin

Raspaud Martin

unread,
Jan 19, 2023, 7:27:51 AM1/19/23
to pyt...@googlegroups.com
Hi Roman,

I think what you need is to apply sun zenith angle normalisation to the
reflectances first.

Best regards,
Martin

On Wed, 2023-01-18 at 08:17 -0800, Roman SvK wrote:
> Hi Martin,
> I am sending images , It's Band C01 original image, after correction
> without cira stretch and correction + cira stretch Red band is
> applied,
> It 's quite dark
> Best regards, Roman
>
>

Roman SvK

unread,
Jan 19, 2023, 9:44:45 AM1/19/23
to pytroll
Hi Martin,
How make sun zenith angle normalisation please,
Thanks,
Best regards, Roman

Dátum: štvrtok 19. januára 2023, čas: 13:27:51 UTC+1, odosielateľ: Raspaud Martin

Raspaud Martin

unread,
Jan 19, 2023, 10:07:57 AM1/19/23
to pyt...@googlegroups.com
Hi Roman,

This should do it:

from satpy.dataset import DataQuery

dq = DataQuery(name="C01", modifiers=("sunz_corrected",
"rayleigh_corrected"))
scn = Scene(filenames=files, reader='abi_l1b')
scn.load([dq])

Best regards,
Martin

Roman SvK

unread,
Jan 19, 2023, 11:04:46 AM1/19/23
to pytroll
Hi  Martin,
I get any error , Where I can found code how apply sun zenith angle normalisation please?
Thanks ,
Best regards Roman.
sun_z.jpg

Dátum: štvrtok 19. januára 2023, čas: 16:07:57 UTC+1, odosielateľ: Raspaud Martin

Raspaud Martin

unread,
Jan 19, 2023, 11:26:07 AM1/19/23
to pyt...@googlegroups.com
Hi Roman,

this is not an error, it's just a message to tell you that you need to
resample to get access to the image. For example:

newscn = scn.resample(resampler="native")
newscn.show(dq)

But if you want to see the code, it's here:
https://github.com/pytroll/satpy/blob/4de45f2343228e0458080b07c0672c04389a4bd2/satpy/modifiers/geometry.py#L33

Best regards,
Martin

On Thu, 2023-01-19 at 08:04 -0800, Roman SvK wrote:
> Hi Martin,
> I get any error , Where I can found code how apply sun zenith angle
> normalisation please?
> Thanks ,
> Best regards Roman.
>
>

Roman SvK

unread,
Jan 20, 2023, 11:31:37 AM1/20/23
to pytroll
Hi Martin
I tried this one code but I get error "No dataset areas available"
Thanks for help
Best regards Roman.


from satpy.dataset import DataQuery
from satpy import Scene
from glob import glob
from pyspectral import rayleigh


dq = DataQuery(name="C01", modifiers=("sunz_corrected","rayleigh_corrected"))
scn = Scene(filenames=glob('D:/E1H-TPG-1/*20192911250339*.nc') ,reader='abi_l1b')

newscn = scn.resample(resampler='native')
newscn.show(dq)



Dátum: štvrtok 19. januára 2023, čas: 17:26:07 UTC+1, odosielateľ: Raspaud Martin

Roman SvK

unread,
Jan 21, 2023, 3:03:25 AM1/21/23
to pytroll
Hi Martin,
I have it C01 band after sunz_corrected and rayleigh_corrected from pytroll code
c01.jpg

Dátum: piatok 20. januára 2023, čas: 17:31:37 UTC+1, odosielateľ: Roman SvK

Roman SvK

unread,
Jan 21, 2023, 11:50:33 AM1/21/23
to pytroll
Result my program  in c#
Thanks for Help guys Martin and Adam:)
Best Regards Roman

goes16_geo_col.jpg
Dátum: sobota 21. januára 2023, čas: 9:03:25 UTC+1, odosielateľ: Roman SvK

Raspaud Martin

unread,
Jan 23, 2023, 4:02:27 AM1/23/23
to pyt...@googlegroups.com
Glad you got is working!

Best regards,
Martin

On Sat, 2023-01-21 at 08:50 -0800, Roman SvK wrote:
> Result my program in c#
> Thanks for Help guys Martin and Adam:)
> Best Regards Roman
>
>
> Dátum: sobota 21. januára 2023, čas: 9:03:25 UTC+1, odosielateľ:
> Roman SvK
> > Hi Martin,
> > I have it C01 band after sunz_corrected and rayleigh_corrected from
> > pytroll code
> >
> >
Reply all
Reply to author
Forward
0 new messages