Ignore:
Timestamp:
01/21/03 15:02:35 (22 years ago)
Author:
moralejo
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/ReflectorII/reflector.c

    r1622 r1722  
    4747extern CerEventHeader *cheadp;  /*  var inited in header.c      */
    4848extern RflEventHeader *rheadp;  /*  var inited in header.c      */
     49extern void SetAtmModel(int model, float ol); /*  from atm.c    */
    4950
    5051/*  Prototypes  */
     
    470471  RflRunHeader RflRunHead;
    471472
    472   extern int atmModel;      /* current atm. model */
     473  const char *AtmModelNames[]={"ATM_NOATMOSPHERE","ATM_90PERCENT","ATM_CORSIKA"};
     474  extern char atmosphere[256];  /* current atm. model */
     475  int model=0;
    473476
    474477  do
     
    490493          if (newFile)
    491494            {
     495              while (strcmp(atmosphere, AtmModelNames[model]))
     496                if (++model == sizeof(AtmModelNames)/sizeof(AtmModelNames[0]))
     497                  {   
     498                    model = 0;
     499                    Error(" *** Atm model \"%s\" not found.\n", atmosphere);
     500                    break;     
     501                  }
     502
    492503              /* Write Reflector "run header" (one per cer file!): */
    493504              memcpy(&RflRunHead, cheadp, sizeof(RflRunHead));
    494505              RflRunHead.wobble_mode = wobble_position;
    495               RflRunHead.atmospheric_model = atmModel;
     506              RflRunHead.atmospheric_model = model;
    496507              fwrite(&RflRunHead, sizeof(RflRunHead), 1, rflfile);
     508
     509              /* Set up atmosphere (do some necessary calculations) once we
     510               * read in the observation level from the run header:
     511               */
     512
     513              Log("Setting atm model \"%s\" and observation level %.0f cm.\n", AtmModelNames[model], RflRunHead.HeightLev[0]);
     514              SetAtmModel(model,RflRunHead.HeightLev[0]);
     515
    497516            }
    498517
Note: See TracChangeset for help on using the changeset viewer.