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

Add geographic coordinate options #134

Merged
merged 60 commits into from
May 8, 2024
Merged

Add geographic coordinate options #134

merged 60 commits into from
May 8, 2024

Conversation

aburrell
Copy link
Owner

@aburrell aburrell commented May 6, 2024

Description

Fixes #127 and #132 by allowing geographic coordinates to be used in VectorData and the pysat Instrument functions. Also updated the pysat example.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality
    to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Wrote new unit tests, ran new example.

Test Configuration

  • Operating system: OS X Big Sur
  • Version number: Python 3.9
  • Any details about your local setup that are relevant: develop branch of pysat

Checklist:

  • Make sure you are merging into the develop (not main) branch
  • My commits are formatted appropriately (following the SciPy/NumPy style)
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • Add a note to Changelog.rst, summarising the changes
  • Add yourself to AUTHORS.rst and .zenodo.json

Created separate functions to convert vectors from one coordinate system to another.
Adapted VectorData to:
- accept geodetic or geocentric coordinates as vector inputs,
- use the new vector functions in the methods, and
- simplify the print output to be more streamlined.
Updated the OCB scaling unit tests by:
- updating the error messages raised,
- removing tests for updated quad lists from scaling vectors as this functionality is no longer present, and
- updated the minimum amount of attribute names to reflect changes in the VectorData class.
Added a description of the vector changes to the changelog.
Added range fixing to all time conversion functions.
Updated the time unit tests for range fixing.
Updated the description of the `get_pole_loc` function.
Created a test suite for the vector functions.
Ensure latitudes are array-like and that flat/zero masking is correct for array-like input when calculating the pole-data-pole angle.
Added unit tests for the `calc_vec_pole_angle` function.
Fixed the quadrant assignment in the `test_calc_vec_pole_angle_flat` integration test.  Also updated docstrings to be more correct.
Added the new bug that is fixed to the changelog.
Improved the robustness of the destination pole quadrant identification by:
- setting the size after finding the time difference instead of assuming it will always be equal to the pole angle,
- testing the cycle condition for floats as well as arrays, and
- testing the cycle condition for large angles as well as negative angles.
Added unit tests for `define_pole_quadrants` and simplified unit tests by making some of the variables class variables.
Added unit tests for the vector quadrant determination.
Improved `calc_dest_polar_angle` by ensuring list inputs can be used.
Added unit tests for the vector function `calc_dest_polar_angle`.
Improved array/float handling in the `adjust_vector` and `calc_dest_polar_angle` functions.
Removed extra whitespace.
Improved test class setup/teardown and added unit tests for the `adjust_vector` function.
Added access to deprecated attributes as properties or normal attributes (based on their previous type).
Updated a warning message to make more sense.
Added unit tests for the deprecation warnings in the VectorData class.
Remove a doubly-defined test and improve the comments.
Fix the degree handling in `hr2deg` to be consistent with other longitude range handling.
Added logging test for the new time logger warning.
Added an attribute deprecation warning for `aacgm_naz`.
Added a test for the `aacgm_naz` deprecation warning.
Scale the OCB vector components, not the original vector components.
Update the VectorData call in SuperMAG to reduce deprecation warnings.
Rename test files to better conform to real file names.
Update test filenames to conform with name change.
Allow geographic coordinates to be used by pysat Instruments.
Update pysat tests by:
- adding a base class for the pysat methods tests,
- setting boundary classes by input kwargs,
- updating structures for new inputs, and
- using new test file names.
Improve the error message output to be more informative.
Updated the supported Python versions to reflect current NEP 29.
Added the Python cycling to the changelog.
Remove failing tests that rely on deprecated code.
@coveralls
Copy link

coveralls commented May 7, 2024

Coverage Status

coverage: 99.165% (-0.4%) from 99.586%
when pulling 2680c38 on geo_coords
into 24f1bd9 on develop.

aburrell added 13 commits May 7, 2024 12:01
Use time conversion function to determine the desired range and improved the handling of mixed inputs to `calc_dest_polar_angle`.
Added tests to access lines uncovered in the vector subroutines.
Remove the support for Python versions less than 3.9.
Fixed bugs in `update_loc_coords` and elsewhere by:
- updated unused kwarg warning to work with or without deprecated kwargs,
- added specification of trace method in all applicable methods,
- fixed typo that assigned local time data to latitude, and
- fixed unnecessary usage of array function.
Added vector data tests to:
- test the uncovered logging messages,
- test the uncovered error messages, and
- test `update_loc_coords`.
Fixed missing output and missing use of `trace_method` in `update_vect_coords_to_mag`.
Added unit tests for `update_vect_coords_to_mag`.
Remove extra whitespace from a blank line.
Added coverage for two remaining uncovered lines.
Fixed the `add_ocb_to_data` function in `pysat_instruments` by:
- adding error catch for badly shaped array-like height input for pandas instruments,
- removing an unreachable section of code to add time to LT data,
- adding an evaluation to avoid unnecessary calls to meshgrid, and
- adding an extra meshgrid call for reshaping with height to reduce memory use.
Added tests for `pysat_instruments` to cover missed lines.
Improved the robustness of the padding function to catch more potential errors.
Added unit tests for `reshape_pad_mask_flatten`.
@aburrell
Copy link
Owner Author

aburrell commented May 8, 2024

Change in coverage is consistent with fixes made to SSJ code.

@aburrell aburrell merged commit 8ac2f62 into develop May 8, 2024
61 of 63 checks passed
@aburrell aburrell deleted the geo_coords branch May 8, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: update EAB example to plot data outside the EAB ENH: allow geographic coordinates to be used in pysat
2 participants