Skip to content

Commit

Permalink
Added a way to download SkyServer dataset and queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Halim committed May 8, 2013
1 parent 0ca4580 commit 909e6b9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -76,3 +76,19 @@ Example runs:
./run.sh 100000000.data crack 100000 Random 1e-2 NOUP 30
./run.sh skyserver.data dd1r 200000 SkyServer 1e-7 NOUP 60
./run.sh skyserver.data dd1r 200000 SkyServer 1e-7 HFLV 60

Download SkyServer dataset and queries
======

The SkyServer dataset consists of a sequence of 585634221 integers which represents the degree of ascension
in the Photoobjall table. Originally the degree is a floating point between 0 to 360, but in this dataset,
it has been multiplied by 1 million and converted to integers. Run the following command to get the dataset
(it may take very long to download).

./run.sh get-skyserver-dataset

Similarly, the SkyServer queries consist of a sequence of 158325 point queries on the ascension column
(similarly formatted by multiplying it by 1 million and converted to integers).

./run.sh get-skyserver-queries

8 changes: 8 additions & 0 deletions run.sh
Expand Up @@ -79,6 +79,14 @@ if [ "$1" == "batch" ]; then
./run.sh 100000000.data aics 1000 Random 1e-2 NOUP $T
./run.sh 100000000.data aics1r 1000 Random 1e-2 NOUP $T
./run.sh 100000000.data aiss 1000 Random 1e-2 NOUP $T
elif [ "$1" == "get-skyserver-dataset" ]; then
make -s data/skyserver.data
g++ src/data.cpp -o bin/data
bin/data data/skyserver.data
elif [ "$1" == "get-skyserver-queries" ]; then
make -s data/skyserver.data
g++ src/query.cpp -o bin/query
bin/query < data/skyserver.queries
else
run $1 $2 $3 $4 $5 $6 $7
fi
15 changes: 15 additions & 0 deletions src/data.cpp
@@ -0,0 +1,15 @@
#include <stdio.h>

#define MAXN (1 << 25)

int arr[MAXN];

int main(int argc, char *argv[]){
FILE *in = fopen(argv[1],"rb");
if (!in){ fprintf(stderr,"Error opening file %s\n",argv[1]); return 1; }
while (true) {
int N = fread(arr, sizeof(int), MAXN, in);
for (int i = 0; i < N; i++) printf("%d\n", arr[i]);
if (N < MAXN) break;
}
}
10 changes: 10 additions & 0 deletions src/query.cpp
@@ -0,0 +1,10 @@
#include <stdio.h>

int nth;
double ascension;

int main(int argc, char *argv[]){
while (scanf("%d %lf", &nth, &ascension) != EOF) {
printf("%.0lf\n", ascension * 1e6);
}
}

0 comments on commit 909e6b9

Please sign in to comment.