Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Documentation

on:
push:
branches: [master]
tags: '*'
pull_request:

jobs:
build:
# These permissions are needed to:
# - Deploy the documentation: https://documenter.juliadocs.org/stable/man/hosting/#Permissions
# - Delete old caches: https://github.com/julia-actions/cache#usage
permissions:
actions: write
contents: write
pull-requests: read
statuses: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
show-versioninfo: true
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
*.jl.cov
*.jl.mem
.DS_Store
/Manifest.toml
Manifest.toml
/test/data/
docs/build/
9 changes: 9 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Reproject = "d1dcc2e6-806e-11e9-2897-3f99785db2ae"

[compat]
Documenter = "1"

[sources]
Reproject = {path = ".."}
18 changes: 18 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Documenter
using Reproject

makedocs(;
sitename = "Reproject.jl",
modules = [Reproject],
authors = "Mosè Giordano, Rohit Kumar",
format = Documenter.HTML(),
pages = [
"index.md",
"api-reference.md",
],
)

deploydocs(;
repo = "github.com/JuliaAstro/Reproject.jl.git",
push_preview = true
)
5 changes: 5 additions & 0 deletions docs/src/api-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# API Reference

```@autodocs
Modules = [Reproject]
```
Binary file added docs/src/assets/input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Reproject

Implementation in [Julia](https://julialang.org/) of the
[`reproject`](https://github.com/astropy/reproject) package by Thomas
Robitaille, part of the Astropy project.

This package can be used to reproject Astronomical Images from one world coordinate to another. By reproject we mean re-gridding of images using interpolation (i.e changing the pixel resolution, orientation, coordinate system).

Installation
-------

Reproject.jl is avilable for Julia 1.0 and later versions and can be installed with [Julia built-in package manager](https://docs.julialang.org/en/v1/stdlib/Pkg/).

```julia-repl
julia> import Pkg; Pkg.add("Reproject")
```

Usage
-------

After installing the package, you can start using it with

```julia-repl
julia> using Reproject

julia> result = reproject(input_data, output_projection)
```

This returns a tuple of reprojected Image and footprint.


Reprojecting Images
-------

To reproject Astronomical Images, primary requirements are Image data (2D Matrix), world cordinate frame of input Image and required output frame in which it needs to be reprojected.

The Image data and input frame is given together as an [ImageHDU](http://juliaastro.github.io/FITSIO.jl/latest/index.html) or [FITS](https://github.com/JuliaAstro/FITSIO.jl) file or name of the FITS file in `input_data`. A keyword argument `hdu_in` can be given while using FITS or FITS file name to specify specific HDU in FITS file.

The `output_projection` is the output world coordinate frame and needs to be a a [WCSTransform](https://github.com/JuliaAstro/WCS.jl) or an [ImageHDU](http://juliaastro.github.io/FITSIO.jl/latest/index.html) or [FITS](https://github.com/JuliaAstro/FITSIO.jl) file or name of the FITS file. A keyword argument `hdu_out` can be given while using FITS or FITS file name to specify specific HDU in FITS file.
WCS information is extracted from header when ImageHDU or FITS file is given as `output_projection`.

Order of Interpolation can be specified by keyword `order` (i.e 0, 1(default), 2).
The dimensions of output Image can be given by keyword `shape_out`. This can be used to change resolution.


Example
-------
```julia-repl
julia> using Reproject, FITSIO

julia> input_data = FITS("gc_msx_e.fits")

julia> output_projection = FITS("gc_2mass_k.fits")

julia> result = reproject(input_data, output_projection, shape_out = (1000,1000), order = 2, hdu_in = 1, hdu_out = 1)
```
**Input Image:**

![community](assets/input.png)

**Output:**

![community](assets/output.png)

Test files can be obtained from [here](https://www.astropy.org/astropy-data/).

Related Packages
-------
Check out [AstroImages.jl](https://github.com/JuliaAstro/AstroImages.jl), which use this package to form coloured RGB image from 2D CCD Astromonical Images.

License
-------

The `reproject` package is released under the terms of the BSD 3-Clause "New" or
"Revised" License. The `Reproject.jl` package received written permission to be
released under the MIT "Expat" License.

The authors of this package are [aquatiko](https://github.com/aquatiko) and [giordano](https://github.com/giordano).
Loading