-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fa51a5
commit 17a41ab
Showing
6 changed files
with
58 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
for path in $(find /fred/oz002/ldunn/meertime_dataportal/data/post -type f -name "obs.header"); do | ||
if [ -e "${path%%obs.header}/meertime.json" ]; then | ||
echo "Skipping $path" | ||
else | ||
echo "Making meetime.json for $path" | ||
EXIT_CODE=0 | ||
generate_meerkat_json $path -o ${path%%obs.header} || EXIT_CODE=$? | ||
if [ "$EXIT_CODE" -ne 42 ]; then | ||
ingest_obs ${path%%obs.header}/meertime.json | ||
fi | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import os | ||
|
||
DATA_DIR = os.path.join(os.path.dirname(__file__), "data") | ||
MOLONGLO_CALIBRATIONS = os.path.join(DATA_DIR, "molonglo_calibrations.txt") | ||
MOLONGLO_CALIBRATIONS = os.path.join(DATA_DIR, "molonglo_phasing.txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
import shlex | ||
|
||
import subprocess | ||
|
||
import psrchive as psr | ||
|
||
|
||
def generate_obs_length(archive): | ||
""" | ||
Determine the length of the observation from the input archive file | ||
""" | ||
|
||
ar = psr.Archive_load(archive) | ||
ar = ar.total() | ||
return ar.get_first_Integration().get_duration() | ||
|
||
|
||
def get_archive_ephemeris(freq_summed_archive): | ||
""" | ||
Get the ephemeris from the archive file using the vap command. | ||
""" | ||
comm = "vap -E {0}".format(freq_summed_archive) | ||
args = shlex.split(comm) | ||
proc = subprocess.Popen(args,stdout=subprocess.PIPE) | ||
proc.wait() | ||
ephemeris_text = proc.stdout.read().decode("utf-8") | ||
|
||
if ephemeris_text.startswith('\n'): | ||
# Remove newline character at start of output | ||
ephemeris_text = ephemeris_text.lstrip('\n') | ||
return ephemeris_text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters