NAME: aosunexamples - Using the idl sun mapping routines SYNTAX: none ARGS: none DESCRIPTION: The sun is mapped daily at xband using the 12meter telescope and the mock spectrometer. ( mapping description. These maps are automatically processed by a cron job (phil on megs3) at 19:15 each evening with the save files written to /share/phildat/sunmaps. The idl sun routines will: Input the map spectra scale to kelvins using the cals compute total power at each point compute the ra,dec offset position (from the center of the sun) for each point. The info is returned in a mapI structure. idl .sav files are generated for each map taken and stored in /share/phildat/sunmaps/ The .sav file naming convention is: yymmdd_nn_sun.sav where yymmdd is the date, and nn is 1..nmaps for the day eg 220420_01_sun.sav 1st map 220420_02_sun.sav 2nd map ... You can recall a map for from a .sav file using: IDL> restore,'/share/phildat/sunmaps/220420_01_sun.sav',/verb % RESTORE: Portable (XDR) SAVE/RESTORE file. % RESTORE: Save file written by phil@gpuserv0, Thu Apr 21 17:28:28 2022. % RESTORE: IDL version 7.1 (linux, x86_64). % RESTORE: Restored variable: MAPI. The structure contains: IDL> help,mapI ** Structure <1055a88>, 16 tags, length=1542944, data length=1532385, refs=1: NSTRIPS LONG 25 number of strips in map NPOL LONG 2 number of pols SMPSTRIP LONG 60 number of samples in ra strip NBMS LONG Array[2] min,max filenumber used.includes cals and map FILENUMS LONG 7 number of freq bandsrr0r YYYYMMDD LONG 20211224 date for start of map MJDSTART DOUBLE 59572.611 mjd start time of 1st strip of map SECSTART DOUBLE 1.6403568e+09 secsonds 1970 for start of 1st strip of map HARBM0 STRUCT MASFHDR Array[60, 25] fits headers bm 0, 60smp/strip,25 strips ungetmap.pro; HARBANDS STRUCT MASFHDR Array[7] fits header first sample,first row, all 7 freq bands. RAOFFD FLOAT Array[60, 25] measured RA offset in deg for each sample DECOFFD FLOAT Array[60, 25] measured Dec offset in deg for each sample CFRARBM DOUBLE Array[7] center freq (MHz) each band SCLFACTOR FLOAT Array[2, 7] scale factor cntsToKelvin if units=3 cntsToCalUnits if units =2 UNITS LONG mockunits if units =1 TPAR FLOAT Array[60, 25, 2, 7] total power data (smpStrip,Nstrips,Npol,Nbms) The maps conver +/-1 deg in ra (great circle) and +/- 1 deg in dec. The ra strips are spaced by 5 Amin in declination (fwhm of xband beam is 10Amin) So there are 25 ra strips in total. The 12th strip (counting from 0) goes through the center of the sun. The total power at each point is returen in mapI.tpar[60,25,2,7] 60= 60 samples across the strip. 25= 25 strips .. index (12 ..cnt from 0) goes through the center of the sun, 2 =polA, polB 7 =7 frequency bands. When taking the data, the telescope drives from -RaOffset to +RaOffset and then reverses direction and drives fro +Raoffset to -RaOffset. That means that the 60 points in adjacent strips start at opposite ra locations. The RaOffD[60,25] array has the actual raOffsets (in deg) for each totalPwr point. Examples using the routines: to enter idl: idl @phil @suninit Example 1: process a days worth of maps and return then in mapIAr IN idl.. yymmdd=220428L nmaps=sunmapsday(yymmdd,mapIar) -->Found: 2 sun maps for date:20220428 -->220428 map 0 fnums: 0 2800 Nnums: 29 -->220428 map 1 fnums: 2900 5700 Nnums: 29 -->maps done: 2 no save files generated Example 2: process a single map using the pattern id: Look in the logfile in the proj directory:/share/obs4/usr/p12m/sun/ (or whatever project you used) Look at the logfile; more sun.p12mlog_20220428.log line: 2022-04-28_09:16:36 mapradec: start. pattern_id:211800018 This is the pattern id for the first map. In idl: yymmdd=220428L patId=211800018L nmaps=sunmapsday(yymmdd,mapIar,patid=patId) -->Found patId:211800018 sun map for date:20220428 -->220428 map 0 fnums: 0 2800 Nnums: 29 -->maps done: 1 no save files generated Example 3: process a day and save it in idl nmaps=sunmapsday(yymmdd,mapIar,/dosav) --> Found: 2 sun maps for date:20220428 --> 220428 map 0 fnums: 0 2800 Nnums: 29 --> 220428 map 1 fnums: 2900 5700 Nnums: 29 --> maps done: 2 save files generated Normal user should not try to generate save files in the default location (you probably don't have write access). If you've done your own maps, then you can save them to one of your directories using the savDir= keyword. More info (from within idl): explain,sundoc ..to get a listing of the routines ----- Documentation for /pkg/rsi/local/libao/phil/doc/sundoc.pro ----- NAME sundoc - routine list (single line) aosunexamples - Using the idl sun mapping routines sungetmap - input mock scans of map, compute totalPwr sunmapsday - process sunmaps for a given day explain,sunmapsday ----- Documentation for ./sunmapsday.pro ----- NAME sunmapsday - process sunmaps for a given day SYNTAX: nmaps=sunmapsday(yymmdd,mapIar,proj=proj,dosav=dosav,savDir=savDir,patId=patId ARGS: ... ...
(See /pkg/rsi/local/libao/phil/sun/aosunexamples.pro)
NAME: sungetmap - input mock scans of map, compute totalPwr SYNTAX: nstrips=sungetmap(yymmdd,proj,fnum0,fnum1,mapI,tcal=tcal,minstrips=minstrips) ARGS: yymmdd: long date for data yyyymmdd (ast) proj : string project name for files fnum0: int first filenum of day (include any cal on,offs fnum1: int last filenum of day KEYWORDS: verb : int if set then plot tp as we go tcal : if set then scale mapI.tpar to units of the cal rather than degK (since we may not have the correct cal values yet. minstrips: int minimum number of radecstrips map needs default:13 RETURNS: nstrips: int num strips. < 0 --> error mapI : {} struct holding the map info (including tpar) DESCRIPTION: Input a map of the sun takne with the 12 meter. This assumes you've used the tcl script mapsun.proc to input the data. The datatakingi does: 1. a cal on, off at the beginnning (2 files) 2. a map of nstrips covering an area, driving in ra, stepping in dec. 3. another calon ,off at the end of the map The routine will: 1. input the cals, compute the scale factor from mock units to cal units exclude 6% of the spectra on each edge. it averages the scale factor computed from the 2 cal measurements. 2. input the map 3. compute the total power for each sample (excluding 6% of the spectra on each edge). 4. scale the total power to Kelvins or calunits depending on tcal= 5. compute the raoff, dec off for each sample (this are currently little circle). 6. return the info in mapI. The mapI struct contains: IDL> help,mapI ** Structure <632c008>, 15 tags, length=1536168, data length=1525660, refs=1: NSTRIPS LONG 25 number of strips in map NPOL LONG 2 number of pols SMPSTRIP LONG 60 number of samples in ra strip NBMS LONG 7 number of freq bandsrr0r FILENUMS LONG Array[2] min,max filenumber used.includes cals and map YYYYMMDD LONG 20211224 date for start of map MJDSTART DOUBLE 59572.611 mjd start time of 1st strip of map SECSTART DOUBLE 1.6403568e+09 secsonds 1970 for start of 1st strip of map HARBM0 STRUCT MASFHDR Array[60, 25] fits headers bm 0, 60smp/strip,25 strips HARBANDS STRUCT MASFHDR Array[7] fits header first sample,first row, all 7 freq bands. RAOFFD FLOAT Array[60, 25] measured RA offset in deg for each sample DECOFFD FLOAT Array[60, 25] measured Dec offset in deg for each sample CFRARBM DOUBLE Array[7] center freq (MHz) each band SCLFACTOR FLOAT Array[2, 7] scale factor cntsToKelvin if units=3 cntsToCalUnits if units =2 UNITS LONG mockunits if units =1 TPAR FLOAT Array[60, 25, 2, 7] total power data (smpStrip,Nstrips,Npol,Nbms) When making the map: - drives from negative ra offset to positive The ra,dec offsets are the measuredPos - SunCenterPos So a negative ra is at a lower ra than the center of the sun. The sun center is interpolated from the jpl ephemeris used to track the sun. The strips
(See /pkg/rsi/local/libao/phil/sun/sungetmap.pro)
NAME: sunmapsday - process sunmaps for a given day SYNTAX: nmaps=sunmapsday(yymmdd,mapIar,proj=proj,dosav=dosav,savDir=savDir,patId=patId ARGS: yymmdd: long date for data yyyymmdd (ast) KEYWORDS: proj : string project name for files to search dosav: int if set then generate idl .sav files If no savdir= is specified then it will default to /share/phildat/sunmaps/ You need to have permissions to write into the savdir. If patId= is used then a single map is done, and no save files are allowed. savDir : string if dosav= is set, then write the save files to this directory. If not supplied, the default is /share/phildat/sunmaps. You must have write permissions to this directory patId : long if supplied then just return 1 map - that has patid=patid, (see logfiles) - it must also be in proj=proj, and have object='sun' minstrips: int minimum number of radecstrips map needs default:13 RETURNS: nmaps: int < 0 --> error >=0 number of maps processed mapIAr[nmaps]: {} array of structs holding info from each map (see below) DESCRIPTION: This routine will input and compute totalpower for all sun maps taken on the specified day. The results are returned in the mapIAr array of structures. You can optionally have each map written to an idl .sav file. If the patId= keyword is supplied then only one map will be returned (that has the patId specified) and no sav files will be written (see reasons below). For a map to be included in the data set (assuming patid= is not used) the following must occur: -The map was taken on yymmdd -the project matches the requested project (def='sun') -The source for the map is 'sun' -The map was taken with the mapradec tcl routine. Each structure in mapIar will contain: IDL> help,mapIAr,/st Structure <214e168>, 16 tags, length=1542944, data length=1532385, refs=1: NSTRIPS LONG 25 number of strips in map NPOL LONG 2 number of pols SMPSTRIP LONG 60 number of samples in ra strip NBMS LONG Array[2] min,max filenumber used.includes cals and map FILENUMS LONG 7 number of freq bandsrr0r YYYYMMDD LONG 20211224 date for start of map MJDSTART DOUBLE 59572.611 mjd start time of 1st strip of map SECSTART DOUBLE 1.6403568e+09 secsonds 1970 for start of 1st strip of map HARBM0 STRUCT MASFHDR Array[60, 25] fits headers bm 0, 60smp/strip,25 strips HARBANDS STRUCT MASFHDR Array[7] fits header first sample,first row, all 7 freq bands. RAOFFD FLOAT Array[60, 25] measured RA offset in deg for each sample DECOFFD FLOAT Array[60, 25] measured Dec offset in deg for each sample CFRARBM DOUBLE Array[7] center freq (MHz) each band SCLFACTOR FLOAT Array[2, 7] scale factor cntsToKelvin if units=3 cntsToCalUnits if units =2 UNITS LONG mockunits if units =1 TPAR FLOAT Array[60, 25, 2, 7] total power data (smpStrip,Nstrips,Npol,Nbms) See sumgetmap() for more info on how each map is taken. Notes on the .sav files: If there are N maps made in a given day, then the .sav file names will be savDir/yymmdd_nn_sun.sav where yymmdd is the date and nn is 1 thru Nmaps eg: on 220420 11maps were made. the names are: 220420_01_sun.sav 220420_02_sun.sav ... 220420_11_sun.sav You are not allowed to generate a save file if you ask for a single map with patid= keyword This could disrupt the file naming of the .sav files for a day eg: suppose you used the patid= for the 4th map of 220420. If you were allowed to generate a save file with the specified format, it would end up being call 220420_01.sav .. This would overwrite the true 1st map. For this reason save files can only be written when the entire day is processed. You can always call the routine with patid= and then do your own save using whatever name you choose,
(See /pkg/rsi/local/libao/phil/sun/sunmapsday.pro)