From b863715572cd11399f66dfd44f981185cd64e1f2 Mon Sep 17 00:00:00 2001
From: Jason Pruitt <55477390+Json-To-String@users.noreply.github.com>
Date: Mon, 24 Nov 2025 23:58:33 -0500
Subject: [PATCH 1/3] Add first step in transition from keras to torch
---
README.md | 54 ++++++++++-------------------------------------
pyproject.toml | 52 +++++++++++++++++++++++++++++++++++++++++++++
src/check_cuda.py | 3 +++
3 files changed, 66 insertions(+), 43 deletions(-)
create mode 100644 pyproject.toml
create mode 100644 src/check_cuda.py
diff --git a/README.md b/README.md
index 01479eb8..9b494f37 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,4 @@
# Current working summary of project:
-(Writeup/Masters Project Report will be included in the repo soon)
-(Presentation will be added as well)
* Take 5437 objects from [Wittmann et al.](https://iopscience.iop.org/article/10.3847/1538-4365/ab4998)
* 7 distinct classes from paper - grouped into 2 / binary classification
@@ -14,13 +12,13 @@
* Fed model grayscale images to train and classify - performance lowered so we are confident in the method including color.
* Train/test split yields good results, but now we wish to move further out from the center of the PCC where Wittmann et al considered, so we use SDSS SQL queries to obtain more data.
* Use SQL to define selection regions in the Red Sequence and radially outward from the center of the cluster. We notice that stars appear here, even though their photometric flag suggests they are galaxies.
- * Currently trying to find if there are [flags](https://live-sdss4org-dr16.pantheonsite.io/algorithms/flags_detail/) that appear for stars and not galaxies but this is proving difficult
+ * Currently trying to find if there are [flags](https://www.sdss4.org/dr16/algorithms/image_quality/) that appear for stars and not galaxies but this is proving difficult
* One attempt was to look at the Spectroscopic redshift (z) of the object to discriminate between stars and galaxies' flags but their flags seem mixed
* Ignoring the presence of galaxies classified as stars, adding new data based off of Spectroscopic Redshift to the training set helped bolster model performance against independent new data.
* Confirmed that adding these new objects did in fact yield good results with an independent testset, searching 90 arcmins radially outward from the center of the Perseus Cluster, and subtracting out common objects with training data.
(8/27/24)
-* Current steps are to ensure project is reproducable, will include requirements.txt and build steps. Restructuring to implement better practices and formats.
+* Current steps are to ensure project is reproducible, will include requirements.txt and build steps. Restructuring to implement better practices and formats.
* Was recommended to explore k-fold cross validation for another check of model robustness
```
@@ -36,7 +34,7 @@ JPAstro/ (New name may be needed. Below are the most important files in each dir
│ └── WriteUpFigs/
├── Models/
├── Notebooks/
-│ ├── perseusResNet50.ipynb (main notebook/driver)
+│ ├── entire-pipeline.ipynb (main notebook/driver)
│ ├── post-training.ipynb
│ ├── Resnet Model Testing.ipynb
│ ├── flagChecking.ipynb
@@ -48,46 +46,16 @@ JPAstro/ (New name may be needed. Below are the most important files in each dir
└── SQL/
├── pcc_crossmatchQuery.txt
└── radialSearchNoColor.txt
-
-*************idea************
-├── *data/
-│ ├── raw/
-│ │ ├── galaxy_images/
-│ │ │ ├── cluster_1/
-│ │ │ │ ├── galaxy_1.png
-│ │ │ │ ├── galaxy_2.png
-│ │ │ └── ...
-│ │ ├── cluster_2/
-│ │ └── ...
-│ └── processed/
-│ ├── train/
-│ ├── val/
-│ └── test/
-├── scripts/
-│ ├── data_preprocessing.py
-│ ├── train_model.py
-│ ├── evaluate_model.py
-│ └── utils.py
-├── models/
-│ ├── resnet50_pretrained.h5
-│ ├── resnet50_finetuned.h5
-│ └── model_architecture.py
-├── results/
-│ ├── training_logs/
-│ │ ├── log_01.txt
-│ │ └── log_02.txt
-│ ├── model_predictions/
-│ └── evaluation_metrics/
-│ ├── confusion_matrix.png
-│ ├── accuracy_report.txt
-│ └── ...
-└── config/
- ├── config.yaml
- └── hyperparameters.json
```
# Installation
-## Method 1 Tensorflow on GPU via conda
+## Method 1 uv install
+1. Install uv
+2. `uv sync`
+3. `uv pip install SciScript-Python/py3`
+
+## Method 2 Tensorflow on GPU via conda (being deprecated)
1. Install anaconda
2. `conda update -n base -c defaults conda`
-3. `conda env create -f tensorflow_gpu_modified.yaml`
+3. `conda env create -f tf_gpu_astro.yaml`
4. `conda activate tf_gpu_astro`
+
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..78b66d17
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,52 @@
+[build-system]
+requires = ["setuptools>=61.0", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "JPAstro"
+version = "0.1.0"
+description = "Galaxy Classification via Convolutional Neural Network"
+readme = "README.md"
+requires-python = ">=3.12"
+license = "MIT"
+license-files = ["LICENSE.txt"]
+authors = [ { name = "Jason Pruitt" } ]
+
+dependencies = [
+ "opencv-python",
+ "pandas",
+ "matplotlib",
+ "seaborn",
+ "scikit-learn",
+ "scikit-image",
+ "ipykernel",
+ "ruff>=0.13.3",
+ "pillow>=11.3.0",
+ "numpy>=2.0.2",
+ "pyesasky>=2.0.4",
+]
+
+[project.optional-dependencies]
+pytorch = [
+ "torch>=2.1.0",
+ "torchvision>=0.16.0",
+ "torchaudio>=2.1.0",
+ "torchmetrics",
+ "tensorboard>=2.14.1",
+]
+[tool.uv.sources]
+torch = [
+ { index = "pytorch-cu128", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
+]
+torchvision = [
+ { index = "pytorch-cu128", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
+]
+[[tool.uv.index]]
+name = "pytorch-cu128"
+url = "https://download.pytorch.org/whl/cu128"
+explicit = true
+dynamic = []
+
+[project.urls]
+"Repository" = "https://github.com/Json-To-String/JPAstro"
+"Homepage" = "https://github.com/Json-To-String/JPAstro"
diff --git a/src/check_cuda.py b/src/check_cuda.py
new file mode 100644
index 00000000..73c24648
--- /dev/null
+++ b/src/check_cuda.py
@@ -0,0 +1,3 @@
+import torch
+
+print(torch.cuda.is_available())
\ No newline at end of file
From 1a9c1f1424b9974b9331a0ac9a5d45c2bad87baa Mon Sep 17 00:00:00 2001
From: Jason Pruitt <55477390+Json-To-String@users.noreply.github.com>
Date: Tue, 25 Nov 2025 01:44:28 -0500
Subject: [PATCH 2/3] Recreate pipeline in torch_trainer with old code as
reference, much cleaner. Still need to authenticate SciServer
---
Notebooks/torch_trainer.ipynb | 1767 +++++++++++++++++++++++++++++++++
README.md | 1 +
pyproject.toml | 1 +
src/populateDataset.py | 52 +-
4 files changed, 1795 insertions(+), 26 deletions(-)
create mode 100644 Notebooks/torch_trainer.ipynb
diff --git a/Notebooks/torch_trainer.ipynb b/Notebooks/torch_trainer.ipynb
new file mode 100644
index 00000000..96e2a185
--- /dev/null
+++ b/Notebooks/torch_trainer.ipynb
@@ -0,0 +1,1767 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "id": "ea344379",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import pandas as pd\n",
+ "import numpy as np\n",
+ "import os\n",
+ "import glob\n",
+ "import PIL.Image as Image\n",
+ "import PIL"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "id": "132fe8c4",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import SciServer.CasJobs as CasJobs # query with CasJobs, the primary database for the SDSS\n",
+ "import SciServer.SkyServer as SkyServer # show individual objects through SkyServer\n",
+ "import SciServer.SciDrive"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e9ddf1e5",
+ "metadata": {},
+ "source": [
+ "# 1. Acquire data\n",
+ "\n",
+ "`PCC.cat` has the ra, dec, label"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "id": "8f2dc168",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "df0 = pd.read_fwf('../PCC_cat.txt', header=None)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ff2840b0",
+ "metadata": {},
+ "source": [
+ "# Bright objects\n",
+ "Unfortunately training the model on incredibly faint images had produced poor results. Our first attempt at rectifying this was choosing the brightest images. Since magnitudes go backwards, we choose a $r < 19.4$ magnitude"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "id": "f45a3e60",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
0
\n",
+ "
1
\n",
+ "
2
\n",
+ "
3
\n",
+ "
4
\n",
+ "
5
\n",
+ "
6
\n",
+ "
7
\n",
+ "
8
\n",
+ "
9
\n",
+ "
...
\n",
+ "
16
\n",
+ "
17
\n",
+ "
18
\n",
+ "
19
\n",
+ "
20
\n",
+ "
label
\n",
+ "
22
\n",
+ "
23
\n",
+ "
24
\n",
+ "
files
\n",
+ "
\n",
+ " \n",
+ " \n",
+ "
\n",
+ "
5
\n",
+ "
NaN
\n",
+ "
PCC-0006
\n",
+ "
49.2388
\n",
+ "
41.4631
\n",
+ "
19.03
\n",
+ "
0.00
\n",
+ "
0.69
\n",
+ "
0.01
\n",
+ "
19.28
\n",
+ "
1.35
\n",
+ "
...
\n",
+ "
-0.11
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Likely merging system
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=49.2388_dec=41.4631.png
\n",
+ "
\n",
+ "
\n",
+ "
6
\n",
+ "
NaN
\n",
+ "
PCC-0007
\n",
+ "
49.2392
\n",
+ "
41.4215
\n",
+ "
19.26
\n",
+ "
0.03
\n",
+ "
0.97
\n",
+ "
0.05
\n",
+ "
20.76
\n",
+ "
3.79
\n",
+ "
...
\n",
+ "
0.68
\n",
+ "
0.88
\n",
+ "
0.66
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Likely background ETG or unresolved source
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=49.2392_dec=41.4215.png
\n",
+ "
\n",
+ "
\n",
+ "
7
\n",
+ "
NaN
\n",
+ "
PCC-0008
\n",
+ "
49.2411
\n",
+ "
41.4991
\n",
+ "
18.51
\n",
+ "
0.01
\n",
+ "
1.78
\n",
+ "
0.02
\n",
+ "
20.95
\n",
+ "
2.50
\n",
+ "
...
\n",
+ "
0.82
\n",
+ "
0.93
\n",
+ "
0.66
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Cluster or background LTG
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=49.2411_dec=41.4991.png
\n",
+ "
\n",
+ "
\n",
+ "
10
\n",
+ "
NaN
\n",
+ "
PCC-0011
\n",
+ "
49.2420
\n",
+ "
41.4454
\n",
+ "
19.19
\n",
+ "
0.01
\n",
+ "
1.51
\n",
+ "
0.02
\n",
+ "
21.95
\n",
+ "
1.02
\n",
+ "
...
\n",
+ "
0.59
\n",
+ "
0.70
\n",
+ "
0.47
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Cluster or background LTG
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=49.242_dec=41.4454.png
\n",
+ "
\n",
+ "
\n",
+ "
25
\n",
+ "
NaN
\n",
+ "
PCC-0026
\n",
+ "
49.2466
\n",
+ "
41.4451
\n",
+ "
19.34
\n",
+ "
0.01
\n",
+ "
2.04
\n",
+ "
0.02
\n",
+ "
21.31
\n",
+ "
1.20
\n",
+ "
...
\n",
+ "
0.85
\n",
+ "
0.98
\n",
+ "
0.75
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Likely cluster or background edge-on disk galaxy
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=49.2466_dec=41.4451.png
\n",
+ "
\n",
+ "
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
...
\n",
+ "
\n",
+ "
\n",
+ "
5386
\n",
+ "
NaN
\n",
+ "
PCC-5387
\n",
+ "
49.9985
\n",
+ "
41.3856
\n",
+ "
18.60
\n",
+ "
0.01
\n",
+ "
2.84
\n",
+ "
0.06
\n",
+ "
22.78
\n",
+ "
2.45
\n",
+ "
...
\n",
+ "
0.70
\n",
+ "
0.82
\n",
+ "
0.65
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Cluster or background LTG
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=49.9985_dec=41.3856.png
\n",
+ "
\n",
+ "
\n",
+ "
5407
\n",
+ "
NaN
\n",
+ "
PCC-5408
\n",
+ "
50.0018
\n",
+ "
41.6806
\n",
+ "
18.16
\n",
+ "
0.00
\n",
+ "
0.16
\n",
+ "
0.00
\n",
+ "
15.85
\n",
+ "
3.30
\n",
+ "
...
\n",
+ "
0.12
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Likely background ETG or unresolved source
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=50.0018_dec=41.6806.png
\n",
+ "
\n",
+ "
\n",
+ "
5416
\n",
+ "
NaN
\n",
+ "
PCC-5417
\n",
+ "
50.0028
\n",
+ "
41.3384
\n",
+ "
18.84
\n",
+ "
0.01
\n",
+ "
1.27
\n",
+ "
0.02
\n",
+ "
20.74
\n",
+ "
2.42
\n",
+ "
...
\n",
+ "
0.75
\n",
+ "
0.78
\n",
+ "
0.71
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Likely background ETG or unresolved source
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=50.0028_dec=41.3384.png
\n",
+ "
\n",
+ "
\n",
+ "
5422
\n",
+ "
NaN
\n",
+ "
PCC-5423
\n",
+ "
50.0040
\n",
+ "
41.3410
\n",
+ "
17.50
\n",
+ "
0.01
\n",
+ "
1.86
\n",
+ "
0.02
\n",
+ "
20.45
\n",
+ "
4.00
\n",
+ "
...
\n",
+ "
0.76
\n",
+ "
0.93
\n",
+ "
0.69
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Likely background ETG or unresolved source
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=50.004_dec=41.341.png
\n",
+ "
\n",
+ "
\n",
+ "
5427
\n",
+ "
NaN
\n",
+ "
PCC-5428
\n",
+ "
50.0051
\n",
+ "
41.6557
\n",
+ "
17.83
\n",
+ "
0.01
\n",
+ "
2.82
\n",
+ "
0.04
\n",
+ "
21.88
\n",
+ "
2.69
\n",
+ "
...
\n",
+ "
0.66
\n",
+ "
0.73
\n",
+ "
0.56
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
Cluster or background LTG
\n",
+ "
NaN
\n",
+ "
NaN
\n",
+ "
http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl...
\n",
+ "
sdss_ra=50.0051_dec=41.6557.png
\n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
272 rows × 26 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " 0 1 2 3 4 5 6 7 8 9 \\\n",
+ "5 NaN PCC-0006 49.2388 41.4631 19.03 0.00 0.69 0.01 19.28 1.35 \n",
+ "6 NaN PCC-0007 49.2392 41.4215 19.26 0.03 0.97 0.05 20.76 3.79 \n",
+ "7 NaN PCC-0008 49.2411 41.4991 18.51 0.01 1.78 0.02 20.95 2.50 \n",
+ "10 NaN PCC-0011 49.2420 41.4454 19.19 0.01 1.51 0.02 21.95 1.02 \n",
+ "25 NaN PCC-0026 49.2466 41.4451 19.34 0.01 2.04 0.02 21.31 1.20 \n",
+ "... .. ... ... ... ... ... ... ... ... ... \n",
+ "5386 NaN PCC-5387 49.9985 41.3856 18.60 0.01 2.84 0.06 22.78 2.45 \n",
+ "5407 NaN PCC-5408 50.0018 41.6806 18.16 0.00 0.16 0.00 15.85 3.30 \n",
+ "5416 NaN PCC-5417 50.0028 41.3384 18.84 0.01 1.27 0.02 20.74 2.42 \n",
+ "5422 NaN PCC-5423 50.0040 41.3410 17.50 0.01 1.86 0.02 20.45 4.00 \n",
+ "5427 NaN PCC-5428 50.0051 41.6557 17.83 0.01 2.82 0.04 21.88 2.69 \n",
+ "\n",
+ " ... 16 17 18 19 20 \\\n",
+ "5 ... -0.11 NaN NaN NaN NaN \n",
+ "6 ... 0.68 0.88 0.66 NaN NaN \n",
+ "7 ... 0.82 0.93 0.66 NaN NaN \n",
+ "10 ... 0.59 0.70 0.47 NaN NaN \n",
+ "25 ... 0.85 0.98 0.75 NaN NaN \n",
+ "... ... ... ... ... ... ... \n",
+ "5386 ... 0.70 0.82 0.65 NaN NaN \n",
+ "5407 ... 0.12 NaN NaN NaN NaN \n",
+ "5416 ... 0.75 0.78 0.71 NaN NaN \n",
+ "5422 ... 0.76 0.93 0.69 NaN NaN \n",
+ "5427 ... 0.66 0.73 0.56 NaN NaN \n",
+ "\n",
+ " label 22 23 \\\n",
+ "5 Likely merging system NaN NaN \n",
+ "6 Likely background ETG or unresolved source NaN NaN \n",
+ "7 Cluster or background LTG NaN NaN \n",
+ "10 Cluster or background LTG NaN NaN \n",
+ "25 Likely cluster or background edge-on disk galaxy NaN NaN \n",
+ "... ... ... ... \n",
+ "5386 Cluster or background LTG NaN NaN \n",
+ "5407 Likely background ETG or unresolved source NaN NaN \n",
+ "5416 Likely background ETG or unresolved source NaN NaN \n",
+ "5422 Likely background ETG or unresolved source NaN NaN \n",
+ "5427 Cluster or background LTG NaN NaN \n",
+ "\n",
+ " 24 \\\n",
+ "5 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "6 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "7 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "10 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "25 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "... ... \n",
+ "5386 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "5407 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "5416 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "5422 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "5427 http://dc.zah.uni-heidelberg.de/pcc/q/stamp/dl... \n",
+ "\n",
+ " files \n",
+ "5 sdss_ra=49.2388_dec=41.4631.png \n",
+ "6 sdss_ra=49.2392_dec=41.4215.png \n",
+ "7 sdss_ra=49.2411_dec=41.4991.png \n",
+ "10 sdss_ra=49.242_dec=41.4454.png \n",
+ "25 sdss_ra=49.2466_dec=41.4451.png \n",
+ "... ... \n",
+ "5386 sdss_ra=49.9985_dec=41.3856.png \n",
+ "5407 sdss_ra=50.0018_dec=41.6806.png \n",
+ "5416 sdss_ra=50.0028_dec=41.3384.png \n",
+ "5422 sdss_ra=50.004_dec=41.341.png \n",
+ "5427 sdss_ra=50.0051_dec=41.6557.png \n",
+ "\n",
+ "[272 rows x 26 columns]"
+ ]
+ },
+ "execution_count": 23,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "brightDF = df0[df0[4] <= 19.4].copy()\n",
+ "\n",
+ "brightDF['files'] = (\n",
+ " \"sdss_ra=\" + brightDF[2].astype(str) +\n",
+ " \"_dec=\" + brightDF[3].astype(str) +\n",
+ " \".png\"\n",
+ ")\n",
+ "\n",
+ "brightDF = brightDF.rename(columns={21: \"label\"})\n",
+ "brightDF"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "id": "393bafa6",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
"
+ ],
+ "text/plain": [
+ " ra dec binary_label\n",
+ "PCC_Bg 0 49.646900 41.450500 0\n",
+ " 1 49.375700 41.313200 0\n",
+ " 2 49.275800 41.541500 0\n",
+ " 3 49.332900 41.499900 0\n",
+ " 4 49.470900 41.346500 0\n",
+ "... ... ... ...\n",
+ "Spec_Mems 206 50.622746 41.050445 1\n",
+ " 210 50.694593 41.941230 1\n",
+ " 211 49.705849 40.827589 1\n",
+ " 212 49.112658 41.180216 1\n",
+ " 213 49.470275 40.897244 1\n",
+ "\n",
+ "[505 rows x 3 columns]"
+ ]
+ },
+ "execution_count": 28,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# pcc_crossDf[['objID', 'ra', 'dec']]\n",
+ "trainObjs = pd.concat([pcc_nonMembers[['ra', 'dec', 'binary_label']],\n",
+ " pcc_Members[['ra', 'dec', 'binary_label']],\n",
+ " searchDf_specNonMembers[['ra', 'dec', 'binary_label']],\n",
+ " searchDf_specMembers[['ra', 'dec', 'binary_label']]],\n",
+ " keys = ('PCC_Bg', 'PCC_Mems', 'Spec_Bg', 'Spec_Mems')) # want to preserve where these come from\n",
+ "\n",
+ "trainObjs"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "id": "c01a43c0",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n",
+ "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
+ " token = Authentication.getToken()\n"
+ ]
+ },
+ {
+ "ename": "KeyboardInterrupt",
+ "evalue": "",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
+ "\u001b[31mKeyboardInterrupt\u001b[39m Traceback (most recent call last)",
+ "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[31]\u001b[39m\u001b[32m, line 19\u001b[39m\n\u001b[32m 16\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 17\u001b[39m \u001b[38;5;66;03m# for id, r, d in zip(searchDf['objID'], trainObjs['ra'], trainObjs['dec']):\u001b[39;00m\n\u001b[32m 18\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m r, d, l \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(trainObjs[\u001b[33m'\u001b[39m\u001b[33mra\u001b[39m\u001b[33m'\u001b[39m], trainObjs[\u001b[33m'\u001b[39m\u001b[33mdec\u001b[39m\u001b[33m'\u001b[39m], trainObjs[\u001b[33m'\u001b[39m\u001b[33mbinary_label\u001b[39m\u001b[33m'\u001b[39m]):\n\u001b[32m---> \u001b[39m\u001b[32m19\u001b[39m img_array = \u001b[43mSkyServer\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetJpegImgCutout\u001b[49m\u001b[43m(\u001b[49m\u001b[43mra\u001b[49m\u001b[43m=\u001b[49m\u001b[43mr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdec\u001b[49m\u001b[43m=\u001b[49m\u001b[43md\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwidth\u001b[49m\u001b[43m=\u001b[49m\u001b[43mimg_width\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mheight\u001b[49m\u001b[43m=\u001b[49m\u001b[43mimg_height\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mscale\u001b[49m\u001b[43m=\u001b[49m\u001b[32;43m0.1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[32m 20\u001b[39m \u001b[43m \u001b[49m\u001b[43mdataRelease\u001b[49m\u001b[43m=\u001b[49m\u001b[43mSkyServer_DataRelease\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 21\u001b[39m \u001b[38;5;66;03m# print(f'{id}-label={labeler(z)}')\u001b[39;00m\n\u001b[32m 22\u001b[39m \u001b[38;5;66;03m# outPicTemplate = f'{id}-label={labeler(z)}.png'\u001b[39;00m\n\u001b[32m 23\u001b[39m outPicTemplate = \u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33msdss_ra=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mr\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m_dec=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00md\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m-label=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00ml\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m.png\u001b[39m\u001b[33m'\u001b[39m\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:128\u001b[39m, in \u001b[36mgetJpegImgCutout\u001b[39m\u001b[34m(ra, dec, scale, width, height, opt, query, dataRelease)\u001b[39m\n\u001b[32m 125\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m token \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m token != \u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m:\n\u001b[32m 126\u001b[39m headers[\u001b[33m'\u001b[39m\u001b[33mX-Auth-Token\u001b[39m\u001b[33m'\u001b[39m] = token\n\u001b[32m--> \u001b[39m\u001b[32m128\u001b[39m response = \u001b[43mrequests\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[32m 129\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response.status_code != \u001b[32m200\u001b[39m:\n\u001b[32m 130\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response.status_code == \u001b[32m404\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m response.status_code == \u001b[32m500\u001b[39m:\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\api.py:73\u001b[39m, in \u001b[36mget\u001b[39m\u001b[34m(url, params, **kwargs)\u001b[39m\n\u001b[32m 62\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mget\u001b[39m(url, params=\u001b[38;5;28;01mNone\u001b[39;00m, **kwargs):\n\u001b[32m 63\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33mr\u001b[39m\u001b[33;03m\"\"\"Sends a GET request.\u001b[39;00m\n\u001b[32m 64\u001b[39m \n\u001b[32m 65\u001b[39m \u001b[33;03m :param url: URL for the new :class:`Request` object.\u001b[39;00m\n\u001b[32m (...)\u001b[39m\u001b[32m 70\u001b[39m \u001b[33;03m :rtype: requests.Response\u001b[39;00m\n\u001b[32m 71\u001b[39m \u001b[33;03m \"\"\"\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m73\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mget\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m=\u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\api.py:59\u001b[39m, in \u001b[36mrequest\u001b[39m\u001b[34m(method, url, **kwargs)\u001b[39m\n\u001b[32m 55\u001b[39m \u001b[38;5;66;03m# By using the 'with' statement we are sure the session is closed, thus we\u001b[39;00m\n\u001b[32m 56\u001b[39m \u001b[38;5;66;03m# avoid leaving sockets open which can trigger a ResourceWarning in some\u001b[39;00m\n\u001b[32m 57\u001b[39m \u001b[38;5;66;03m# cases, and look like a memory leak in others.\u001b[39;00m\n\u001b[32m 58\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m sessions.Session() \u001b[38;5;28;01mas\u001b[39;00m session:\n\u001b[32m---> \u001b[39m\u001b[32m59\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msession\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\sessions.py:589\u001b[39m, in \u001b[36mSession.request\u001b[39m\u001b[34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[39m\n\u001b[32m 584\u001b[39m send_kwargs = {\n\u001b[32m 585\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mtimeout\u001b[39m\u001b[33m\"\u001b[39m: timeout,\n\u001b[32m 586\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mallow_redirects\u001b[39m\u001b[33m\"\u001b[39m: allow_redirects,\n\u001b[32m 587\u001b[39m }\n\u001b[32m 588\u001b[39m send_kwargs.update(settings)\n\u001b[32m--> \u001b[39m\u001b[32m589\u001b[39m resp = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprep\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43msend_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 591\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\sessions.py:703\u001b[39m, in \u001b[36mSession.send\u001b[39m\u001b[34m(self, request, **kwargs)\u001b[39m\n\u001b[32m 700\u001b[39m start = preferred_clock()\n\u001b[32m 702\u001b[39m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m703\u001b[39m r = \u001b[43madapter\u001b[49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 705\u001b[39m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[32m 706\u001b[39m elapsed = preferred_clock() - start\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\adapters.py:644\u001b[39m, in \u001b[36mHTTPAdapter.send\u001b[39m\u001b[34m(self, request, stream, timeout, verify, cert, proxies)\u001b[39m\n\u001b[32m 641\u001b[39m timeout = TimeoutSauce(connect=timeout, read=timeout)\n\u001b[32m 643\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m644\u001b[39m resp = \u001b[43mconn\u001b[49m\u001b[43m.\u001b[49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 645\u001b[39m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 646\u001b[39m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 647\u001b[39m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 648\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 649\u001b[39m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 650\u001b[39m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 651\u001b[39m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 652\u001b[39m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 653\u001b[39m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mmax_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 654\u001b[39m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 655\u001b[39m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 656\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 658\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[32m 659\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(err, request=request)\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\urllib3\\connectionpool.py:787\u001b[39m, in \u001b[36mHTTPConnectionPool.urlopen\u001b[39m\u001b[34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[39m\n\u001b[32m 784\u001b[39m response_conn = conn \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m release_conn \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 786\u001b[39m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m787\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_make_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 788\u001b[39m \u001b[43m \u001b[49m\u001b[43mconn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 789\u001b[39m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 790\u001b[39m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 791\u001b[39m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 792\u001b[39m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 793\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 794\u001b[39m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 795\u001b[39m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m=\u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 796\u001b[39m \u001b[43m \u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 797\u001b[39m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 798\u001b[39m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 799\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 800\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 802\u001b[39m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n\u001b[32m 803\u001b[39m clean_exit = \u001b[38;5;28;01mTrue\u001b[39;00m\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\urllib3\\connectionpool.py:534\u001b[39m, in \u001b[36mHTTPConnectionPool._make_request\u001b[39m\u001b[34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[39m\n\u001b[32m 532\u001b[39m \u001b[38;5;66;03m# Receive the response from the server\u001b[39;00m\n\u001b[32m 533\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m534\u001b[39m response = \u001b[43mconn\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetresponse\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 535\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m (BaseSSLError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[32m 536\u001b[39m \u001b[38;5;28mself\u001b[39m._raise_timeout(err=e, url=url, timeout_value=read_timeout)\n",
+ "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\urllib3\\connection.py:565\u001b[39m, in \u001b[36mHTTPConnection.getresponse\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 562\u001b[39m _shutdown = \u001b[38;5;28mgetattr\u001b[39m(\u001b[38;5;28mself\u001b[39m.sock, \u001b[33m\"\u001b[39m\u001b[33mshutdown\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m 564\u001b[39m \u001b[38;5;66;03m# Get the response from http.client.HTTPConnection\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m565\u001b[39m httplib_response = \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetresponse\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 567\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 568\u001b[39m assert_header_parsing(httplib_response.msg)\n",
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\http\\client.py:1430\u001b[39m, in \u001b[36mHTTPConnection.getresponse\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 1428\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 1429\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1430\u001b[39m \u001b[43mresponse\u001b[49m\u001b[43m.\u001b[49m\u001b[43mbegin\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1431\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m:\n\u001b[32m 1432\u001b[39m \u001b[38;5;28mself\u001b[39m.close()\n",
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\http\\client.py:331\u001b[39m, in \u001b[36mHTTPResponse.begin\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 329\u001b[39m \u001b[38;5;66;03m# read until we get a non-100 response\u001b[39;00m\n\u001b[32m 330\u001b[39m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m331\u001b[39m version, status, reason = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_read_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 332\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m status != CONTINUE:\n\u001b[32m 333\u001b[39m \u001b[38;5;28;01mbreak\u001b[39;00m\n",
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\http\\client.py:292\u001b[39m, in \u001b[36mHTTPResponse._read_status\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 291\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_read_status\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m292\u001b[39m line = \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mfp\u001b[49m\u001b[43m.\u001b[49m\u001b[43mreadline\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_MAXLINE\u001b[49m\u001b[43m \u001b[49m\u001b[43m+\u001b[49m\u001b[43m \u001b[49m\u001b[32;43m1\u001b[39;49m\u001b[43m)\u001b[49m, \u001b[33m\"\u001b[39m\u001b[33miso-8859-1\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 293\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(line) > _MAXLINE:\n\u001b[32m 294\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m LineTooLong(\u001b[33m\"\u001b[39m\u001b[33mstatus line\u001b[39m\u001b[33m\"\u001b[39m)\n",
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\socket.py:719\u001b[39m, in \u001b[36mSocketIO.readinto\u001b[39m\u001b[34m(self, b)\u001b[39m\n\u001b[32m 717\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33mcannot read from timed out object\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 718\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m719\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_sock\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrecv_into\u001b[49m\u001b[43m(\u001b[49m\u001b[43mb\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 720\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m timeout:\n\u001b[32m 721\u001b[39m \u001b[38;5;28mself\u001b[39m._timeout_occurred = \u001b[38;5;28;01mTrue\u001b[39;00m\n",
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\ssl.py:1304\u001b[39m, in \u001b[36mSSLSocket.recv_into\u001b[39m\u001b[34m(self, buffer, nbytes, flags)\u001b[39m\n\u001b[32m 1300\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m flags != \u001b[32m0\u001b[39m:\n\u001b[32m 1301\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[32m 1302\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mnon-zero flags not allowed in calls to recv_into() on \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m %\n\u001b[32m 1303\u001b[39m \u001b[38;5;28mself\u001b[39m.\u001b[34m__class__\u001b[39m)\n\u001b[32m-> \u001b[39m\u001b[32m1304\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnbytes\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1305\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1306\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m().recv_into(buffer, nbytes, flags)\n",
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\ssl.py:1138\u001b[39m, in \u001b[36mSSLSocket.read\u001b[39m\u001b[34m(self, len, buffer)\u001b[39m\n\u001b[32m 1136\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 1137\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m buffer \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1138\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_sslobj\u001b[49m\u001b[43m.\u001b[49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1139\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1140\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._sslobj.read(\u001b[38;5;28mlen\u001b[39m)\n",
+ "\u001b[31mKeyboardInterrupt\u001b[39m: "
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "# trainObjs = trainObjs.drop_duplicates(subset = 'objID')\n",
+ "trainObjs['binary_label'] = pd.to_numeric(trainObjs['binary_label'], downcast='integer')\n",
+ "\n",
+ "img_width, img_height = 200, 200\n",
+ "SkyServer_DataRelease = 'DR16'\n",
+ "\n",
+ "dirName = 'PCC-and-SpecSearch'\n",
+ "outDir = os.path.join('..', 'Images', dirName)\n",
+ "\n",
+ "fileList = list()\n",
+ "if not os.path.exists(outDir):\n",
+ " os.makedirs(outDir)\n",
+ " \n",
+ "if len(glob.glob(os.path.join(outDir, '*.png'))) == trainObjs.shape[0]:\n",
+ " print('Skipping Populate')\n",
+ "else:\n",
+ " # for id, r, d in zip(searchDf['objID'], trainObjs['ra'], trainObjs['dec']):\n",
+ " for r, d, l in zip(trainObjs['ra'], trainObjs['dec'], trainObjs['binary_label']):\n",
+ " img_array = SkyServer.getJpegImgCutout(ra=r, dec=d, width=img_width, height=img_height, scale=0.1, \n",
+ " dataRelease=SkyServer_DataRelease)\n",
+ " # print(f'{id}-label={labeler(z)}')\n",
+ " # outPicTemplate = f'{id}-label={labeler(z)}.png'\n",
+ " outPicTemplate = f'sdss_ra={r}_dec={d}-label={l}.png'\n",
+ " \n",
+ " img0 = PIL.Image.fromarray(img_array, 'RGB')\n",
+ " img0.save(f'{outDir}/{outPicTemplate}')\n",
+ " fileList.append(f'{outPicTemplate}')\n",
+ "\n",
+ "print(f'Finished populate with {len(fileList)} images')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "bf582b23",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "final_df = pd.concat([\n",
+ " searchDf_specMembers[['files','labels']],\n",
+ " searchDf_specNonMembers[['files','labels']],\n",
+ " pcc_Members.rename(columns={'binary_label':'labels'})[['files','labels']],\n",
+ " pcc_nonMembers.rename(columns={'binary_label':'labels'})[['files','labels']]\n",
+ "]).reset_index(drop=True)\n",
+ "final_df"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "1c43301b",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "JPAstro",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.13.7"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/README.md b/README.md
index 9b494f37..6ea1d77a 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,7 @@ JPAstro/ (New name may be needed. Below are the most important files in each dir
1. Install uv
2. `uv sync`
3. `uv pip install SciScript-Python/py3`
+ 1. Follow the steps to authenticate SciServer (you'll have to change the relevant files)
## Method 2 Tensorflow on GPU via conda (being deprecated)
1. Install anaconda
diff --git a/pyproject.toml b/pyproject.toml
index 78b66d17..8aacfa18 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -24,6 +24,7 @@ dependencies = [
"pillow>=11.3.0",
"numpy>=2.0.2",
"pyesasky>=2.0.4",
+ "requests>=2.32.5",
]
[project.optional-dependencies]
diff --git a/src/populateDataset.py b/src/populateDataset.py
index b532082a..7c9e9dbd 100644
--- a/src/populateDataset.py
+++ b/src/populateDataset.py
@@ -1,35 +1,35 @@
-
import requests
import pandas as pd
-import sys
import os
-#from skimage import io, transform
-import matplotlib.pyplot as plt
import time
-# testUrl = f'https://skyserver.sdss.org/dr16/SkyServerWS/ImgCutout/getjpeg?TaskName=Skyserver.Explore.Image&ra={raEx}&dec={dcEx}&scale=0.1&width=200&height=200'
-
-
-df0 = pd.read_fwf('PCC_cat.txt', header=None)
+# testUrl = f'https://skyserver.sdss.org/dr16/SkyServerWS/ImgCutout/getjpeg?TaskName=Skyserver.Explore.Image&ra={raEx}&dec={dcEx}&scale=0.1&width=200&height=200'
+df0 = (pd.read_fwf("PCC_cat.txt", header=None),)
ra = df0[2]
dec = df0[3]
-outDir = 'SDSS400'
-height = 400
-width = 400
-
-for i in range(len(ra)):
-# for i in range(800):
- urlVar = f'https://skyserver.sdss.org/dr16/SkyServerWS/ImgCutout/' f'getjpeg?TaskName=Skyserver.Explore.Image&ra={str(ra[i]).strip()}' f'&dec={str(dec[i]).strip()}&scale=0.1&width={width}&height={height}'
-
- # tell the loop to pause for a bit - every 100 images
- if i%100==0:
- time.sleep(5)
-
- img_data = requests.get(urlVar).content
- with open(f'{outDir}/sdss_ra={ra[i]}_dec={dec[i]}.png', 'wb') as handler:
- handler.write(img_data)
-
-#images = [f'https://skyserver.sdss.org/dr16/SkyServerWS/ImgCutout/' f'getjpeg?TaskName=Skyserver.Explore.Image&ra={str(ra[i]).strip()}' f'&dec={str(dec[i]).strip()}&scale=0.1&width=200&height=200' for i in range(len(ra))]
-# os.path.join('SDSS', f'sdss_ra={str(df0[2][1])}_dec={str(df0[3][1])}.jpeg')
+def populateDataset(
+ outDir="SDSS200",
+ height=200,
+ width=200,
+ scale=0.1,
+):
+ for i in range(len(ra)):
+ urlVar = (
+ f"https://skyserver.sdss.org/dr16/SkyServerWS/ImgCutout/"
+ f"getjpeg?TaskName=Skyserver.Explore.Image&ra={str(ra[i]).strip()}"
+ f"&dec={str(dec[i]).strip()}&scale={scale}&width={width}&height={height}"
+ )
+
+ # tell the loop to pause for a bit - every 100 images (to avoid timeout)
+ if i % 100 == 0:
+ time.sleep(5)
+
+ img_data = requests.get(urlVar).content
+ out_path = os.path.join(outDir, f"sdss_ra={str(ra[i])}_dec={str(dec[i])}.png")
+ with open(out_path, "wb") as handler:
+ handler.write(img_data)
+
+if __name__ == "__main__":
+ populateDataset()
\ No newline at end of file
From f68d97e4d2642db4aaf4621ffaa41528f0d0b763 Mon Sep 17 00:00:00 2001
From: Jason Pruitt <55477390+Json-To-String@users.noreply.github.com>
Date: Thu, 1 Jan 2026 22:34:31 -0500
Subject: [PATCH 3/3] Add working pytorch notebook
---
Notebooks/torch_trainer.ipynb | 1785 +++++++++++++++++++++++++++++----
1 file changed, 1609 insertions(+), 176 deletions(-)
diff --git a/Notebooks/torch_trainer.ipynb b/Notebooks/torch_trainer.ipynb
index 96e2a185..850a111b 100644
--- a/Notebooks/torch_trainer.ipynb
+++ b/Notebooks/torch_trainer.ipynb
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 30,
+ "execution_count": 84,
"id": "ea344379",
"metadata": {},
"outputs": [],
@@ -12,12 +12,13 @@
"import os\n",
"import glob\n",
"import PIL.Image as Image\n",
- "import PIL"
+ "import PIL\n",
+ "import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 85,
"id": "132fe8c4",
"metadata": {},
"outputs": [],
@@ -39,7 +40,7 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 86,
"id": "8f2dc168",
"metadata": {},
"outputs": [],
@@ -58,7 +59,7 @@
},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": 87,
"id": "f45a3e60",
"metadata": {},
"outputs": [
@@ -445,7 +446,7 @@
"[272 rows x 26 columns]"
]
},
- "execution_count": 23,
+ "execution_count": 87,
"metadata": {},
"output_type": "execute_result"
}
@@ -465,7 +466,7 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 88,
"id": "393bafa6",
"metadata": {},
"outputs": [
@@ -852,7 +853,7 @@
"[252 rows x 27 columns]"
]
},
- "execution_count": 24,
+ "execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
@@ -919,7 +920,7 @@
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 89,
"id": "d57144a0",
"metadata": {},
"outputs": [
@@ -1293,7 +1294,7 @@
"[272 rows x 29 columns]"
]
},
- "execution_count": 25,
+ "execution_count": 89,
"metadata": {},
"output_type": "execute_result"
}
@@ -1315,7 +1316,7 @@
},
{
"cell_type": "code",
- "execution_count": 26,
+ "execution_count": 90,
"id": "f82a0132",
"metadata": {},
"outputs": [
@@ -1336,12 +1337,12 @@
],
"source": [
"print(downSampleDf1['binary_label'].value_counts())\n",
- "print(downSampleDf1_balanced['binary_label'].value_counts())\n"
+ "print(downSampleDf1_balanced['binary_label'].value_counts())"
]
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 91,
"id": "14e81668",
"metadata": {},
"outputs": [
@@ -1395,7 +1396,7 @@
},
{
"cell_type": "code",
- "execution_count": 28,
+ "execution_count": 92,
"id": "4d2449ed",
"metadata": {},
"outputs": [
@@ -1518,7 +1519,7 @@
"[505 rows x 3 columns]"
]
},
- "execution_count": 28,
+ "execution_count": 92,
"metadata": {},
"output_type": "execute_result"
}
@@ -1536,164 +1537,29 @@
},
{
"cell_type": "code",
- "execution_count": 31,
+ "execution_count": 93,
"id": "c01a43c0",
"metadata": {},
"outputs": [
{
- "name": "stderr",
+ "name": "stdout",
"output_type": "stream",
"text": [
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n",
- "c:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:124: Warning: In Authentication.getToken: Authentication token is not defined: the user did not log in with the Authentication.login function, or the token has not been stored in the command line argument --ident.\n",
- " token = Authentication.getToken()\n"
- ]
- },
- {
- "ename": "KeyboardInterrupt",
- "evalue": "",
- "output_type": "error",
- "traceback": [
- "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
- "\u001b[31mKeyboardInterrupt\u001b[39m Traceback (most recent call last)",
- "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[31]\u001b[39m\u001b[32m, line 19\u001b[39m\n\u001b[32m 16\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 17\u001b[39m \u001b[38;5;66;03m# for id, r, d in zip(searchDf['objID'], trainObjs['ra'], trainObjs['dec']):\u001b[39;00m\n\u001b[32m 18\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m r, d, l \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(trainObjs[\u001b[33m'\u001b[39m\u001b[33mra\u001b[39m\u001b[33m'\u001b[39m], trainObjs[\u001b[33m'\u001b[39m\u001b[33mdec\u001b[39m\u001b[33m'\u001b[39m], trainObjs[\u001b[33m'\u001b[39m\u001b[33mbinary_label\u001b[39m\u001b[33m'\u001b[39m]):\n\u001b[32m---> \u001b[39m\u001b[32m19\u001b[39m img_array = \u001b[43mSkyServer\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetJpegImgCutout\u001b[49m\u001b[43m(\u001b[49m\u001b[43mra\u001b[49m\u001b[43m=\u001b[49m\u001b[43mr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdec\u001b[49m\u001b[43m=\u001b[49m\u001b[43md\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwidth\u001b[49m\u001b[43m=\u001b[49m\u001b[43mimg_width\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mheight\u001b[49m\u001b[43m=\u001b[49m\u001b[43mimg_height\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mscale\u001b[49m\u001b[43m=\u001b[49m\u001b[32;43m0.1\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[32m 20\u001b[39m \u001b[43m \u001b[49m\u001b[43mdataRelease\u001b[49m\u001b[43m=\u001b[49m\u001b[43mSkyServer_DataRelease\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 21\u001b[39m \u001b[38;5;66;03m# print(f'{id}-label={labeler(z)}')\u001b[39;00m\n\u001b[32m 22\u001b[39m \u001b[38;5;66;03m# outPicTemplate = f'{id}-label={labeler(z)}.png'\u001b[39;00m\n\u001b[32m 23\u001b[39m outPicTemplate = \u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33msdss_ra=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mr\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m_dec=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00md\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m-label=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00ml\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m.png\u001b[39m\u001b[33m'\u001b[39m\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\SciServer\\SkyServer.py:128\u001b[39m, in \u001b[36mgetJpegImgCutout\u001b[39m\u001b[34m(ra, dec, scale, width, height, opt, query, dataRelease)\u001b[39m\n\u001b[32m 125\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m token \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m token != \u001b[33m\"\u001b[39m\u001b[33m\"\u001b[39m:\n\u001b[32m 126\u001b[39m headers[\u001b[33m'\u001b[39m\u001b[33mX-Auth-Token\u001b[39m\u001b[33m'\u001b[39m] = token\n\u001b[32m--> \u001b[39m\u001b[32m128\u001b[39m response = \u001b[43mrequests\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[32m 129\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response.status_code != \u001b[32m200\u001b[39m:\n\u001b[32m 130\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response.status_code == \u001b[32m404\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m response.status_code == \u001b[32m500\u001b[39m:\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\api.py:73\u001b[39m, in \u001b[36mget\u001b[39m\u001b[34m(url, params, **kwargs)\u001b[39m\n\u001b[32m 62\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mget\u001b[39m(url, params=\u001b[38;5;28;01mNone\u001b[39;00m, **kwargs):\n\u001b[32m 63\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33mr\u001b[39m\u001b[33;03m\"\"\"Sends a GET request.\u001b[39;00m\n\u001b[32m 64\u001b[39m \n\u001b[32m 65\u001b[39m \u001b[33;03m :param url: URL for the new :class:`Request` object.\u001b[39;00m\n\u001b[32m (...)\u001b[39m\u001b[32m 70\u001b[39m \u001b[33;03m :rtype: requests.Response\u001b[39;00m\n\u001b[32m 71\u001b[39m \u001b[33;03m \"\"\"\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m73\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mget\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m=\u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\api.py:59\u001b[39m, in \u001b[36mrequest\u001b[39m\u001b[34m(method, url, **kwargs)\u001b[39m\n\u001b[32m 55\u001b[39m \u001b[38;5;66;03m# By using the 'with' statement we are sure the session is closed, thus we\u001b[39;00m\n\u001b[32m 56\u001b[39m \u001b[38;5;66;03m# avoid leaving sockets open which can trigger a ResourceWarning in some\u001b[39;00m\n\u001b[32m 57\u001b[39m \u001b[38;5;66;03m# cases, and look like a memory leak in others.\u001b[39;00m\n\u001b[32m 58\u001b[39m \u001b[38;5;28;01mwith\u001b[39;00m sessions.Session() \u001b[38;5;28;01mas\u001b[39;00m session:\n\u001b[32m---> \u001b[39m\u001b[32m59\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msession\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m=\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\sessions.py:589\u001b[39m, in \u001b[36mSession.request\u001b[39m\u001b[34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[39m\n\u001b[32m 584\u001b[39m send_kwargs = {\n\u001b[32m 585\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mtimeout\u001b[39m\u001b[33m\"\u001b[39m: timeout,\n\u001b[32m 586\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mallow_redirects\u001b[39m\u001b[33m\"\u001b[39m: allow_redirects,\n\u001b[32m 587\u001b[39m }\n\u001b[32m 588\u001b[39m send_kwargs.update(settings)\n\u001b[32m--> \u001b[39m\u001b[32m589\u001b[39m resp = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mprep\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43msend_kwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 591\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\sessions.py:703\u001b[39m, in \u001b[36mSession.send\u001b[39m\u001b[34m(self, request, **kwargs)\u001b[39m\n\u001b[32m 700\u001b[39m start = preferred_clock()\n\u001b[32m 702\u001b[39m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m703\u001b[39m r = \u001b[43madapter\u001b[49m\u001b[43m.\u001b[49m\u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 705\u001b[39m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[32m 706\u001b[39m elapsed = preferred_clock() - start\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\requests\\adapters.py:644\u001b[39m, in \u001b[36mHTTPAdapter.send\u001b[39m\u001b[34m(self, request, stream, timeout, verify, cert, proxies)\u001b[39m\n\u001b[32m 641\u001b[39m timeout = TimeoutSauce(connect=timeout, read=timeout)\n\u001b[32m 643\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m644\u001b[39m resp = \u001b[43mconn\u001b[49m\u001b[43m.\u001b[49m\u001b[43murlopen\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 645\u001b[39m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 646\u001b[39m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m=\u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 647\u001b[39m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 648\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrequest\u001b[49m\u001b[43m.\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 649\u001b[39m \u001b[43m \u001b[49m\u001b[43mredirect\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 650\u001b[39m \u001b[43m \u001b[49m\u001b[43massert_same_host\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 651\u001b[39m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 652\u001b[39m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[32m 653\u001b[39m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mmax_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 654\u001b[39m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 655\u001b[39m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 656\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 658\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[32m 659\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(err, request=request)\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\urllib3\\connectionpool.py:787\u001b[39m, in \u001b[36mHTTPConnectionPool.urlopen\u001b[39m\u001b[34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[39m\n\u001b[32m 784\u001b[39m response_conn = conn \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m release_conn \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 786\u001b[39m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m787\u001b[39m response = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_make_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 788\u001b[39m \u001b[43m \u001b[49m\u001b[43mconn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 789\u001b[39m \u001b[43m \u001b[49m\u001b[43mmethod\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 790\u001b[39m \u001b[43m \u001b[49m\u001b[43murl\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 791\u001b[39m \u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m=\u001b[49m\u001b[43mtimeout_obj\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 792\u001b[39m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[43m=\u001b[49m\u001b[43mbody\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 793\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 794\u001b[39m \u001b[43m \u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m=\u001b[49m\u001b[43mchunked\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 795\u001b[39m \u001b[43m \u001b[49m\u001b[43mretries\u001b[49m\u001b[43m=\u001b[49m\u001b[43mretries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 796\u001b[39m \u001b[43m \u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresponse_conn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 797\u001b[39m \u001b[43m \u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mpreload_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 798\u001b[39m \u001b[43m \u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdecode_content\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 799\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mresponse_kw\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 800\u001b[39m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 802\u001b[39m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n\u001b[32m 803\u001b[39m clean_exit = \u001b[38;5;28;01mTrue\u001b[39;00m\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\urllib3\\connectionpool.py:534\u001b[39m, in \u001b[36mHTTPConnectionPool._make_request\u001b[39m\u001b[34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[39m\n\u001b[32m 532\u001b[39m \u001b[38;5;66;03m# Receive the response from the server\u001b[39;00m\n\u001b[32m 533\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m534\u001b[39m response = \u001b[43mconn\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetresponse\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 535\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m (BaseSSLError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[32m 536\u001b[39m \u001b[38;5;28mself\u001b[39m._raise_timeout(err=e, url=url, timeout_value=read_timeout)\n",
- "\u001b[36mFile \u001b[39m\u001b[32mc:\\Users\\jsonp\\Documents\\Github\\JPAstro\\.venv\\Lib\\site-packages\\urllib3\\connection.py:565\u001b[39m, in \u001b[36mHTTPConnection.getresponse\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 562\u001b[39m _shutdown = \u001b[38;5;28mgetattr\u001b[39m(\u001b[38;5;28mself\u001b[39m.sock, \u001b[33m\"\u001b[39m\u001b[33mshutdown\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m 564\u001b[39m \u001b[38;5;66;03m# Get the response from http.client.HTTPConnection\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m565\u001b[39m httplib_response = \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m.\u001b[49m\u001b[43mgetresponse\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 567\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 568\u001b[39m assert_header_parsing(httplib_response.msg)\n",
- "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\http\\client.py:1430\u001b[39m, in \u001b[36mHTTPConnection.getresponse\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 1428\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 1429\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1430\u001b[39m \u001b[43mresponse\u001b[49m\u001b[43m.\u001b[49m\u001b[43mbegin\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1431\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m:\n\u001b[32m 1432\u001b[39m \u001b[38;5;28mself\u001b[39m.close()\n",
- "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\http\\client.py:331\u001b[39m, in \u001b[36mHTTPResponse.begin\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 329\u001b[39m \u001b[38;5;66;03m# read until we get a non-100 response\u001b[39;00m\n\u001b[32m 330\u001b[39m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m331\u001b[39m version, status, reason = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_read_status\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 332\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m status != CONTINUE:\n\u001b[32m 333\u001b[39m \u001b[38;5;28;01mbreak\u001b[39;00m\n",
- "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\http\\client.py:292\u001b[39m, in \u001b[36mHTTPResponse._read_status\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 291\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_read_status\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[32m--> \u001b[39m\u001b[32m292\u001b[39m line = \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mfp\u001b[49m\u001b[43m.\u001b[49m\u001b[43mreadline\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_MAXLINE\u001b[49m\u001b[43m \u001b[49m\u001b[43m+\u001b[49m\u001b[43m \u001b[49m\u001b[32;43m1\u001b[39;49m\u001b[43m)\u001b[49m, \u001b[33m\"\u001b[39m\u001b[33miso-8859-1\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 293\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(line) > _MAXLINE:\n\u001b[32m 294\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m LineTooLong(\u001b[33m\"\u001b[39m\u001b[33mstatus line\u001b[39m\u001b[33m\"\u001b[39m)\n",
- "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\socket.py:719\u001b[39m, in \u001b[36mSocketIO.readinto\u001b[39m\u001b[34m(self, b)\u001b[39m\n\u001b[32m 717\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m(\u001b[33m\"\u001b[39m\u001b[33mcannot read from timed out object\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 718\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m719\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_sock\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrecv_into\u001b[49m\u001b[43m(\u001b[49m\u001b[43mb\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 720\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m timeout:\n\u001b[32m 721\u001b[39m \u001b[38;5;28mself\u001b[39m._timeout_occurred = \u001b[38;5;28;01mTrue\u001b[39;00m\n",
- "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\ssl.py:1304\u001b[39m, in \u001b[36mSSLSocket.recv_into\u001b[39m\u001b[34m(self, buffer, nbytes, flags)\u001b[39m\n\u001b[32m 1300\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m flags != \u001b[32m0\u001b[39m:\n\u001b[32m 1301\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[32m 1302\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mnon-zero flags not allowed in calls to recv_into() on \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m %\n\u001b[32m 1303\u001b[39m \u001b[38;5;28mself\u001b[39m.\u001b[34m__class__\u001b[39m)\n\u001b[32m-> \u001b[39m\u001b[32m1304\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnbytes\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1305\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1306\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28msuper\u001b[39m().recv_into(buffer, nbytes, flags)\n",
- "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\uv\\python\\cpython-3.13.7-windows-x86_64-none\\Lib\\ssl.py:1138\u001b[39m, in \u001b[36mSSLSocket.read\u001b[39m\u001b[34m(self, len, buffer)\u001b[39m\n\u001b[32m 1136\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 1137\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m buffer \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1138\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_sslobj\u001b[49m\u001b[43m.\u001b[49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mlen\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbuffer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1139\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[32m 1140\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._sslobj.read(\u001b[38;5;28mlen\u001b[39m)\n",
- "\u001b[31mKeyboardInterrupt\u001b[39m: "
+ "Skipping Populate\n",
+ "Finished populate with 505 images\n"
]
}
],
"source": [
- "\n",
+ "import warnings\n",
"# trainObjs = trainObjs.drop_duplicates(subset = 'objID')\n",
"trainObjs['binary_label'] = pd.to_numeric(trainObjs['binary_label'], downcast='integer')\n",
"\n",
+ "# TODO: This should be in the populate dataset steps\n",
"img_width, img_height = 200, 200\n",
"SkyServer_DataRelease = 'DR16'\n",
"\n",
- "dirName = 'PCC-and-SpecSearch'\n",
+ "dirName = 'PCC-and-SpecSearch-2025'\n",
"outDir = os.path.join('..', 'Images', dirName)\n",
"\n",
"fileList = list()\n",
@@ -1702,43 +1568,1610 @@
" \n",
"if len(glob.glob(os.path.join(outDir, '*.png'))) == trainObjs.shape[0]:\n",
" print('Skipping Populate')\n",
+ " for r, d, label in zip(trainObjs['ra'], trainObjs['dec'], trainObjs['binary_label']):\n",
+ " outPicTemplate = f'sdss_ra={r}_dec={d}-label={label}.png'\n",
+ " fileList.append(f'{outPicTemplate}')\n",
+ "\n",
"else:\n",
" # for id, r, d in zip(searchDf['objID'], trainObjs['ra'], trainObjs['dec']):\n",
- " for r, d, l in zip(trainObjs['ra'], trainObjs['dec'], trainObjs['binary_label']):\n",
- " img_array = SkyServer.getJpegImgCutout(ra=r, dec=d, width=img_width, height=img_height, scale=0.1, \n",
- " dataRelease=SkyServer_DataRelease)\n",
- " # print(f'{id}-label={labeler(z)}')\n",
- " # outPicTemplate = f'{id}-label={labeler(z)}.png'\n",
- " outPicTemplate = f'sdss_ra={r}_dec={d}-label={l}.png'\n",
- " \n",
- " img0 = PIL.Image.fromarray(img_array, 'RGB')\n",
- " img0.save(f'{outDir}/{outPicTemplate}')\n",
- " fileList.append(f'{outPicTemplate}')\n",
+ " with warnings.catch_warnings():\n",
+ " warnings.simplefilter(\"ignore\")\n",
+ " for r, d, label in zip(trainObjs['ra'], trainObjs['dec'], trainObjs['binary_label']):\n",
+ " img_array = SkyServer.getJpegImgCutout(ra=r, dec=d, width=img_width, height=img_height, scale=0.1, \n",
+ " dataRelease=SkyServer_DataRelease)\n",
+ " # print(f'{id}-label={labeler(z)}')\n",
+ " # outPicTemplate = f'{id}-label={labeler(z)}.png'\n",
+ " outPicTemplate = f'sdss_ra={r}_dec={d}-label={label}.png'\n",
+ " \n",
+ " img0 = PIL.Image.fromarray(img_array, 'RGB')\n",
+ " img0.save(f'{outDir}/{outPicTemplate}')\n",
+ " fileList.append(f'{os.path.abspath(outPicTemplate)}')\n",
"\n",
"print(f'Finished populate with {len(fileList)} images')"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 94,
"id": "bf582b23",
"metadata": {},
"outputs": [],
"source": [
- "final_df = pd.concat([\n",
- " searchDf_specMembers[['files','labels']],\n",
- " searchDf_specNonMembers[['files','labels']],\n",
- " pcc_Members.rename(columns={'binary_label':'labels'})[['files','labels']],\n",
- " pcc_nonMembers.rename(columns={'binary_label':'labels'})[['files','labels']]\n",
- "]).reset_index(drop=True)\n",
- "final_df"
+ "# final_df = pd.concat([\n",
+ "# searchDf_specMembers[['files','binary_label']],\n",
+ "# searchDf_specNonMembers[['files','binary_label']],\n",
+ "# # pcc_Members.rename(columns={'binary_label':'labels'})[['files','labels']],\n",
+ "# # pcc_nonMembers.rename(columns={'binary_label':'labels'})[['files','labels']]\n",
+ "# pcc_Members,\n",
+ "# pcc_nonMembers\n",
+ "# ]).reset_index(drop=True)\n",
+ "# final_df"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 95,
"id": "1c43301b",
"metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "