Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MERSI-2 250meters corrected refl. #1154

Closed
jee34 opened this issue Apr 17, 2020 · 3 comments
Closed

MERSI-2 250meters corrected refl. #1154

jee34 opened this issue Apr 17, 2020 · 3 comments
Assignees
Labels

Comments

@jee34
Copy link

jee34 commented Apr 17, 2020

Hi, i am new to write here on Github.
Satpy is fantastic, works well.
Ok here is the thing:
Mersi-2 true color is available with Rayleigh and correcred reflectance for 1000m resolution only because SZA data is only available in the 1000m resolution HDF file.
Is it possible to use the 1000m SZA data with the 1000m hdf file and interpolate it to 250m?
That way, it would be possible to create a 250m resolution picture with true color and including corrected reflectance and Rayleigh correction. Thank you.

@djhoese djhoese self-assigned this Apr 19, 2020
@djhoese
Copy link
Member

djhoese commented Apr 19, 2020

The MERSI-2 reader allows for datasets to be loaded at whatever resolution you provide. So if you only provide 1000m input files then that's the only resolution available. If you also provide 250m resolution files then the 250m versions of the datasets will be loaded by default (default is to load the highest quality resolution possible). As you've pointed out the SZA data is only available at 1000m resolution, but there is a simple way around that in Satpy: the native resampler. For example:

scn = Scene(reader='mersi2_l1b', filenames=[...])
scn.load(['true_color'])
new_scn = scn.resample(resampler='native')
new_scn.save_datasets()

This will create a 250m resolution true_color composite (if you provided the 250m and 1000m resolution files). Initially when you try to load the true_color you will likely see a warning logged saying something like "you need to resample to generate this composite". This is because Satpy is trying to combine bands 1, 2, and 3 at 250m resolution with SZA at 1000m resolution. In the next line the native resampler, by default, will replicate pixels of the SZA to make them 250m resolution. After resampling Satpy automatically re-attempts to create the true_color composite and should succeed. It can then be saved to disk using save_datasets.

Typically the native resampler isn't needed for MERSI-2 because it is polar-orbiting and is typically resampled to a uniform grid (AreaDefinition). This resampling serves the same purpose here where every input dataset will now be at the same resolution (the resolution of the grid being resampled to).

Hopefully this answers your question. If you aren't able to get this to work please post an example of what you are trying to do and we can go from there.

@jee34
Copy link
Author

jee34 commented Apr 19, 2020 via email

@djhoese
Copy link
Member

djhoese commented Apr 19, 2020

Glad it worked for you. And yeah that's an easy "gotcha" to run in to when doing stuff like this.

@djhoese djhoese closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants