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

Possible example to demonstrate manipulating data #10

Open
Rankicker795 opened this issue Mar 6, 2019 · 3 comments
Open

Possible example to demonstrate manipulating data #10

Rankicker795 opened this issue Mar 6, 2019 · 3 comments

Comments

@Rankicker795
Copy link

My group and I are learning SatPy and one of our requirements were to manipulate HRIT data with some limb-correcting schemes. It took us several hours to figure out that we needed to satpy.get to access the data array. Would it be possible to include an example (any satellite platform) that can help demonstrate how to access and change the data array using satpy.get, etc.?

@djhoese
Copy link
Member

djhoese commented Mar 6, 2019

We are actively working on various tutorials that should do a better job of introducing things like this. That said, doesn't the "Quickstart" page of the documentation answer this question? https://satpy.readthedocs.io/en/latest/quickstart.html

You mention satpy.get, what do you mean by that? You should be using scn['name'] for the products you want to load. Also, the reason we have a mailing list, documentation, and a slack channel is so users shouldn't have to spend hours learning something. Don't be afraid to come talk to us. We will work on improving the documentation the best we can with the time we have. Thanks again for creating this issue.

@Rankicker795
Copy link
Author

@djhoese Thanks for the reply.

Let me rephrase what I meant by satpy.get because I realized I said the wrong thing.

So, we have created the Scene object and loaded our wavelength or channel as what was included in the QuickStart guide. What held us up and wasn't included in the QuickStart is that to get the data array in the Scene object is to use scn.get(wavelength) to actually interact with the environment. That "get" call is what I would suggest to include in a tutorial.

As we dive deeper into satpy, we will probably be in contact with your group. I am sure we will have a lot more questions as we go. Thanks again.

@djhoese
Copy link
Member

djhoese commented Mar 6, 2019

See the last line of this quick start section: https://satpy.readthedocs.io/en/latest/quickstart.html#loading-and-accessing-data

You should be using scn[wavelength] or scn['name'] in most cases. I think the issue in the case of the quick start is that it is at the bottom of the section after a huge long print out. @mraspaud we could probably swap these.

Note: The Scene object can be accessed a lot like a dictionary (dict) after data has been loaded so scn['name'] gets the item with the name 'name', scn['name'] = xr.DataArray(...) sets the item, and scn.get('name', default) will get the item from the Scene (same as the bracket/getitem syntax scn['name']), but if it isn't there then return default...which itself defaults to None. This get operation is equivalent to a python dictionary's get method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants