ranieremenezes / easyfermi

The easiest way to analyze Fermi-LAT data
https://easyfermi.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
42 stars 6 forks source link

Use the Python Standard Library to download #70

Open HealthyPear opened 1 month ago

HealthyPear commented 1 month ago

If you use Python's urllib module to download files, you don't need to worry about wget/curl macos/not-macos differences as in e.g.

if OS_name != "Darwin":
            os.system("wget -P ./Diffuse/ https://fermi.gsfc.nasa.gov/ssc/data/analysis/software/aux/iso_P8R3_SOURCE_V3_v1.txt")
            os.system("wget -P ./Diffuse/ https://fermi.gsfc.nasa.gov/ssc/data/analysis/software/aux/4fgl/gll_iem_v07.fits")
        else:
            os.system("curl -o ./Diffuse/iso_P8R3_SOURCE_V3_v1.txt https://fermi.gsfc.nasa.gov/ssc/data/analysis/software/aux/iso_P8R3_SOURCE_V3_v1.txt")
            os.system("curl -o ./Diffuse/gll_iem_v07.fits https://fermi.gsfc.nasa.gov/ssc/data/analysis/software/aux/4fgl/gll_iem_v07.fits")