panstamps Documentation Release v0.5.3 Dave Young 2020 Getting Started 1 Installation 3 1.1 Troubleshooting on Mac OSX......................................3 1.2 Development...............................................3 1.2.1 Sublime Snippets........................................4 1.3 Issues...................................................4 2 Command-Line Usage 5 3 Documentation 7 4 Command-Line Tutorial 9 4.1 Command-Line..............................................9 4.1.1 JPEGS.............................................. 12 4.1.2 Temporal Constraints (Useful for Moving Objects)...................... 17 4.2 Importing to Your Own Python Script.................................. 18 5 Installation 19 5.1 Troubleshooting on Mac OSX...................................... 19 5.2 Development............................................... 19 5.2.1 Sublime Snippets........................................ 20 5.3 Issues................................................... 20 6 Command-Line Usage 21 7 Documentation 23 8 Command-Line Tutorial 25 8.1 Command-Line.............................................. 25 8.1.1 JPEGS.............................................. 28 8.1.2 Temporal Constraints (Useful for Moving Objects)...................... 33 8.2 Importing to Your Own Python Script.................................. 34 8.2.1 Subpackages.......................................... 35 8.2.1.1 panstamps.commonutils (subpackage)........................ 35 8.2.1.2 panstamps.image (subpackage)............................ 35 8.2.2 Classes............................................. 35 8.2.2.1 panstamps.downloader (class)............................. 35 8.2.2.2 panstamps.image.image (class)............................ 36 i 8.3 Indexes.................................................. 38 8.4 Todo................................................... 38 Python Module Index 39 Index 41 ii panstamps Documentation, Release v0.5.3 A python package and command-line tools to download stacked and/or warp image stamps from the STScI PanSTARRS image server. Note: If working with warped PS1 images then you need to work off a machine that has an IP address whitelisted by the Pan-STARRS1 data archive, otherwise only stacked images will be available to you. Also w-band images are not (yet) accessible from the data archive. Here’s a summary of what’s included in the python package: Classes panstamps.downloader Tools to download the panstarrs image stamps from STScI PanSTARRS image server panstamps.image.image The worker class for the image module Functions Getting Started 1 panstamps Documentation, Release v0.5.3 2 Getting Started CHAPTER 1 Installation The easiest way to install panstamps is to use pip: pip install panstamps Or you can clone the github repo and install from a local version of the code: git clone [email protected]:thespacedoctor/panstamps.git cd panstamps python setup.py install To upgrade to the latest version of panstamps use the command: pip install panstamps--upgrade 1.1 Troubleshooting on Mac OSX panstamps uses pillow (a fork of the Python Imaging Library) which requires some external libraries. If you have issues running panstamps on OSX, try installing Homebrew and running: brew install libtiff libjpeg webp little-cms2 1.2 Development If you want to tinker with the code, then install in development mode. This means you can modify the code from your cloned repo: git clone [email protected]:thespacedoctor/panstamps.git cd panstamps python setup.py develop 3 panstamps Documentation, Release v0.5.3 Pull requests are welcomed! 1.2.1 Sublime Snippets If you use Sublime Text as your code editor, and you’re planning to develop your own python code with panstamps, you might find my Sublime Snippets useful. 1.3 Issues Please report any issues here. 4 Chapter 1. Installation CHAPTER 2 Command-Line Usage Documentation for panstamps can be found here: http://panstamps.readthedocs.org/en/ ,!stable Usage: panstamps [options] [--width=<arcminWidth>] [--filters=<filterSet>] [--settings= ,!<pathToSettingsFile>] [--downloadFolder=<path>] (warp|stack) <ra> <dec> [<mjdStart> ,!<mjdEnd>] panstamps [options] --closest=<beforeAfter> [--width=<arcminWidth>] [--filters= ,!<filterSet>] [--settings=<pathToSettingsFile>] [--downloadFolder=<path>] <ra> <dec> ,!<mjd> -h, --help show this help message -f, --fits download fits (default on) -F, --nofits don't download fits (default off) -j, --jpeg download jepg (default off) -J, --nojpeg don't download jepg (default on) -c, --color download color jepg (default off) -C, --nocolor don't download color jepg (default on) -a, --annotate annotate jpeg (default true) -A, --noannotate don't annotate jpeg (default false) -t, --transient add a small red circle at transient ,!location (default false) -T, --notransient don't add a small red circle at transient ,!location (default true) -g, --greyscale convert jpeg to greyscale (default false) -G, --nogreyscale don't convert jpeg to greyscale (default ,!true) -i, --invert invert jpeg colors (default false) -I, --noinvert don't invert jpeg colors (default true) --width=<arcminWidth> width of image in arcsec (default 1) --filters=<filterSet> filter set to download and use for color ,!image (default gri) --downloadFolder=<path> path to the download folder, relative or ,!absolute (folder created where command is run if not set) (continues on next page) 5 panstamps Documentation, Release v0.5.3 (continued from previous page) --settings=<pathToSettingsFile> the settings file --closest=<beforeAfter> return the warp closest in time to the ,!given mjd. If you want to set a strict time window then pass in a positive or ,!negative time in sec (before | after | secs) ra right-ascension in sexagesimal or decimal ,!degrees dec declination in sexagesimal or decimal ,!degrees mjdStart the start of the time-window within which ,!to select images mjdEnd the end of the time-window within which ,!to select images mjd report the warp closest in time to this ,!mjd 6 Chapter 2. Command-Line Usage CHAPTER 3 Documentation Documentation for panstamps is hosted by Read the Docs (last stable version and latest version). 7 panstamps Documentation, Release v0.5.3 8 Chapter 3. Documentation CHAPTER 4 Command-Line Tutorial There are 2 ways to use panstamps, either via the command-line or import it into your own python code and use it from there. 4.1 Command-Line Full usage options can be found by typing: panstamps -h Here I’ll run through the basics. By default the command will only download the fits files for the location given. To download the stack fits cutouts for M82 run the command: panstamps stack 09:55:52.2 +69:40:47 By default the gri filter, 1 arcmin fits cutouts are downloaded: 9 panstamps Documentation, Release v0.5.3 10 Chapter 4. Command-Line Tutorial panstamps Documentation, Release v0.5.3 To increase the image width and download all filters, run the command: 4.1. Command-Line 11 panstamps Documentation, Release v0.5.3 panstamps --width=4 --filters=griyz stack 09:55:52.2 +69:40:47 As you can see we now have a larger cutout: 4.1.1 JPEGS To download the jpegs, and not the fits files rerun the command with the correct flags set. We’ll also use the --downloadFolder option to assign the download directory. 12 Chapter 4. Command-Line Tutorial panstamps Documentation, Release v0.5.3 panstamps -Fj --width=4 --filters=gri --downloadFolder=/Users/Dave/Desktop/m81 stack ,!09:55:52.2 +69:40:47 This downloads the jpegs and adds some useful annotation, which can be switched off if required. Sometimes it maybe useful to add a transient marker at the centre of the image: panstamps -FjAt --width=4 --filters=gri --downloadFolder=/Users/Dave/Desktop/m81 ,!stack 09:55:52.2 +69:40:47 4.1. Command-Line 13 panstamps Documentation, Release v0.5.3 Or grab the color image as well as/instead of the single filter images: panstamps -FJc --width=4 --filters=gri --downloadFolder=/Users/Dave/Desktop/m81 stack ,!09:55:52.2 +69:40:47 14 Chapter 4. Command-Line Tutorial panstamps Documentation, Release v0.5.3 Note the code will try its best to choose a colour for the annotation lines and text to make them contrast well against the background image. Finally you can invert the image colors or convert the image to greyscale: panstamps -FJci --width=4 --filters=gri --downloadFolder=/Users/Dave/Desktop/m81 ,!stack 09:55:52.2 +69:40:47 4.1. Command-Line 15 panstamps Documentation, Release v0.5.3 panstamps -FJcig --width=4 --filters=gri --downloadFolder=/Users/Dave/Desktop/m81 ,!stack 09:55:52.2 +69:40:47 16 Chapter 4. Command-Line Tutorial panstamps Documentation, Release v0.5.3 4.1.2 Temporal Constraints (Useful for Moving Objects) For moving objects, alongside spatially filtering the panstarrs images, we also require a temporal filter. We need to be able to request images at a sky-position that were taken within a given time range. With panstamps we have the option of passing a time-window to filter the images by via the mjdStart and mjdEnd variables: For example I can run: panstamps -Fj --width=4 --filters=gri --downloadFolder=~/Desktop/movers warp 189. ,!1960991 28.2374845 55246.63 55246.64 to only return the 2 images I want within the temporal window at the location in the sky. 4.1. Command-Line 17 panstamps Documentation, Release v0.5.3 It’s also possible to request the closest warp image taken before or after a requested MJD by using the closest flag. For example, to request the closest r-band warp taken before MJD=‘55246.64‘ for the location above, run the command: panstamps -Fj --closest=before --width=4 --filters=gri --downloadFolder=~/Desktop/
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages45 Page
-
File Size-