Comments (6)
Yes. That would be nice. It might be best to write a script to extract the information from the C files and generate the python code before the PyPI distribution is built. The prologues are standard Starlink format and can be extracted either with the SST application or a perl module. I don't have native python code at the moment for parsing the documentation.
from palpy.
I've had a stab at this and I've pushed some test code in commit 35a562f
Seems to work in that help(palpy)
is much more useful than it used to be.
Some routines are still undocumented because they are undocumented in PAL (they are the ones that map trivially to ERFA/SOFA). I'll sort those out in PAL itself.
Please let me know if this works for you (not tested on python 2).
For reference your example now gives me:
mapqk(...)
(ra, da) = mapqk( rm, dm, pr, pd, px, rv, amprms )
Quick mean to apparent place
rm = double (Given)
Mean RA (radians)
dm = double (Given)
Mean declination (radians)
pr = double (Given)
RA proper motion, changes per Julian year (radians)
pd = double (Given)
Dec proper motion, changes per Julian year (radians)
px = double (Given)
Parallax (arcsec)
rv = double (Given)
Radial velocity (km/s, +ve if receding)
amprms = double [21] (Given)
Star-independent mean-to-apparent parameters (see palMappa).
ra = double * (Returned)
Apparent RA (radians)
dec = double * (Returned)
Apparent dec (radians)
- The reference frames and timescales used are post IAU 2006.
from palpy.
That looks great. I'll download the branch and give it a try.
from palpy.
I got it to compile and run under Python 2.7. I ran the test file and it passed, so it seem like it's good to go.
I had to do two things.
- In Python 2.7, the open built-in doesn't take a codec argument. You have to used the codecs module. I checked and this should be forward compatible to Python 3. Following is the patch for setup.py:
diff --git a/setup.py b/setup.py
index 0c0e680..4f6f48e 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,7 @@
import os
import numpy
import re
+import codecs
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
@@ -94,8 +95,8 @@ for cfile in pal_c:
# Generate cpal.pxd
paldoc_re = re.compile(r"@(pal.*)@")
-outfh = open("pal.pyx", "w", encoding="utf8")
-with open('pal.pyx.in') as file:
+outfh = codecs.open("pal.pyx", "w", "utf8")
+with codecs.open('pal.pyx.in', 'r', 'utf8') as file:
prevline = ""
for line in file.readlines():
match_paldoc = paldoc_re.search(line)
- In Python 2 you can't import from a directory without making it a module. This just requires placing an empty init.py in the support directory.
I can create a pull request, if you like. Just let me know.
from palpy.
Should now all work for you with commit 160bec2. Closing.
from palpy.
I'll release v1.2 in a couple of weeks once I know that @schandra doesn't need any more tweaks made for his OpSim updates.
from palpy.
Related Issues (6)
- Windows support? HOT 3
- pm doesn't work HOT 2
- Palpy Cython-related issues HOT 4
- New release HOT 6
- relationship between mapqk and ampqk HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from palpy.