Skip to content

Commit

Permalink
Add unit test data in hipscat format
Browse files Browse the repository at this point in the history
  • Loading branch information
camposandro committed Jun 13, 2024
1 parent 8ffcb5c commit aab3ba0
Show file tree
Hide file tree
Showing 73 changed files with 277 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,5 @@ _html/

# Project initialization script
.initialize_new_project.sh

.idea/
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=1.parquet
Binary file not shown.
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=10.parquet
Binary file not shown.
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=2.parquet
Binary file not shown.
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=5.parquet
Binary file not shown.
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=6.parquet
Binary file not shown.
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=7.parquet
Binary file not shown.
Binary file added tests/data/DATA/Norder=0/Dir=0/Npix=9.parquet
Binary file not shown.
Binary file added tests/data/DATA/_common_metadata
Binary file not shown.
Binary file added tests/data/DATA/_metadata
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/data/DATA/catalog_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"catalog_name": "DATA",
"catalog_type": "object",
"total_rows": 84383,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
8 changes: 8 additions & 0 deletions tests/data/DATA/partition_info.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Norder,Dir,Npix,num_rows
0,0,1,23743
0,0,2,34965
0,0,5,632
0,0,6,21350
0,0,7,3481
0,0,9,3
0,0,10,209
25 changes: 25 additions & 0 deletions tests/data/DATA/provenance_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"catalog_name": "DATA",
"catalog_type": "object",
"total_rows": 84383,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec",
"version": "0.3.4",
"generation_date": "2024.06.13",
"tool_args": {
"tool_name": "lsdb",
"version": "0.2.5",
"runtime_args": {
"catalog_name": "DATA",
"output_path": "DATA",
"output_catalog_name": "DATA",
"catalog_path": "DATA",
"catalog_type": "object",
"total_rows": 84383,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added tests/data/DR7-lrg-rand/_common_metadata
Binary file not shown.
Binary file added tests/data/DR7-lrg-rand/_metadata
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/data/DR7-lrg-rand/catalog_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"catalog_name": "DR7-lrg-rand",
"catalog_type": "object",
"total_rows": 832474,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
22 changes: 22 additions & 0 deletions tests/data/DR7-lrg-rand/partition_info.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Norder,Dir,Npix,num_rows
0,0,0,1362
1,0,4,87864
1,0,5,90690
1,0,6,32248
1,0,7,33718
1,0,8,90367
1,0,9,57506
1,0,10,90376
1,0,11,35271
0,0,3,3655
0,0,4,54658
0,0,5,11292
1,0,24,1720
1,0,25,60046
1,0,26,51279
1,0,27,90066
0,0,7,30562
0,0,8,4775
0,0,9,78
0,0,10,1062
0,0,11,3879
25 changes: 25 additions & 0 deletions tests/data/DR7-lrg-rand/provenance_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"catalog_name": "DR7-lrg-rand",
"catalog_type": "object",
"total_rows": 832474,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec",
"version": "0.3.4",
"generation_date": "2024.06.13",
"tool_args": {
"tool_name": "lsdb",
"version": "0.2.5",
"runtime_args": {
"catalog_name": "DR7-lrg-rand",
"output_path": "DR7-lrg-rand",
"output_catalog_name": "DR7-lrg-rand",
"catalog_path": "DR7-lrg-rand",
"catalog_type": "object",
"total_rows": 832474,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
}
}
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=0.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=1.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=10.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=11.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=2.parquet
Binary file not shown.
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=4.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=5.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=6.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=7.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=8.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/Norder=0/Dir=0/Npix=9.parquet
Binary file not shown.
Binary file added tests/data/DR7-lrg/_common_metadata
Binary file not shown.
Binary file added tests/data/DR7-lrg/_metadata
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/data/DR7-lrg/catalog_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"catalog_name": "DR7-lrg",
"catalog_type": "object",
"total_rows": 105831,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
13 changes: 13 additions & 0 deletions tests/data/DR7-lrg/partition_info.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Norder,Dir,Npix,num_rows
0,0,0,176
0,0,1,31379
0,0,2,35044
0,0,3,420
0,0,4,6692
0,0,5,1330
0,0,6,25672
0,0,7,4049
0,0,8,523
0,0,9,7
0,0,10,111
0,0,11,428
25 changes: 25 additions & 0 deletions tests/data/DR7-lrg/provenance_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"catalog_name": "DR7-lrg",
"catalog_type": "object",
"total_rows": 105831,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec",
"version": "0.3.4",
"generation_date": "2024.06.13",
"tool_args": {
"tool_name": "lsdb",
"version": "0.2.5",
"runtime_args": {
"catalog_name": "DR7-lrg",
"output_path": "DR7-lrg",
"output_catalog_name": "DR7-lrg",
"catalog_path": "DR7-lrg",
"catalog_type": "object",
"total_rows": 105831,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
}
}
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=1.parquet
Binary file not shown.
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=10.parquet
Binary file not shown.
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=2.parquet
Binary file not shown.
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=5.parquet
Binary file not shown.
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=6.parquet
Binary file not shown.
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=7.parquet
Binary file not shown.
Binary file added tests/data/RAND/Norder=0/Dir=0/Npix=9.parquet
Binary file not shown.
Binary file added tests/data/RAND/_common_metadata
Binary file not shown.
Binary file added tests/data/RAND/_metadata
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/data/RAND/catalog_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"catalog_name": "RAND",
"catalog_type": "object",
"total_rows": 227336,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
8 changes: 8 additions & 0 deletions tests/data/RAND/partition_info.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Norder,Dir,Npix,num_rows
0,0,1,73222
0,0,2,82167
0,0,5,1742
0,0,6,60914
0,0,7,8953
0,0,9,17
0,0,10,321
25 changes: 25 additions & 0 deletions tests/data/RAND/provenance_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"catalog_name": "RAND",
"catalog_type": "object",
"total_rows": 227336,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec",
"version": "0.3.4",
"generation_date": "2024.06.13",
"tool_args": {
"tool_name": "lsdb",
"version": "0.2.5",
"runtime_args": {
"catalog_name": "RAND",
"output_path": "RAND",
"output_catalog_name": "RAND",
"catalog_path": "RAND",
"catalog_type": "object",
"total_rows": 227336,
"epoch": "J2000",
"ra_column": "ra",
"dec_column": "dec"
}
}
}
92 changes: 92 additions & 0 deletions tests/data/generate_data.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Unit test data\n",
"\n",
"This directory contains very small, toy, data sets that are used for unit tests."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import lsdb\n",
"from astropy.table import Table\n",
"\n",
"def construct_df_from_fits(file_path):\n",
" dat = Table.read(file_path, format=\"fits\")\n",
" return dat.to_pandas()\n",
"\n",
"def generate_catalog(catalog_name):\n",
" raw_fits = f\"./raw/{catalog_name}.fits\"\n",
" catalog = lsdb.from_dataframe(\n",
" construct_df_from_fits(raw_fits),\n",
" catalog_name=catalog_name,\n",
" catalog_type=\"object\",\n",
" )\n",
" catalog.to_hipscat(catalog_name)\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Galaxy samples"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"generate_catalog(\"DATA\")\n",
"generate_catalog(\"DR7-lrg\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Random samples"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"generate_catalog(\"RAND\")\n",
"generate_catalog(\"DR7-lrg-rand\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "corrgi",
"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.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Binary file added tests/data/raw/DATA.fits
Binary file not shown.
Binary file added tests/data/raw/DR7-lrg-rand.fits
Binary file not shown.
Binary file added tests/data/raw/DR7-lrg.fits
Binary file not shown.
Binary file added tests/data/raw/RAND.fits
Binary file not shown.

0 comments on commit aab3ba0

Please sign in to comment.