{"id":34089580,"url":"https://github.com/behrouzz/sdss","last_synced_at":"2026-04-10T10:31:57.885Z","repository":{"id":50582870,"uuid":"387547058","full_name":"behrouzz/sdss","owner":"behrouzz","description":"Retrieve and analysis data from SDSS (Sloan Digital Sky Survey)","archived":false,"fork":false,"pushed_at":"2023-11-01T22:35:02.000Z","size":56,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T04:49:00.403Z","etag":null,"topics":["astronomy","astrophysics","deep-sky-objects","python","sdss","spectroscopy","spectrum"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/behrouzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-07-19T17:39:11.000Z","updated_at":"2025-05-06T07:25:56.000Z","dependencies_parsed_at":"2022-08-12T21:50:15.446Z","dependency_job_id":"b7eb7066-7701-475d-8a6a-2e7248544b8d","html_url":"https://github.com/behrouzz/sdss","commit_stats":{"total_commits":54,"total_committers":2,"mean_commits":27.0,"dds":0.01851851851851849,"last_synced_commit":"2a4a173df44d63acd4b6bedc7f70cdae307a8309"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/behrouzz/sdss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrouzz%2Fsdss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrouzz%2Fsdss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrouzz%2Fsdss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrouzz%2Fsdss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behrouzz","download_url":"https://codeload.github.com/behrouzz/sdss/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrouzz%2Fsdss/sbom","scorecard":{"id":230593,"data":{"date":"2025-08-11","repo":{"name":"github.com/behrouzz/sdss","commit":"533c21e316df0e0f33a8061a1779008b22868d98"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T04:46:28.027Z","repository_id":50582870,"created_at":"2025-08-17T04:46:28.027Z","updated_at":"2025-08-17T04:46:28.027Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31638419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronomy","astrophysics","deep-sky-objects","python","sdss","spectroscopy","spectrum"],"created_at":"2025-12-14T14:02:29.133Z","updated_at":"2026-04-10T10:31:57.878Z","avatar_url":"https://github.com/behrouzz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Author:** [Behrouz Safari](https://behrouzz.github.io/)\u003cbr/\u003e\n**License:** [MIT](https://opensource.org/licenses/MIT)\u003cbr/\u003e\n\n# sdss\n*A python package for retrieving and analysing data from SDSS (Sloan Digital Sky Survey)*\n\n*Important:*\u003cbr/\u003e\n[CSV](https://skyserver.sdss.org/dr18/en/tools/quicklook/summary.aspx)\n\n## Installation\n\nInstall the latest version of *sdss* from [PyPI](https://pypi.org/project/sdss/):\n\n    pip install sdss\n\nRequirements are *numpy*, *requests*, *Pillow*, *matplotlib*, *pandas* and *astropy*.\nVersions before 1.0.0 are not dependent on *astropy*.\n\n## Quick start\n\nLet's create a Region:\n\n```python\nfrom sdss import Region\n\nra = 179.689293428354\ndec = -0.454379056007667\n\nreg = Region(ra, dec, fov=0.033)\n```\n\nTo see the image:\n\n```python\nreg.show()\n```\n\n![alt text](https://raw.githubusercontent.com/behrouzz/astronomy/main/images/Region-show.png)\n\nTo see the image in three *gri* filter bands (green, red, infrared) separately:\n\n```python\nreg.show3b()\n```\n\n![alt text](https://raw.githubusercontent.com/behrouzz/astronomy/main/images/Region-show3b.png)\n\nTo find nearest objects:\n\n```python\ndf_obj = reg.nearest_objects()\n```\n\nTo find nearest objects with spectrum:\n\n```python\ndf_sp = reg.nearest_spects()\n```\n\n## Photometry example\n\nLet's download a frame, in fits and jpg, retrieve all of its objects.:\n\n```python\nfrom sdss.photometry import frame_filename, obj_frame_url, \\\n     download_file, unzip, get_df, df_radec2pixel\n\nobjid = 1237646587710014999\n\nzip_file = 'data/' + frame_filename(objid) + '.fits.bz2'\nfits_file = zip_file[:-4]\njpg_file = fits_file.replace('-r-', '-irg-').replace('fits', 'jpg')\n\nzip_url = obj_frame_url(objid, 'r')\ndownload_file(zip_url, 'data/')\nunzip(zip_file)\n\njpg_url = obj_frame_url(objid, 'irg', jpg=True)\ndownload_file(jpg_url, 'data/')\n\ndf = get_df(objid)\ndf = df_radec2pixel(df=df, fits_file=fits_file)\n\ndf.to_csv('data/COMP.csv', index=False)\n```\n\nNow we can plot our target image:\n\n```python\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sdss.photometry import frame_filename, obj_from_jpg\n\nobjid = 1237646587710014999\n\njpg_file = 'data/' + frame_filename(objid).replace('-r-', '-irg-') + '.jpg'\n\ndf = pd.read_csv('data/COMP.csv')\n\nimg = obj_from_jpg(jpg_file=jpg_file, df=df, objid=objid)\n\nfig, ax = plt.subplots()\nax.imshow(img)\nplt.show()\n```\n\nLet's find the best apparture:\n\n```python\nfrom sdss.photometry import flux\n\ndata = img[:,:,0]\nhalf = data.shape[0]//2\ncenter = (half, half)\n\nls_r_star = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\nls_background = []\nls_real_flux = []\nfor r_star in ls_r_star:\n    background, real_flux = flux(data, center, r_star)\n    ls_background.append(background)\n    ls_real_flux.append(real_flux)\n\nfig, ax = plt.subplots()\nax.scatter(ls_r_star, ls_real_flux, c='b')\nax.set_xlabel('R star')\nax.set_ylabel('Sky subtracted flux')\nplt.grid()\nplt.show()\n```\n\nSee more examples at [astrodatascience.net](https://astrodatascience.net/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehrouzz%2Fsdss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehrouzz%2Fsdss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehrouzz%2Fsdss/lists"}