Skip to content

Creating of example folder structure#8

Closed
Fonotec wants to merge 20 commits intomasterfrom
examplefolder
Closed

Creating of example folder structure#8
Fonotec wants to merge 20 commits intomasterfrom
examplefolder

Conversation

@Fonotec
Copy link
Owner

@Fonotec Fonotec commented Oct 23, 2018

As discussed in the previous issue it would be excellent if we had an example structure in our code. Therefore I propose this merge request. Which starts by adding six basic examples, the examples will be automatically downloaded either from our CAMRAS server or from the charon CAMRAS server, after this the examples are run, currently none of the examples work yet.

@Fonotec Fonotec added enhancement New feature or request Documentation New or improved documentation labels Oct 23, 2018
@ewoudwempe
Copy link
Collaborator

Looks good :) Can you update the yml a bit? (things that are relevant: false and true instead of 0 for boolean inputs such as RawData or ConvertRaw, renaming Centrefreq to MixFreq, better chisq parameters, and metadata subdictionary, see the new param.yml).
But before merging this, perhaps we should probably add the features first :)

@Fonotec Fonotec changed the title Creating of example folder structure WIP: Creating of example folder structure Oct 25, 2018

# Loading the data
def load_pulsar_data(pulsar_name, pulsarcat_file='small-data-files/pulsarcat.csv'):
def load_pulsar_data(pulsar_name, pulsarcat_file='./../../small-data-files/pulsarcat.csv'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zo werkt de code niet meer als hij vanaf een andere map wordt gerund. Kun je dat even fixen? Gewoon dirname van de python-file zelf opvragen in python. Iets als Path(__file__).parent+'/small-data-files/pulsarcat.csv', en from pathlib import Path bovenin importeren.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of trouwens Path(__file__).parent/'small-data-files/pulsarcat.csv' is nog mooier :)

Copy link
Owner Author

@Fonotec Fonotec Oct 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, ik zal er even naar kijken, dat is wel een goede suggestie. Mooiste is natuurlijk als het programma vanuit alle folders gerunt kan worden, het zelfde geldt dan voor het defaults.yml bestand.

@Fonotec
Copy link
Owner Author

Fonotec commented Oct 27, 2018

Okay, Currently I have 3 working examples. These are the huispulsar, buurpulsar and the buurpulsar_raw. For the other 3 examples with data we need to read a filterbank file and do the chifit. So I think this so far is all the working examples. Maybe we should get better data for the buurpulsar_raw, so that might be worth discussing Monday. And having a huispulsar_raw example would be really nice, so far I couldn't find a file like this on the data server. So do you think we can merge this branch with master?

@ewoudwempe
Copy link
Collaborator

ewoudwempe commented Oct 27, 2018

Nice, I forgot about the defaults.yml, good catch. Huispulsar_raw is in fact possible, this observation is quite nice: http://www.astro.rug.nl/~camras/data/obs-18-11-2016/B0329%2054.2016.11.18.1038.5min.dat
It would be cleanest to not have non-working examples in master, but I guess the pulsar_live stuff is also in master and not completely working.

@Fonotec Fonotec mentioned this pull request Oct 27, 2018
@Fonotec Fonotec changed the title WIP: Creating of example folder structure Creating of example folder structure Oct 27, 2018
@ewoudwempe
Copy link
Collaborator

@Fonotec
Copy link
Owner Author

Fonotec commented Oct 28, 2018

Okay, I improved the examples for the buurpulsar_raw and the huispulsar_raw, I currently get a bug when I run the huispulsar_raw which is kind of strange. When I run the example I get the error: ValueError: Input values did not match any of the formats where the format keyword is optional ['datetime', 'iso', 'isot', 'yday', 'fits', 'byear_str', 'jyear_str'] while, so far as I can see I included a readible date for astropy. I tend to agree with you on that we should only have working examples in the example folder, so lets first fix that we can also read filterbank such that we have something like 6 examples.

@ewoudwempe
Copy link
Collaborator

I don't think it is necessary to dynamically download these dependencies, instead, just copy them into our repository. They are small enough. Also, I think it is better to open a new pull request for the filterbank stuff, since it does not depend on this one.

@Fonotec
Copy link
Owner Author

Fonotec commented Oct 28, 2018

Okay, I just removed the whole thing of dynamically downloading them. Instead I use the blimpy module, which is almost identical to what Tammo-Jan does, only this can be installed easily by pip.

@ewoudwempe
Copy link
Collaborator

This request has now been split up into #11, #12 and #13, so it will be closed.

@ewoudwempe ewoudwempe closed this Oct 28, 2018
@ewoudwempe ewoudwempe deleted the examplefolder branch November 4, 2018 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation New or improved documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants