Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7beed08
start adding some text
icweaver Mar 14, 2026
8683b57
more text
icweaver Mar 15, 2026
a6908a8
start adding text on NDArrayWrapper and friends
icweaver Mar 15, 2026
5bbcd1e
docs: adding some more text
icweaver Mar 20, 2026
015aad4
docs: autodownload data
icweaver Mar 21, 2026
dd18ff8
docs: update README [skip ci]
icweaver Mar 21, 2026
f208136
docs: cleanup
icweaver Mar 21, 2026
1069a51
ci(docs): temporarily disable package dev so that feature branch can …
icweaver Mar 21, 2026
3022cbf
ci(docs): typo
icweaver Mar 21, 2026
5a7be47
ci(docs): towards temp feature branch activation
icweaver Mar 21, 2026
1ac9a07
docs: update READEME [skip ci]
icweaver Mar 21, 2026
73a4745
docs: update data downloads
icweaver Mar 21, 2026
c99408a
ci: for real this time
icweaver Mar 21, 2026
ab80df9
bruh
icweaver Mar 21, 2026
d378b76
ci: temporarily try with [workspace]
icweaver Mar 21, 2026
c37b714
Update docs/Project.toml
icweaver Mar 21, 2026
1401c8a
ci(docs): finish putting [workspace] back
icweaver Mar 21, 2026
96e1b56
try explicit PackageSpec to other branch, drop [sources]
icweaver Mar 22, 2026
344009b
try explicit checkout of strict branch
icweaver Mar 22, 2026
76485ae
typo: add --> develop
icweaver Mar 22, 2026
5356d54
try explicit clone
icweaver Mar 22, 2026
b95a08f
try wrapping path in PackageSpec
icweaver Mar 22, 2026
2da91fb
try just copying the src over from the other branch
icweaver Mar 22, 2026
67614fb
try just omitting docs from [workspace]
icweaver Mar 22, 2026
984b0f5
nvm
icweaver Mar 22, 2026
b7b3ccd
ci: cleanup
icweaver Mar 22, 2026
2f983b2
docs: added compression scheme docstring
icweaver Mar 23, 2026
62f6474
docs: more docstrings
icweaver Mar 23, 2026
3c10fc7
docs: add ASDF.jl to doctests
icweaver Mar 23, 2026
9d8ecea
typo
icweaver Mar 23, 2026
ad82da6
docs: more docstrings
icweaver Mar 23, 2026
ddb5b93
docs: more docstrings
icweaver Mar 23, 2026
898558e
docs: more docstrings
icweaver Mar 23, 2026
02c5599
docs: add FileIO.jl todo for public API
icweaver Mar 23, 2026
174b662
Merge branch 'strict' into usage
icweaver Mar 30, 2026
56bda67
Merge branch 'strict' into usage
icweaver Mar 31, 2026
e1c5da4
Merge branch 'strict' into usage
icweaver Mar 31, 2026
d21edcb
Merge branch 'strict' into usage
icweaver Apr 1, 2026
4503cfa
Merge branch 'main' into usage
icweaver Apr 4, 2026
94e474e
Merge branch 'access' into usage
icweaver Apr 10, 2026
a3ed4cd
feature: add convenience setindex! and save method
icweaver Apr 10, 2026
e3a5ad7
build: switch to master branch of FileIO.jl now that PR is merged
icweaver Apr 10, 2026
aad1185
docs: update index and intro
icweaver Apr 10, 2026
bcc13c0
fix: forward kwargs to load command + update interpolation in docstri…
icweaver Apr 10, 2026
7c84531
docs: updated jwst, roman, and api docs
icweaver Apr 10, 2026
f14267e
build(docs): add OrderedCollections.jl to deps
icweaver Apr 11, 2026
f281a86
Merge branch 'main' into usage
icweaver Apr 11, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Manifest*.toml
data/
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

# TODO: Remove after https://github.com/JuliaIO/FileIO.jl/pull/427
[sources]
FileIO = {url = "https://github.com/icweaver/FileIO.jl", rev = "asdf"}
FileIO = {url = "https://github.com/JuliaIO/FileIO.jl", rev = "master"}

[compat]
AbstractTrees = "0.4.5"
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,27 @@

A new [Advanced Scientific Data Format (ASDF)](https://asdf-standard.readthedocs.io/en/latest/index.html) package, written in Julia.

## Quickstart

```julia
using ASDF
```

```julia
# Load
af = ASDF.load_file("<file.asdf>")
```

```julia
# Acess and modify
af.metadata["<key>"] = <val>
```

```julia
# Write
doc = Dict(<data>)
ASDF.write_file("<new_file.asdf>", doc)
```

=======
See [`ASDF.jl v1`](https://github.com/JuliaAstro/ASDF.jl/tree/v1) for the older one which is based on the Python [`asdf`](https://github.com/spacetelescope/asdf) Python package.
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[deps]
ASDF = "686f71d1-807d-59a4-a860-28280ea06d7b"
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"

[compat]
Documenter = "1"
10 changes: 9 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ makedocs(;
repo = GitHub("JuliaAstro/ASDF.jl"),
sitename = "ASDF.jl",
format = Documenter.HTML(
prettyurls = true,
canonical = "https://juliaastro.org/ASDF/stable/",
),
pages = [
"Home" => "index.md",
"Introduction" => "intro.md",
"Examples" => [
"JWST" => "examples/jwst.md",
"Roman" => "examples/roman.md",
],
"API" => "api.md",
],
doctest = false,
)

Expand Down
14 changes: 14 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# API

## Public

```@autodocs
Modules = [ASDF]
Private = false
```

## Private
```@autodocs
Modules = [ASDF]
Public = false
```
54 changes: 54 additions & 0 deletions docs/src/examples/jwst.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# JWST

*Adapted from [ADASS 2024 workshop](https://github.com/asdf-format/asdf-adass2024/blob/main/02_working_with_asdf/Working_with_ASDF.ipynb).*

In this example, we show how to use ASDF.jl to load and view some astronomical data taken from the James Webb Space Telescope ([JWST](https://science.nasa.gov/mission/webb/)).

!!! note "Data availability"
The sample data for this example can be [downloaded here](https://data.science.stsci.edu/redirect/Roman/Roman_Data_Workshop/ADASS2024/jwst.asdf) from the data repository of the Space Telescope Science Institute ([STScI](https://www.stsci.edu/)). Note: it is a moderately large file (~100 MB).

## Load

```@repl jwst

fpath = let
data_dir = joinpath("..", "..", "data")
mkpath(data_dir)
joinpath(data_dir, "jwst.asdf")
end;

if !isfile(fpath)
using Downloads: download

download("https://data.science.stsci.edu/redirect/Roman/Roman_Data_Workshop/ADASS2024/jwst.asdf", fpath)
end
```

```@repl jwst
using ASDF

af = load(fpath; extensions = true)
```

## Plot

```@example jwst
using CairoMakie

img_sci = let
img = af["data"][]
img[img .< 0] .= 1
img
end

fig, ax, hm = heatmap(img_sci;
colorrange = (1, 1e3),
colorscale = log10,
colormap = :cividis,
nan_color = :limegreen, # NaNs are handled automatically
)

Colorbar(fig[1, 2], hm)

fig
```
55 changes: 55 additions & 0 deletions docs/src/examples/roman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Roman

*Adapted from [STScI Roman Notebooks](https://spacetelescope.github.io/roman_notebooks/notebooks/working_with_asdf/working_with_asdf.html).*

In this example, we show how to use ASDF.jl to load and view some simulated astronomical data created in preparation for the future ([Nancy Grace Roman Space Telescope](https://science.nasa.gov/mission/roman-space-telescope/)) mission.

!!! note "Data availability"
Simulated data products are currently provided by STScI via [AWS S3 buckets](https://spacetelescope.github.io/roman_notebooks/notebooks/data_discovery_and_access/data_discovery_and_access.html). Note: The data product used for this example is a moderately large file (~300 MB).

## Load

```@repl roman
fpath = let
data_dir = joinpath("..", "..", "data")
mkpath(data_dir)
joinpath(data_dir, "roman.asdf")
end;

if !isfile(fpath)
using AWSS3, AWS
aws_config = AWS.AWSConfig(; creds = nothing, region = "us-east-1")
AWSConfig(nothing, "us-east-1", "json", 3)

# This is a large file, will take some time to download
s3_get_file(
aws_config,
"stpubdata",
"roman/nexus/soc_simulations/tutorial_data/r0003201001001001004_0001_wfi01_f106_cal.asdf",
fpath
)
end
```

```@repl roman
using ASDF

af = load(fpath; extensions = true, validate_checksum = false)
```

## Plot

```@example roman
using CairoMakie

img = af["roman"]["data"][]

fig, ax, hm = heatmap(img[begin:1000, begin:1000]; colorscale = asinh, colorrange = (0.5, 4))

Colorbar(fig[1, 2], hm)

fig
```

!!! note
Some ASDF files produced by the Python implementation of ASDF may save a checksum in its header block computed from the original decompressed file. This will cause ASDF.jl to fail because in constrast, it computes the checksum based on the compressed (i.e., "used data"), as per the [current specification for ASDF](https://www.asdf-format.org/projects/asdf-standard/en/1.0.1/file_layout.html#block-header). To handle this potenial failure mode, we pass `validate_checksum = false` to avoid running the default checksum.
33 changes: 31 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# ASDF.jl

```@autodocs
Modules = [ASDF]
A new [Advanced Scientific Data Format (ASDF)](https://asdf-standard.readthedocs.io/en/latest/index.html) package, written in Julia.


## Quickstart


### Installation

```julia-repl
pkg> add ASDF, OrderedCollections
```

### Usage

```@repl
using ASDF, OrderedCollections

doc = OrderedDict(
"field_1" => [5, 6, 7, 8],
"field_2" => ["up", "down", "left", "right"],
"field_3" => OrderedDict(
"field_3a" => ["apple", "orange", "pear"],
"field_3b" => [1.0, 2.0, 3.0],
)
);

save("example.asdf", doc)

af = load("example.asdf")

ASDF.info(af; max_rows = 3)
```
Loading
Loading