Commits
Pam Harris authored cc478d62719 Merge
986 986 | eta_b geometrical blockage efficiency, |
987 987 | eta_t taper efficiency, |
988 988 | eta_q correlator efficiency including quantization, |
989 989 | t_rx reciever temperature. |
990 990 | antenna efficiency = eta_p * eta_s * eta_b * eta_t |
991 991 | Notes: VLA correlator efficiency includes waveguide loss |
992 992 | EVLA correlator efficiency is probably optimistic at 0.88 |
993 993 | """ |
994 994 | |
995 995 | if telescope==None: telescope=self.telescopename |
996 + | # Noisetemp only knows about 6 observatories, |
997 + | # none of which have measure.observatory dicts that |
998 + | # contain lowercase characters so str.upper is harmless here |
996 999 | telescope=str.upper(telescope) |
997 1000 | |
998 1001 | obs =['ALMASD','ALMA','ACA','EVLA','VLA','SMA'] |
999 1002 | d =[ 12. ,12. ,7. ,25. ,25. , 6. ] |
1000 1003 | ds =[ 0.75 ,0.75 ,0.75 ,0.364 ,0.364,0.35] # subreflector size for ACA? |
1001 1004 | eps =[ 25. ,25. ,20. ,300 ,300 ,15. ] # antenna surface accuracy |
1002 1005 | |
1003 1006 | cq =[ 0.845, 0.845, 0.88, 0.79, 0.86, 0.88] # correlator eff |
1004 1007 | # SMA is from Wright http://astro.berkeley.edu/~wright/obsrms.py |
1005 1008 | # ALMA includes quantization eff of 0.96 |
1169 1172 | if antennalist==None: |
1170 1173 | if telescope==None: |
1171 1174 | self.msg("Telescope name has not been set.",priority="error") |
1172 1175 | return False |
1173 1176 | if diam==None: |
1174 1177 | self.msg("Antenna diameter has not been set.",priority="error") |
1175 1178 | return False |
1176 1179 | if nant==None: |
1177 1180 | self.msg("Number of antennas has not been set.",priority="error") |
1178 1181 | return False |
1179 - | |
1180 - | found=False |
1181 - | t=telescope.upper() |
1182 - | for l in pl.arange(len(t)-1)+2: |
1183 - | if t[0:l] in me.obslist(): found=True |
1184 - | if found: |
1185 - | posobs=me.measure(me.observatory(telescope),'WGS84') |
1182 + | |
1183 + | known=False |
1184 + | # check if telescope is known to measures tool |
1185 + | # ensure case insensitivity - CAS-12753 |
1186 + | obslist_lower = [obs.lower() for obs in me.obslist()] |
1187 + | if self.telescope.lower() in obslist_lower: |
1188 + | t = self.telescope |
1189 + | known = True |
1190 + | |
1191 + | if known == True: |
1192 + | posobs = me.measure(me.observatory(t), 'WGS84') |
1186 1193 | else: |
1187 - | self.msg("Unknown telescope and no antenna list.",priority="error") |
1194 + | self.msg("Unknown telescope and no antenna list.", |
1195 + | priority="error") |
1188 1196 | return False |
1189 1197 | |
1190 1198 | obslat=qa.convert(posobs['m1'],'deg')['value'] |
1191 1199 | obslon=qa.convert(posobs['m0'],'deg')['value'] |
1192 1200 | obsalt=qa.convert(posobs['m2'],'m')['value'] |
1193 1201 | stnx,stny,stnz = self.locxyz2itrf(obslat,obslon,obsalt,0,0,0) |
1194 1202 | antnames="A00" |
1195 1203 | # use a single dish of diameter diam - must be set if antennalist |
1196 1204 | # is not set. |
1197 1205 | stnd=[diam] |
1656 1664 | self.coordsys=params["coordsys"] |
1657 1665 | |
1658 1666 | if "observatory" in params: |
1659 1667 | self.telescopename=params["observatory"] |
1660 1668 | else: |
1661 1669 | self.telescopename="SIMULATED" |
1662 1670 | if self.verbose: |
1663 1671 | self.msg("Using observatory= %s" % self.telescopename, |
1664 1672 | origin="readantenna") |
1665 1673 | |
1666 - | # me.observatory has partial matching implemented |
1667 - | found=False |
1668 - | t=self.telescopename.upper() |
1669 - | for l in pl.arange(len(t)-1)+2: |
1670 - | if t[0:l] in me.obslist(): found=True |
1671 - | if found: |
1672 - | posobs=me.measure(me.observatory(self.telescopename),'WGS84') |
1674 + | known = False |
1675 + | # case insensitive check if telescopename is known |
1676 + | obslist_lower = [obs.lower() for obs in me.obslist()] |
1677 + | if self.telescopename.lower() in obslist_lower: |
1678 + | t = self.telescopename |
1679 + | known = True |
1680 + | posobs=me.measure(me.observatory(t),'WGS84') |
1673 1681 | |
1674 1682 | if "COFA" in params: |
1683 + | if known: |
1684 + | self.msg("antenna config file specifies COFA for a known observatory "+ |
1685 + | self.telescopename+", overriding with specified COFA.",priority="warn") |
1675 1686 | obs_latlon=params["COFA"].split(",") |
1676 1687 | cofa_lon=float(obs_latlon[0]) |
1677 1688 | cofa_lat=float(obs_latlon[1]) |
1678 1689 | cofa_alt=0. |
1679 1690 | posobs=me.position("WGS84",qa.quantity(cofa_lon,"deg"),qa.quantity(cofa_lat,"deg"),qa.quantity(cofa_alt,"m")) |
1680 - | if found: |
1681 - | self.msg("antenna config file specifies COFA but a known observatory "+self.telescopename+", so ignoring specified COFA.",priority="warn") |
1682 - | elif not found: |
1691 + | elif not known: |
1683 1692 | if params["coordsys"].upper()[0:3]=="LOC": |
1684 1693 | self.msg("To use local coordinates in the antenna position file, you must either use a known observatory name, or provide the COFA explicitly",priority="error") |
1685 1694 | return -1 |
1686 1695 | else: |
1687 1696 | # we have absolute coords, so can create the posobs from their |
1688 1697 | # average at the end |
1689 1698 | posobs={} |
1690 1699 | |
1691 1700 | |
1692 1701 | |