forked from i4Ds/STIXCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add first version of ddpd generator based on html * use new fits table read method * add intro block for each product * add first version of ddpd generator based on html * use new fits table read method * add intro block for each product * add description from lookup files * add first version of ddpd generator based on html * add low latency to dpdd * dimension format change * fix download path * update script documentation * add ref to issue i4Ds#224
- Loading branch information
Showing
12 changed files
with
562 additions
and
17 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
counter name description | ||
8 control_index "join index to the control table" | ||
8 time "unique time index: center of bin relative to DATE_BEG" | ||
8 timedel "duration of the time bin" | ||
8 index "index column" | ||
8 integration_time "duration of the (aggregated) time bin" | ||
8 packet "packet ID from XML TM file" | ||
8 parent "the parent fits file(s) of this data entry" | ||
8 raw_file "the RAW TM file from SOC of this data entry" | ||
8 scet_coarse "coarse part (s) of the spacecraft elapsed time (OBT)" | ||
8 scet_fine "fine part (bin s) of the spacecraft elapsed time (OBT)" | ||
8 obt_end "Start of the IDB period in OBT" | ||
8 obt_start "End of the IDB period in OBT" | ||
8 version "valid IDB version for the time period" | ||
6 channel "Energy Band Index" | ||
6 e_high "end of the energy band" | ||
6 e_low "beginning of the energy band" | ||
8 triggers "trigger counts for the time period" | ||
7 counts "pixel counts for the time period" | ||
7 triggers_err "estimated error due to compression alone for the trigger values" | ||
7 variance_err "estimated error due to compression alone for the variance values" | ||
7 real_err "estimated error due to compression alone for the real part values" | ||
7 imaginary_err "estimated error due to compression alone for the imaginary part values" | ||
7 compression_scheme_counts_skm "SKM compression schema parameter used for count values" | ||
7 compression_scheme_triggers_skm "SKM compression schema parameter used for tigger values" | ||
7 compression_scheme_variance_skm "SKM compression schema parameter used for variance values" | ||
7 compression_scheme_spectra_skm "SKM compression schema parameter used for spectra values" | ||
6 rcr "current rate control regime of the instrument" | ||
6 energy_bin_mask "mask for all 32 energy bands used for the combined data" | ||
6 request_id "unique request ID for the BSD processing" | ||
6 counts_err "estimated error due to compression alone for the pixel count values" | ||
6 num_samples "number of data samples" | ||
5 num_substructures "number of science sub packets" | ||
5 time_stamp "OBT time stamp" | ||
5 pixel_mask "mask for all 12 detector pixels used for the combined data" | ||
4 detector_masks "mask for all 32 detectors used for the combined data" | ||
4 detector_mask "mask for all 32 detectors used for the combined data" | ||
4 num_energies "number of energy bins" | ||
3 pixel_masks "mask for all 12 detector pixels used for the combined data" | ||
12 num_samples "number of data samples" | ||
10 tc_packet_id_ref "reference to the TC type that triggered this TM" | ||
10 tc_packet_seq_control "refernece to the TC (counter) that triggered this TM" | ||
4 num_energy_groups "number of energy bands" | ||
4 num_pixel_sets "number of pixelsets in the count structure" | ||
4 energy_bin_edge_mask "mask of 33 bits - setting start and closing points of enery ranges" | ||
1 cha_diode0 "Photodiode A counts|Photodiode A voltage" | ||
1 cha_diode1 "Photodiode B counts|Photodiode B voltage" | ||
1 chb_diode0 "Photodiode C counts|Photodiode C voltage" | ||
1 chb_diode1 "Photodiode D counts|Photodiode D voltage" | ||
1 spectra "spectra count values" | ||
1 spectra_err "estimated error due to compression alone for the spectra values" | ||
1 detector_id "ID of the detector" | ||
1 num_channels "number of channels" | ||
1 subspec_lowest_channel "lowest channel of the subspectra" | ||
1 subspec_num_summed_channel "number of summed channel in spectral point" | ||
1 subspec_num_points "number of spectral points" | ||
1 average_temperature "average temperature" | ||
1 quiet_time "quiet time" | ||
1 det_q1_t "Detector Temperature Quarter 1" | ||
1 det_q2_t "Detector Temperature Quarter 2" | ||
1 det_q3_t "Detector Temperature Quarter 3" | ||
1 det_q4_t "Detector Temperature Quarter 4" | ||
1 hk_asp_photoa0_v "Aspect system Photodiode A0 voltage" | ||
1 hk_asp_photoa1_v "Aspect system Photodiode A1 voltage" | ||
1 hk_asp_photob0_v "Aspect system Photodiode B0 voltage" | ||
1 hk_asp_photob1_v "Aspect system Photodiode B1 voltage" | ||
1 hk_asp_ref_2v5a_v "Aspect System A 2.5V reference" | ||
1 hk_asp_ref_2v5b_v "Aspect System B 2.5V reference" | ||
1 hk_asp_tim01_t "Aspect System Temperature TIM01" | ||
1 hk_asp_tim02_t "Aspect System Temperature TIM02" | ||
1 hk_asp_tim03_t "Aspect System Temperature TIM03" | ||
1 hk_asp_tim04_t "Aspect System Temperature TIM04" | ||
1 hk_asp_tim05_t "Aspect System Temperature TIM05" | ||
1 hk_asp_tim06_t "Aspect System Temperature TIM06" | ||
1 hk_asp_tim07_t "Aspect System Temperature TIM07" | ||
1 hk_asp_tim08_t "Aspect System Temperature TIM08" | ||
1 hk_asp_vsensa_v "Aspect System A supply voltage" | ||
1 hk_asp_vsensb_v "Aspect System B supply voltage" | ||
1 hk_att_c "Attenuator current" | ||
1 hk_att_t "Attenuator temperature" | ||
1 hk_att_v "Attenuator voltage" | ||
1 hk_det_c "Detector current" | ||
1 hk_dpu_1v5_c "IDPU FPGA 1.5V Current" | ||
1 hk_dpu_1v5_v "IDPU FPGA 1.5V" | ||
1 hk_dpu_2v5_c "IDPU FPGA 2.5V Current" | ||
1 hk_dpu_2v9_v "IDPU 2.9V" | ||
1 hk_dpu_3v3_c "IDPU 3.3V Current" | ||
1 hk_dpu_fpga_t "IDPU FPGA Temperature" | ||
1 hk_dpu_pcb_t "IDPU PCB Temperature" | ||
1 hk_dpu_spw0_v "SpaceWire Main Supply Voltage" | ||
1 hk_dpu_spw1_v "SpaceWire Redundant Supply Voltage" | ||
1 hk_dpu_spw_c "IDPU SpaceWire Current" | ||
1 hk_hv_01_16_v "High Voltage supply for Detectors 1-16" | ||
1 hk_hv_17_32_v "High Voltage supply for Detectors 17-32" | ||
1 hk_psu_temp_t "PSU Temperature" | ||
1 hk_ref_2v5_v "IDPU 2.5V Analog Reference" | ||
1 live_time "live time" |
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
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,42 @@ | ||
from collections import defaultdict | ||
|
||
from stixcore.products.product import GenericProduct | ||
from stixcore.time.datetime import SCETimeRange | ||
|
||
|
||
class LightCurve(GenericProduct): | ||
""""Low Latency Quick Look Light Curve data product. | ||
for Low Latency Processing | ||
""" | ||
def __init__(self, *, service_type, service_subtype, ssid, control, data, | ||
idb_versions=defaultdict(SCETimeRange), **kwargs): | ||
super().__init__(service_type=service_type, service_subtype=service_subtype, | ||
ssid=ssid, control=control, data=data, idb_versions=idb_versions, **kwargs) | ||
self.name = 'lightcurve' | ||
self.level = kwargs.get('level', 'LL01') | ||
self.type = 'ql' | ||
|
||
@classmethod | ||
def is_datasource_for(cls, *, service_type, service_subtype, ssid, **kwargs): | ||
return (kwargs['level'] == 'LL01' and service_type == 21 | ||
and service_subtype == 6 and ssid == 30) | ||
|
||
|
||
class FlareFlag(GenericProduct): | ||
"""Low Latency Quick Look Flare Flag and Location data product. | ||
for Low Latency Processing | ||
""" | ||
def __init__(self, *, service_type, service_subtype, ssid, control, data, | ||
idb_versions=defaultdict(SCETimeRange), **kwargs): | ||
super().__init__(service_type=service_type, service_subtype=service_subtype, | ||
ssid=ssid, control=control, data=data, idb_versions=idb_versions, **kwargs) | ||
self.name = 'flareflag' | ||
self.level = kwargs.get('level', 'LL01') | ||
self.type = 'ql' | ||
|
||
@classmethod | ||
def is_datasource_for(cls, *, service_type, service_subtype, ssid, **kwargs): | ||
return (kwargs['level'] == 'LL01' and service_type == 21 | ||
and service_subtype == 6 and ssid == 34) |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import tempfile | ||
from pathlib import Path | ||
from collections import defaultdict | ||
|
||
from astropy.io import fits | ||
|
||
from stixcore.data.test import test_data | ||
from stixcore.idb.manager import IDBManager | ||
from stixcore.products.product import Product | ||
|
||
name_counter = defaultdict(int) | ||
|
||
IDB = IDBManager(test_data.idb.DIR).get_idb("2.26.34") | ||
|
||
collector = defaultdict(lambda: defaultdict(list)) | ||
files = [ | ||
# L0 | ||
# science | ||
"L0/21/6/20/solo_L0_stix-sci-xray-rpd_0678187309f00000-0678187429f00000_V01_2106280011-54760.fits", # noqa | ||
"L0/21/6/21/solo_L0_stix-sci-xray-cpd_0688454771f32768-0688455372f13108_V01_2110250007-65280.fits", # noqa | ||
"L0/21/6/22/solo_L0_stix-sci-xray-spd_0678187309f00000-0678187429f58982_V01_2106280006-54720.fits", # noqa | ||
"L0/21/6/23/solo_L0_stix-sci-xray-vis_0678187308f65535-0678187429f58982_V01_2106280004-54716.fits", # noqa | ||
"L0/21/6/42/solo_L0_stix-sci-aspect-burst_0687412111f52953-0687412634f03145_V01_0.fits", # noqa | ||
"L0/21/6/24/solo_L0_stix-sci-xray-spec_0689786926f13107-0689801914f19660_V01_2111090002-50819.fits", # noqa | ||
# QL | ||
"L0/21/6/31/solo_L0_stix-ql-background_0668822400_V01.fits", | ||
"L0/21/6/34/solo_L0_stix-ql-flareflag_0684547200_V01.fits", | ||
"L0/21/6/30/solo_L0_stix-ql-lightcurve_0684892800_V01.fits", | ||
"L0/21/6/33/solo_L0_stix-ql-variance_0687484800_V01.fits", | ||
"L0/21/6/32/solo_L0_stix-ql-spectra_0680400000_V01.fits", | ||
"L0/21/6/41/solo_L0_stix-cal-energy_0683856000_V01.fits", | ||
# HK | ||
"L0/3/25/2/solo_L0_stix-hk-maxi_0647913600_V01.fits", | ||
"L0/3/25/1/solo_L0_stix-hk-mini_0643507200_V01.fits"] | ||
|
||
remote = ["http://pub099.cs.technik.fhnw.ch/data/fits_test/" + x for x in files] | ||
# files = ["/home/shane/fits_test/" + x for x in files] | ||
files = [("/home/shane/fits_test_latest/" + x, remote[i]) for i, x in enumerate(files)] | ||
|
||
with tempfile.TemporaryDirectory() as tempdir: | ||
temppath = Path(tempdir) | ||
for f, rm in files: | ||
try: | ||
pr = Product(f) | ||
prLB = Product(pr.parent) | ||
prlb = Product(Path("/home/shane/fits_test_latest/LB/21/6/20/")) | ||
# / header.get("parent")) | ||
|
||
header = fits.getheader(f) | ||
collector[pr.level][pr.type].append((pr, header)) | ||
except Exception as e: | ||
print(e) |
Oops, something went wrong.