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

Code formatting cleanup #115

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Code formatting cleanup #115

merged 2 commits into from
Aug 20, 2024

Conversation

alexgleith
Copy link
Contributor

@alexgleith alexgleith commented Aug 20, 2024

  • Minor changes to code, like var is True rather than var == True.
  • Changed to isinstance(filepath, S3File) rather than type(filepath) == S3File because my linter said that the latter wouldn't work (lead to unreachable code)

openjournals/joss-reviews#7025 (comment)

@CLAassistant
Copy link

CLAassistant commented Aug 20, 2024

CLA assistant check
All committers have signed the CLA.

@giswqs
Copy link
Member

giswqs commented Aug 20, 2024

@alexgleith Thank you very much for the code cleanup. Some code blocks you pointed out were inherited from the EMIT-Data-Resources. I did not make changes.

https://github.com/nasa/EMIT-Data-Resources/blob/main/python/modules/emit_tools.py#L347

image

You suggested changes look good except the following:

ortho = True and ortho = False are intended for variable assignment, not conditional statements. So these need to be reverted.
image

@alexgleith
Copy link
Contributor Author

Whoops, sorry about that mistake @giswqs!

Ok, that makes sense re. the EMIT code.

I'm a bit uncomfortable with this section, as it's not very safe, but it makes more sense if it was just like that in the upstream source.

    if longitude is not None and latitude is not None:
        ortho = True

    if downtrack is not None and crosstrack is not None:
        ortho = False

@giswqs
Copy link
Member

giswqs commented Aug 20, 2024

The idea was to simplify the upstream code in the Exploring_EMIT_L2A_Reflectance.ipynb notebook by creating the plot_emit() function that can plot both orthorectified and non-rothorectified EMIT data. If both latitude and longitude are set, we assume it is orthorectified data. Otherwise, if both downtrack and crosstrack are set, we assume it is non-orthorectified data. Would this be acceptable? I am open to suggestions for improving it.

@giswqs
Copy link
Member

giswqs commented Aug 20, 2024

I am merging this PR for now to avoid conflicts with a new PR also editing emit.py. I would be happy to improve this section if needed.

@giswqs giswqs merged commit b20fc8a into opengeos:main Aug 20, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants