Skip to content

Commit eb12cee

Browse files
authored
Merge pull request #232 from JuliaAstro/updates
Updates
2 parents 6690e94 + 31a536f commit eb12cee

File tree

18 files changed

+1068
-1226
lines changed

18 files changed

+1068
-1226
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,16 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
version:
23-
- "1.3"
23+
- "min"
2424
- "1"
25-
- "nightly"
25+
- "pre"
2626
os:
2727
- ubuntu-latest
2828
- macOS-latest
2929
- macOS-13
3030
- windows-latest
3131
arch:
3232
- default
33-
exclude:
34-
- os: macOS-latest
35-
version: "1.3"
3633
steps:
3734
- uses: actions/checkout@v6
3835
- uses: julia-actions/setup-julia@v2
@@ -42,24 +39,11 @@ jobs:
4239
- uses: julia-actions/cache@v2
4340
- uses: julia-actions/julia-buildpkg@v1
4441
- uses: julia-actions/julia-runtest@v1
42+
with:
43+
test_args: "--verbose"
4544
- uses: julia-actions/julia-processcoverage@v1
4645
- uses: codecov/codecov-action@v5
4746
with:
4847
token: ${{ secrets.CODECOV_TOKEN }}
4948
files: lcov.info
5049
continue-on-error: true
51-
52-
docs:
53-
name: Documentation
54-
runs-on: ubuntu-latest
55-
steps:
56-
- uses: actions/checkout@v6
57-
- uses: julia-actions/setup-julia@v2
58-
with:
59-
version: "1"
60-
- uses: julia-actions/cache@v2
61-
- uses: julia-actions/julia-docdeploy@v1
62-
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
65-
JULIA_PKG_SERVER: ""
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: ["*"]
7+
pull_request:
8+
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: always.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
docs:
17+
name: build
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
- uses: julia-actions/setup-julia@v2
22+
with:
23+
version: "1"
24+
- uses: julia-actions/cache@v2
25+
- uses: julia-actions/julia-docdeploy@v1
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
29+
JULIA_PKG_SERVER: ""

NEWS.md

Lines changed: 0 additions & 143 deletions
This file was deleted.

Project.toml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ name = "FITSIO"
22
uuid = "525bcba6-941b-5504-bd06-fd0dc1a4d2eb"
33
version = "0.17.5"
44

5+
[workspace]
6+
projects = ["test", "docs"]
7+
58
[deps]
69
CFITSIO = "3b1b4be9-1499-4b22-8d78-7db3344d1961"
710
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
8-
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
9-
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1011

1112
[weakdeps]
1213
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
@@ -17,24 +18,7 @@ FITSIOTablesExt = "Tables"
1718
WCSExt = "WCS"
1819

1920
[compat]
20-
Aqua = "0.8"
2121
CFITSIO = "1.7.0"
22-
OrderedCollections = "1"
2322
Printf = "<0.0.1, 1"
24-
Random = "<0.0.1, 1"
25-
Reexport = "0.2, 1.0"
2623
Tables = "1"
27-
Test = "<0.0.1, 1"
28-
WCS = "0.6.2"
29-
julia = "1.3"
30-
31-
[extras]
32-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33-
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
34-
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
35-
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
36-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
37-
WCS = "15f3aee2-9e10-537f-b834-a6fb8bdb944d"
38-
39-
[targets]
40-
test = ["Aqua", "OrderedCollections", "Random", "Tables", "Test", "WCS"]
24+
julia = "1.10"

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ Flexible Image Transport System (FITS) support for Julia
1111
[![codecov](https://codecov.io/gh/juliaastro/fitsio.jl/graph/badge.svg?token=SA9EG0z8pt)](https://codecov.io/gh/juliaastro/fitsio.jl)
1212
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1313

14-
**Note:** The `Libcfitsio` submodule has been moved to [CFITSIO.jl](https://github.com/JuliaAstro/CFITSIO.jl) and will be deprecated in a future release.
15-
16-
1714
## Usage
1815

1916
For more in-depth usage and examples, see [the documentation](http://juliaastro.github.io/FITSIO.jl/stable/).

docs/src/index.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
# FITSIO.jl
22

3-
[![GitHub](https://img.shields.io/badge/Code-GitHub-black.svg)](https://github.com/JuliaAstro/FITSIO.jl)
4-
[![CI](https://github.com/JuliaAstro/FITSIO.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/JuliaAstro/FITSIO.jl/actions/workflows/CI.yml)
5-
[![codecov](https://codecov.io/gh/juliaastro/fitsio.jl/graph/badge.svg?token=SA9EG0z8pt)](https://codecov.io/gh/juliaastro/fitsio.jl)
3+
A [Julia](http://julialang.org) package for reading and writing Flexible Image Transport System (FITS) files, based on the [cfitsio](http://heasarc.gsfc.nasa.gov/fitsio/) library.
64

7-
A [Julia](http://julialang.org) package for reading and writing
8-
Flexible Image Transport System (FITS) files, based on the
9-
[cfitsio](http://heasarc.gsfc.nasa.gov/fitsio/) library.
5+
The interface is inspired by Erin Sheldon's [fitsio](https://github.com/esheldon/fitsio) Python package.
106

11-
The interface is inspired by Erin Sheldon's
12-
[fitsio](https://github.com/esheldon/fitsio) Python package.
13-
14-
!!! warning
15-
The `Libcfitsio` submodule has been moved to [CFITSIO.jl](https://github.com/JuliaAstro/CFITSIO.jl) and will be deprecated in a future release.
16-
17-
# Installation
7+
## Installation
188

199
`FITSIO.jl` can be installed using the built-in package manager:
2010

@@ -26,7 +16,7 @@ pkg> add FITSIO
2616
DocTestFilters = r"File: [a-zA-Z0-9/._]+"
2717
```
2818

29-
# Quick start
19+
## Quick start
3020

3121
The simplest way to write and read an image from a FITS file is by using the functions [`FITSIO.fitswrite`](@ref) and [`FITSIO.fitsread`](@ref).
3222

@@ -47,16 +37,19 @@ julia> FITSIO.fitsread(fname, 1, 1:2, 1) # read a section of HDU number 1
4737
1
4838
3
4939
```
40+
5041
This is not the most performant way, as the file is opened and closed on every invocation. However, this abstracts away the complexity.
42+
5143
!!! warn
5244
Currently, `fitswrite` overwrites an existing file, so this should be used with caution. In the future, this may allow
5345
appending to an existing file.
5446

55-
# Usage
47+
## Usage
5648

5749
In this example, we write to and read from a fits file.
5850

5951
We create a new temporary file using the `FITS` constructor:
52+
6053
```jldoctest example
6154
julia> fname, _ = mktemp(); # create a temporary file for this example
6255
@@ -70,12 +63,10 @@ No HDUs.
7063
julia> length(f) # shows the number of HDUs in the file
7164
0
7265
```
66+
7367
In this example, we have used the file mode `"w"`, which will overwrite any existing file with the same name. To append to an existing file instead, we use the mode `"r+"`, and to open a file for reading, we may specify the mode `"r"`.
7468

75-
A FITS file consists of one or more header-data units (HDUs),
76-
concatenated one after the other. The `FITS` object therefore is
77-
represented as a collection of these HDUs. Each HDU can contain image data, or table data (either binary or
78-
ASCII-formatted). Since we have just created a new file, there are no HDUs currently in the file.
69+
A FITS file consists of one or more header-data units (HDUs), concatenated one after the other. The `FITS` object therefore is represented as a collection of these HDUs. Each HDU can contain image data, or table data (either binary or ASCII-formatted). Since we have just created a new file, there are no HDUs currently in the file.
7970

8071
## Image
8172

@@ -223,6 +214,7 @@ Variable length columns are not supported by the `Tables.jl` interface, and `Tab
223214
In this section, we re-use the file that we had created in the eariler section, which contains an image HDU and a table HDU.
224215

225216
We may read the header of an HDU as
217+
226218
```jldoctest example
227219
julia> header = read_header(imghdu)
228220
SIMPLE = T / file does conform to FITS standard
@@ -240,6 +232,7 @@ FITSHeader
240232
julia> length(header) # number of keys
241233
8
242234
```
235+
243236
This reads the entire header from the HDU into memory. The header object behaves like a dictionary that may be queried using its keys:
244237

245238
```jldoctest example
@@ -276,7 +269,9 @@ julia> read_key(imghdu, 3) # query by key index
276269
julia> get_comment(header, "NAXIS")
277270
"number of data axes"
278271
```
272+
279273
We may modify the header in memory as
274+
280275
```jldoctest example
281276
julia> header["NEWKEY"] = 10; # change or add a keyword
282277
@@ -291,7 +286,6 @@ julia> get_comment(header, "NEWKEY")
291286
!!! note
292287
Manipulating a header only changes it in memory until it is written to disk. The header object in memory is not connected to the fits file. To write some header keywords in the new extension, pass a [`FITSHeader`](@ref) instance as a keyword: `write(f, data; header=header)`
293288

294-
295289
## Iterating over the HDUs
296290

297291
We may iterate over the fits file to access individual HDUs.
@@ -310,6 +304,7 @@ Close the file to write the in-memory FITS file to disk.
310304
```jldoctest example
311305
julia> close(f)
312306
```
307+
313308
FITS objects are also closed automatically when garbage collected.
314309

315310
!!! tip "Compressed storage"

0 commit comments

Comments
 (0)