Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdstein authored Dec 8, 2018
1 parent 0a178e2 commit 031d59c
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ The entire package can simply be pip installed, and this will automatically inst

### OPTION B: Actually, I want to see the backend code myself. Maybe I want to contribute to it!

Now you will need one extra line of code:
Now you will need a couple of extra code lines:

```bash
git clone [email protected]:robertdstein/flarestack.git
pip install -e flarestack
git clone [email protected]:IceCubeOpenSource/flarestack.git
export PYTHONPATH=/path/to/flarestack
```

This will give you the very latest copy of the code, update the installed version if you git pull or modify scripts yourself, and still enable you to import flarestack.
Expand All @@ -43,32 +43,42 @@ Flarestack uses python 2.7, and requires the following packages:
* matplotlib
* numexpr

All required dependencies can be found using the IceCube py2-v3 environment. They can collectively be installed with ```pip install -r requirements.txt```, if for some reason you don't want to install flarestack via pip..
All required dependencies can be found using the IceCube py2-v3 environment. They can collectively be installed with ```pip install -r requirements.txt```, if you don't want to install flarestack via pip.

### Right, anyway, I've now downloaded Flarestack. Can I use it right away?

Unfortunately, you can't do Science quite yet. There is an additional step, in which multiple recycleable values are computed once, and will be frequently reused later on. To perform this step, you need to firstly download some data+MC. IceCube users can download these files from Madison under ```/data/ana/analyses/```, where the appropriate directory naming convention is then mirrored by the ```flarestack/data/IceCube/``` structure. That can be bypassed if you are working on the DESY /afs/ filesystem, or on the cobalt machinces at WIPAC, because Flarestack will instead find the relevant IceCube files automatically. Either way, you then need to select a space to save these precomputed/stored values. Since they can be regenerated at any time, a scratch space is ideal for this purpose. You then need to run a script such as the following:
Unfortunately, you can't do science quite yet. There is an additional step, in which multiple recycleable values are computed once, and will be frequently reused later on. To perform this step, you need to firstly download some data+MC. IceCube users can download these files from Madison under ```/data/ana/analyses/```, where the appropriate directory naming convention is then mirrored by the ```flarestack/data/IceCube/``` structure. That can be bypassed if you are working on the DESY /afs/ filesystem, or on the cobalt machinces at WIPAC, because Flarestack will instead find the relevant IceCube files automatically. Either way, you then need to select a space to save these precomputed/stored values. Since they can be regenerated at any time, a scratch space is ideal for this purpose.

The most straighforward way to set up Flarestack is to run the following command from inside the flarestack directory.

```bash
python flarestack/precompute.py -sp /path/to/scratch
```

Alternatively, you can setup your own precomputation in a python console, in the following way. Firstly, you specify the scratch directory you want to use:

```python
from flarestack.precompute import run_precompute, set_scratch_directory
set_scratch_directory("/path/to/my/scratch/")
```

If you are *not* using the DESY/WIPAC datasets, you'll need to add the following lines to your code:
If you are *not* using the DESY/WIPAC datasets, you'll need to point to the relevant directory where raw datasets are stored:

```python
from flarestack.shared import set_dataset_directory
set_dataset_directory("/path/to/datasets/")
```

In any case, you then need the next to lines to begin setup:
Finally, you then need to select datasets and run the begin setup:

```python
from flarestack.data.icecube.gfu.gfu_v002_p01 import txs_sample_v1
run_precompute(txs_sample_v1)
```

The above 4/6 lines of code will then build all relevant files for the datasets used in the TXS analysis (7 years of Point Source data and 2.5 years of GFU data). *Be prepared that this will take some time*. Fortunately, having done this once, you will not need to repeat it unless you require new datasets or a new release of Flarestack. The scratch directory will not need to be set again, although the dataset directory will need to be newly assigned at the top of your analysis scripts.
The above 4/6 lines of code will then build all relevant files for the datasets used in the TXS analysis (7 years of Point Source data and 2.5 years of GFU data), in the same way as when flarestack/precompute.py is run directly.

In either case, the code will then run. *Be prepared that this will take some time*. Fortunately, having done this once, you will not need to repeat it unless you require new datasets or a new release of Flarestack. The scratch directory will not need to be set again, although the dataset directory will need to be newly assigned at the top of your analysis scripts.

You can them simply run scripts such as those under /flarestack/analyses/, and do your science!

Expand Down

0 comments on commit 031d59c

Please sign in to comment.