Arts2{ AgendaSet(abs_xsec_agenda) { abs_xsec_per_speciesInit abs_xsec_per_speciesAddCIA abs_xsec_per_speciesAddLines2 } # Can run with abs_xsec_per_speciesAddLines by uncommenting: # abs_lineshapeDefine(abs_lineshape, "Faddeeva_Algorithm_916", "no_norm", -1) # Will fail at first derivatives with somewhat small error # Constants (changes here might require changes in perturbations to match) isotopologue_ratiosInitFromBuiltin partition_functionsInitFromBuiltin abs_speciesSet(species=["H2-CIA-H2-0,H2-CIA-He-0", "He"]) # BUG: Must have lines (though good for this test) VectorNLinSpace(f_grid, 11, 3e9, 30e12) VectorSet(rtp_vmr, [0.1, 0.2]) VectorSet(rtp_nlte, [0.6, 0.4]) NumericSet(rtp_temperature, 250) NumericSet(rtp_pressure, 25000) NumericSet(lm_p_lim, 0) IndexSet(stokes_dim, 1) Touch(rtp_nlte) # Calculate w/o NLTE nlteOff # Comparative parameter ArrayOfPropagationMatrixCreate(testdata) # CIA catalog from arts-xml-data ReadXML(abs_cia_data, "spectroscopy/cia/borysow/Borysow_CIA_JUICE_SWI.xml") # Absorption lines (VP) ReadXML(abs_lines, "tests/test-he-line.xml") abs_lines_per_speciesCreateFromLines # Silly parameters that have to be set by agendas and ARTS in general but are completely useless for these calculations VectorSet(p_grid, [150]) # We have no grid VectorSet(lat_grid, [0]) # We have no grid VectorSet(lon_grid, [0]) # We have no grid IndexSet(atmosphere_dim, 1) # We have no atmosphere MatrixSet(sensor_pos, [0, 0, 0]) # We have no sensor sensorOff # We have no sensor IndexSet(propmat_clearsky_agenda_checked, 1) # We have no propmat agenda # Set up partial derivatives jacobianInit jacobianAddTemperature(g1=p_grid, g2=[0], g3=[0], dt=0.1) jacobianAddAbsSpecies(g1=p_grid, g2=[0], g3=[0], species="H2", for_species_tag=0) jacobianAddAbsSpecies(g1=p_grid, g2=[0], g3=[0], species="He", for_species_tag=0) jacobianAddWind(g1=p_grid, g2=[0], g3=[0], dfrequency=1e3) jacobianClose # Perform calculations for analytical propagation matrix and derivatives abs_xsec_agenda_checkedCalc propmat_clearskyInit propmat_clearskyAddOnTheFly # WriteXML("ascii", propmat_clearsky, "tests/propmat.xml") # WriteXML("ascii", dpropmat_clearsky_dx, "tests/dpropmat.xml") ReadXML(testdata, "tests/propmat.xml") CompareRelative(testdata, propmat_clearsky, 1e-6) ReadXML(testdata, "tests/dpropmat.xml") CompareRelative(testdata, dpropmat_clearsky_dx, 1e-4) # Turn off the jacobian to make for faster calculations for perturbations below jacobianOff # Perform calculations for perturbed temperature derivative NumericSet(rtp_temperature, 250.0001) abs_xsec_agenda_checkedCalc propmat_clearskyInit propmat_clearskyAddOnTheFly NumericSet(rtp_temperature, 250) # WriteXML("ascii", propmat_clearsky, "tests/propmat-dT.xml") ReadXML(testdata, "tests/propmat-dT.xml") CompareRelative(testdata, propmat_clearsky, 1e-6) # Perform calculations for perturbed VMR derivative VectorSet(rtp_vmr, [0.10001, 0.2]) abs_xsec_agenda_checkedCalc propmat_clearskyInit propmat_clearskyAddOnTheFly VectorSet(rtp_vmr, [0.1, 0.2]) # WriteXML("ascii", propmat_clearsky, "tests/propmat-dvmr-H2.xml") ReadXML(testdata, "tests/propmat-dvmr-H2.xml") CompareRelative(testdata, propmat_clearsky, 1e-6) # Perform calculations for perturbed VMR derivative VectorSet(rtp_vmr, [0.1, 0.20001]) abs_xsec_agenda_checkedCalc propmat_clearskyInit propmat_clearskyAddOnTheFly VectorSet(rtp_vmr, [0.1, 0.2]) # WriteXML("ascii", propmat_clearsky, "tests/propmat-dvmr-He.xml") ReadXML(testdata, "tests/propmat-dvmr-He.xml") CompareRelative(testdata, propmat_clearsky, 1e-6) # Perform calculations for perturbed frequency derivative VectorNLinSpace(f_grid, 11, 3000001000, 30000000001000) abs_xsec_agenda_checkedCalc propmat_clearskyInit propmat_clearskyAddOnTheFly VectorNLinSpace(f_grid, 11, 3e9, 30e12) # WriteXML("ascii", propmat_clearsky, "tests/propmat-df.xml") ReadXML(testdata, "tests/propmat-df.xml") CompareRelative(testdata, propmat_clearsky, 1e-6) }