-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fits meta #12
Merged
Merged
Fits meta #12
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
113394c
improvement to photon fits files
ehsteve 0dd86b8
add test for baseline
ehsteve 95f6a41
baseline aware file processing
ehsteve 44ba969
adding more meta data to file files and new organization
ehsteve a8e2ec5
adding metadata and reading fits files
ehsteve b7b91a0
added and re-organized documentation
ehsteve 1628df4
added housekeeping l1 fits files
ehsteve a826db3
cleaning up fits tools
ehsteve 51bbde9
first working commit of fits file creation
ehsteve 5727a10
bug fix for cmd_resp
ehsteve 564f1da
Update util.py
ehsteve be87157
bug fix and protecting has_baseline
ehsteve c0a5b02
Merge remote-tracking branch 'upstream/main' into fits_meta
ehsteve 9ed516f
fixed swxsoc config and added tests
ehsteve 39d5545
Update fits_tools.py
ehsteve 1fe918f
Update fits_tools.py
ehsteve 39865f8
Update fits_tools.py
ehsteve 08501b4
Update calibration.py
ehsteve 5e05673
removed unneeded config
ehsteve 4400edd
made gitpython module optional
ehsteve c6b1fb8
black
ehsteve 0bb8dc1
Update __init__.py
ehsteve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,36 +6,72 @@ Level 0 Data | |
|
||
Overview | ||
======== | ||
This section document the format of the level 0 binary files. | ||
Level 0 binary files are raw telemetry or command response packets generated by the instrument. | ||
|
||
|
||
Photon Packet | ||
------------- | ||
The packet which provides individual hit data or photons for each detector. | ||
|
||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Name | Bit Size | Type | Description | | ||
+=============+===========+========+============================================================+ | ||
| HEADER WORD | 16 | UINT | value is always 65131 | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| FLAGS | 16 | UNIT | various flags, To be defined | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Packet Size | 16 | UINT | The size of the packet which can be used to determine the | | ||
| | | | number of hits included in the packet | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Time Stamp | 48 | UINT | | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Checksum | 16 | UINT | For data integrity | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Pixel data | | | This field is repeated based on the number of hits detected| | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
|
||
|
||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Pixel Data | | | | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Detector id | 16 | UINT | The detector id for the location of the hit | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Hit energy | 16 | UINT | The ADC value for the energy of the hit | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
Level 0 data are provided in the `FITS file <https://fits.gsfc.nasa.gov/>`__ format. | ||
For more information on how to read or write FITS file see `astropy.fits <https://docs.astropy.org/en/stable/io/fits/index.html>`__. | ||
This section describes the organization the level 0 FITS files. | ||
Level 0 fits files generally include the unconverted data from the raw binary files of ccsds packets. | ||
The purpose of these files is to provide the raw data from the raw binary files in a more convinient form for analysis. | ||
It also provides metadata information which summary the data in the file. | ||
|
||
Level 0 event files | ||
------------------- | ||
|
||
This file contains the data from all events that triggered the detectors. | ||
They consist of 3 HDUs including the primary HDU. | ||
The primary HDU contains no data and is only used for metadata. | ||
The two other HDUs are named `SCI` and `PKT`. | ||
`SCI` includes the event data while `PKT` includes the packet data. | ||
Each data packet may include one of more event therefore there is a one to many relationship between them. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am confused by this. Should it say "Each data packet may include one or more events, therefore there is a one to many..."? |
||
In order to understand the relationship between the events and packets, each event provides the associated packet sequence number. | ||
This sequence number can be used to lookup the packet data for that event. | ||
|
||
Primary HDU | ||
*********** | ||
No data is provided. | ||
Stay tuned for a list of metadata | ||
|
||
PKT HDU | ||
******* | ||
The following columns are provided for each data packet. | ||
The bits column provide the number of significant bits and not the bit length of the column itself. | ||
The columns in the FITS file are provided in the smallest possible data type. | ||
|
||
======== ============================================= ==== | ||
name bits | ||
======== ============================================= ==== | ||
seqcount packet sequence number, should be consecutive 12 | ||
pkttimes the packet time in seconds since EPOCH 32 | ||
pktclock the packet subsecond time in clocks 32 | ||
livetime live time 16 | ||
inttime integration time in real time 16 | ||
flags flags 16 | ||
======== ============================================= ==== | ||
|
||
SCI HDU | ||
******* | ||
The following columns are provided for each event or photon detected. | ||
The bits column provide the number of significant bits and not the bit length of the column itself. | ||
The columns in the FITS file are provided in the smallest possible data type. | ||
|
||
======== ============================================================================================ ==== | ||
name description bits | ||
======== ============================================================================================ ==== | ||
seqcount packet sequence number 12 | ||
clocks the clock number 16 | ||
asic the asic number or detector id 3 | ||
channel the asic channel which is related to the pixel 5 | ||
atod the uncalibrated energy of the event in ADC counts 12 | ||
baseline the baseline measurement if exists, otherwise all zeros 12 | ||
pkttimes the packet time in seconds since EPOCH, also exists in PKT, 32 | ||
pktclock the packet time in clocks since EPOCH, also exists in PKT 32 | ||
======== ============================================================================================ ==== | ||
|
||
Level 0 spectrum files | ||
---------------------- | ||
Summary spectra are created for 24 pixels at a regular cadence (normally every 10 s) | ||
Each spectrum has a total of 512 energy bins. | ||
|
||
Level 0 housekeeping files | ||
-------------------------- | ||
These files contain housekeeping data as described in the housekeeping packet. | ||
It also includes any register read responses that may exist during that time period. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _raw: | ||
|
||
*************** | ||
Raw Binary Data | ||
*************** | ||
|
||
Overview | ||
======== | ||
This section document the format of the raw binary files. | ||
Level 0 binary files are raw telemetry or command response packets generated by the instrument. | ||
|
||
|
||
Photon Packet | ||
------------- | ||
The packet which provides individual hit data or photons for each detector. | ||
|
||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Name | Bit Size | Type | Description | | ||
+=============+===========+========+============================================================+ | ||
| HEADER WORD | 16 | UINT | value is always 65131 | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| FLAGS | 16 | UNIT | various flags, To be defined | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Packet Size | 16 | UINT | The size of the packet which can be used to determine the | | ||
| | | | number of hits included in the packet | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Time Stamp | 48 | UINT | | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Checksum | 16 | UINT | For data integrity | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Pixel data | | | This field is repeated based on the number of hits detected| | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
|
||
|
||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Pixel Data | | | | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Detector id | 16 | UINT | The detector id for the location of the hit | | ||
+-------------+-----------+--------+------------------------------------------------------------+ | ||
| Hit energy | 16 | UINT | The ADC value for the energy of the hit | | ||
+-------------+-----------+--------+------------------------------------------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change "summary" to "summarizes".