-
Notifications
You must be signed in to change notification settings - Fork 9
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
New Features and Improvements to AstroImages #30
Changes from all commits
1bf197c
9f80446
ba8459d
29df5c8
34360e4
b675ff3
056207e
73d4272
c332a39
b72b7b0
65d126e
5972a7c
f0d7b7f
7ca7ea6
2879636
b175aef
80f7484
747b748
0c3cf72
f86fcc7
8d237d6
18df410
3ef9cd0
ade4206
5920089
b02cacc
b4f0bc8
5d1453c
4161bdd
72edafc
38887ad
65bf3ce
9e9bd1a
07fdbe0
747af1a
4be5a04
b8454c7
e48625c
2d9d378
a7b00ae
52b78b0
bbaf300
1d629c0
0fa711b
ba8729d
e7f478a
21a5299
2209269
e8eb678
3a4a061
42512f6
0fc7d9e
8096796
fbb0d3d
b6a2164
a1e3d54
4177b7b
522ebd0
f6f7a28
2d62d96
2c7eeef
3998477
32f0a12
43cc672
886d1fd
a90b27b
2a3f28c
c2a3826
ddaaf06
8ec98bb
44441f2
2476fad
bc0be85
991a1c9
5740516
a4ca804
75e3789
0936a47
2973ba5
9c9db60
abeff6f
3472912
6f93c35
86e1c55
6b33e54
52f254e
f4c2934
dbb93f1
41804d4
30d464a
69f1325
519b98b
dd21ea2
28eff9a
39da97a
ffe5f77
36d9034
257c9de
78f25c4
53d8e5e
df520f3
dfbb9f7
bc7c66f
918db4f
747fcc8
68eb2c7
2efd538
24713ac
b91c7ea
80603d3
0774e71
67d9edf
c396595
ee42cbf
e90afa3
c73adb2
5c9d590
4e57573
95e2e34
6e94d7d
2c51c02
3972fd1
574c51a
a48b4c3
9ebb74c
a65be92
3767528
6204824
3510ec9
fea17c7
6aa1533
5628d29
9fbf3a4
66db70c
e4d9f0f
c4fba11
ded071c
9500c95
f1a5a7a
c6aad34
5e9caa1
5442bfa
4a4baba
25a9077
1c92df9
43f751f
6e8d890
e7e7d07
443bb3b
25d0f59
e2ce839
2d5fff2
a978932
cb916f6
b161d0c
091e6a5
2647d7a
7de1b7f
077c1df
84efb96
a507739
edc9357
d2431f5
edba8f0
bbcff54
a967da6
e9dfae0
990c782
8d25e20
e0fb31e
ac1771f
dd6e349
2d524f3
e2e2081
d3ae34f
30b5938
e8359ec
b89f09d
cc218a5
e9a5d0a
383299f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
tags: '*' | ||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'. | ||
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. | ||
- 'nightly' | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: julia-actions/cache@v1 | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: lcov.info |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: '1.7' | ||
- name: Install dependencies | ||
run: julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | ||
- uses: julia-actions/cache@v1 | ||
- name: Build and deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token | ||
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key | ||
run: julia --color=yes --project=docs/ docs/make.jl | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ Manifest.toml | |
|
||
# test files | ||
/test/data | ||
|
||
|
||
# built docs | ||
/docs/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,51 @@ | ||
name = "AstroImages" | ||
uuid = "fe3fc30c-9b16-11e9-1c73-17dabf39f4ad" | ||
authors = ["Mosè Giordano", "Rohit Kumar"] | ||
version = "0.2.0" | ||
authors = ["Mosè Giordano", "Rohit Kumar", "William Thompson"] | ||
version = "0.3.0" | ||
|
||
[deps] | ||
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c" | ||
AstroAngles = "5c4adb95-c1fc-4c53-b4ea-2a94080c53d2" | ||
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" | ||
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0" | ||
FITSIO = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb" | ||
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" | ||
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" | ||
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" | ||
Interact = "c601a237-2ae4-5e1e-952c-7a85b0c7eef1" | ||
ImageAxes = "2803e5a7-5153-5ecf-9a86-9b4c37f5f5ac" | ||
ImageBase = "c817782e-172a-44cc-b673-b171935fbb9e" | ||
ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31" | ||
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" | ||
PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043" | ||
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
Reproject = "d1dcc2e6-806e-11e9-2897-3f99785db2ae" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you need it, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @giordano! I had just run into that issue. One thing I am wondering is whether it might be better to have the opposite relationship, with Reproject.jl depending on AstroImages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now there is nothing that rotates or otherwise transforms images, except for the RGB composite functions that first call reproject. composechannels([
astroimg1,
reproject(astroimg2, wcs(astroimg1,1)),
reproject(astroimg3, wcs(astroimg1,1)),
], ...) where One thing that doesn't yet work is reprojecting one slice of a cube, but it should be possible with all the information now tracked by the |
||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | ||
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | ||
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d" | ||
MappedArrays = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" | ||
|
||
[compat] | ||
julia = "^1.0.0" | ||
Reproject = "^0.3.0" | ||
AbstractFFTs = "1.1" | ||
AstroAngles = "0.1" | ||
ColorSchemes = "3.18" | ||
DimensionalData = "^0.20" | ||
FITSIO = "0.16" | ||
FileIO = "1.14" | ||
ImageAxes = "0.6" | ||
ImageBase = "^0.1.5" | ||
ImageShow = "0.3" | ||
MappedArrays = "0.4" | ||
PlotUtils = "1.2" | ||
RecipesBase = "1.2" | ||
Tables = "1.7" | ||
WCS = "0.6" | ||
julia = "^1.6.0" | ||
|
||
[extras] | ||
FITSIO = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb" | ||
ImageBase = "c817782e-172a-44cc-b673-b171935fbb9e" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
Widgets = "cc8bc4a8-27d6-5769-a93b-9d913e69aa62" | ||
JLD = "4138dd39-2aa7-5051-a626-17a0bb65d9c8" | ||
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" | ||
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d" | ||
|
||
[targets] | ||
test = ["Test", "Random", "Widgets", "JLD", "SHA"] | ||
test = ["Test", "WCS", "FITSIO", "Random", "Statistics", "ImageBase"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[deps] | ||
AstroImages = "fe3fc30c-9b16-11e9-1c73-17dabf39f4ad" | ||
DemoCards = "311a05b2-6137-4a5a-b473-18580a3d38b5" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5" | ||
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19" | ||
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795" | ||
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" | ||
Photometry = "af68cb61-81ac-52ed-8703-edc140936be4" | ||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | ||
Reproject = "d1dcc2e6-806e-11e9-2897-3f99785db2ae" | ||
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d" | ||
|
||
[compat] | ||
Documenter = "0.27" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# --- | ||
# title: Displaying Images | ||
# author: "[William Thompson](https://github.com/sefffal)" | ||
# cover: assets/displaying-images.png | ||
# --- | ||
|
||
# We'll start by downloading a sample image. If you have an image stored locally, | ||
# you would skip this step. | ||
using AstroImages | ||
|
||
AstroImages.set_clims!(Percent(99.5)) #src | ||
AstroImages.set_cmap!(:magma) #src | ||
AstroImages.set_stretch!(identity) #src | ||
|
||
|
||
# Any AbstractArray can be visualized with the `imview` function. | ||
arr = randn(10,10) | ||
imview(arr) | ||
|
||
# Let's load an astronomical image to see how we can tweak its display | ||
fname = download( | ||
"http://www.astro.uvic.ca/~wthompson/astroimages/fits/656nmos.fits", | ||
"eagle-656nmos.fits" | ||
); | ||
img = AstroImage("eagle-656nmos.fits"); | ||
imview(img) | ||
|
||
# We can adjust the color limits manually | ||
imview(img, clims=(0,100)) | ||
|
||
# Or provide a function to calculate them for us | ||
imview(img, clims=extrema) | ||
|
||
# AstroImages includes some handy callables, like Percent and Zscale.flags | ||
# `Percent` sets the limits to include some central percentage of the data range | ||
# For example, 95% sets the color limits to clip the top and bottom 2.5% of pixels. | ||
# Percent(99.5) is the default value of clims. | ||
imview(img, clims=Percent(95)) | ||
|
||
|
||
|
||
|
||
# Arrays wrapped by `AstroImage` are displayed automatically using `imview` | ||
AstroImage(randn(10,10)) | ||
|
||
# The settings for automatic imview are controlled using package defaults that can | ||
# be adjusted to suit your tastes | ||
AstroImages.set_clims!(Zscale()) # Display the full range automatically | ||
AstroImages.set_cmap!(:viridis) | ||
AstroImages.set_stretch!(asinhstretch) | ||
AstroImage(randn(10,10)) | ||
|
||
# --- restore defaults --- #src | ||
AstroImages.set_clims!(Percent(99.5)) #src | ||
AstroImages.set_cmap!(:magma) #src | ||
AstroImages.set_stretch!(identity) #src | ||
|
||
# --- save covers --- #src | ||
mkpath("assets") #src | ||
save("assets/loading-images.png", imview(img)) #src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary, I guess