python: logging

While one can use if-else statements, the use of logging and raising errors (raise) can be a better way to handle errors and warnings in complex projects for the following…

How to install miniconda on MacOS

source: https://docs.anaconda.com/free/miniconda/ # create parent directory miniconda3 mkdir -p ~/miniconda3 # download curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh # execute installation and updates bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 # remove setup…

Ways to download ERDDAP Data using python

ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE url = 'https://oceanwatch.pifsc.noaa.gov/erddap/griddap/sw_chla_monthly_2018_0.nc?chlor_a[(1997-10-16T12:00:00Z):1:(2010-10-16T12:00:00Z)][(25):10:(15)][(198):10:(208)]' file_name = "sw.nc" with urllib.request.urlopen(url, context=ctx) as u, \ open(file_name, 'wb') as f: f.write(u.read()) print('complete') source: https://github.com/CoastWatch-WestCoast/python_code/blob/satellite_course_jan_2022/compare_satellite_timeseries.ipynb def…