Skip to content

Add option to preserve 0–360 longitude convention (--keep_longitude)#20

Merged
daniloceano merged 4 commits into
daniloceano:mainfrom
RonaldRN:add-new-feature-files
Apr 27, 2026
Merged

Add option to preserve 0–360 longitude convention (--keep_longitude)#20
daniloceano merged 4 commits into
daniloceano:mainfrom
RonaldRN:add-new-feature-files

Conversation

@RonaldRN

Copy link
Copy Markdown
Contributor

This pull request introduces an option to preserve the original longitude convention (0–360) when processing data.

Motivation:
Cyclones crossing the dateline can be difficult to track and visualize when longitudes are automatically converted to -180 to 180. Keeping the original convention simplifies domain selection, tracking, and visualization, especially for systems near 180°.

Main changes:

  • Adds the --keep_longitude flag to preserve 0–360 longitude format
  • Maintains backward compatibility (default behavior unchanged)
  • Improves usability for dateline-crossing systems

Usage example:

bash
python atmos_bud.py input.nc -c --keep_longitude

- Introduces a flag to keep the original longitude format (0–360)
- Useful for cyclones crossing the dateline (e.g., near New Zealand)
- Avoids issues when selecting regions, tracking systems, or centering maps at 180°
- Default behavior remains unchanged if the flag is not used

Usage:
python atmos_bud.py input.nc -c --keep_longitude
@RonaldRN

Copy link
Copy Markdown
Contributor Author

Additional updates included:

  • Implements interactive box selection (click-and-drag) to extract cyclone coordinates
  • Outputs time, latitude, longitude, length, and width
  • Preserves longitude convention (0–360 or -180–180), handling dateline-crossing systems
  • Adds continent boundaries using shapefile input
  • Supports variable and pressure level selection

Usage examples:
python Extract_coords_time-lat-lon-length-width.py input.nc --shp shapefile.shp --out track_cyclone.txt
python Extract_coords_time-lat-lon-length-width.py input.nc --shp shapefile.shp --var z --level 850 --out track_850.txt

@daniloceano daniloceano merged commit 1df6c4a into daniloceano:main Apr 27, 2026
1 check 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.

2 participants