Skip to content

Commit

Permalink
remove configparser
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Mar 7, 2024
1 parent 8d5e7a8 commit feedb91
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
configparser==5.3.0
matplotlib==3.1.0
numpy==1.24.3
pandas==1.3.5
pytest==7.2.2
matplotlib>=3.1.0
numpy>=1.24.3
pandas>=1.3.5
pytest>=7.2.2
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
'star_chart_spherical_projection.*']),
include_package_data=True,
install_requires=[
"configparser>=5.3.0",
"matplotlib>=3.1.0",
"numpy>=1.24.3",
"pandas>=1.3.5",
Expand Down
1 change: 0 additions & 1 deletion star_chart_spherical_projection/error_handling.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
########################################################################
# ERROR CATCHES AND LOGGING
########################################################################
import configparser
import csv
import logging
import numpy as np
Expand Down
19 changes: 10 additions & 9 deletions star_chart_spherical_projection/generate_star_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Northern Hemsiphere = 90°
# Southern Hemsiphere = -90°
########################################################################
import configparser
import csv
import logging
import math
Expand All @@ -21,8 +20,10 @@
logger.addHandler(stream_handler)

## Constants
config = configparser.ConfigParser()
config.read(os.path.join(os.path.dirname(__file__), 'config.ini'))
northern_declination_min = -30
northern_declination_max = 90
southern_declination_min = 30
southern_declination_max = -90

# Start Year (JP2000)
j2000 = 2000 # start year of the star catalogue (jan 1 2000 via IAU)
Expand Down Expand Up @@ -327,10 +328,10 @@ def plotStereographicProjection(builtInStars=[],

# Set declination based on hemisphere selected
if declination_min is None:
if northOrSouth == "North": declination_min = int(config["declinationDefaultValues"]["northern_declination_min"])
if northOrSouth == "South": declination_min = int(config["declinationDefaultValues"]["southern_declination_min"])
if northOrSouth == "North": declination_max = int(config["declinationDefaultValues"]["northern_declination_max"])
if northOrSouth == "South": declination_max = int(config["declinationDefaultValues"]["southern_declination_max"])
if northOrSouth == "North": declination_min = northern_declination_min
if northOrSouth == "South": declination_min = southern_declination_min
if northOrSouth == "North": declination_max = northern_declination_max
if northOrSouth == "South": declination_max = southern_declination_max

# Polar plot figure
fig = plt.figure(figsize=(figsize_n,figsize_n), dpi=figsize_dpi)
Expand Down Expand Up @@ -368,9 +369,9 @@ def displayDeclinationMarksOnAxis(declination_values, dec_min, dec_max, isInvert

# Display declination lines based on hemisphere
if northOrSouth == "North":
displayDeclinationMarksOnAxis(declination_values, int(config["declinationDefaultValues"]["northern_declination_min"]), int(config["declinationDefaultValues"]["northern_declination_max"]), False)
displayDeclinationMarksOnAxis(declination_values, northern_declination_min, northern_declination_max, False)
if northOrSouth == "South":
displayDeclinationMarksOnAxis(declination_values, int(config["declinationDefaultValues"]["southern_declination_min"]), int(config["declinationDefaultValues"]["southern_declination_max"]), True)
displayDeclinationMarksOnAxis(declination_values, southern_declination_min, southern_declination_max, True)

logger.debug("\n{0}ern Range of Declination: {1} to {2}".format(northOrSouth, declination_min, declination_max))

Expand Down

0 comments on commit feedb91

Please sign in to comment.