Skip to content
Draft
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
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