Skip to content

Manually merging data submissions

snlongmore edited this page May 15, 2015 · 17 revisions

The following steps explain how to merge different data submissions to a single master file.

Firstly, make sure your code is up to date. Go to the main directory and type:

git pull upstream master

From the same directory, start the web server locally:

python upload_form.py

Open the "upload form" webpage by going to this page in a browser, http://127.0.0.1:5000/upload_form. Select the file with data you want to upload and hit "upload". This will take you to a new page where you need to select the columns with Sigma, sigma, radius, select the units etc. Note, the username should be the name of the person whose data you are uploading (ie the name that will appear in the database, which might not necessarily be the same as the name of the person actually doing the uploading).

Hit submit. This data should be added to the "merged_table.ipac" file in the "database" directory and a nice, shiny, interactive figure with the new data should appear. In the future, a link will appear showing the pull request (an issue has been raised about this here, https://github.com/camelot-project/frontend/issues/52). But in the mean time, you have to get the link manually. So, in the terminal where you started the server, there should be a bunch of new text, including something which should look like

To [email protected]:camelot-project/database.git
 * [new branch]      MarkHeyer_2015-05-15T12_14_50.510734 -> MarkHeyer_2015-05-15T12_14_50.510734

The new branch is "MarkHeyer_2015-05-15T12_14_50.510734". Now, change to the database directory:

cd database

Then checkout the new branch:

git checkout MarkHeyer_2015-05-15T12_14_50.510734

Now you need to merge your local copy of "merged_table.ipac" with that in the master version of the code. Use the following command to create a local copy of the master "merged_table.ipac" in the file "main_table.ipac".

git show origin/master:merged_table.ipac > main_table.ipac

Open ipython and run the following code that Adam put together to merge the two existing tables.

from astropy.table import vstack, Table

diederiktable = Table.read('merged_table.ipac', format='ascii.ipac')

maintable = Table.read('main_table.ipac', format='ascii.ipac')

newtable = vstack([maintable, diederiktable])

newtable.write('new_table.ipac', format='ascii.ipac')

Now replace the old "merged_table.ipac" with "new_table.ipac and remove "main_table.ipac":

mv new_table.ipac merged_table.ipac
rm main_table.ipac
git status
git commit -a
git push
git merge origin master