Put

Top  Previous  Next

Description


The Put command transmits data from a FreeFlyer Object to an external file. Several formats are available for the creation of external ephemeris files; other object files are created in an XML format specific to FreeFlyer. For more information on creating external files, see the Interfacing with External Resources Guide.

 

 

Syntax


FreeFlyer Object Files

 

Put myVariable to "myVariable.FFObjectFile";
Put myGroundStation to "myGroundStation.FFObjectFile";
Put mySpacecraft to "mySpacecraft.FFObjectFile";
Put mySpacecraft_myThruster to "Thruster.FFObjectFile";
Put myEphemeris to "myEphemeris.FFObjectFile";

 

Ephemeris Formats

 

// Put Spacecraft state to ephemeris

Put mySpacecraft to myEphemeris;
Put mySpacecraft to myEphemeris as Global; // Millisecond timing precision mode only

 

// Put Spacecraft state and additional columns to ephemeris

// Only supported by the FreeFlyer ephemeris file format in versions 2 or higher

Put mySpacecraft, myVariable to myEphemeris;

Put mySpacecraft to myEphemeris with comment "Some Comment";

 

// Put Ephemeris to FreeFlyer, CCSDS OEM, STK, or SPICE formatted ephemeris file

Put myEphemeris to FFephem "SCephem.FFephem";

Put myEphemeris to CCSDSOEM "SCephem.txt";

Put myEphemeris to STKephem "SCephem.e";

Put myEphemeris to SPKephem "SCephem.bsp";

 

// Put Ephemeris to Code 500 ephemeris file in HP (big endian) format (Requires NASA Pack)
Put myEphemeris to ephem "SCephem.ephem";

Put myEphemeris to ephem "SCephem.ephem" with StepSize = 300 and CS as J2000;

 

// Put Ephemeris to Code 500 ephemeris file in PC (little endian) format (Requires NASA Pack)

Put myEphemeris to PCephem "SCephem.PCEphem";

Put myEphemeris to PCephem "SCephem.PCEphem" with StepSize = 300 and CS as TOD;

 

Where:

"myVariable.FFObjectFile" is any text specifying a valid path and filename, including extension, of an XML formatted output file

The FFephem, CCSDSOEM, STKephem, SPKephem, ephem, or PCephem keywords cause FreeFlyer to output specifically formatted ephemeris text files

"SCephem.FFephem" is a FreeFlyer-formatted external ephemeris

"SCephem.txt" is a CCSDS OEM-formatted external ephemeris

"SCephem.e" is a STK-formatted external ephemeris

"SCephem.bsp" is a SPICE-formatted external ephemeris

"SCephem.ephem" is an HP (big endian) binary external ephemeris (Requires NASA Pack)

"SCephem.PCephem" is a PC (little endian) binary external ephemeris (Requires NASA Pack)

 

 

Details


Most FreeFlyer objects' configurations can be stored in external XML-formatted files using the syntax: Put <myObjectName> to "myObjectName.FFObjectFile";

The Object.PutToFile() or Object.PutToString() methods can be used in place of the Put command.

The Put command will overwrite the file if it already exists, or create a new file if it does not exist.

The Get command can retrieve object data that has been saved to an external file with the Put command.

The Put and Get commands provide similar functionality to the Save and Restore commands, while saving object data to external files instead of internal memory.

When storing data for a Spacecraft object, the Put command will only record the spacecraft's properties, not its attached objects (such as tanks and sensors).

The Put command can not be used with Lists or Formations.

 

Working with Ephemerides:

The Put command provides a mechanism to collect Spacecraft state data into an Ephemeris object.

oWhenever you want to add the Spacecraft's current state into the Ephemeris object, use the Put command.

oThis is often in a While loop, usually following Step and/or Maneuver commands.

oYou can also use the Ephemeris.AddVectorData() method instead of the Put command.

oSee the Creating an Ephemeris File page for more information and examples.

 

If you want to automatically add all the states a Spacecraft will have over the entire Mission Plan simulation, you may want to Put the Spacecraft to the Ephemeris using the "as Global" option, as shown above.

oNote that the "as Global" option is scoped to the control statement it was called in. That is to say, when the "as Global" option is used inside of an If block, While loop, or For loop, all steps inside of the control statement will automatically be added; any steps taken outside of the control statement will NOT be added.

oYou can also employ the "Global" option using the checkbox shown on the Ephemeris Object editor.

oWhen the Ephemeris object has been initialized with the Global checkbox turned on, the associated Spacecraft's state will be added to the Ephemeris object automatically whenever the Spacecraft is stepped or maneuvered; therefore, no Put command from Spacecraft object to Ephemeris object is required.

oThis is particularly useful if the Mission Sequence is complex (multiple loops, maneuvers, etc.) or if the "Step To" syntax is used.

 

Once all of the Spacecraft states have been collected into the Ephemeris object, the Put command can be used to generate an external ephemeris file.

oThis is usually at the end of the Mission Sequence.

oSeveral formats are available for the creation of external ephemeris files, including FreeFlyer ephemerides (*.FFephem), STK ephemerides (*.e), SPICE ephemerides (*.bsp), CCSDS ephemerides, and Goddard Space Flight Center Code 500 ephemerides (requires NASA pack).

oYou can also use the Ephemeris.GenerateEphemeris() method instead of the Put command.

oSee Ephemerides and AHF for more information.

 

With the FreeFlyer ephemeris format in version 2 or higher, FreeFlyer has the ability to add custom columns.

oWhen adding custom columns, you can specify whether the value for the column will be automatically retrieved from a mapped Spacecraft property when the Put command is called, or if the value for the column will be explicitly provided to the Put command.

oIf a custom column is not mapped to a Spacecraft property, the value for this column must be explicitly provided to the Put command, as shown in the example above.

 

Copying objects:

The Assignment command can be used to set all the properties of one object equal to those of another object.

oThe Assignment command only supports certain object types: Variables, Arrays, Strings, StringArrays, Spacecraft, and GroundStations.

oThe Assignment command does not equalize the properties of any attached objects or subsystems (such as Propagators, ForceModels, Tanks, Thrusters, Sensors, and Antennas).

One way to copy objects or subsystems that are not supported by the Assignment command is to use the Put and Get commands to put the first object out to a file and then load all the properties back in to a second object.

oThe example below shows how to equalize all the properties of two Spacecraft's Propagators and ForceModels:

 

// Use the Assigment command to copy Spacecraft1's properties into Spacecraft2

Spacecraft2 = Spacecraft1;

 

// Put Spacecraft1's Propagator and ForceModel to files

Put (Spacecraft1.Propagator AsType RK89) to "prop.FFObjectFile";

Put (Spacecraft1.Propagator AsType RK89).ForceModel to "fm.FFObjectFile";

 

// Retrieve data from files into Spacecraft2's Propagator and ForceModel

Get (Spacecraft2.Propagator AsType RK89) from "prop.FFObjectFile";

Get (Spacecraft2.Propagator AsType RK89).ForceModel from "fm.FFObjectFile";

 

 

Command Editor


Object

Any FreeFlyer Object type

 

Type of Put

Default:

oFreeFlyer Object File

For Spacecraft Objects:

oFreeFlyer Object File

oEphemeris Object - Adds the current Spacecraft state into the Ephemeris object

For Ephemeris Objects:

oFreeFlyer Object File

oFreeFlyer Ephem - Writes the Ephemeris object stored states out to a FreeFlyer-formatted ephemeris file

oSTK Ephem - Writes the Ephemeris object stored states out to an STK-formatted ephemeris file

oSPICE Ephem - Writes the Ephemeris object stored states out to a SPICE-formatted ephemeris file

oCCSDS OEM - Writes the Ephemeris object stored states out to a CCSDS OEM-formatted ephemeris file

oGSFC Ephem (UNIX) (Requires NASA Pack)

oGSFC Ephem (PC) (Requires NASA Pack)

 

File

Output file path and file name for object file or ephemeris

 

Script

Displays the FreeFlyer Script that is generated by the editor

 

Description

Displays descriptions of the editor and its fields

Description text changes as the mouse pointer moves over the different fields within the editor

 

 

 

See Also


Get Command

Save Command

Restore Command

Working with Ephemerides

oCreating an Ephemeris File

Data Files Reference