|
27 | 27 | find_latitude_index, |
28 | 28 | find_longitude_index, |
29 | 29 | find_time_index, |
| 30 | + geodesic_to_utm, |
30 | 31 | get_elevation_data_from_dataset, |
31 | 32 | get_final_date_from_time_array, |
32 | 33 | get_initial_date_from_time_array, |
33 | 34 | get_interval_date_from_time_array, |
34 | 35 | get_pressure_levels_from_file, |
35 | 36 | mask_and_clean_dataset, |
36 | 37 | ) |
37 | | -from rocketpy.environment.tools import geodesic_to_utm as geodesic_to_utm_tools |
38 | | -from rocketpy.environment.tools import utm_to_geodesic as utm_to_geodesic_tools |
39 | 38 | from rocketpy.environment.weather_model_mapping import WeatherModelMapping |
40 | 39 | from rocketpy.mathutils.function import NUMERICAL_TYPES, Function, funcify_method |
41 | 40 | from rocketpy.plots.environment_plots import _EnvironmentPlots |
@@ -451,7 +450,7 @@ def __initialize_utm_coordinates(self): |
451 | 450 | self.initial_utm_letter, |
452 | 451 | self.initial_hemisphere, |
453 | 452 | self.initial_ew, |
454 | | - ) = self.geodesic_to_utm( |
| 453 | + ) = geodesic_to_utm( |
455 | 454 | lat=self.latitude, |
456 | 455 | lon=self.longitude, |
457 | 456 | flattening=self.ellipsoid.flattening, |
@@ -2523,98 +2522,7 @@ def set_earth_geometry(self, datum): |
2523 | 2522 | f"the following recognized datum: {available_datums}" |
2524 | 2523 | ) from e |
2525 | 2524 |
|
2526 | | - # Auxiliary functions - Geodesic Coordinates |
2527 | | - |
2528 | | - @staticmethod |
2529 | | - def geodesic_to_utm( |
2530 | | - lat, lon, semi_major_axis=6378137.0, flattening=1 / 298.257223563 |
2531 | | - ): |
2532 | | - """Function which converts geodetic coordinates, i.e. lat/lon, to UTM |
2533 | | - projection coordinates. Can be used only for latitudes between -80.00° |
2534 | | - and 84.00° |
2535 | | -
|
2536 | | - Parameters |
2537 | | - ---------- |
2538 | | - lat : float |
2539 | | - The latitude coordinates of the point of analysis, must be contained |
2540 | | - between -80.00° and 84.00° |
2541 | | - lon : float |
2542 | | - The longitude coordinates of the point of analysis, must be |
2543 | | - contained between -180.00° and 180.00° |
2544 | | - semi_major_axis : float |
2545 | | - The semi-major axis of the ellipsoid used to represent the Earth, |
2546 | | - must be given in meters (default is 6,378,137.0 m, which corresponds |
2547 | | - to the WGS84 ellipsoid) |
2548 | | - flattening : float |
2549 | | - The flattening of the ellipsoid used to represent the Earth, usually |
2550 | | - between 1/250 and 1/150 (default is 1/298.257223563, which |
2551 | | - corresponds to the WGS84 ellipsoid) |
2552 | | -
|
2553 | | - Returns |
2554 | | - ------- |
2555 | | - x : float |
2556 | | - East coordinate, always positive |
2557 | | - y : float |
2558 | | - North coordinate, always positive |
2559 | | - utm_zone : int |
2560 | | - The number of the UTM zone of the point of analysis, can vary |
2561 | | - between 1 and 60 |
2562 | | - utm_letter : string |
2563 | | - The letter of the UTM zone of the point of analysis, can vary |
2564 | | - between C and X, omitting the letters "I" and "O" |
2565 | | - hemis : string |
2566 | | - Returns "S" for southern hemisphere and "N" for Northern hemisphere |
2567 | | - EW : string |
2568 | | - Returns "W" for western hemisphere and "E" for eastern hemisphere |
2569 | | - """ |
2570 | | - warnings.warn( |
2571 | | - "This function is deprecated and will be removed in v1.10.0. " |
2572 | | - "Please use the new method `tools.geodesic_to_utm` instead.", |
2573 | | - DeprecationWarning, |
2574 | | - ) |
2575 | | - return geodesic_to_utm_tools(lat, lon, semi_major_axis, flattening) |
2576 | | - |
2577 | | - @staticmethod |
2578 | | - def utm_to_geodesic( |
2579 | | - x, y, utm_zone, hemis, semi_major_axis=6378137.0, flattening=1 / 298.257223563 |
2580 | | - ): |
2581 | | - """Function to convert UTM coordinates to geodesic coordinates |
2582 | | - (i.e. latitude and longitude). |
2583 | | -
|
2584 | | - Parameters |
2585 | | - ---------- |
2586 | | - x : float |
2587 | | - East UTM coordinate in meters |
2588 | | - y : float |
2589 | | - North UTM coordinate in meters |
2590 | | - utm_zone : int |
2591 | | - The number of the UTM zone of the point of analysis, can vary |
2592 | | - between 1 and 60 |
2593 | | - hemis : string |
2594 | | - Equals to "S" for southern hemisphere and "N" for Northern |
2595 | | - hemisphere |
2596 | | - semi_major_axis : float |
2597 | | - The semi-major axis of the ellipsoid used to represent the Earth, |
2598 | | - must be given in meters (default is 6,378,137.0 m, which corresponds |
2599 | | - to the WGS84 ellipsoid) |
2600 | | - flattening : float |
2601 | | - The flattening of the ellipsoid used to represent the Earth, usually |
2602 | | - between 1/250 and 1/150 (default is 1/298.257223563, which |
2603 | | - corresponds to the WGS84 ellipsoid) |
2604 | | -
|
2605 | | - Returns |
2606 | | - ------- |
2607 | | - lat : float |
2608 | | - latitude of the analyzed point |
2609 | | - lon : float |
2610 | | - latitude of the analyzed point |
2611 | | - """ |
2612 | | - warnings.warn( |
2613 | | - "This function is deprecated and will be removed in v1.10.0. " |
2614 | | - "Please use the new method `tools.utm_to_geodesic` instead.", |
2615 | | - DeprecationWarning, |
2616 | | - ) |
2617 | | - return utm_to_geodesic_tools(x, y, utm_zone, hemis, semi_major_axis, flattening) |
| 2525 | + # Auxiliary functions |
2618 | 2526 |
|
2619 | 2527 | @staticmethod |
2620 | 2528 | def calculate_earth_radius( |
|
0 commit comments