Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b613a81
curve pos limit from 40 to 30 (#28)
sora-ryu Oct 29, 2026
cd9da36
add trailing semicolon to QA0 template (#30)
sora-ryu Oct 29, 2026
43010ff
fix qa0 format with trailing semicolon + add validation (#30)
sora-ryu Oct 29, 2026
e2de9cf
fix valid qa0 format
sora-ryu Nov 2, 2026
a33a33a
remove Kn lower than 0.01 (#25)
sora-ryu Nov 3, 2026
9a27c01
exclude sza<80 (#26)
sora-ryu Nov 3, 2026
f676b84
update readme with qafit advanced features
sora-ryu Nov 3, 2026
5dd939f
fix boundary curve and position plotting with correct numbers, formul…
sora-ryu Nov 3, 2026
3892de6
new logo and disclaimer
sora-ryu Nov 3, 2026
957081e
make sure kt, kn max for each airmass treated independently (#34)
sora-ryu Nov 5, 2026
08fbf90
make sure reset works properly with non-zero values
sora-ryu Nov 5, 2026
874c09e
make sure reset works properly with zero values
sora-ryu Nov 5, 2026
b1c01e8
allow Kt over 99
sora-ryu Nov 5, 2026
79b6d32
Kt Max only go up to 130
sora-ryu Nov 9, 2026
0d20296
confirm SZA calculation
sora-ryu Nov 12, 2026
ff5c66f
curve and position numbers matched with reference SRRL
sora-ryu Nov 13, 2026
7c19ae1
calculate ETRN using inverse-square law with sun-earth distance
sora-ryu Nov 13, 2026
f83b2ce
implement k-value rounding and bounds clamping to match C program beh…
sora-ryu Nov 13, 2026
3da8a43
remove disclaimer text (#49)
sora-ryu Nov 24, 2026
cbe281f
List record data header (#44)
sora-ryu Nov 24, 2026
9499617
subprocess is needed to pop up + txt header aligned (#44)
sora-ryu Nov 24, 2026
0de5d8a
write XT, XN, XD for K-space values to store naive fractional K-space…
sora-ryu Nov 25, 2026
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
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ jobs:
if: runner.os == 'Windows'
run: >-
python -m PyInstaller --noconfirm --clean --windowed --onefile
--name QAFIT-windows --icon dataFiles/qcfit-icon.ico
--name QAFIT-windows --icon dataFiles/qafit-icon.ico
--add-data "dataFiles;dataFiles" qafit_script.py

- name: Generate macOS application icon
if: runner.os == 'macOS'
run: >-
python -c "from PIL import Image; image = Image.open('dataFiles/qafit-icon.ico'); image.save('qafit.icns', format='ICNS')"

- name: Build macOS application
if: runner.os == 'macOS'
run: >-
python -m PyInstaller --noconfirm --clean --windowed --onedir
--name QAFIT-macos --add-data "dataFiles:dataFiles" qafit_script.py
--name QAFIT-macos --icon qafit.icns
--add-data "dataFiles:dataFiles" qafit_script.py

- name: Package macOS application
if: runner.os == 'macOS'
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Python tests

on:
push:
branches:
- "**"
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
pytest:
name: pytest (Python 3.10)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install test dependencies
run: python -m pip install numpy==1.24.4 pandas==1.5.3 Pillow==9.5.0 "pytest>=8,<10"

- name: Run tests
run: python -m pytest tests -v
30 changes: 30 additions & 0 deletions SERI-QC_with_QAFIT/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,36 @@ Advanced features:
- displays the points those fails by 3-component filtering
- data point list saved as *.csv and *.txt

(As of Oct 7 2026, QAFIT upgraded from QCFIT)
- wider Ktmax and Knmax readouts in all three main-window panels accommodate three-digit values
- the main window title shows the selected station's code and description
- new QA0 files use aligned air-mass headers and `Kn-Kt S-PP S-PP;` groups, with two-digit Kn and three-digit Kt fields; unconfigured months retain `00-000 0-00 0-00;` defaults
- Save writes the same monthly row format; existing QA0 files without a final semicolon remain readable
- malformed QA0 files show a `QA0 File Error` dialog with the file path and the invalid field or boundary row; opening and saving stop without overwriting the file
- boundary-value errors identify the month, air-mass range, field, and offending value; separator errors are reported separately
- Help -> About displays the entire disclaimer image, resized proportionally to fit its panel when the window is resized
- QAFIT excludes points with unrounded Kn <= 0.01 (1%) from all K-space plots and automatic curve fitting, in every air-mass range and plane; the Y-axis still starts at zero
- QAFIT filters input immediately after SZA calculation: only rows with calculated SZA < 80 degrees and positive extraterrestrial irradiance proceed to K-space processing, fitting, and graphing
- curve positions are one-based: position 1 has no horizontal shift, and each subsequent position adds 2.5 percentage points; plotted boundaries and Configure adjustments use the same shift as automatic fitting
- fitting area tables include all 8 left curves and 7 right curves at positions 1 through 30; both initial fitting and Configure refitting look up areas by curve and position

Application icons:

QAFIT uses Tk photo icons generated from `dataFiles/qafit-icon.ico` for its windows, including dialogs and plot windows. Native window-icon visibility depends on the desktop environment; macOS does not show ordinary title-bar icons.

The macOS build workflow converts the same artwork to ICNS and embeds it in the `.app` bundle for Finder and Dock. Rebuild and launch the packaged app to see the new bundle icon; running the Python script directly does not set the Finder icon of the Python executable. The Windows build embeds the ICO in the executable.

Testing:

From the repository root, using the application's Python environment:

```bash
python -m pip install "pytest>=8,<10"
python -m pytest tests -v
```

The GitHub Actions `Run Python tests` workflow runs the tests on pushes, pull requests, and manual dispatches using Python 3.10. QA0 samples are embedded in the tests; external data files and GUI access are not required.

About SERI-QC:

SERI-QC is a mathematical software package that assesses the quality of solar radiation data. Flags are set to inform the user of any departure of the data from expected values. These flags indicate the magnitude and direction of such departures. Flags only indicate that data do or do not fall within expected ranges. This does not mean that the data are or are not valid. Check Maxwell, 1993 for description of flags.
Expand Down
7 changes: 2 additions & 5 deletions SERI-QC_with_QAFIT/curveArea.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@ def getArea(shape):
y = [int(i) for i in y]
if shape == "left":
curve = ut.curveLeft
end = 7
elif shape == "right":
curve = ut.curveRight
end = 6
else:
print("Shape should be <left> or <right>")
return

cols = {"y": y}
for i in range(1, end):
for j in range(1, 21):
for i in range(1, len(curve) + 1):
for j in range(1, 31):
val = []
toAdd = 0
shift = (j - 1) * 2.5
Expand Down Expand Up @@ -210,6 +208,5 @@ def getArea(shape):






31 changes: 15 additions & 16 deletions SERI-QC_with_QAFIT/dataFiles/blankQA0
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@
--- Elevation:
--- Time Zone:

---Low Airmass-- ---Med Airmass-- --High Airmass--
-MAX- -LFT RGT- -MAX- -LFT RGT- -MAX- -LFT RGT-
KN KT S P S P KN KT S P S P KN KT S P S P

JAN: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
FEB: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
MAR: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
APR: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
MAY: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
JUN: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
JUL: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
AUG: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
SEP: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
OCT: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
NOV: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
DEC: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00
---Low Airmass--- ---Med Airmass--- ---High Airmass--
-Max- -Lft Rgt- -Max- -Lft Rgt- -Max- -Lft Rgt-
Kn Kt S P S P Kn Kt S P S P Kn Kt S P S P
JAN: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
FEB: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
MAR: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
APR: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
MAY: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
JUN: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
JUL: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
AUG: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
SEP: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
OCT: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
NOV: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;
DEC: 00-000 0-00 0-00; 00-000 0-00 0-00; 00-000 0-00 0-00;

DEFAULT CONFIGURATION
Integration (minutes):
Expand Down
Binary file added SERI-QC_with_QAFIT/dataFiles/disclaimer_qafit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added SERI-QC_with_QAFIT/dataFiles/qafit-icon.ico
Binary file not shown.
Loading
Loading