nenupy.observation.parset
Parset reader
- class nenupy.observation.parset.Parset(parset)[source]
Bases:
object
- property parset
- property version
- class nenupy.observation.parset.ParsetUser[source]
Bases:
object
Class that handles the formatting of a NenuFAR parset_user file.
- Example:
from nenupy.observation import ParsetUser # Create an instance of this class p = ParsetUser() # Add an analog beam p.add_analog_beam(target="Analog beam 1") # Add two numerical beams associated with this analog beam p.add_numerical_beam(0, target="One") p.add_numerical_beam(0, target="Two") # Print the analog beam parset block print(p.analog_beams[0]) # Validate the parset p.validate() # Write the file p.write("my_parset.parset_user")
See also
NenuFAR Parset_User guide and the tutorial.
Attributes Summary
Lists all the available analog beam fields.
Lists all the available numerical beam fields.
Lists all the available phase center fields.
Lists all the available observation fields.
Lists all the available output fields.
Methods Summary
set_observation_config
(**kwargs)Sets the configuration of the parset_user observation block.
set_output_config
(**kwargs)Sets the configuration of the parset_user output block.
add_analog_beam
(**kwargs)Adds an analog beam to the
analog_beams
attribute and updates its index based on other analog beams.add_numerical_beam
([anabeam_index])Adds a numerical beam to the analog beam '
anabeam_index
' and updates its index based on other numerical beams.modify_analog_beam
(anabeam_index, **kwargs)Modifies the configuration of the analog beam.
modify_numerical_beam
(numbeam_index, **kwargs)Modifies the configuration of the numerical beam.
remove_analog_beam
(anabeam_index)Removes an analog beam along with its associated numerical beams and phase centers.
remove_numerical_beam
(numbeam_index)Removes a numerical beam and updates the numerical beam indices.
validate
()Validates the syntax of each field.
write
(file_name)Writes the current instance of
ParsetUser
to a file calledfile_name
.Attributes and Methods Documentation
- add_analog_beam(**kwargs)[source]
Adds an analog beam to the
analog_beams
attribute and updates its index based on other analog beams. This method ingests any valid keyword argument corresponding to an Anabeam configuration.- Example:
from nenupy.observation import ParsetUser from astropy.time import Time, TimeDelta p = ParsetUser() p.add_analog_beam( target="My fav target", simbadSearch="Cygnus X-3", trackingType="tracking", duration=TimeDelta(3600, format="sec"), # or "3600s" startTime=Time("2022-01-01 12:00:00") # or "2022-01-01T12:00:00Z" )
- add_numerical_beam(anabeam_index=0, **kwargs)[source]
Adds a numerical beam to the analog beam ‘
anabeam_index
’ and updates its index based on other numerical beams. This method ingests any valid keyword argument corresponding to a Beam configuration.- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam( target="My fav target", simbadSearch="Cygnus X-3", trackingType="tracking", duration="3600s", startTime="2022-01-01T12:00:00Z" ) p.add_numerical_beam( anabeam_index=0, target="My fav target", useParentPointing=True, subbandList="[200..300]" )
- add_phase_center(anabeam_index=0, **kwargs)[source]
Adds a phase center to the analog beam ‘
anabeam_index
’ and updates its index based on other phase centers. This method ingests any valid keyword argument corresponding to a PhaseCenter configuration.- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam( target="My fav target", simbadSearch="Cygnus X-3", trackingType="tracking", duration="3600s", startTime="2022-01-01T12:00:00Z" ) p.add_phase_center( anabeam_index=0, target="My fav target", useParentPointing=True, subbandList="[200..300]" )
- property analog_beam_fields
Lists all the available analog beam fields.
- modify_analog_beam(anabeam_index, **kwargs)[source]
Modifies the configuration of the analog beam.
- Parameters:
anabeam_index (
int
) – Index of the analog beam to modify.- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="First") p.modify_analog_beam(0, target="Modified_Value")
- modify_numerical_beam(numbeam_index, **kwargs)[source]
Modifies the configuration of the numerical beam.
- Parameters:
numbeam_index (
int
) – Index of the numerical beam to modify.- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="First") p.add_numerical_beam(0, target="Initial_Value") p.modify_numerical_beam(0, target="Modified_Value")
- modify_phase_center(phasecenter_index, **kwargs)[source]
Modifies the configuration of the phase center.
- Parameters:
phasecenter_index (
int
) – Index of the phase center to modify.- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="First") p.add_phase_center(0, target="Initial_Value") p.modify_phase_center(0, target="Modified_Value")
- property numerical_beam_fields
Lists all the available numerical beam fields.
- property observation_fields
Lists all the available observation fields.
- property output_fields
Lists all the available output fields.
- property phase_center_fields
Lists all the available phase center fields.
- remove_analog_beam(anabeam_index)[source]
Removes an analog beam along with its associated numerical beams and phase centers.
- Parameters:
anabeam_index (
int
) – Index of the analog beam to remove.
Note
One can quickly identify the indices of the analog beams:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="First") p.add_analog_beam(target="Second") p.analog_beams # prints: [<AnalogBeam(target=First, index=0)>, <AnalogBeam(target=Second, index=1)>]
- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="First") p.add_analog_beam(target="Second") p.remove_analog_beam(anabeam_index=0) # removes the analog beam "First"
- remove_numerical_beam(numbeam_index)[source]
Removes a numerical beam and updates the numerical beam indices.
- Parameters:
numbeam_index (
int
) – Index of the numerical beam to remove.
Note
One can quickly identify the indices of the numerical beams:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="Analog beam 1") p.add_analog_beam(target="Analog beam 2") p.add_numerical_beam(0, target="One") p.add_numerical_beam(0, target="Two") p.add_numerical_beam(1, target="Three") [anabeam.numerical_beams for anabeam in p.analog_beams] # prints: [[<NumericalBeam(target=One, index=0)>, <NumericalBeam(target=Two, index=1)>], [<NumericalBeam(target=Three, index=2)>]]
- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="Analog beam 1") p.add_numerical_beam(0, target="One") p.add_numerical_beam(0, target="Two") p.remove_numerical_beam(numbeam_index=0) # removes the numerical beam "One"
- remove_phase_center(phasecenter_index)[source]
Removes a phase center and updates the phase center indices.
- Parameters:
phasecenter_index (
int
) – Index of the phase center to remove.
Note
One can quickly identify the indices of the phase centers:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="Analog beam 1") p.add_analog_beam(target="Analog beam 2") p.add_phase_center(0, target="One") p.add_phase_center(0, target="Two") p.add_phase_center(1, target="Three") [anabeam.phase_centers for anabeam in p.analog_beams] # prints: [[<PhaseCenter(target=One, index=0)>, <PhaseCenter(target=Two, index=1)>], [<PhaseCenter(target=Three, index=2)>]]
- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.add_analog_beam(target="Analog beam 1") p.add_phase_center(0, target="One") p.add_phase_center(0, target="Two") p.remove_phase_center(phasecenter_index=0) # removes the phase center "One"
- set_observation_config(**kwargs)[source]
Sets the configuration of the parset_user observation block. This method ingests any valid keyword argument corresponding to an Observation configuration.
- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.set_observation_config( name="My observation", contactName="AlanLoh", contactEmail="alan.loh@obspm.fr", topic="DEBUG" )
- set_output_config(**kwargs)[source]
Sets the configuration of the parset_user output block. This method ingests any valid keyword argument corresponding to an Output configuration.
- Example:
from nenupy.observation import ParsetUser p = ParsetUser() p.set_output_config( hd_bitMode=16, hd_receivers="[undysputed]" )
- validate()[source]
Validates the syntax of each field.
- Returns:
True
if all the checked keys have a correct syntax.- Return type:
Warning
This is merely just a syntax validation made with regular expressions. The relevance of the parameter values are not checked at all.
- write(file_name)[source]
Writes the current instance of
ParsetUser
to a file calledfile_name
.- Parameters:
file_name (
str
) – Name of the parset_user file to write. The file extension must be".parset_user"
.