#!/usr/bin/perl $magsynopexe = "/home/arta/Dev/STAGING/bin/_linux4/magsynop"; #$magsynopexe = "/home/arta/Dev/STAGING/bin/_sgi4/magsynop"; $rootdir = "/synoptic/carrot"; $cr = $ARGV[0]; $s = $ARGV[1]; $f = $ARGV[2]; $skipRM = "no"; if (scalar(@ARGV) > 3) { $skipRM = $ARGV[3]; } #$SYNOPDIR = "$rootdir/M/$cr" . "_arta"; $SYNOPDIR = "$rootdir/M/$cr"; system("mkdir -p $SYNOPDIR"); #$MAGDIR = "$rootdir/fd_M_96m_01d_arta"; $MAGDIR = "$rootdir/fd_M_96m_01d"; #$REMAPDIR = "$rootdir/fd_M_remap_96m_01d_arta"; $REMAPDIR = "$rootdir/fd_M_remap_96m_01d"; #$ENV{'mdi'} = "wd:$rootdir/{series}_arta/{series}.{#%06d#series}"; $ENV{'mdi'} = "wd:$rootdir/{series}/{series}.{#%06d#series}"; $s = sprintf("%d", $s); $ss = $s - 4; $f = sprintf("%d", $f); $ff = $f + 4; if ($skipRM ne "skiprm") { system("mkdir -p $MAGDIR"); system("mkdir -p $REMAPDIR"); foreach $d ($ss .. $ff) { # if (-d "$REMAPDIR/fd_M_remap_96m_01d.00$d") { next; } system("mkdir -p $REMAPDIR/fd_M_remap_96m_01d.00$d"); system("/bin/cp -r /mag/fd_M_96m_01d.00$d $MAGDIR"); system("uncompress $MAGDIR/fd_M_96m_01d.00$d/*Z"); system("v2helio z=1 MOFFSET=0 MCORLEV=1 VCORLEV=0 MAPRMAX=0.994 MAPLGMAX=90 MAPLGMIN=-90 MAPBMAX=90 LGSHIFT=2 MAPMMAX=1800 SINBDIVS=540 CARRSTRETCH=1 in=prog:mdi,level:lev1.8,series:fd_M_96m_01d\[$d\] out=prog:mdi,level:lev1.8,series:fd_M_remap_96m_01d\[$d\]"); system("rm -r $MAGDIR/fd_M_96m_01d.00$d"); } } my($incr) = 15; my($nOffcenter) = 4; my($idx); my($cmdln); my($center); my($sign); my($ewIdx); my($offCStr); my($cmd); $sign = 1; $idx = 4; $ss = $s + ($sign * $idx); $ff = $f + ($sign * $idx); $center = $idx * $incr * $sign; $cmdln = "CR=$cr checkqual=1 qualmask=0x402c01f2 center=60 nsig=3.0 -f in=prog:mdi,level:lev1.8,series:fd_M_remap_96m_01d\[$ss-$ff\] out=$SYNOPDIR "; $offCStr = $idx * $incr . "W"; $cmd = $magsynopexe . " " . $cmdln . " 2>1 > $SYNOPDIR/synop_UNK.$cr.log"; print(, $cmd . "\n"); system($cmd); # check to see what types of magnetograms produced (radial, los?) # possibilites are: M || Mr. The latter may include a Ml synop, # which was converted from the Mr synop. if (-e "$SYNOPDIR/synop_M.$cr.fits") { # type is M $mtype = "M"; system("mv $SYNOPDIR/synop_M.$cr.fits $SYNOPDIR/synop_M_$offCStr.$cr.fits"); } # oddly enough, having _$mtype_$offCStr in a string doesn't work, so concatenate # two strings. # rename log appropriately $cmd = "mv $SYNOPDIR/synop_UNK.$cr.log $SYNOPDIR/synop_$mtype" . "_$offCStr.$cr.log"; print(, $cmd . "\n"); system($cmd); # rename w and epts files appropriately $cmd = "mv $SYNOPDIR/wt_$mtype.$cr.fits $SYNOPDIR/wt_$mtype" . "_$offCStr.$cr.fits"; print(, $cmd . "\n"); system($cmd); $cmd = "mv $SYNOPDIR/epts_$mtype.$cr.fits $SYNOPDIR/epts_$mtype" . "_$offCStr.$cr.fits"; print(, $cmd . "\n"); system($cmd); system("gzip $SYNOPDIR/*.log"); if ($skipRM ne "skiprm") { system("rm -r $REMAPDIR/*"); }