Workout how to get the Quality information from GOES FITS

Open
#6,275 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
numpy, python
Domain
data

Research direction

Read the existing netCDF quality implementation introduced by #6290, then inspect the FITS Status data from sunpy.io.read_file at hdulist[3]. Establish how the status bits map to XRS-A and XRS-B and make the FITS and netCDF quality representations consistent; done means both formats expose equivalent quality information.

Written by the indexing model from the issue text.

Description

Effort Medium Feature Request Package Novice Priority Medium timeseries

WIth #6290 merged in, we have quality flags for the netcdf files but not the FITS.

We need to unify that.

See the comment below:

When looking at the FITS header the following information is contained,
e.g. for https://umbra.nascom.nasa.gov/goes/fits/2019/go1520191210.fits:

import sunpy.io
from sunpy.util.metadata import MetaDict
from collections import OrderedDict

filepath= "./go1520191210.fits"
hdulist = sunpy.io.read_file(filepath)
header = MetaDict(OrderedDict(hdulist[3].header))
print(header)
print(hdulist[3].data)
>FITS_rec([(0.55999994, [0., 0.])],
         dtype=(numpy.record, [('Time', '>f4'), ('Status', '>f4', (2,))]))

The following doc is provided for Status, however it is not clear to me how the status maps to xrsa and xrsb (e.g. in netcdf format there is a value for each channel and measurement):

Convert status words to long integer then examine bits.Status
1 - octal mask, description (incomplete list):

  • 1000, Sun eclipsed by MoonStatus
    2 - octal mask, description (incomplete list):
  • 1, X-Ray detector off
  • 2, X-Ray detector being calibrated
  • 4, X-Ray Transient
  • 10, X-Ray short channel saturation
  • 20, X-Ray long channel range change
  • 40, X-Ray short channel range change
  • 200, X-Ray long channel saturation')

Does someone know how to extract this information?

Originally posted by @mariusgiger in https://github.com/sunpy/sunpy/pull/6260#discussion_r900046426

Dominant language
Python
Stars
1k
Forks
682
Avg merge
1d 17h
Merged PRs (30d)
17

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sunpy/sunpy

All issues in sunpy/sunpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.