Skip to content

Commit 37a0fd5

Browse files
authored
Merge pull request #12 from Caltech-IPAC/spherex-cutouts-update
Documentation on cutouts, mostly
2 parents 4011c89 + 0681436 commit 37a0fd5

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

documentation/spherex_data_access.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ IRSA provides layered access to these data to support a variety of use cases and
55
These layers include:
66

77
* **Browsable Directories:** SPHEREx on-premises data products are laid out in directories that can be navigated with standard web browsers.
8-
* **Application Program Interfaces:** IRSA provides SPHEREx data access APIs that are compliant with International Virtual Observatory Alliance (IVOA) standards.
8+
* **Application Program Interfaces:** IRSA provides SPHEREx data access APIs, most of which are compliant with International Virtual Observatory Alliance (IVOA) standards.
99
* **Python Packages:** SPHEREx data at IRSA are accessible via the Python packages pyvo and astroquery
1010
* **SPHEREx Data Explorer:** IRSA provides a web-based Graphical User Interface (GUI) that makes it easy to search for, visualize, and download SPHEREx data.
1111

1212
Each of these data access layers is described in greater detail in the subsections below.
1313

1414
## Browsable Directories
1515
SPHEREx data products are laid out in directories that can be navigated with standard web browsers.
16-
This is convenient for users to get a quick sense of the types of data products that are available, to quickly download some examples by clicking through the directory tree, and to script bulk downloads using wget or curl.
16+
This is convenient for users to get a quick sense of the types of data products that are available, to quickly download some examples by clicking through the directory tree, and to script bulk downloads using `wget` or `curl`.
1717

1818
The root of the SPHEREx data quick release data directories is:
1919
https://irsa.ipac.caltech.edu/ibe/data/spherex/qr
@@ -35,6 +35,8 @@ The content of each subdirectory is described in greater detail in the Data Prod
3535

3636
## Application Program Interfaces (APIs)
3737

38+
### SPHEREx Spectral Image MEFs and Calibration Files are available through the IVOA Simple Image Access Protocol
39+
3840
IRSA provides API access to SPHEREx Spectral Images through version 2 of the VO Simple Image Access (SIA2) protocol.
3941
SIA2 allows users to query for a list of images that satisfy constraints based on position(s) on the sky, band, time, ID, and instrument.
4042
The list returned by the service includes data access URLs, which can be used to retrieve some or all of the images in the list using wget or curl.
@@ -47,12 +49,12 @@ Due to the nature of the ingestion process, new SPHEREx data will first be avail
4749
Availability via SIA2 and Python libraries like Astroquery and PyVO will lag on the order of a day.
4850
:::
4951

50-
IRSA's generric SIA2 endpoint is:
52+
IRSA's generic SIA2 endpoint is:
5153

5254
`https://irsa.ipac.caltech.edu/SIA?`
5355

5456
Users must add a `COLLECTION` parameter to this endpoint to specify which dataset to search.
55-
There are three SPHEREx-related SIA2 collections:
57+
There are three SPHEREx-related SIA2 collections:
5658

5759
* SPHEREx Quick Release Spectral Image MEFs that are part of the SPHEREx **Wide Survey** can be accessed with: `COLLECTION=spherex_qr`
5860

@@ -63,9 +65,21 @@ Users must add a `COLLECTION` parameter to this endpoint to specify which datase
6365
You can use `wget` or `curl` to submit SIA2 queries from the command line.
6466
For example:
6567

66-
* `wget -O example1.html "https://irsatest.ipac.caltech.edu/SIA?COLLECTION=spherex_qr&POS=circle+127.69444+-39.17760+0.01&RESPONSEFORMAT=HTML"`
68+
* `wget -O example1.html "https://irsa.ipac.caltech.edu/SIA?COLLECTION=spherex_qr&POS=circle+127.69444+-39.17760+0.01&RESPONSEFORMAT=HTML"`
69+
70+
See the section on Python packages to learn how to use Python wrappers around IRSA’s SIA2 service.
71+
72+
### Cutouts of SPHEREx Spectral Image MEFs
73+
74+
SPHEREx Spectral Image MEFs are available on premises at IPAC and on the cloud.
75+
76+
If you have identified the access URL for an on-premises Spectral Image, you can request a cutout of this MEF by appending a query string containing the center and size parameters. The parameters are described in more detail here:
77+
78+
`https://irsa.ipac.caltech.edu/ibe/cutouts.html`
79+
80+
**Example:**
6781

68-
See the next section to learn how to use Python wrappers around IRSA’s SIA2 service.
82+
`curl -o cutout.fits "https://irsa.ipac.caltech.edu/ibe/data/spherex/qr/level2/2025W19_2B/l2b-v11-2025-163/3/level2_2025W19_2B_0073_2D3_spx_l2b-v11-2025-163.fits?center=156.09328159,-41.64466331&size=0.1"`
6983

7084
## Python packages: PyVO & Astroquery
7185

documentation/spherex_data_products.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPHEREx Data Products Available at IRSA
1+
SPHEREx Data Products Available at IRSA
22

33
A detailed description of SPHEREx data products available to the public is provided in the [SPHEREx Explanatory Supplement](https://irsa.ipac.caltech.edu/data/SPHEREx/docs/SPHEREx_Expsupp_QR.pdf).
44
Here we provide a concise summary of the science, calibration, and additional data products available at IRSA.
@@ -7,7 +7,10 @@ This summary includes filenaming conventions, for which we adopt the following d
77
- `Planning Period` designates the survey plan uploaded to the spacecraft, e.g. `2025W18_2B`.
88
Each planning period covers approximately 3.5 days of operation.
99

10-
- `Observation ID` includes the survey planning period and the large and small slew counters, e.g. `2025W18_2B_0001_1`.
10+
- `Observation ID` includes the survey planning period and the large and small slew counters.
11+
For example, `2025W18_2B_0001_1` contains the planning period (`2025W18_2B`), the large slew counter (`0001`), and the small slew counter (`1`).
12+
Each large slew has a maximum of 4 small slews, so the allowed small slew counter range is 1 to 4.
13+
Some large slews will have fewer than 4 small slews.
1114

1215
- `Detector` is an integer from 1 through 6.
1316

@@ -18,8 +21,10 @@ Each planning period covers approximately 3.5 days of operation.
1821

1922
## Main Science Data Product: Spectral Image Multi-Extension FITS Files (MEF)
2023

21-
The main Quick Release data product is the Level 2 Spectral Image MEF.
24+
The main Quick Release data product is the Level 2 Spectral Image MEF,as described in Section 2.1 of the [Explanatory Supplement](https://irsa.ipac.caltech.edu/data/SPHEREx/docs/SPHEREx_Expsupp_QR.pdf).
25+
2226
There are 6 Spectral MEFs (one for each detector) for each sky pointing.
27+
Because data quality assessments are evaluated per spectral image band, some observations will not include all 6 bands in the archive.
2328
Each Spectral MEF is approximately 70 MB and contains 6 extensions:
2429

2530
HDU 1: IMAGE
@@ -40,7 +45,7 @@ HDU 1: IMAGE
4045

4146
HDU 2: FLAGS
4247
: Bitmap of per-pixel status and processing flags, stored as a 2040 x 2040 image.
43-
The definition of the flags are provided in Table 8 of the [SPHEREx Explanatory Supplement](https://irsa.ipac.caltech.edu/data/SPHEREx/docs/SPHEREx_Expsupp_QR.pdf).
48+
The definition of the flags are provided in Table 10 of the [SPHEREx Explanatory Supplement](https://irsa.ipac.caltech.edu/data/SPHEREx/docs/SPHEREx_Expsupp_QR.pdf).
4449

4550
HDU 3: VARIANCE
4651
: Variance of calibrated surface brightness flux in units of (MJy/sr)^2, stored as a 2,040 x 2,040 image.
@@ -78,6 +83,30 @@ HDU 6: WCS-WAVE
7883

7984
- `level2_2025W18_2B_0001_1D1_spx_l2b-v12-2025-164.fits`
8085

86+
## Cutouts of Spectral Image MEFs
87+
88+
IRSA enables users to access rectangular cutouts of a SPHEREx Spectral Image MEF by simply appending a [query string](https://irsa.ipac.caltech.edu/ibe/cutouts.html) containing center and size parameters to the image URL.
89+
These cutout MEFs contain the same HDUs as the original Spectral Images (IMAGE, FLAGS, VARIANCE, ZODI, PSF, WCS-WAVE). However, the IMAGE, FLAGS, VARIANCE, AND ZODI HDUs have been modified to include only those pixels within the specified cutout size.
90+
The WCS-WAVE HDU has also modified to provide the correct mapping between the pixels in the cutout to wavelength.
91+
The PSF HDU from the original spectral image is included unmodified in the cutout MEF.
92+
93+
The spatially-varying PSF is represented as an image cube with 121 planes.
94+
Each plane is a 101x101 pixel image representing a PSF for a different region of the detector. Users interested in performing photometry on a cutout using the information in the cutout PSF HDU will need to understand how to find the most applicable PSF cube plane for each pixel in the cutout.
95+
The basic steps are described below, and a [Python notebook tutorial](https://caltech-ipac.github.io/irsa-tutorials/) is provided to help users get started with a simple implementation.
96+
97+
1. Determine the 0-based pixel coordinates of the position of interest in the IMAGE HDU of the cutout.
98+
99+
2. Determine the 0-based pixel coordinates of the position of interest in the IMAGE HDU of the original Spectral Image.
100+
101+
```
102+
xpix_orig = 1 + xpix_cutout - CRPIX1A
103+
ypix_orig = 1 + ypix_cutout - CRPIX2A
104+
```
105+
106+
3. Examine the header of the PSF HDU of the cutout to determine the PSF zone and cube plane corresponding to the pixel of interest in the original Spectral Image.
107+
108+
The PSF HDU has a header containing the keywords `XCTR_*`, `YCTR_*`, `XWID_*`, and `YWID_*`, where * goes from [1 to 121].
109+
To determine if a pixel in the original Spectral Image falls within a PSF zone, simply find the closest `XCTR_*` and `YCTR_*` to determine the cube plane that contains the corresponding PSF for this zone.
81110

82111
## Calibration Product: Absolute Gain Matrix
83112

0 commit comments

Comments
 (0)