NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Software > AntennaPFMSchema (r1.1 vs. r1.2)
   Changes | Index | Contents | Search | Statistics | Go
 <<O>>  Difference Topic AntennaPFMSchema (r1.2 - 24 May 2007 - JoeBrandt)
Added:
>
>

Configuration data for the antenna pointing/focusing models, residual corrections, beam offsets, optical configuration data, site information and dynamic correction setup is keyed by a configuration name. A configuration name is related to a configuration id, which specifies a row in the configuration_map. The configuration_map has foreign keys into the poiting_gravity_model, focus_gravity_model, site_data, refraction_model, and residual set tables.

The dynamic_model_map, used by the antenna characterization manager, contains a foriegn key into the configuration_id table. This relates the configuration table with the dynamic_model.

I should note that the Active Surface tables (zernike_gravity_model, zernike_gravity_model_coeff) are not related by the configuration table. Active surface configurations are specified separately, but a similar pattern of named active surface correction models is used. (i.e. the zernike_gravity_model table is analogous to the configuration table, and likewise the zernike_gravity_model_coeff table is analogous to the pointing and focusing tables.)

Example Database Queries

Note: Beware this section is old, and possibly incorrect.
Changed:
<
<

Select pointing_model_id,focus_model_id,site_data_id from configuration_map where configuration_id=configuration.id limit 1

This query will return id's for pointing, focus tracking, and site data.

Select * from receiver_beam_map where configuration_id=configuration.id

This returns all 27 receiver_beam_offsets for the given configuration.

SELECT receiver_id, beam_id, el_offset,xel_offset, receiver.name, boom_retracted, turret_angle, beam.name AS beam_name, f_x, f_y, f_z, f_xt, f_yt, f_zt, sr_feed1, sr_feed2 FROM receiver_beam_offset, receiver_beam_map, optics_config, receiver, beam WHERE receiver_beam_offset.id = receiver_beam_map.receiver_beam_offset_id AND receiver_beam_map.configuration_id = 1 AND receiver.id = receiver_beam_map.receiver_id AND optics_config.id = receiver_beam_map.optics_config_id AND beam.id = receiver_beam_map.beam_id ORDER BY receiver_id, beam_id ;

>
>

SELECT pointing_model_id,focus_model_id,site_data_id FROM configuration_map WHERE configuration_id=configuration.id LIMIT 1

The query above will return id's for pointing, focus tracking, and site data.

The query: SELECT * FROM receiver_beam_map WHERE configuration_id=configuration.id

returns all 27 receiver_beam_offsets for the given configuration id.

    SELECT receiver_id, beam_id, el_offset,xel_offset,
    receiver.name, boom_retracted, turret_angle,
    beam.name AS beam_name,
    f_x, f_y, f_z, f_xt, f_yt, f_zt, sr_feed1, sr_feed2
    FROM receiver_beam_offset, receiver_beam_map,
    optics_config, receiver, beam
    WHERE receiver_beam_offset.id = receiver_beam_map.receiver_beam_offset_id
    AND receiver_beam_map.configuration_id = 1
    AND receiver.id = receiver_beam_map.receiver_id
    AND optics_config.id = receiver_beam_map.optics_config_id
    AND beam.id = receiver_beam_map.beam_id
    ORDER BY receiver_id, beam_id ;

 <<O>>  Difference Topic AntennaPFMSchema (r1.1 - 24 May 2007 - JoeBrandt)
Added:
>
>

%META:TOPICINFO{author="JoeBrandt" date="1180019460" format="1.0" version="1.1"}% %META:TOPICPARENT{name="PlanOfRecordC42007"}%

Description of Antenna Pointing Focusing Database Schema

This is a description of the schema used by the antenna system to manage pointing correction model data. A pictorial of the schema is shown below:
Antenna PFM Schema
Active Surface Schema

The database stores five basic quantities:

  • site (location) data
  • pointing model
  • focus tracking model
  • receiver-beam specific beam offset and focus offsets
  • Zernike coefficients for active surface corrections

A basic requirement in the schema design was that measurement data should never be replicated, simply because of the database layout itself. This means the system should allow any one of the quantities to be remeasured and updated without replicating measurements of other quantities.

A user knowing only that they should type "default" for the PFM configuration, comes to observe. Starting at the configuration table, a query is run to map the name to an id; specifically configuration.name is mapped to configuration.id. In SQL:

Select configuration.id from configuration where configuration.name="default" order by configuration.version limit 1

The order by and limit 1 clauses, assure that the user gets the latest version.

The next question is what items are associated with the resulting configuration.id? Since many configurations can reference the same pointing and focusing models, and since we have more than one receiver, a many to many association exists between the configuration table and just about everything else. A complicating factor is that many to many relationships are either difficult to express and/or not supported by MySQL.

To resolve this three 'mapping' tables are used. For a given configuration, each map relates either a single quantity (e.g. pointing, focusing) or a set of quantities (e.g. receiver_beam_offsets, residuals) to a configuration.

For every single unique configuration.id, there will be a single corresponding entry in the configuration_map; approximately 27 rows in the receiver_beam_map; and optionally N rows in the residual_map.

So, back to queries: What quantities are related to a given configuration.id?

Select pointing_model_id,focus_model_id,site_data_id from configuration_map where configuration_id=configuration.id limit 1

This query will return id's for pointing, focus tracking, and site data.

Select * from receiver_beam_map where configuration_id=configuration.id

This returns all 27 receiver_beam_offsets for the given configuration.

SELECT receiver_id, beam_id, el_offset,xel_offset, receiver.name, boom_retracted, turret_angle, beam.name AS beam_name, f_x, f_y, f_z, f_xt, f_yt, f_zt, sr_feed1, sr_feed2 FROM receiver_beam_offset, receiver_beam_map, optics_config, receiver, beam WHERE receiver_beam_offset.id = receiver_beam_map.receiver_beam_offset_id AND receiver_beam_map.configuration_id = 1 AND receiver.id = receiver_beam_map.receiver_id AND optics_config.id = receiver_beam_map.optics_config_id AND beam.id = receiver_beam_map.beam_id ORDER BY receiver_id, beam_id ;

This query joins five tables which together define beam offset and focusing attributes of each receiver and beam, for a given configuration.

The Antenna PFM database is now online at: http://leo.gb.nrao.edu/antenna_db/displaydb.php

-- JoeBrandt - 24 May 2007 %META:FILEATTACHMENT{name="AntennaPFMSchema.png" attr="" comment="Main PFM Schema" date="1180022210" path="AntennaPFMSchema.png" size="53549" user="JoeBrandt" version="1.2"}% %META:FILEATTACHMENT{name="SurfaceSchema.png" attr="" comment="Active Surface Schema" date="1180020798" path="SurfaceSchema.png" size="5406" user="JoeBrandt" version="1.1"}%


Topic AntennaPFMSchema . { View | Diffs | r1.2 | > | r1.1 | More }
Revision r1.1 - 24 May 2007 - 15:11 GMT - JoeBrandt
Revision r1.2 - 24 May 2007 - 17:15 GMT - JoeBrandt
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.