Commit d63f10d6 authored by Sogo Mineo's avatar Sogo Mineo
Browse files


parent 7944fb8a
Download FITS cutouts from the website of HSC data release.
python >= 3.7
### Download images of all bands at a location
python3 --ra=222.222 --dec=44.444 --sw=0.5arcmin --sh=0.5arcmin --name="cutout-{filter}"
Note that `{filter}` must appear in `--name`.
Otherwise, the five images of the five bands will be written
to a single file over and over.
### Use coordinate list
You can feed a coordinate list that is in nearly the same format as
There are a few differences:
- There must not appear comments
except for the mandatory one at the first line.
- You can use "all" as a value of "filter" field.
- There may be columns with unrecognised names,
which are silently be ignored.
It is permissible for the coordinate list to contain only coordinates.
For example:
#? ra dec
222.222 44.444
222.223 44.445
222.224 44.446
In this case, you have to specify other fields via the command line:
python3 \
--sw=5arcsec --sh=5arcsec \
--image=true --variance=true --mask=true \
--name="cutout_{tract}_{ra}_{dec}_{filter}" \
--list=coordlist.txt # <- the name of the above list
It is more efficient to use a list like the example above
than to use a for-loop to call the script iteratively.
### Stop asking a password
To stop the script asking your password, put the password
into an environment variable. (Default: `HSC_SSP_CAS_PASSWORD`)
Then, run the script with `--user` option:
python3 \
--ra=222.222 --dec=44.444 --sw=0.5arcmin --sh=0.5arcmin \
--name="cutout-{filter}" \
If you are using your own personal laptop or desktop,
you may pass your password through `--password` option.
But you must never do so
if there are other persons using the same computer.
Remember that other persons can see your command lines
with, for example, `top` command.
(If it is GNU's `top`, press `C` key to see others' command lines).
Usage as a python module
Here is an example:
import downloadCutout
rect = downloadCutout.Rect.create(
images =
# Multiple images (of various filters) are returned.
# We look into the first one of them.
metadata, data = images[0]
# `data` is just the binary data of a FITS file.
# You can use, for example, `astropy` to decode it.
import io
hdus =
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment