mcdittmar / rama Goto Github PK
View Code? Open in Web Editor NEWThis project forked from olaurino/rama
A data modeling library in Python for the Virtual Observatory
This project forked from olaurino/rama
A data modeling library in Python for the Virtual Observatory
Within the TEMPLATES context, these elements do not produce a constant, repeating value per row, but only a single scalar value.
eg: SkyCoord.longitude => => Quantity with array value (one per row)
SkyCoord.latitude => => Quantity with singular value
rama/rama/reader/votable/parser.py
Lines 182 to 205 in c1fc61a
I believe its because the annotated dmtype is RealQuantity, but if the VOTable contains string columns of RA,DEC in sexagesimal notation, the TABLEDATA handler, I think, attempts to make numeric columns from them, and fails miserably.
TypeError, "The value must be a valid Python or Numpy numeric value"
Not sure what to do about this, but probably should be able to handle this notation in Positional columns.
The SkyCoord adapter operates on the coords:Point class
Point
A nasty exception ensues if axis1 and/or axis2 have no value.
The SkyCoord instructor complains that they are not proper value types.
Another point to consider here.
Point used in Velocity context, underlying Point is still cast to a SkyCoord, but that is not really appropriate.
NOTE: SkyCoord contains position, velocity, proper motion, radial velocity together in the same Frame.
Need to check the response for a column whose value has multiplicity > 1 (ie: an array).
See test_reader.py::test_parsing_columns()
MultiObj.b is an array element of type ivoa:real[2]
o for CONSTANT and LITERAL, this results in 'list of float', [ r1, r2 ]
o for COLUMN, this results in 'list of length 1 of MaskedColumn'
MultiObj.a (scalar)
o LITERAL - float n/a v1
o CONSTANT - float n/a v1
o COLUMN - MaskedColumn(float) shape(2,) [r1v1, r2v1]
MultiObj.b (array)
o LITERAL - list(float) len=2 [v1, v2]
o CONSTANT - list(float) len=2 [v1, v2]
o COLUMN - list(MaskedColumn(float)) len=1 <<< This doesn't look right
list[0] = MaskedColumn shape(2,2) [[r1v1, r1v2],[r2v1, r2v2]]
Handled by: framework.VodmlDescriptor::select_return_value()
o this is the base class for Attribute, Reference, Composition
o current logic looks OK for Reference and Composition, but not Attribute
o probably want override in Attribute
Composition max = -1 for unbound (so if not making override, take into account)
rama/rama/reader/votable/tests/test_reader.py
Lines 136 to 147 in c1fc61a
When an ObjectType contains a List of references to another ObjectType, the interface to access the target object is a bit clunky.
Object.attribute = List[n].referenced_instance == Target object
I have a VOTable with a REMOTEREFERENCE, but this is not interpreted by the rama code.
Following is snippet of VOTable annotation containing a REMOTEREFERENCE.
<TEMPLATES tableref="T1622026678915_1">
<INSTANCE dmtype="sample:catalog.Source" ID="T1622026678915_718">
<PRIMARYKEY>
<PKFIELD>
<COLUMN dmtype="ivoa:string" ref="oidsaada_100"/>
</PKFIELD>
</PRIMARYKEY>
<ATTRIBUTE dmrole="sample:catalog.AbstractSource.position">
<INSTANCE dmtype="sample:catalog.SkyCoordinate">
<ATTRIBUTE dmrole="sample:catalog.SkyCoordinate.longitude">
<COLUMN dmtype="ivoa:RealQuantity" ref="pos_ra_csa_102"/>
</ATTRIBUTE>
<ATTRIBUTE dmrole="sample:catalog.SkyCoordinate.latitude">
<COLUMN dmtype="ivoa:RealQuantity" ref="pos_dec_csa_103"/>
</ATTRIBUTE>
<REFERENCE dmrole="sample:catalog.SkyCoordinate.frame">
<REMOTEREFERENCE>http://ivoa.net/dm-instances/STC/Coords/ICRS-frame.xml</REMOTEREFERENCE>
</REFERENCE>
</INSTANCE>
</ATTRIBUTE>
<ATTRIBUTE dmrole="sample:catalog.AbstractSource.positionError">
<INSTANCE dmtype="sample:catalog.GenericEllipse">
<ATTRIBUTE dmrole="sample:catalog.GenericEllipse.major">
<COLUMN dmtype="ivoa:real" ref="error_maj_csa_105"/>
The rama code generates a position as follows:
'position': {'rama.models.test.sample.SkyCoordinate': {'frame': None, 'latitude': -17.071667101891, 'longitude': 340.91055060369}},
The path to the 'leaf' data from columns appears to depend on what sort of value is at the leaf:
Or maybe more to the point, how it is serialized.
dmusecases:standard_properties
The Quantity types are mapped to astropy.units.Quantity, on which you can add a 'name' attribute.
The others, map to base types (float, int, bool), which can not be modified/appended with a 'name'.
Use Case:
* Not sure there is a use case, but noting the disparity in the code.
* The current usage (cube.py) is that column names from FIELD element are used
as the key in a hash storing the column values (Quantity, or MaskedColumn? instance).
However, in this context as Measurements, the columns map to the
corresponding Axes of the coordinate space, and the name should
map back to the meas.coord.coordsys.coordspace.axis[n].name
** This is something to explore more thoroughly **
o perhaps coords/meas needs shortcut methods to access coordspace info.
o should meas implementation collapse coords?? making access to content at the meas level?
rama/rama/models/ivoa/__init__.py
Lines 53 to 104 in c1fc61a
The following VOTable annotation segment declares a PRIMARYKEY. In the Source instance created by rama this is left out.
PRIMARYKEY is very important to distinguish ObjectType instances, particularly in certain flattened situations or ORM FK->PK mapping:
<TEMPLATES tableref="T1622026678915_1">
<INSTANCE dmtype="sample:catalog.Source" ID="T1622026678915_718">
<PRIMARYKEY>
<PKFIELD>
<COLUMN dmtype="ivoa:string" ref="oidsaada_100"/>
</PKFIELD>
</PRIMARYKEY>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.