Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legacy imaging stamps of galaxies #93

Open
forero opened this issue Jun 20, 2023 · 2 comments
Open

legacy imaging stamps of galaxies #93

forero opened this issue Jun 20, 2023 · 2 comments
Assignees

Comments

@forero
Copy link
Member

forero commented Jun 20, 2023

Write a notebook with examples on how to plot stamps of galaxies given a TARGETID.

Here is a recipe from @araichoor that should make it into a tutorial

I guess you can easily get the (ra, dec) from the lss catalog, provided the id.
then it s a simple bash command, e.g.:

wget -O tmp.jpeg "http://legacysurvey.org/viewer/jpeg-cutout/?layer=ls-dr9&ra=0.23790&dec=0.05840&pixscale=0.1&size=300"

and you can of course wrap that in python — and adjust the stamp properties, e.g.:

ra, dec = 0.2379, 0.0584
width_arcsec = 30
pixscale = 0.1
tmpfn = "tmp.jpeg"
size = int(width_arcsec / pixscale)
layer = "ls-dr9"
tmpstr = 'wget -O {} "http://legacysurvey.org/viewer/jpeg-cutout/?layer={}&ra={:.5f}&dec={:.5f}&pixscale={}&size={:.0f}"'.format(
    tmpfn, layer, ra, dec, pixscale, size
)
subprocess.check_call(tmpstr, stderr=subprocess.DEVNULL, shell=True)
@forero forero self-assigned this Jun 20, 2023
@weaverba137
Copy link
Member

Any reason not to use requests.get here instead of calling to an external process?

@araichoor
Copy link

no, no reason; I just copied some piece of code I had; any suggestion you d have is certainly better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants