{"id":22421,"library":"sunpy","title":"SunPy","description":"SunPy is the core package for solar data analysis in Python, providing data structures, coordinate transformations, and visualization tools for solar physics. Current version 7.1.2 (requires Python >=3.12). Released approximately every 3-4 months.","status":"active","version":"7.1.2","language":"python","source_language":"en","source_url":"https://github.com/sunpy/sunpy","tags":["solar physics","astronomy","data analysis","coordinates","visualization"],"install":[{"cmd":"pip install sunpy[all]","lang":"bash","label":"Full installation with recommended extras"}],"dependencies":[{"reason":"Core dependency for units, coordinates, and FITS handling","package":"astropy","optional":false},{"reason":"Access JSOC DRMS data export (e.g., HMI, AIA)","package":"drms","optional":true},{"reason":"Parallel file download client","package":"parfive","optional":true}],"imports":[{"note":"Map is a module, not a class; use sunpy.map.Map for the class","wrong":"from sunpy import Map","symbol":"Map","correct":"import sunpy.map"},{"note":"Direct import of Map is possible but discouraged due to namespace conflicts with built-in map()","wrong":"from sunpy.map import Map","symbol":"sunpy.map.Map","correct":"import sunpy.map; smap = sunpy.map.Map(...)"}],"quickstart":{"code":"import sunpy.map\nimport astropy.units as u\nfrom sunpy.net import Fido, attrs as a\n\n# Download an AIA 193 image (requires internet)\nresult = Fido.search(a.Time('2020-01-01 00:00:00', '2020-01-01 00:00:10'),\n                     a.Instrument.aia, a.Wavelength(193*u.angstrom))\nfiles = Fido.fetch(result)[0]\n\n# Load and plot map\nm = sunpy.map.Map(files)\nm.plot()","lang":"python","description":"Downloads an AIA 193 Å image from JSOC and displays it"},"warnings":[{"fix":"Upgrade to Python 3.12 or later.","message":"sunpy 7.x requires Python >=3.12; dropped support for Python 3.10 and 3.11.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Use astropy.coordinates.SkyCoord with proper astropy.units, e.g., coord = SkyCoord(10*u.deg, 20*u.deg, frame='heliographic_stonyhurst').","message":"sunpy.coordinates.frames.HeliographicStonyhurst no longer accepts 'deg' as input unit by default; must use Quantity with appropriate units.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Use str(Path(files[0]).resolve()) or pass the path through sunpy.map.Map.","message":"Fido.fetch returns a list of paths, but some downloaders (e.g., JSOC) can return paths that are relative; always resolve to absolute path before using in Map.","severity":"gotcha","affected_versions":"all"},{"fix":"Download the file first using Fido.fetch or another download method, then pass the local path.","message":"sunpy.map.Map() requires a FITS file or array; passing a URL directly will fail.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'import sunpy.map' then 'sunpy.map.Map'.","cause":"Using 'from sunpy import Map' which imports the module, not the class.","error":"ImportError: cannot import name 'Map' from 'sunpy'"},{"fix":"Use astropy.units, e.g., coord = SkyCoord(10*u.deg, 20*u.deg, frame='heliographic_stonyhurst').","cause":"Passing plain numbers to coordinate constructors without astropy units.","error":"TypeError: Cannot parse unit from input"},{"fix":"Broaden time range or use different instrument/wavelength. Consider using Fido with attrs from sunpy.net.attrs.","cause":"VSO query parameters too restrictive or server issue; JSOC may have different availability.","error":"sunpy.net.vso - VSOClient error: No data found for the given query"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}