Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions stixcore/processing/L0toL1.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def process_fits_files(self, files=None):
batch = 0
prio = 3
product_type = str(file.parent)
if "L0" in file._parts:
product_type = tuple(map(int, file._parts[file._parts.index("L0") + 1 : -1]))
if "L0" in file.parts:
product_type = tuple(map(int, file.parts[file.parts.index("L0") + 1 : -1]))
if product_type[0] == 21 and product_type[-1] in {20, 21, 22, 23, 24, 42}: # sci data
product_types_batch[product_type] += 1
prio = 2
Expand Down
10 changes: 8 additions & 2 deletions stixcore/products/level1/quicklookL1.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,16 @@ def from_level0(cls, l0product, parent=""):
# fix for wrong calibration in IDB https://github.com/i4Ds/STIXCore/issues/432
# nix00122 was wrong assumed to be in ds but it is plain s
l1.control["integration_time"] = l1.control["integration_time"] * 10
# rescale for idb >= 36
scale_lt = 100.0
scale_qt = 100000.0
if max([int(vl.split(".")[2]) for vl in l1.idb_versions.keys()]) < 36:
scale_lt = 1
scale_qt = 0.1
# nix00124 was wrong assumed to be in ds but it is unscaled ms
l1.control["live_time"] = (l1.control["live_time"] / 100.0).to("ms").astype(np.uint32)
l1.control["live_time"] = (l1.control["live_time"] / scale_lt).to("ms").astype(np.uint32)
# nix00124 was wrong assumed to be in s but it is us
l1.control["quiet_time"] = (l1.control["quiet_time"] / 100000.0).to("us")
l1.control["quiet_time"] = (l1.control["quiet_time"] / scale_qt).to("us")
return l1


Expand Down
5 changes: 2 additions & 3 deletions stixcore/products/product.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from pathlib import Path
from datetime import datetime
from datetime import datetime, timezone
from itertools import chain

import numpy as np
import pytz
from sunpy.time.timerange import TimeRange
from sunpy.util.datatype_factory_base import (
BasicRegistrationFactory,
Expand Down Expand Up @@ -50,7 +49,7 @@

# date when the min integration time was changed from 1.0s to 0.5s needed to fix count and time
# offset issue
MIN_INT_TIME_CHANGE = datetime(2021, 9, 6, 13, tzinfo=pytz.UTC)
MIN_INT_TIME_CHANGE = datetime(2021, 9, 6, 13, tzinfo=timezone.utc)


def read_qtable(file, hdu, hdul=None):
Expand Down
Loading