Skip to content

Commit

Permalink
Merge pull request #18 from tikk3r/dp3-v6-update
Browse files Browse the repository at this point in the history
Update imports for DP3 6.0
  • Loading branch information
jurjen93 authored Aug 25, 2023
2 parents f8ed804 + d659747 commit 1e899ac
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions dp3_helpers/polconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,16 @@
export PYTHONPATH=/somewhere/you/like:$PYTHONPATH
"""

try:
from dppp import DPStep as Step
DP3name = 'DPPP' # default
except:
from dp3 import Step
DP3name = 'DP3'

from subprocess import check_output
import re
import numpy as np
import shutil
import sys

#hacky way to figure out the DPPP/DP3 version (important to run this script properly)
DP3name = shutil.which('DP3')
if not DP3name:
DP3name = shutil.which('DPPP')
try:
rgx = '[0-9]+(\.[0-9]+)+'
grep_version_string = str(check_output(DP3name+' --version', shell=True), 'utf-8')
Expand All @@ -32,6 +28,14 @@
if DP3_VERSION > 5.3:
from dp3 import Fields

try:
from dppp import DPStep as Step
except:
if DP3_VERSION >= 6:
from dp3.pydp3 import Step
else:
from dp3 import Step

class PolConv(Step):
"""
Convert UV data polarization.
Expand Down

0 comments on commit 1e899ac

Please sign in to comment.